5-phase-workflow 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +31 -101
  2. package/bin/install.js +168 -176
  3. package/bin/sync-agents.js +59 -54
  4. package/docs/workflow-guide.md +35 -79
  5. package/package.json +2 -2
  6. package/src/agents/step-executor-agent.md +5 -4
  7. package/src/agents/step-orchestrator-agent.md +12 -12
  8. package/src/agents/verification-agent.md +7 -8
  9. package/src/codex-commands/plan.md +65 -0
  10. package/src/commands/5/address-review-findings.md +43 -52
  11. package/src/commands/5/analyze-feature.md +1 -1
  12. package/src/commands/5/configure.md +75 -179
  13. package/src/commands/5/eject.md +0 -1
  14. package/src/commands/5/implement.md +78 -68
  15. package/src/commands/5/lean-check.md +75 -0
  16. package/src/commands/5/reconfigure.md +48 -129
  17. package/src/commands/5/review.md +42 -14
  18. package/src/commands/5/synchronize-agents.md +1 -1
  19. package/src/commands/5/update.md +2 -2
  20. package/src/hooks/dependency-guard.js +150 -0
  21. package/src/hooks/statusline.js +5 -3
  22. package/src/references/configure-tables.md +0 -33
  23. package/src/settings.json +3 -4
  24. package/src/skills/baseline-conventions/SKILL.md +37 -0
  25. package/src/skills/cognitive-load/SKILL.md +52 -0
  26. package/src/skills/configure-agents-md/SKILL.md +72 -0
  27. package/src/skills/configure-rules/SKILL.md +146 -0
  28. package/src/skills/documentation-style/SKILL.md +32 -0
  29. package/src/skills/fowler-code-smells/SKILL.md +25 -0
  30. package/src/skills/review-style/SKILL.md +142 -0
  31. package/src/templates/AGENTS.md +31 -31
  32. package/src/templates/workflow/REVIEW-FINDINGS.md +2 -9
  33. package/src/workflows/5-implement.js +67 -92
  34. package/docs/findings.md +0 -361
  35. package/docs/progress.md +0 -102
  36. package/src/commands/5/apply-review-findings.md +0 -66
  37. package/src/commands/5/commit.md +0 -43
  38. package/src/commands/5/plan.md +0 -189
  39. package/src/commands/5/reply-pr-comments.md +0 -48
  40. package/src/commands/5/split.md +0 -86
  41. package/src/commands/5/triage-pr-comments.md +0 -70
  42. package/src/hooks/config-guard.js +0 -30
  43. package/src/skills/configure-docs-index/SKILL.md +0 -243
  44. package/src/skills/configure-skills/SKILL.md +0 -311
  45. package/src/skills/generate-readme/EXAMPLES.md +0 -168
  46. package/src/skills/generate-readme/SKILL.md +0 -122
  47. package/src/skills/generate-readme/TEMPLATE.md +0 -141
  48. package/src/skills/use-index/SKILL.md +0 -49
  49. package/src/templates/ARCHITECTURE.md +0 -33
  50. package/src/templates/CONCERNS.md +0 -33
  51. package/src/templates/CONVENTIONS.md +0 -74
  52. package/src/templates/TESTING.md +0 -24
  53. package/src/templates/workflow/FIX-PLAN.md +0 -55
  54. package/src/templates/workflow/PLAN-COMPACT.md +0 -42
  55. package/src/templates/workflow/PLAN.md +0 -76
  56. package/src/templates/workflow/REVIEW-SUMMARY.md +0 -53
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: 5:plan
3
+ description: Plans a feature without native plan mode — explores, discusses, and writes one approved plan to .5/planning/, then hands it to /5:implement. Re-run with an existing feature name or plan path to refine that plan. Codex only; Claude Code plans in native plan mode under the Planning rules in AGENTS.md.
4
+ allowed-tools: Bash, Read, Write, Glob, Grep, Agent, AskUserQuestion
5
+ user-invocable: true
6
+ argument-hint: [feature-name-or-plan-path-or-ticket-id-or-description]
7
+ ---
8
+
9
+ <role>
10
+ You are a Workflow Planner. Your deliverable is one plan file in `.5/planning/`, written only after the user approves it.
11
+ Until then you write no files, write no source code, and spawn no implementation agents.
12
+ </role>
13
+
14
+ # Plan
15
+
16
+ The "Planning" section of `AGENTS.md` applies to every plan. This command adds the planning loop that Claude Code gets from native plan mode.
17
+
18
+ ## Step 1: Resolve Feature and Description
19
+
20
+ **Refine mode.** The argument names an existing plan when it is a path to a plan file, when `.5/planning/{argument}.md` exists, or when a file in `.5/planning/` has `feature: {argument}` in its frontmatter. A ticket prefix matches `feature: {prefix}*`. Read that plan; you are refining it. If several plans match, ask which one.
21
+
22
+ **New plan.** Otherwise:
23
+
24
+ 1. When the argument or request names a ticket, validate the ID (GitHub: digits only, `^[0-9]+$`; Jira: `^[A-Z][A-Z0-9]+-[0-9]+$`), then fetch it — Jira through its MCP tool with the key as a typed parameter, GitHub with `gh issue view "$id" --json title,body`. If validation or fetching fails, report the reason and continue without fetched content. Show the fetched content to the user and ask whether any context is missing.
25
+ 2. Otherwise, ask the user for the feature description.
26
+ 3. Determine a short kebab-case feature name. With a known ticket ID, use `{ticket-id}-{feature-name}`. Sanitize to alphanumeric, dash, and underscore only.
27
+
28
+ ## Step 2: Explore
29
+
30
+ Spawn one Explore agent:
31
+
32
+ ```text
33
+ Analyze the codebase for a workflow plan.
34
+
35
+ Feature description:
36
+ {feature description}
37
+
38
+ Tasks:
39
+ 1. Identify relevant modules, existing patterns, and likely target files.
40
+ 2. Find at most 3 similar implementations and reusable helpers.
41
+ 3. Identify test framework, test file conventions, and the narrowest relevant build/test commands.
42
+ 4. Find the repository's own standards — the files `.claude/skills/review-style/SKILL.md` step 2 lists — and what they require for this change.
43
+ 5. Identify constraints, risks, and places where the user needs to decide.
44
+
45
+ Report:
46
+ - Relevant existing patterns: path + symbol or line range + one-line reason
47
+ - Similar implementations: max 3 paths + one-line reason
48
+ - Likely target paths
49
+ - Test/build setup: commands only, with scope
50
+ - Repository standards: path + what it requires here
51
+ - Risks or unknowns
52
+
53
+ READ-ONLY. Use only Read, Glob, and Grep.
54
+ Keep the report under 40 lines. Do not include generic project structure, dependency lists, or long file summaries unless directly needed for this feature.
55
+ ```
56
+
57
+ ## Step 3: Discuss and Draft
58
+
59
+ Discuss with the user until you understand the problem, the expected outcome, and what is in and out of scope. Ask only useful questions — prefer proposing a concrete understanding and letting the user correct it. In refine mode, start from the existing plan and change only what the discussion changes.
60
+
61
+ Draft the plan as the "Planning" section of `AGENTS.md` asks; shape it as the change needs.
62
+
63
+ ## Step 4: Approve and Hand Off
64
+
65
+ Show the plan and get explicit approval. Then write it to `.5/planning/{name}.md`; in refine mode, overwrite the plan you refined. Then run `/5:implement {name}`.
@@ -1,68 +1,58 @@
1
1
  ---
