all-for-claudecode 2.1.0 → 2.2.1

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 (42) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +131 -113
  4. package/agents/afc-architect.md +2 -0
  5. package/commands/analyze.md +5 -6
  6. package/commands/architect.md +6 -8
  7. package/commands/auto.md +31 -25
  8. package/commands/checkpoint.md +0 -1
  9. package/commands/debug.md +1 -1
  10. package/commands/doctor.md +1 -2
  11. package/commands/ideate.md +191 -0
  12. package/commands/implement.md +5 -5
  13. package/commands/init.md +60 -49
  14. package/commands/launch.md +181 -0
  15. package/commands/plan.md +1 -7
  16. package/commands/principles.md +0 -1
  17. package/commands/resume.md +6 -4
  18. package/commands/review.md +2 -2
  19. package/commands/security.md +10 -13
  20. package/commands/spec.md +2 -1
  21. package/commands/test.md +4 -4
  22. package/docs/phase-gate-protocol.md +18 -6
  23. package/hooks/hooks.json +2 -4
  24. package/package.json +15 -9
  25. package/scripts/afc-consistency-check.sh +286 -0
  26. package/scripts/afc-dag-validate.sh +3 -2
  27. package/scripts/afc-notify.sh +5 -6
  28. package/scripts/afc-parallel-validate.sh +3 -5
  29. package/scripts/afc-permission-request.sh +27 -3
  30. package/scripts/afc-pipeline-manage.sh +24 -11
  31. package/scripts/afc-state.sh +42 -26
  32. package/scripts/afc-stop-gate.sh +4 -6
  33. package/scripts/afc-stop-todo-check.sh +83 -0
  34. package/scripts/afc-subagent-context.sh +7 -0
  35. package/scripts/afc-task-completed-gate.sh +4 -6
  36. package/scripts/pre-compact-checkpoint.sh +19 -4
  37. package/scripts/session-start-context.sh +11 -3
  38. package/templates/afc.config.template.md +12 -76
  39. package/templates/afc.config.express-api.md +0 -99
  40. package/templates/afc.config.monorepo.md +0 -98
  41. package/templates/afc.config.nextjs-fsd.md +0 -107
  42. package/templates/afc.config.react-spa.md +0 -96
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: afc:ideate
3
+ description: "Explore and structure a product idea"
4
+ argument-hint: "[rough idea or problem statement]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Glob
9
+ - Grep
10
+ - WebSearch
11
+ - WebFetch
12
+ model: sonnet
13
+ ---
14
+
15
+ # /afc:ideate — Explore and Structure a Product Idea
16
+
17
+ > Transforms a rough idea, problem statement, or inspiration into a structured product brief (ideate.md).
18
+ > This is a **pre-spec exploration** tool — use it when you don't yet know exactly what to build.
19
+ > The output feeds directly into `/afc:spec` as input.
20
+
21
+ ## Relationship to Other Commands
22
+
23
+ ```
24
+ afc:ideate (what to build?) → afc:spec (how to specify it) → afc:plan → afc:implement → ...
25
+ ```
26
+
27
+ - **ideate** = "I have an idea but haven't decided the scope, audience, or approach yet"
28
+ - **spec** = "I know what to build and need a formal specification"
29
+ - ideate is **never** part of the auto pipeline — it's a standalone exploration tool
30
+
31
+ ## Arguments
32
+
33
+ - `$ARGUMENTS` — (required) One of:
34
+ - Rough idea: `"real-time collaborative whiteboard"`
35
+ - Problem statement: `"users keep losing unsaved work when the browser crashes"`
36
+ - Reference URL: `"https://example.com/competitor-product"` (fetched and analyzed)
37
+ - File path: `"./meeting-notes.md"` (read and extracted)
38
+
39
+ ## Execution Steps
40
+
41
+ ### 1. Parse Input
42
+
43
+ Determine the input type and extract raw content:
44
+
45
+ 1. **If `$ARGUMENTS` starts with `http://` or `https://`**:
46
+ - Fetch content via WebFetch
47
+ - Extract: product name, key features, target audience, value proposition
48
+ - Frame as: "Build something similar/better that addresses {gap}"
49
+
50
+ 2. **If `$ARGUMENTS` is a file path** (contains `/` or ends with `.md`/`.txt`):
51
+ - Read the file content
52
+ - Extract: action items, feature requests, pain points, user feedback
53
+ - Frame as: structured requirements from raw notes
54
+
55
+ 3. **Otherwise**: treat as a natural language idea/problem statement
56
+
57
+ ### 2. Market & Context Research
58
+
59
+ Perform lightweight research to ground the idea in reality:
60
+
61
+ 1. **Competitive landscape** (WebSearch):
62
+ - Search: `"{core concept}" tool OR app OR service {current year}`
63
+ - Identify 3-5 existing solutions
64
+ - Note: what they do well, what gaps exist
65
+
66
+ 2. **Technology feasibility** (WebSearch, optional):
67
+ - If the idea involves unfamiliar tech: search for current state and constraints
68
+ - Tag findings with `[RESEARCHED]`
69
+
70
+ 3. **Target user validation**:
71
+ - Who would use this? Why? What's their current workaround?
72
+
73
+ ### 3. Explore Existing Codebase (if applicable)
74
+
75
+ If running inside a project with source code:
76
+
77
+ 1. Check if any related functionality already exists (Glob/Grep)
78
+ 2. If found: note as "Existing foundation" — ideate around extending, not rebuilding
79
+ 3. If no codebase or greenfield: skip this step
80
+
81
+ ### 4. Write Product Brief
82
+
83
+ Create `.claude/afc/ideate.md` (overwrite if exists after confirmation):
84
+
85
+ ```markdown
86
+ # Product Brief: {idea name}
87
+
88
+ > Created: {YYYY-MM-DD}
89
+ > Status: Exploration
90
+ > Input: {original $ARGUMENTS summary}
91
+
92
+ ## Problem Statement
93
+ {What problem does this solve? Who has this problem? How painful is it?}
94
+ {2-3 sentences, specific and measurable where possible}
95
+
96
+ ## Target Users
97
+
98
+ ### Primary Persona
99
+ - **Who**: {role/demographic}
100
+ - **Context**: {when/where they encounter the problem}
101
+ - **Current workaround**: {what they do today}
102
+ - **Pain level**: {High/Medium/Low — with justification}
103
+
104
+ ### Secondary Persona (if applicable)
105
+ {same format}
106
+
107
+ ## Value Proposition
108
+ {One sentence: "For {persona} who {need}, this {product} provides {benefit} unlike {alternatives}"}
109
+
110
+ ## Core Features (MoSCoW)
111
+
112
+ ### Must Have (MVP)
113
+ 1. {feature} — {why it's essential}
114
+ 2. {feature} — {why it's essential}
115
+ 3. {feature} — {why it's essential}
116
+
117
+ ### Should Have (v1.1)
118
+ 1. {feature} — {value added}
119
+
120
+ ### Could Have (future)
121
+ 1. {feature} — {potential value}
122
+
123
+ ### Won't Have (explicit scope cut)
124
+ 1. {feature} — {why excluded}
125
+
126
+ ## User Journey (primary flow)
127
+
128
+ ```mermaid
129
+ graph LR
130
+ A[Entry Point] --> B[Core Action]
131
+ B --> C[Key Decision]
132
+ C --> D[Success State]
133
+ C --> E[Error/Edge Case]
134
+ ```
135
+
136
+ {Describe the 3-5 step primary user flow in plain text as well}
137
+
138
+ ## Competitive Analysis
139
+
140
+ | Aspect | {Competitor 1} | {Competitor 2} | This Product |
141
+ |--------|---------------|---------------|-------------|
142
+ | Core strength | {X} | {X} | {X} |
143
+ | Key weakness | {X} | {X} | {X} |
144
+ | Pricing | {X} | {X} | {X} |
145
+ | Differentiator | — | — | {what makes this unique} |
146
+
147
+ ## Open Questions
148
+ - {Decision that needs user input before proceeding to spec}
149
+ - {Technical uncertainty that affects scope}
150
+ - {Business assumption that should be validated}
151
+
152
+ ## Suggested Next Steps
153
+ 1. Resolve Open Questions above
154
+ 2. Run `/afc:spec {refined feature description}` to formalize as a specification
155
+ 3. {Any other recommended action}
156
+
157
+ ## Research Sources
158
+ - [{source title}]({url}) — {what was learned}
159
+ ```
160
+
161
+ ### 5. Interactive Refinement
162
+
163
+ After writing the initial brief, present key decisions to the user:
164
+
165
+ 1. **Scope check**: "The MVP has {N} features. Does this feel right, or should we cut/add?"
166
+ 2. **Persona validation**: "Is {persona} the right primary user?"
167
+ 3. **Open questions**: present the top 2 unresolved questions via AskUserQuestion
168
+
169
+ Apply user feedback directly into ideate.md.
170
+
171
+ ### 6. Final Output
172
+
173
+ ```
174
+ Ideation complete
175
+ ├─ .claude/afc/ideate.md
176
+ ├─ Personas: {count}
177
+ ├─ MVP features: {count}
178
+ ├─ Competitors analyzed: {count}
179
+ ├─ Open questions: {count}
180
+ ├─ Research sources: {count}
181
+ └─ Next step: /afc:spec "{suggested feature description}"
182
+ ```
183
+
184
+ ## Notes
185
+
186
+ - **This is exploration, not specification**. Do not write acceptance criteria, system requirements, or FR/NFR numbers — that belongs in `/afc:spec`.
187
+ - **ideate.md lives at `.claude/afc/ideate.md`** (project-level, not feature-level) because ideation may span multiple features.
188
+ - **Not part of the auto pipeline**. ideate is manually invoked when a developer needs to think through an idea before committing to a spec.
189
+ - **One ideate.md per project** — overwrite on re-run (with confirmation). If you need to preserve a previous ideation, rename it first.
190
+ - **Competitive analysis is lightweight** — 3-5 competitors max. Deep market research is not the goal; grounding the idea in reality is.
191
+ - **Mermaid diagrams are optional** — only include if the user flow benefits from visualization. Do not force diagrams for simple concepts.
@@ -94,7 +94,7 @@ If tasks.md already exists (e.g., from standalone `/afc:tasks` run): use as-is,
94
94
  - Identify already-completed `[x]` tasks
