Skip to content

fix(cli): lead the next-steps hints with prd generate, not prd add (#1111) - #1133

Merged
frankbria merged 1 commit into
mainfrom
fix/1111-next-steps-hints
Aug 10, 2026
Merged

fix(cli): lead the next-steps hints with prd generate, not prd add (#1111)#1133
frankbria merged 1 commit into
mainfrom
fix/1111-next-steps-hints

Conversation

@frankbria

Copy link
Copy Markdown
Owner

Closes #1111.

The problem

Immediately after the documented cf init . --detect, the tool said:

Next steps:
  codeframe prd add <file.md>   Add a PRD
  codeframe status              View workspace status

prd add requires a PRD the user has already written. GOLDEN_PATH §2 makes
prd generate primary and prd add secondary, and the README leads with
prd generate. A new user following the tool's own hint walks straight past
Socratic discovery — the capability the product leads on.

Scope: six sites, not two

The issue names app.py:240 and :488. There were six, each with its own
wording, every one pointing only at prd add:

site command
init next-steps cf init
status empty-PRD hint cf status
prd show no-PRD cf prd show
prd list empty cf prd list
tasks generate no-PRD cf tasks generate
templates apply no-PRD cf templates apply

They are now a single PRD_NEXT_STEPS constant. Six strings drifting apart
independently is what produced this, so consolidating is the fix, not just
editing the two the report happened to catch.

After

Next steps:
  cf prd generate              Start AI-guided requirements discovery
  cf prd add <file.md>         Import a PRD you already have
  cf status                    View workspace status
PRD
  No PRD loaded. Run 'cf prd generate', or 'cf prd add <file>' if you already have one.

Both captured from a real cf init --detect on a fresh workspace.

Acceptance criteria

  • cf init leads with cf prd generate, prd add offered as the alternative
  • cf status empty-PRD hint does the same
  • Hints use cf, matching the README
  • Tests pin the hint text against the docs

Nine tests cover the ordering, the binary name, the four commands that print it,
and a guard that no hard-coded codeframe prd add hint creeps back in.

ruff clean; tests/cli/ + golden-path integration: 558 passed.

…1111)

The CLI's own hints pointed new users away from the documented THINK path.
Immediately after `cf init`, the tool said:

    codeframe prd add <file.md>   Add a PRD

`prd add` requires a PRD you have already written. GOLDEN_PATH §2 makes
`prd generate` the primary path and `prd add` the secondary one, and the README
leads with `prd generate`. So a user following the tool's own advice never
discovered Socratic discovery — the capability the product leads on.

The issue named two sites; there were six, each with its own wording, all
pointing only at `prd add`. They are now one shared PRD_NEXT_STEPS constant, so
they cannot drift apart again:

  cf prd generate              Start AI-guided requirements discovery
  cf prd add <file.md>         Import a PRD you already have

Also switched to `cf` from `codeframe`, matching the README. Both binaries work,
but the mismatch made the hint look like a different tool than the one just
installed.

Nine tests pin the ordering, the binary name, the four commands that print it,
and that no hard-coded "codeframe prd add" hint has crept back in.
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Claude finished @frankbria's task in 2m 39s —— View job


GLM precision bug-hunting review — complete

Scoped to concrete defects only (logic errors, null/error paths, security, data loss, breaking changes, resource leaks). Style/alignment/coverage handled separately.

  • Gather PR context and full diff
  • Check existing comments to avoid duplicate findings
  • Read changed files and surrounding callers/callees
  • Confirm or discard each suspected defect
  • Post inline comments for confirmed findings — none to post
  • Post summary comment

Result: ✅ no defects found. (No inline comments; summary posted via a separate review comment.)

Checked every hunk against real context — all 6 hint sites are behaviorally-equivalent string swaps on already-existing branches, PRD_NEXT_STEPS carries no Rich markup tokens (no injection/render conflict), and both repo-state-dependent tests pass (the surviving codeframe prd add strings are docstring examples, not console.print hints; GOLDEN_PATH.md documents prd generate). The only candidate, hint column alignment, is style — out of scope.

@claude

claude Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review

Small, well-scoped fix. Verified the diff against the codebase:

Correctness

  • PRD_NEXT_STEPS is a single source of truth now used at all 6 sites (init, status, prd show, prd list, tasks generate, templates apply) — confirms the PR's stated scope (grep -n PRD_NEXT_STEPS codeframe/cli/app.py).
  • cf is a real registered console-script alias (pyproject.toml:103, cf = "codeframe.cli.app:main"), and prd generate is an implemented command (@prd_app.command("generate") at app.py:1448) — so the hint doesn't point users at something that doesn't exist.
  • The init next-steps block manually re-aligns the follow-up cf status line rather than folding it into the constant; checked column alignment and all three lines (cf prd generate, cf prd add <file.md>, cf status) pad to the same 31-char column before the description, so the visual table stays intact.
  • docs/GOLDEN_PATH.md:99-100 does list prd generate as primary and prd add as secondary, matching the new ordering and the test_the_hint_matches_the_golden_path_ordering test's premise.

Minor / non-blocking

  • prd_show/prd_list/tasks_generate/templates_apply now print PRD_NEXT_STEPS directly under "No PRD found." with no "Next steps:" (or similar) header, whereas init prints it under an explicit "Next steps:" label. Reads fine either way, but the two indented command lines appearing with no lead-in is a slightly different presentation from init. Not worth blocking on.
  • The regression-guard test (test_no_stale_codeframe_prd_add_hints_remain) only catches a stale hint if "codeframe prd add" and "console.print(" sit on the same physical line. It wouldn't catch a reintroduced hint split across a multi-line string (the way the status hint itself is written, just using cf instead of codeframe). Low risk given the string is now centralized, but worth knowing the guard isn't watertight if someone hand-rolls a new hint later.
  • The docstring/help-text examples elsewhere in the file (e.g. codeframe prd add requirements.md in the add command's own Example: block, lines ~961-962) still use the codeframe binary name rather than cf. That's pre-existing and outside this PR's stated scope (user-facing "no PRD" hints, not command examples), so not a defect here — just noting it's a separate, smaller inconsistency if a future pass wants to unify binary naming everywhere.

Test coverage

  • 9 tests as claimed, covering ordering, binary name, all four print sites, and the anti-regression grep guard. Straightforward and well-targeted at the actual bug (six independently-drifting strings).

Overall this looks correct and appropriately scoped — no functional issues found.

@github-actions

Copy link
Copy Markdown
Contributor

✅ GLM review: no defects found.

Scoped to concrete defects only (logic errors, null/error paths, security, data loss, breaking changes, resource leaks). Style/alignment/coverage are out of scope — handled by the general review.

Checked against real context, not just the diff:

  • All 6 hint sites (init, status, prd show, prd list, tasks generate, templates apply) print PRD_NEXT_STEPS on already-existing branches; no control flow changed.
  • PRD_NEXT_STEPS is a static literal with no Rich [/] markup tokens (only literal <file.md>), so no markup injection/render conflict via console.print.
  • The remaining codeframe prd add strings in app.py (lines 10, 961, 962) are docstring examples, not console.print hints — so the stale-hint guard test correctly passes.
  • GOLDEN_PATH.md contains prd generate (lines 99/103/376), so the golden-path ordering test passes.

@frankbria
frankbria merged commit 27d4cda into main Aug 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2.28] cf init / cf status next-steps point at 'prd add', steering new users off the documented 'prd generate' path

1 participant