2
2
  name: 5:address-review-findings
3
- description: Coordinates interactive review finding decisions and optionally handles GitHub PR review comments.
4
- allowed-tools: Bash, Read, Write, Glob, AskUserQuestion
3
+ description: Fixes clear review findings on its own, asks the user one question at a time only for real decisions, then verifies the result. --interactive asks about every finding.
4
+ allowed-tools: Bash, Read, Edit, Write, Glob, AskUserQuestion, Agent
5
+ argument-hint: [feature-name] [--interactive] [dirty: {paths}]
5
6
  user-invocable: true
6
- model: haiku
7
+ model: sonnet
7
8
  context: inherit
8
9
  ---
9
10
 
10
11
  <role>
11
- You are a Review Fix Coordinator. You keep context lean, collect user decisions one finding at a time, route work to narrower helper commands, and do not review code or implement unrelated changes.
12
+ You are a Review Fix Coordinator. You fix what is clear, ask the user only what they must decide, and do not review code or implement unrelated changes.
12
13
  </role>
13
14
 
14
15
  # Address Review Findings
15
16
 
16
- This is the stable entrypoint after `/5:review`.
17
+ `/5:review` runs this after every review. For comments on a GitHub PR, ask Claude directly; this command handles the findings file only.
17
18
 
18
19
  ## Options
19
20
 
20
- - `--github` - skip local findings and process PR comments only.
21
+ - `--interactive` — ask about every finding, one at a time, instead of deciding the clear ones yourself.
22
+ - `dirty: {paths}` — files that held the user's own uncommitted work before the run (`/5:implement` passes this). A finding in one of them may sit in that earlier work, so it is always **ask**, never fixed on your own.
21
23
 
22
24
  ## Process
23
25
 
24
26
  1. Determine feature context:
25
- - Find `.5/features/*/state.json`.
26
- - Select the most recent `startedAt` or `lastUpdated`.
27
- - If none exists, ask for the feature name.
28
- - Read `.5/config.json` only if needed for git/review settings.
29
- 2. Normal mode:
30
- - Find the latest `.5/features/{feature}/review-findings-*.md`.
31
- - If missing, ask whether to stop or continue with GitHub PR comments only.
27
+ - Use the feature name argument when given.
28
+ - Otherwise use the feature of the most recently modified plan in `.5/planning/`: its `feature` frontmatter field, or its file name without `.md`.
29
+ - If there is none, ask for the feature name.
30
+ 2. Decide:
31
+ - Find the latest `.5/features/{feature}/review-findings-*.md`. If missing, tell the user to run `/5:review` and stop.
32
32
  - Parse each finding into compact records with `id`, `file`, `line`, `category`, `severity`, `description`, `suggestedFix`, and `originalReviewerMessage`.
33
- - For each finding, present one item at a time:
34
- - Show `Comment {current}/{total}`, file and line, category/severity, concise description, suggested fix, and a recommendation.
35
- - Recommendation rules:
36
- - Recommend `fix` for clear, low-risk correctness, test, type, API-contract, or documentation fixes with a specific suggested change.
37
- - Recommend `wont_fix` for findings that are obsolete, duplicates, outside the feature scope, or based on an incorrect premise.
38
- - Recommend `wait` for ambiguous behavior, product decisions, risky refactors, or findings needing external validation.
39
- - Ask the user to choose `fix`, `wont_fix`, `wait`, or provide textual instructions.
40
- - Treat textual instructions as `fix` with `customInstructions` unless the text clearly says to defer or reject the finding.
33
+ - Sort each finding into one group:
34
+ - **fix** — a confirmed bug, security issue, breach of a repository standard, or style finding with a clear, local fix that changes no behavior beyond the finding.
35
+ - **wont_fix** — obsolete, a duplicate, outside the feature scope, or based on an incorrect premise.
36
+ - **ask** — uncertain (`Question` category), spanning several files, or needing a design, product, or API decision; also any fix whose suggested change you cannot apply with confidence.
37
+ - Record `fix` and `wont_fix` yourself, each with a one-line reason.
38
+ - For each **ask** finding, ask the user — **one finding per question, one question at a time**. Show `Decision {current}/{total}`, file and line, a concise description, the suggested fix, and your recommendation. Options: `fix`, `wont_fix`, `wait`, or textual instructions. Treat textual instructions as `fix` with `customInstructions` unless the text clearly says to defer or reject the finding.
39
+ - With `--interactive`, ask about every finding this way instead.
41
40
  - Write decisions to `.5/features/{feature}/review-decisions-{YYYYMMDD-HHmmss}.json`.