95
95
  2. Load **Implementation Context** section from plan.md (used in sub-agent prompts)
96
96
 
97
- ### 1.5. Retrospective Check
97
+ ### 1.7. Retrospective Check
98
98
 
99
99
  If `.claude/afc/memory/retrospectives/` exists, load and check:
100
100
  - Were there implementation issues in past pipelines (e.g., file conflicts, unexpected dependencies, CI failures after parallel execution)?
@@ -141,7 +141,7 @@ TaskUpdate({ taskId: "T004", addBlockedBy: ["T002"] }) // if T004 depends on T0
141
141
 
142
142
  **Step 2 — Launch unblocked [P] tasks in a single message** (Claude Code executes multiple Task() calls in a single message concurrently, up to ~10):
143
143
  ```
144
- Task("T003: Create UserService", subagent_type: "afc-impl-worker",
144
+ Task("T003: Create UserService", subagent_type: "afc:afc-impl-worker",
145
145
  isolation: "worktree",
146
146
  prompt: "Implement the following task:
147
147
 
@@ -164,7 +164,7 @@ Task("T003: Create UserService", subagent_type: "afc-impl-worker",
164
164
  - Key decisions: {any design choices made}
165
165
  - Issues: {blockers or concerns, if any}
166
166
  - Verification: {config.gate} result")
167
- Task("T004: Create AuthService", subagent_type: "afc-impl-worker", isolation: "worktree", ...)
167
+ Task("T004: Create AuthService", subagent_type: "afc:afc-impl-worker", isolation: "worktree", ...)
168
168
  ```
169
169
 
170
170
  **Step 3 — Collect results and advance**: After all parallel agents return:
@@ -201,7 +201,7 @@ TaskUpdate({ taskId: "T008", addBlockedBy: ["T006"] }) // if dependency exists
201
201
  Instead of workers self-claiming (race-prone), the **orchestrator pre-assigns** tasks:
202
202
  ```
203
203
  // Orchestrator assigns: each worker gets a unique, non-overlapping task set
204
- Task("Worker 1: T007, T009, T011", subagent_type: "afc-impl-worker",
204
+ Task("Worker 1: T007, T009, T011", subagent_type: "afc:afc-impl-worker",
205
205
  isolation: "worktree",
206
206
  prompt: "Implement these tasks in order:
207
207
  1. T007: {description} — `{file path}`
@@ -224,7 +224,7 @@ Task("Worker 1: T007, T009, T011", subagent_type: "afc-impl-worker",
224
224
  Return a structured summary per task (max 2000 chars total):
225
225
  - Files changed, key decisions, issues encountered per task.")
226
226
 
227
- Task("Worker 2: T008, T010, T012", subagent_type: "afc-impl-worker", isolation: "worktree", ...)
227
+ Task("Worker 2: T008, T010, T012", subagent_type: "afc:afc-impl-worker", isolation: "worktree", ...)
228
228
  ```
229
229
 
230
230
  **Step 3 — Collect and reconcile**:
package/commands/init.md CHANGED
@@ -1,8 +1,7 @@
1
1
  ---
2
2
  name: afc:init
3
3
  description: "Project initial setup"