42
- - Invoke `/5:apply-review-findings {feature} --decisions .5/features/{feature}/review-decisions-{timestamp}.json` to apply approved local fixes.
43
- 3. GitHub mode or user-approved PR handling:
44
- - Invoke `/5:triage-pr-comments {feature}` to fetch and classify compact PR comments.
45
- - Parse the `---PR-TRIAGE---` block. If triage succeeded, continue even when there are zero actionable comments because duplicate, declined, or deferred comments may still need replies.
46
- - Ask the user for decisions on actionable/manual comments.
47
- - Invoke `/5:apply-review-findings {feature} --pr-approved` for approved PR fixes.
48
- - Invoke `/5:reply-pr-comments {feature}` to post PR replies.
49
- - Parse the `---PR-REPLIES---` block and include `POSTED`, `FAILED`, and `ERRORS` in the review summary.
50
- - Do not proceed to final output in GitHub mode until `/5:reply-pr-comments` has either posted replies or returned an explicit `---PR-REPLIES---` failure/partial result. Reply failures are non-fatal, but silent omission of the reply step is not allowed.
51
- 4. Run post-fix verification. This is mandatory after any approved fix is applied.
52
- - Read `.5/config.json`, project run skills, and common project manifests such as `package.json`, `Makefile`, `pyproject.toml`, `Cargo.toml`, and Gradle files only as needed to identify configured commands.
53
- - Run every available configured command in these categories: `build`, `test`, `e2e`/`test:e2e`, and `lint`.
54
- - Prefer generated run skills when present (`run-build`, `run-tests`, `run-lint`, and any e2e/test-e2e variant). Otherwise run the exact configured command from `.5/config.json` or the project manifest.
55
- - Do not skip a category because another category passed. Skip only when no command exists or the command is explicitly configured as `none`; record the reason.
56
- - If any command fails, continue running remaining independent categories so the user gets a complete verification picture.
57
- - Do not claim the review findings are fully addressed unless every discovered post-fix verification command passes or is explicitly skipped because no command exists.
58
- - Store compact results for each category in the summary: command, status (`passed`, `failed`, or `skipped`), and a one-line reason.
59
- 5. Write `.5/features/{feature}/review-summary-{YYYYMMDD-HHmmss}.md` using `.claude/templates/workflow/REVIEW-SUMMARY.md`.
60
-
61
- Keep all intermediate summaries compact. Do not paste raw diffs, raw PR JSON, or command logs unless a failure needs exact evidence.
62
-
63
- ## Local Decision Format
64
-
65
- Write JSON with this shape:
41
+ 3. Apply the fixes:
42
+ - Take every decision with `fix`. Use `customInstructions` when present; otherwise `suggestedFix`.
43
+ - Group fixes by file. Read each file before editing it.
44
+ - 1-3 simple fixes in a file: edit directly, highest line number first.
45
+ - 4+ fixes or complex logic in a file: spawn one focused agent with only the file path and its numbered fix list. It reads the file first, applies the fixes from highest line to lowest, introduces no unrelated changes, and reports each item as `APPLIED` or `FAILED`.
46
+ - Track each finding as `APPLIED`, `FAILED`, or `SKIPPED` (`wont_fix` and `wait`).
47
+ 4. Run post-fix verification. This is mandatory after any fix is applied.
48
+ - Identify the commands from `.5/config.json` and, only as needed, the project manifests (`package.json`, `Makefile`, `pyproject.toml`, `Cargo.toml`, Gradle files).
49
+ - Run every available command in these categories: `build`, `test`, `e2e`/`test:e2e`, and `lint`. Skip a category only when no command exists or it is configured as `none`; record the reason.
50
+ - If a command fails, still run the remaining independent categories.
51
+ - Do not claim the findings are addressed unless every discovered command passes or is skipped because no command exists.
52
+
53
+ Keep all intermediate summaries compact. Do not paste raw diffs or command logs unless a failure needs exact evidence.
54
+
55
+ ## Decision Format
66
56
 
67
57
  ```json
68
58
  {
@@ -74,7 +64,8 @@ Write JSON with this shape:
74
64
  "file": "path/to/file.ts",
75
65
  "line": 123,
76
66
  "decision": "fix",
77
- "recommendation": "fix",
67
+ "decidedBy": "claude",
68
+ "reason": "Confirmed off-by-one; local fix",
78
69
  "description": "Concise issue summary",
79
70
  "suggestedFix": "Concrete fix to apply",
80
71
  "customInstructions": ""
@@ -83,7 +74,7 @@ Write JSON with this shape:
83
74
  }
84
75
  ```
85
76
 
86
- Allowed `decision` values are `fix`, `wont_fix`, and `wait`.
77
+ Allowed `decision` values are `fix`, `wont_fix`, and `wait`. `decidedBy` is `claude` or `user`.
87
78
 
88
79
  ## Completion
89
80
 
@@ -92,13 +83,13 @@ Output:
92
83
  ```text
93
84
  Review findings addressed: {yes/no}
94
85
 
95
- Local findings: {summary}
96
- PR comments: {summary}
97
- PR replies: {posted/failed/skipped with reason}
98
- Post-fix verification: {passed/failed}
86
+ Fixed on my own: {N} — {one line per finding: id, file, what changed}
87
+ Decided by you: {N} ({fixed} fixed, {deferred} deferred)
88
+ Skipped: {N} — {one line per finding: id, reason}
89
+ Failed: {N}
99
90
  Build: {passed/failed/skipped}
100
91
  Tests: {passed/failed/skipped}
101
92
  E2E: {passed/failed/skipped}
102
93
  Lint: {passed/failed/skipped}
103
- Summary saved at .5/features/{feature}/review-summary-{timestamp}.md
94
+ Decisions saved at .5/features/{feature}/review-decisions-{timestamp}.json
104
95
  ```
@@ -30,7 +30,7 @@ Do NOT proceed until you have a clear understanding of what to analyze.
30
30
 
31
31
  1. Derive a short kebab-case name from the analysis subject (e.g., `user-auth`, `order-processing`, `payment-integration`). This becomes the filename: `{name}-analysis.md`.
32
32
 
33
- 2. Identify the relevant modules and layers to analyze. Invoke the `use-index` skill for a quick structural overview. The skill will rebuild the index if stale; fall back to Glob only if the index is missing.
33
+ 2. Identify the relevant modules and layers to analyze.
34
34
 
35
35
  3. Use Glob and Grep to locate the relevant source files. Search for key classes, interfaces, functions, and types related to the analysis subject.
36
36