4
- argument-hint: "[preset: nextjs-fsd | react-spa | express-api | monorepo]"
5
- disable-model-invocation: true
4
+ argument-hint: "[additional context]"
6
5
  allowed-tools:
7
6
  - Read
8
7
  - Write
@@ -18,9 +17,7 @@ model: haiku
18
17
 
19
18
  ## Arguments
20
19
 
21
- - `$ARGUMENTS` — (optional) Template preset name (e.g., `nextjs-fsd`)
22
- - If not specified: analyzes project structure and auto-infers
23
- - If preset specified: uses `${CLAUDE_PLUGIN_ROOT}/templates/afc.config.{preset}.md`
20
+ - `$ARGUMENTS` — (optional) Additional context or hints for project analysis
24
21
 
25
22
  ## Execution Steps
26
23
 
@@ -55,64 +52,76 @@ If `.claude/afc.config.md` already exists:
55
52
  - Ask user: "Config file already exists. Do you want to overwrite it?"
56
53
  - If declined: **abort**
57
54
 
58
- ### 3. Preset Branch
55
+ ### 3. Analyze Project Structure
59
56
 
60
- #### A. Preset Specified (`$ARGUMENTS` provided)
61
-
62
- 1. Verify `${CLAUDE_PLUGIN_ROOT}/templates/afc.config.{$ARGUMENTS}.md` exists
63
- 2. If found: copy that file to `.claude/afc.config.md`
64
- 3. If not found: print "Preset `{$ARGUMENTS}` not found. Available: {list}" then **abort**
65
-
66
- #### B. Auto-Infer (`$ARGUMENTS` not provided)
67
-
68
- Analyze project structure and auto-infer configuration:
57
+ Analyze the project and auto-infer configuration. Use `$ARGUMENTS` as additional context if provided.
69
58
 
70
59
  **Step 1. Package Manager / Script Detection**
71
60
  - Read `package.json` → extract CI-related commands from `scripts` field
72
- - Determine package manager from lockfile (yarn.lock / pnpm-lock.yaml / package-lock.json)
73
- - Reflect detected scripts in `CI Commands` section
61
+ - Determine package manager from lockfile:
62
+
63
+ | Lockfile | Package Manager |
64
+ |----------|----------------|
65
+ | `pnpm-lock.yaml` | pnpm |
66
+ | `yarn.lock` | yarn |
67
+ | `bun.lockb` or `bun.lock` | bun |
68
+ | `package-lock.json` | npm |
69
+
70
+ - If no lockfile: check `packageManager` field in `package.json`
71
+ - Non-JS projects: check `pyproject.toml` (Python), `Cargo.toml` (Rust), `go.mod` (Go)
74
72
 
75
73
  **Step 2. Framework Detection**
76
74
  - Determine from `package.json` dependencies/devDependencies:
77
- - `next` → Next.js (App Router/Pages Router determined by presence of `app/` directory)
78
- - `nuxt` Nuxt
79
- - `@sveltejs/kit` → SvelteKit
80
- - `vite` Vite
81
- - etc.
75
+
76
+ | Dependency | Framework |
77
+ |-----------|-----------|
78
+ | `next` | Next.js (App Router if `app/` dir exists, else Pages Router) |
79
+ | `nuxt` | Nuxt |
80
+ | `@sveltejs/kit` | SvelteKit |
81
+ | `@remix-run/react` | Remix |
82
+ | `astro` | Astro |
83
+ | `@angular/core` | Angular |
84
+ | `vite` (alone) | Vite SPA |
85
+ | `hono` | Hono |
86
+ | `fastify` | Fastify |
87
+ | `express` | Express |
88
+
89
+ - Non-JS: `pyproject.toml` → Django/FastAPI/Flask, `Cargo.toml` → Rust project, `go.mod` → Go project
82
90
  - Presence of `tsconfig.json` → TypeScript indicator
83
91
 
84
92
  **Step 3. Architecture Detection**
85
93
  - Analyze directory structure:
86
- - `src/app/`, `src/features/`, `src/entities/`, `src/shared/` FSD
94
+ - FSD: requires **at least 3** of `features/`, `entities/`, `shared/`, `widgets/`, `pages/` under `src/`
87
95
  - `src/domain/`, `src/application/`, `src/infrastructure/` → Clean Architecture
88
96
  - `src/modules/` → Modular
89
97
  - Other → Layered
90
- - `paths` in `tsconfig.json` → extract path_alias
91
-
92
- **Step 4. State Management Detection**
93
- - From dependencies:
94
- - `zustand` Zustand
95
- - `@reduxjs/toolkit` Redux Toolkit
96
- - `@tanstack/react-query` React Query
97
- - `swr` SWR
98
- - `pinia` → Pinia
99
-
100
- **Step 5. Styling / Testing Detection**
101
- - `tailwindcss` → Tailwind CSS
102
- - `styled-components` → styled-components
103
- - `jest` / `vitest` / `playwright` → mapped respectively
104
-
105
- **Step 6. Code Style Detection**
106
- - Check `.eslintrc*` / `eslint.config.*` → identify lint rules
107
- - `strict` in `tsconfig.json` → strict_mode
98
+ - `paths` in `tsconfig.json` → extract path alias
99
+
100
+ **Step 4. State / Styling / Testing / DB Detection**
101
+ - State management: `zustand`, `@reduxjs/toolkit`, `@tanstack/react-query`, `swr`, `pinia`, `jotai`, `recoil`
102
+ - Styling: `tailwindcss`, `styled-components`, `@emotion/react`, `sass`, CSS Modules (check for `*.module.css`)
103
+ - Testing: `jest`, `vitest`, `playwright`, `@testing-library/*`, `cypress`
104
+ - Linter: `.eslintrc*` / `eslint.config.*` / `biome.json` / `biome.jsonc`
105
+ - DB/ORM: `prisma` (check `prisma/schema.prisma`), `drizzle-orm`, `typeorm`, `@prisma/client`
106
+
107
+ **Step 5. Code Style Detection**
108
+ - Check linter config identify key rules
109
+ - `strict` in `tsconfig.json` strict mode
108
110
  - Read 2-3 existing code samples to verify naming patterns
109
111
 
110
112
  ### 4. Generate Config File
111
113
 
112
- 1. Generate config based on `${CLAUDE_PLUGIN_ROOT}/templates/afc.config.template.md`
113
- 2. Fill in blanks with auto-inferred values
114
- 3. For items that cannot be inferred: keep template defaults + mark with `# TODO: Adjust for your project`
115
- 4. Save to `.claude/afc.config.md`
114
+ Generate `.claude/afc.config.md` in **free-form markdown** format:
115
+
116
+ 1. **CI Commands** section: YAML code block with `ci`, `gate`, `test` keys (fixed format, scripts parse these)
117
+ 2. **Architecture** section: describe detected architecture style, layers, import rules, path aliases in free-form prose/lists
118
+ 3. **Code Style** section: describe detected language, strictness, naming conventions, lint rules in free-form prose/lists
119
+ 4. **Project Context** section: describe framework, state management, styling, testing, DB/ORM, risks, and any other relevant project characteristics in free-form prose/lists
120
+
121
+ Reference `${CLAUDE_PLUGIN_ROOT}/templates/afc.config.template.md` for the section structure.
122
+ Write sections as natural descriptions — **no YAML code blocks** except for CI Commands.
123
+ For items that cannot be inferred: note `TODO: Adjust for your project` inline.
124
+ Save to `.claude/afc.config.md`.
116
125
 
117
126
  ### 5. Scan Global CLAUDE.md and Detect Conflicts
118
127
 
@@ -127,14 +136,15 @@ Check for presence of `<!-- AFC:START -->` or `<!-- SELFISH:START -->` marker.
127
136
 
128
137
  #### Step 2. Conflict Pattern Scan
129
138
 
130
- Search the entire CLAUDE.md for the patterns below. **Include content inside marker blocks (`<!-- *:START -->` ~ `<!-- *:END -->`) in the scan.**
139
+ Search CLAUDE.md for the patterns below. **IMPORTANT: EXCLUDE content inside any marker blocks (`<!-- *:START -->` ~ `<!-- *:END -->`). Only scan unguarded content outside marker blocks.** Other tools (OMC, etc.) manage their own blocks — their internal agent names are not conflicts.
131
140
 
132
141
  **A. Marker Block Detection**
133
142
  - Regex: `<!-- ([A-Z0-9_-]+):START -->` ~ `<!-- \1:END -->`
134
143
  - Record all found block names and line ranges
144
+ - **Strip these ranges from the scan target** — only scan lines NOT inside any marker block
135
145
 
136
146
  **B. Agent Routing Conflict Detection**
137
- Find directives containing these keywords:
147
+ In the **unguarded** (non-marker-block) content only, find directives containing these keywords:
138
148
  - `executor`, `deep-executor` — conflicts with afc:implement
139
149
  - `code-reviewer`, `quality-reviewer`, `style-reviewer`, `api-reviewer`, `security-reviewer`, `performance-reviewer` — conflicts with afc:review
140
150
  - `debugger` (in agent routing context) — conflicts with afc:debug
@@ -143,7 +153,7 @@ Find directives containing these keywords:
143
153
  - `test-engineer` — conflicts with afc:test
144
154
 
145
155
  **C. Skill Routing Conflict Detection**
146
- Find these patterns:
156
+ In the **unguarded** content only, find these patterns:
147
157
  - Another tool's skill trigger table (e.g., tables like `| situation | skill |`)
148
158
  - `delegate to`, `route to`, `always use` + agent name combinations
149
159
  - Directives related to `auto-trigger`, `intent detection`, `intent-based routing`
@@ -214,10 +224,12 @@ IMPORTANT: For requests matching the afc skill routing table below, always invok
214
224
  | Spec | `afc:spec` | spec, specification |
215
225
  | Tasks | `afc:tasks` | break down tasks, decompose |
216
226
  | Research | `afc:research` | research, investigate |
227
+ | Ideate | `afc:ideate` | idea, brainstorm, what to build, product brief |
217
228
  | Ambiguous | `afc:clarify` | auto-triggered when requirements are unclear |
218
229
  | Full auto | `afc:auto` | do it automatically, auto-run |
219
230
 
220
231
  User-only (not auto-triggered — inform user on request):
232
+ - `afc:launch` — inform user when release artifact generation is requested
221
233
  - `afc:doctor` — inform user when health check is requested
222
234
  - `afc:architect` — inform user when architecture review is requested
223
235
  - `afc:security` — inform user when security scan is requested
@@ -268,7 +280,6 @@ all-for-claudecode initialization complete
268
280
 
269
281
  - **Overwrite caution**: If config file already exists, always confirm with user.
270
282
  - **Inference limits**: Auto-inference is best-effort. User may need to review and adjust.
271
- - **Preset path**: Presets are loaded from the `templates/` directory inside the plugin.
272
283
  - **`.claude/` directory**: Created automatically if it does not exist.
273
284
  - **Global CLAUDE.md principles**:
274
285
  - Never modify content outside the `<!-- AFC:START/END -->` markers (the `AFC` prefix in markers is a compact technical identifier)
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: afc:launch
3
+ description: "Generate release artifacts"
4
+ argument-hint: "[version tag or 'auto']"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ model: sonnet
13
+ ---
14
+
15
+ # /afc:launch — Generate Release Artifacts
16
+
17
+ > Generates release artifacts (CHANGELOG entry, README updates, GitHub Release notes) from git history and optional spec context.
18
+ > This is a **standalone utility** — not part of the auto pipeline.
19
+ > Works with or without a prior afc pipeline run.
20
+
21
+ ## Arguments
22
+
23
+ - `$ARGUMENTS` — (optional) One of:
24
+ - Version tag: `"v2.2.0"` — uses this as the release version
25
+ - `"auto"` — auto-detects version from package.json/Cargo.toml/pyproject.toml
26
+ - Not specified: prompts for version
27
+
28
+ ## Execution Steps
29
+
30
+ ### 1. Detect Project Context
31
+
32
+ 1. **Version detection**:
33
+ - If `$ARGUMENTS` is a version string (matches `v?\d+\.\d+\.\d+`): use it
34
+ - If `$ARGUMENTS` = `"auto"`: read version from package.json → Cargo.toml → pyproject.toml → setup.py (first found)
35
+ - If not specified: check package.json etc. for current version, present to user, confirm or override
36
+
37
+ 2. **Previous version detection**:
38
+ ```bash
39
+ git describe --tags --abbrev=0 2>/dev/null || echo "none"
40
+ ```
41
+ - If a previous tag exists: diff range = `{previous_tag}..HEAD`
42
+ - If no tags: diff range = all commits (warn user: "No previous release tag found. Including all history.")
43
+
44
+ 3. **Changelog detection**:
45
+ - Check for existing: `CHANGELOG.md` → `CHANGES.md` → `HISTORY.md`
46
+ - If found: will prepend new entry
47
+ - If not found: will create `CHANGELOG.md`
48
+
49
+ ### 2. Gather Change Context
50
+
51
+ Collect all available context for high-quality release notes:
52
+
53
+ 1. **Git history** (required):
54
+ ```bash
55
+ git log {previous_tag}..HEAD --pretty=format:"%h %s" --no-merges
56
+ ```
57
+
58
+ 2. **Changed files summary** (required):
59
+ ```bash
60
+ git diff --stat {previous_tag}..HEAD
61
+ ```
62
+
63
+ 3. **Spec context** (optional — enhances quality):
64
+ - Glob `.claude/afc/specs/*/spec.md` — if any exist, read Overview and User Stories sections
65
+ - This provides **intent context** that raw commit messages lack
66
+ - If no specs found: rely on git history only (still produces good output)
67
+
68
+ 4. **Review context** (optional):
69
+ - Glob `.claude/afc/memory/reviews/*` — if any exist from this version cycle, note key findings
70
+ - Skip if not found
71
+
72
+ 5. **Breaking change detection**:
73
+ - Grep commit messages for: `BREAKING`, `breaking change`, `!:` (conventional commits)
74
+ - Grep diffs for: deleted public exports, renamed public APIs, changed function signatures
75
+ - Flag any findings as breaking changes in the output
76
+
77
+ ### 3. Generate CHANGELOG Entry
78
+
79
+ Prepend a new entry to the changelog file:
80
+
81
+ 1. **Duplicate check**: Grep the changelog for `## [{version}]`. If an entry for this version already exists:
82
+ - Ask user: "CHANGELOG already has an entry for {version}. (1) Overwrite (2) Abort"
83
+ - If overwrite: replace the existing entry (from `## [{version}]` to the next `## [` line)
84
+ - If abort: skip CHANGELOG generation
85
+
86
+ 2. Follow the existing format if one exists; otherwise use [Keep a Changelog](https://keepachangelog.com/) format:
87
+
88
+ ```markdown
89
+ ## [{version}] - {YYYY-MM-DD}
90
+
91
+ ### Added
92
+ - {new features, described from user perspective}
93
+
94
+ ### Changed
95
+ - {modifications to existing functionality}
96
+
97
+ ### Fixed
98
+ - {bug fixes}
99
+
100
+ ### Removed
101
+ - {removed features or deprecated items}
102
+
103
+ ### Breaking Changes
104
+ - {if any — empty section omitted}
105
+ ```
106
+
107
+ **Quality rules**:
108
+ - Write from **user perspective**, not developer perspective ("Add dark mode support" not "Add ThemeProvider component")
109
+ - Group related changes into single entries (don't list every file)
110
+ - If spec context is available: use feature names from specs, not commit message fragments
111
+ - Omit empty sections (if no fixes, don't include "### Fixed")
112
+
113
+ ### 4. Update README (conditional)
114
+
115
+ Only update README if meaningful changes warrant it:
116
+
117
+ 1. **Check triggers**:
118
+ - New CLI commands or API endpoints added?
119
+ - Installation process changed?
120
+ - New dependencies or requirements?
121
+ - Feature that users need to know about?
122
+
123
+ 2. **If no triggers match**: skip README update entirely (print: "README: no updates needed")
124
+
125
+ 3. **If triggers match**: read current README, identify the relevant section, apply minimal targeted edit
126
+ - Do NOT rewrite the entire README
127
+ - Do NOT add badges, shields, or decorative elements
128
+ - Only update sections directly affected by changes
129
+
130
+ ### 5. Generate GitHub Release Notes
131
+
132
+ Create `.claude/afc/release-notes.md` (draft for `gh release create`):
133
+
134
+ ```markdown
135
+ # {version}
136
+
137
+ {2-3 sentence summary of this release — what's the headline?}
138
+
139
+ ## Highlights
140
+
141
+ - {top 1-3 user-facing changes, expanded with context}
142
+
143
+ ## What's Changed
144
+
145
+ {CHANGELOG entry content, reformatted for GitHub}
146
+
147
+ ## Breaking Changes
148
+
149
+ {if any — clear migration instructions}
150
+
151
+ **Full Changelog**: {previous_tag}...{version}
152
+ ```
153
+
154
+ ### 6. Present Summary and Next Steps
155
+
156
+ ```
157
+ Release artifacts generated: {version}
158
+ ├─ CHANGELOG.md: entry prepended ({N} items across {M} categories)
159
+ ├─ README.md: {updated section / no updates needed}
160
+ ├─ .claude/afc/release-notes.md: draft created
161
+ ├─ Breaking changes: {count or "none"}
162
+ ├─ Commits included: {N} (since {previous_tag})
163
+ └─ Specs referenced: {N or "none (git-only mode)"}
164
+
165
+ Next steps:
166
+ git add CHANGELOG.md README.md
167
+ git commit -m "docs: prepare release {version}"
168
+ git tag {version}
169
+ gh release create {version} --notes-file .claude/afc/release-notes.md
170
+ ```
171
+
172
+ **Do NOT execute these commands automatically.** Present them for the user to review and run.
173
+
174
+ ## Notes
175
+
176
+ - **Not part of the auto pipeline**. Launch is a standalone utility invoked when you're ready to release, not after every feature.
177
+ - **Non-destructive**: only creates/edits CHANGELOG and README (conditionally). Does not push, tag, or create releases automatically.
178
+ - **Git history is the source of truth**. Spec context enhances quality but is never required.
179
+ - **Conventional Commits awareness**: if the project uses conventional commits (`feat:`, `fix:`, `chore:`), the generated CHANGELOG respects those categories.
180
+ - **Idempotent**: running launch twice with the same version overwrites the release-notes.md draft and re-generates the CHANGELOG entry (warns before overwriting).
181
+ - **No scope for `clean`**: release-notes.md in `.claude/afc/` is a draft file. The user decides whether to keep or delete it after the release.
package/commands/plan.md CHANGED
@@ -109,13 +109,7 @@ Create `.claude/afc/specs/{feature}/plan.md`. **Must** follow the structure belo
109
109
  {summary of core requirements from spec + technical approach, 3-5 sentences}
110
110
 
111
111
  ## Technical Context
112
- {summary of project settings loaded from afc.config.md}
113
- - **Language**: {config.code_style.language}
114
- - **Framework**: {config.framework.name}
115
- - **State**: {config.state_management summary}
116
- - **Architecture**: {config.architecture.style}
117
- - **Styling**: {config.styling.framework}
118
- - **Testing**: {config.testing.framework}
112
+ {Summarize key project settings from afc.config.md — Architecture, Code Style, and Project Context sections}
119
113
  - **Constraints**: {constraints extracted from spec}
120
114
 
121
115
  ## Principles Check
@@ -2,7 +2,6 @@
2
2
  name: afc:principles
3
3
  description: "Manage project principles"
4
4
  argument-hint: "[action: add, remove, init]"
5
- disable-model-invocation: true
6
5
  allowed-tools:
7
6
  - Read
8
7
  - Write
@@ -2,7 +2,6 @@
2
2
  name: afc:resume
3
3
  description: "Restore session"
4
4
  argument-hint: "[no arguments]"
5
- disable-model-invocation: true
6
5
  model: haiku
7
6
  allowed-tools:
8
7
  - Read
@@ -23,8 +22,8 @@ allowed-tools:
23
22
  ### 1. Load Checkpoint
24
23
 
25
24
  Read `.claude/afc/memory/checkpoint.md`:
26
- - If not found: output "No saved checkpoint found." then **stop**
27
- - If found: parse the full contents
25
+ - If not found: output "No saved checkpoint found. Use `/afc:checkpoint` to create one, or checkpoints are created automatically on context compaction." then **stop**
26
+ - If found: parse the full contents (extract branch, commit hash, pipeline feature, task progress, modified files)
28
27
 
29
28
  ### 2. Validate Environment
30
29
 
@@ -33,7 +32,10 @@ Compare the checkpoint state against the current environment:
33
32
  1. **Branch check**: Does the checkpoint branch match the current branch?
34
33
  - If different: warn + suggest switching
35
34
  2. **File state**: Have any files changed since the checkpoint?
36
- - Check for new commits with `git log {checkpoint hash}..HEAD --oneline`
35
+ - First verify HEAD exists: `git rev-parse --verify HEAD 2>/dev/null`
36
+ - If HEAD does not exist (empty repo / no commits): report "No commits yet — cannot check changes since checkpoint." and skip this check
37
+ - If checkpoint hash is present and non-empty: `git log {checkpoint hash}..HEAD --oneline`
38
+ - If checkpoint hash is empty or missing: report "Checkpoint has no git reference — cannot diff." and skip this check
37
39
  3. **Feature directory**: Does .claude/afc/specs/{feature}/ still exist?
38
40
 
39
41
  ### 3. Report State
@@ -127,12 +127,12 @@ For each changed file, examine from the following perspectives:
127
127
  - Startup/response latency concerns
128
128
  - Unnecessary computation or redundant operations
129
129
  - Resource management (memory, file handles, connections, subprocesses)
130
- - {config.framework}-specific performance patterns
130
+ - Framework-specific performance patterns (from Project Context)
131
131
 
132
132
  #### E. Project Pattern Compliance
133
133
  - {config.code_style} naming and structure conventions
134
134
  - {config.architecture} layer rules and boundaries
135
- - {config.framework}-specific idioms and best practices
135
+ - Framework-specific idioms and best practices (from Project Context)
136
136
 
137
137
  #### F. Reusability
138
138
  - Duplicate or near-duplicate logic across files