forge-cc 1.0.2 → 2.0.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 (66) hide show
  1. package/.forge.json +6 -5
  2. package/README.md +7 -7
  3. package/dist/cli.js +193 -131
  4. package/dist/cli.js.map +1 -1
  5. package/dist/codex-poll.d.ts +38 -0
  6. package/dist/codex-poll.js +70 -0
  7. package/dist/codex-poll.js.map +1 -0
  8. package/dist/config/schema.d.ts +0 -28
  9. package/dist/config/schema.js +0 -7
  10. package/dist/config/schema.js.map +1 -1
  11. package/dist/graph/index.d.ts +6 -0
  12. package/dist/graph/index.js +11 -0
  13. package/dist/graph/index.js.map +1 -0
  14. package/dist/graph/query.d.ts +52 -0
  15. package/dist/graph/query.js +319 -0
  16. package/dist/graph/query.js.map +1 -0
  17. package/dist/graph/reader.d.ts +13 -0
  18. package/dist/graph/reader.js +140 -0
  19. package/dist/graph/reader.js.map +1 -0
  20. package/dist/graph/schemas.d.ts +215 -0
  21. package/dist/graph/schemas.js +54 -0
  22. package/dist/graph/schemas.js.map +1 -0
  23. package/dist/graph/types.d.ts +109 -0
  24. package/dist/graph/types.js +2 -0
  25. package/dist/graph/types.js.map +1 -0
  26. package/dist/graph/validator.d.ts +32 -0
  27. package/dist/graph/validator.js +253 -0
  28. package/dist/graph/validator.js.map +1 -0
  29. package/dist/graph/writer.d.ts +18 -0
  30. package/dist/graph/writer.js +159 -0
  31. package/dist/graph/writer.js.map +1 -0
  32. package/dist/linear/client.d.ts +94 -4
  33. package/dist/linear/client.js +203 -20
  34. package/dist/linear/client.js.map +1 -1
  35. package/dist/linear/sync.d.ts +11 -14
  36. package/dist/linear/sync.js +63 -83
  37. package/dist/linear/sync.js.map +1 -1
  38. package/dist/runner/loop.d.ts +1 -1
  39. package/dist/runner/loop.js +93 -100
  40. package/dist/runner/loop.js.map +1 -1
  41. package/dist/runner/prompt.d.ts +7 -9
  42. package/dist/runner/prompt.js +27 -30
  43. package/dist/runner/prompt.js.map +1 -1
  44. package/dist/setup.js +26 -3
  45. package/dist/setup.js.map +1 -1
  46. package/dist/types.d.ts +0 -23
  47. package/package.json +3 -5
  48. package/skills/README.md +35 -33
  49. package/skills/forge-build.md +344 -0
  50. package/skills/forge-capture.md +204 -0
  51. package/skills/forge-fix.md +207 -0
  52. package/skills/forge-plan.md +335 -0
  53. package/skills/forge-quick.md +154 -0
  54. package/skills/forge-setup.md +2 -2
  55. package/skills/ref/adversarial-review.md +117 -0
  56. package/skills/ref/graph-correction.md +88 -0
  57. package/skills/ref/requirement-sizing.md +146 -0
  58. package/dist/server.d.ts +0 -6
  59. package/dist/server.js +0 -51
  60. package/dist/server.js.map +0 -1
  61. package/dist/state/status.d.ts +0 -66
  62. package/dist/state/status.js +0 -96
  63. package/dist/state/status.js.map +0 -1
  64. package/skills/forge-go.md +0 -583
  65. package/skills/forge-spec.md +0 -367
  66. package/skills/forge-triage.md +0 -179
@@ -1,367 +0,0 @@
1
- # /forge:spec — Linear Project to PRD with Milestones
2
-
3
- Turn a Linear project into a detailed PRD with milestones and issues. This skill scans the codebase, conducts an adaptive interview, generates a PRD, and syncs the plan back to Linear.
4
-
5
- ## Instructions
6
-
7
- Follow these steps exactly. The interview is adaptive — lead with recommendations, not blank-slate questions.
8
-
9
- ### Step 1 — Select Linear Project
10
-
11
- Fetch incomplete projects from Linear:
12
-
13
- ```
14
- Use mcp__linear__list_projects to get all existing projects.
15
- ```
16
-
17
- Filter to projects in "Backlog" state (these are triaged but not yet specced). Present them as a numbered list:
18
-
19
- ```
20
- ## Projects Ready for Spec
21
-
22
- 1. **Project Name** — description
23
- 2. **Project Name** — description
24
- ```
25
-
26
- Then ask:
27
-
28
- > Which project would you like to spec? Pick a number, or type a project name.
29
-
30
- If no Backlog projects exist, say:
31
-
32
- > No projects in Backlog state. Run `/forge:triage` first to create projects from your ideas, or create one directly in Linear.
33
-
34
- Wait for the user's selection before continuing.
35
-
36
- ### Step 2 — Scan the Codebase
37
-
38
- Run 3 parallel codebase scan agents using the Task tool (subagent_type: Explore):
39
-
40
- **Agent 1 — Structure Scanner:**
41
- ```
42
- Use Glob and Read tools to scan for: package.json, tsconfig.json, .env*, config files, key directories (src/, app/, pages/, lib/).
43
- Report: framework, language, dependencies, project structure, build tools.
44
- ```
45
-
46
- **Agent 2 — Routes/UI Scanner:**
47
- ```
48
- Use Glob and Grep tools to scan for: route files, pages, layouts, navigation components, route definitions.
49
- Look in common locations: src/app/, src/pages/, src/routes/, app/, pages/.
50
- Grep for route patterns (e.g., "createBrowserRouter", "Route", "router.", "app.get", "app.post").
51
- Report: routing framework, page count, API route count, layout structure.
52
- ```
53
-
54
- **Agent 3 — Data/APIs Scanner:**
55
- ```
56
- Use Glob and Grep tools to scan for: API endpoints, database files (schema.prisma, migrations/, models/), env files (.env*), external service configs, ORM setup, SDK clients.
57
- Grep for patterns like "fetch(", "axios", "prisma.", "mongoose.", "createClient".
58
- Report: database type, API patterns, external integrations, auth setup.
59
- ```
60
-
61
- Combine the results into a plain-text summary. Print a brief overview:
62
-
63
- ```
64
- ## Codebase Scan Complete
65
-
66
- - **Framework:** Next.js (TypeScript)
67
- - **Pages:** 12 | **API Routes:** 8
68
- - **Dependencies:** 24 | **DB Files:** 3
69
- - **Key Files:** src/lib/auth.ts, src/db/schema.prisma, ...
70
- ```
71
-
72
- If the current working directory does not look like a project (no package.json, no src/), warn:
73
-
74
- > This directory doesn't look like a project root. Should I scan here, or provide a path to the project?
75
-
76
- ### Step 3 — LLM-Driven Adaptive Interview
77
-
78
- You (the LLM) drive the interview directly. Track coverage mentally across the 5 sections. No TypeScript state tracking — you are the state tracker.
79
-
80
- The interview covers 5 sections:
81
-
82
- 1. **Problem & Goals** — core problem, desired outcome, success criteria, impact/urgency, current workarounds, who feels the pain
83
- 2. **User Stories** — primary users, user workflows step-by-step, secondary users, edge cases, permissions/roles, error states
84
- 3. **Technical Approach** — architecture pattern, data model/schema, APIs/integrations, auth/security, performance requirements, error handling, existing code to leverage
85
- 4. **Scope** — in scope boundaries, out of scope, sacred files/areas, constraints, future phases explicitly deferred
86
- 5. **Milestones** — breakdown into chunks, dependencies between milestones, sizing (fits in one agent context?), verification criteria, delivery order, risk areas
87
-
88
- **Interview Loop — You Drive:**
89
-
90
- 1. Start with a broad opening question for Problem & Goals, informed by scan results
91
- 2. After each answer:
92
- - Assess coverage gaps mentally (which topics are uncovered? which answers were vague?)
93
- - Generate the next question based on: scan results, all prior Q&A, what's still ambiguous
94
- - Probe deeper on vague or short answers — don't accept "TBD" or one-liners for important topics
95
- - Move to the next section when the current one has thorough coverage
96
- - Revisit earlier sections if later answers reveal new info
97
- 3. Continue until all 5 sections have adequate coverage
98
-
99
- **Question Principles — Encode These:**
100
-
101
- - Ask about edge cases, error states, and "what could go wrong"
102
- - When the user mentions an integration, ask about auth, rate limits, failure modes
103
- - When the user describes a workflow, walk through it step-by-step
104
- - For milestones, actively challenge sizing — "is this too big for one context window?"
105
- - Don't ask yes/no questions — ask "how" and "what" questions that elicit detail
106
- - Circle back to earlier sections when new info surfaces
107
- - Follow interesting threads: if the user mentions migration, breaking changes, multiple user types, or external services, dig deeper
108
-
109
- **Stop Condition:**
110
-
111
- You determine you have enough detail for a thorough PRD across ALL sections, with no significant ambiguity remaining. Before transitioning to Step 4, print a coverage summary showing the final state of each section.
112
-
113
- **Early Exit:**
114
-
115
- If the user says "stop", "that's enough", "skip", or "generate it" at any time, respect that and move to Step 4 with what you have.
116
-
117
- **Milestone Sizing Constraint (Hard Rule):**
118
-
119
- Each milestone MUST be completable in one main agent context window. If a milestone requires more than ~4 agents across 2-3 waves, split it. This is non-negotiable — large milestones cause context overflow and execution failures. When interviewing about milestones, actively recommend splitting any milestone that looks too large.
120
-
121
- **Milestone Dependencies (dependsOn):**
122
-
123
- During the milestones phase of the interview, ask about milestone dependencies using AskUserQuestion. For each milestone after the first, ask:
124
-
125
- - question: "Does Milestone {N} depend on any previous milestones?"
126
- - options:
127
- - "No dependencies — can start immediately"
128
- - "Depends on Milestone {N-1} (sequential)"
129
- - "Depends on specific milestones (I'll specify)"
130
-
131
- If milestones have explicit dependencies, include `**dependsOn:** 1, 2` in the milestone section of the PRD. If no dependencies are specified, omit the field (backward compatible — treated as sequential).
132
-
133
- Independent milestones enable parallel execution via `/forge:go`, which creates separate worktrees for each parallel milestone.
134
-
135
- **Question Format:**
136
-
137
- Mix AskUserQuestion (for structured choices) and conversational questions (for open-ended probing):
138
-
139
- - **Use AskUserQuestion** when there are clear option sets (architecture choices, yes/no with detail, picking from scan-derived options). Provide 2-4 options plus "Other (I'll describe)".
140
- - **Use conversational questions** when probing for depth, asking "how" or "what" questions, or exploring topics that don't have predefined options.
141
- - **NEVER present questions as numbered text lists.** Each structured question gets its own AskUserQuestion call.
142
- - **Lead with recommendations.** Every question includes context from the codebase scan. Never ask a blank "what do you want to build?" question.
143
-
144
- **Progress Display:**
145
-
146
- After each answer, show a compact coverage status:
147
-
148
- ```
149
- Progress: Problem & Goals [thorough] | User Stories [moderate] | Technical [thin] | Scope [none] | Milestones [none]
150
- ```
151
-
152
- **Draft Updates:**
153
-
154
- - **Update the PRD draft every 2-3 answers.** Write to `.planning/prds/{project-slug}.md`. Tell the user:
155
-
156
- > Updated PRD draft at `.planning/prds/{slug}.md` — you can review it anytime.
157
-
158
- **Do NOT do this (anti-pattern):**
159
-
160
- ```
161
- ### Round N
162
-
163
- 1. **[Section]** Question text?
164
- 2. **[Section]** Question text?
165
-
166
- > Answer by number...
167
- ```
168
-
169
- This numbered-text format is explicitly prohibited. Always use AskUserQuestion for structured choices.
170
-
171
- ### Step 4 — Generate PRD
172
-
173
- Using all gathered interview answers and codebase scan results, generate the final PRD directly. The LLM synthesizes all interview data into the PRD — no external generator module needed.
174
-
175
- The PRD should follow this structure:
176
-
177
- ```markdown
178
- # PRD: {Project Name}
179
-
180
- ## Problem & Goals
181
- {Synthesized from interview answers}
182
-
183
- ## User Stories
184
- {Structured user stories derived from interview}
185
-
186
- ## Technical Approach
187
- {Stack decisions, architecture, constraints — informed by codebase scan}
188
-
189
- ## Scope
190
- ### In Scope
191
- {What will be built}
192
-
193
- ### Out of Scope
194
- {Explicitly excluded items}
195
-
196
- ### Sacred Files
197
- {Files/areas not to be touched}
198
-
199
- ## Milestones
200
-
201
- ### Milestone 1: {Name}
202
- **Goal:** {What this delivers}
203
- **Issues:**
204
- - [ ] Issue title — brief description
205
- - [ ] Issue title — brief description
206
-
207
- ### Milestone 2: {Name}
208
- **dependsOn:** 1
209
- **Goal:** {What this delivers}
210
- ...
211
- ```
212
-
213
- **Milestone sizing check:** Before finalizing, review each milestone against the sizing constraint. Every milestone MUST fit in one agent context window (~4 agents across 2-3 waves max). If any milestone exceeds this, split it into smaller milestones before writing the final PRD. Set `maxContextWindowFit: true` on all milestones — if you cannot make a milestone fit, flag it as `maxContextWindowFit: false` and warn the user.
214
-
215
- **Test criteria guidance:** Test criteria are optional. Only include them when the milestone produces testable behavior. Verification commands (`npx tsc --noEmit`, `npx forge verify`) are always included automatically — test criteria are for additional functional checks beyond mechanical gates. When including test criteria, make them **functional**, not structural:
216
- - Good: "CLI `npx forge verify` runs and exits 0", "tsc compiles with no errors", "the new gate produces structured JSON output"
217
- - Bad: "All new source files must have corresponding test files", "Run npx forge verify --gate tests"
218
-
219
- Write the final PRD to `.planning/prds/{project-slug}.md`.
220
-
221
- After writing the PRD file, **execute BOTH steps below — do not skip either**:
222
-
223
- 1. **Create status file:** Write `.planning/status/<slug>.json` with all milestones set to "pending". **You MUST include `linearProjectId` and `linearTeamId`** — these are the Linear project UUID and team UUID from the project selected in Step 1. Without `linearProjectId`, `/forge:go` cannot sync Linear issue or project state and will silently skip all Linear operations. Without `linearTeamId`, `forge linear-sync` silently skips all operations. Copy the exact IDs — do not omit these fields:
224
- ```json
225
- {
226
- "project": "{project name}",
227
- "slug": "{slug}",
228
- "branch": "feat/{slug}",
229
- "createdAt": "{today}",
230
- "linearProjectId": "{Linear project UUID from Step 1}",
231
- "linearTeamId": "{team UUID — resolved in Step 5, but placeholder here}",
232
- "milestones": {
233
- "1": { "status": "pending" },
234
- "2": { "status": "pending" }
235
- }
236
- }
237
- ```
238
-
239
- 2. **Create feature branch:** `git checkout -b feat/{slug}`
240
-
241
- Tell the user:
242
-
243
- > Final PRD written to `.planning/prds/{slug}.md`.
244
- > Status file created at `.planning/status/{slug}.json`.
245
- > Feature branch `feat/{slug}` created.
246
-
247
- Present the full PRD in chat for review and ask:
248
-
249
- > Review the PRD above. You can:
250
- > - **Approve** — I'll create milestones and issues in Linear
251
- > - **Edit** — tell me what to change (e.g., "add a milestone for testing" or "remove the admin user story")
252
- > - **Regenerate** — start the interview over
253
- >
254
- > What would you like to do?
255
-
256
- Wait for approval before continuing to Step 5.
257
-
258
- ### Step 5 — Sync to Linear
259
-
260
- After the user approves the PRD, create milestones and issues in Linear.
261
-
262
- First, get the team ID:
263
-
264
- ```
265
- Use mcp__linear__list_teams to get available teams.
266
- ```
267
-
268
- If there is only one team, use it automatically. If multiple, ask the user which team.
269
-
270
- **Store the team ID** — it will be written to the status file after sync.
271
-
272
- For each milestone in the PRD:
273
-
274
- ```
275
- Use mcp__linear__create_milestone with:
276
- - projectId: the selected project's ID
277
- - name: milestone name
278
- - description: milestone goal
279
- ```
280
-
281
- **Record the returned milestone ID** for each milestone.
282
-
283
- For each issue under that milestone:
284
-
285
- ```
286
- Use mcp__linear__create_issue with:
287
- - title: issue title
288
- - description: issue description (from PRD)
289
- - teamId: the team ID
290
- - projectId: the project ID
291
- - milestoneId: the milestone ID just created
292
- ```
293
-
294
- **Record the returned issue IDs** for each milestone.
295
-
296
- **After all milestones and issues are created, do THREE things:**
297
-
298
- 1. **Transition the project to "Planned":**
299
-
300
- ```
301
- Use mcp__linear__update_project to set the project state to "planned".
302
- ```
303
-
304
- **The project is a separate entity from its milestones and issues.** Creating milestones and issues does NOT automatically update the project state. You must explicitly call `mcp__linear__update_project`. Without this transition, `/forge:go` will find the project still in "Backlog" and the state machine will reject the "In Progress" transition.
305
-
306
- 2. **Update the status file** at `.planning/status/<slug>.json` with the Linear IDs:
307
-
308
- ```json
309
- {
310
- "project": "{project name}",
311
- "slug": "{slug}",
312
- "branch": "feat/{slug}",
313
- "createdAt": "{today}",
314
- "linearProjectId": "{Linear project UUID from Step 1}",
315
- "linearTeamId": "{team UUID from this step}",
316
- "milestones": {
317
- "1": { "status": "pending", "linearMilestoneId": "{id}", "linearIssueIds": ["{id1}", "{id2}"] },
318
- "2": { "status": "pending", "linearMilestoneId": "{id}", "linearIssueIds": ["{id1}", "{id2}"] }
319
- }
320
- }
321
- ```
322
-
323
- **`linearTeamId` is MANDATORY.** Without it, `forge linear-sync` silently skips all operations. **`linearMilestoneId` and `linearIssueIds` per milestone are MANDATORY.** These enable `/forge:go` to transition issues as milestones are completed.
324
-
325
- 3. **Print a summary:**
326
-
327
- ```
328
- ## Synced to Linear
329
-
330
- - **Project:** {name} (now "Planned")
331
- - **Milestones:** {N} created
332
- - **Issues:** {M} created across all milestones
333
-
334
- View in Linear: {project URL}
335
- ```
336
-
337
- If any creation fails, report the error and continue with remaining items.
338
-
339
- ### Step 6 — Handoff
340
-
341
- After sync, print the handoff prompt:
342
-
343
- ```
344
- ## Ready for Development
345
-
346
- PRD: `.planning/prds/{slug}.md`
347
- Status: `.planning/status/{slug}.json`
348
- Branch: `feat/{slug}`
349
- Linear: {project URL}
350
-
351
- **Next step:** Run `/forge:go` for one milestone at a time, or exit and run `npx forge run` to execute all milestones autonomously. The execution engine will:
352
- - Read the PRD and per-PRD status file
353
- - Spawn agent teams for each milestone
354
- - Verify each change with forge verification gates
355
- - Update status JSON and transition Linear issues automatically
356
- ```
357
-
358
- **Note:** `/forge:go` now uses git worktrees for session isolation. Multiple users can run `/forge:go` on different milestones simultaneously without conflicts.
359
-
360
- ## Edge Cases
361
-
362
- - **No Linear connection:** Warn the user. Still generate the PRD locally — skip the Linear sync steps.
363
- - **Empty codebase:** The interview still works — questions will be more open-ended without scan context. Note this to the user.
364
- - **User wants to spec a project not in Linear:** Allow it. Skip Step 1 project selection, ask for a project name, and create the Linear project in Step 5 before creating milestones.
365
- - **User provides info upfront:** If the user includes project details in the same message as `/forge:spec`, use that info to pre-fill interview answers and skip questions that are already answered.
366
- - **Very large codebase:** Scan agents may return truncated results. That's fine — the interview fills in gaps.
367
- - **Interrupted interview:** If the user stops mid-interview, save what you have to the PRD draft. They can resume by running `/forge:spec` again and selecting the same project.
@@ -1,179 +0,0 @@
1
- # /forge:triage — Brain Dump to Linear Projects
2
-
3
- Turn sticky notes, rambling thoughts, and unstructured ideas into organized Linear projects. Paste anything — bullet points, paragraphs, stream of consciousness — and this skill extracts distinct projects, deduplicates against your existing Linear backlog, and creates them after your confirmation.
4
-
5
- **This skill uses Linear MCP tools directly** (`mcp__linear__*`) for all Linear operations. Unlike `/forge:go` and `/forge:spec` (which call forge CLI commands), triage is a conversational skill that requires interactive feedback at every step — direct MCP tool access is the correct pattern here.
6
-
7
- ## Prerequisites
8
-
9
- This skill requires **Linear MCP tools** to be configured in your Claude environment. If the tools are not available, Step 0 will detect this and provide setup instructions. The required tools are:
10
-
11
- - `mcp__linear__list_projects` — fetch existing projects for dedup
12
- - `mcp__linear__list_teams` — resolve team for project creation
13
- - `mcp__linear__create_project` — create confirmed projects
14
-
15
- ## Instructions
16
-
17
- Follow these steps exactly. Do not skip confirmation.
18
-
19
- ### Step 0 — Resolve Team Configuration
20
-
21
- Read `.forge.json` from the project root. Check for the `linearTeam` field:
22
-
23
- - **If `linearTeam` is set** (non-empty string): store it as the configured team key. This will be used to auto-resolve the team in Step 5 and to scope project listing in Step 3.
24
- - **If `linearTeam` is empty or `.forge.json` does not exist**: no team is pre-configured. The skill will prompt for team selection in Step 5 if needed.
25
-
26
- This check is silent — do not print output unless there is an error reading the config.
27
-
28
- ### Step 1 — Collect Input
29
-
30
- If the user has already provided text (ideas, notes, brain dump) in the same message as invoking this skill, use that as input. Otherwise, prompt:
31
-
32
- > Paste your ideas, sticky notes, or brain dump below. Any format works — bullet points, paragraphs, stream of consciousness. I'll extract the projects from whatever you give me.
33
-
34
- Wait for the user's input before continuing. Do not proceed with an empty input.
35
-
36
- If the input is extremely short or vague (fewer than 5 words with no actionable idea), ask:
37
-
38
- > That's a bit thin. Can you expand on what you're thinking? Even a sentence or two per idea helps me create better project descriptions.
39
-
40
- ### Step 2 — Extract Projects
41
-
42
- Parse the input to identify distinct project ideas. For each idea, determine:
43
-
44
- - **Name**: Short, descriptive project name (2-5 words, title case)
45
- - **Description**: 1-2 sentence summary capturing the core intent
46
- - **Priority**: High / Medium / Low based on urgency signals in the text (words like "urgent", "ASAP", "critical", "soon" = High; "eventually", "someday", "nice to have" = Low; everything else = Medium)
47
-
48
- Rules for extraction:
49
- - Group related ideas into a single project. If someone mentions "mobile app redesign" and "fix the mobile nav", that is one project, not two.
50
- - If an idea is extremely vague (e.g., "maybe something with AI"), still extract it but flag it for clarification in Step 4.
51
- - For a single idea, create one project. For 10+ ideas, create as many projects as are genuinely distinct — do not artificially limit or pad.
52
- - Do not invent projects that were not in the input. Only extract what is there.
53
-
54
- ### Step 3 — Deduplicate Against Linear
55
-
56
- Fetch existing projects from Linear, scoped to the configured team:
57
-
58
- ```
59
- Use mcp__linear__list_projects to get existing projects.
60
- ```
61
-
62
- If a `linearTeam` was resolved in Step 0, filter the returned projects to those belonging to the configured team. This prevents false duplicate matches against projects from other teams.
63
-
64
- For each extracted project, compare its name and description against existing projects. A project is a potential duplicate if:
65
- - The name is very similar (e.g., "Mobile Redesign" vs "Mobile App Redesign")
66
- - The description covers the same scope
67
-
68
- Mark duplicates with status `DUPLICATE` and reference the existing project name. Mark new projects with status `NEW`.
69
-
70
- If `mcp__linear__list_projects` fails (auth issue, Linear not configured, MCP tools unavailable), warn the user:
71
-
72
- > Could not connect to Linear to check for duplicates. Make sure your Linear MCP tools are configured in your Claude environment (see [Linear MCP setup docs](https://linear.app/docs)). I'll proceed without dedup — you can review for duplicates manually.
73
-
74
- Then skip dedup and mark all projects as `NEW`.
75
-
76
- ### Step 4 — Present for Confirmation
77
-
78
- Show the user a formatted list:
79
-
80
- ```
81
- ## Extracted Projects (N total)
82
-
83
- 1. **Project Name** — Description
84
- Priority: High | Status: NEW
85
-
86
- 2. **Project Name** — Description
87
- Priority: Medium | Status: DUPLICATE of "Existing Project Name"
88
-
89
- 3. **Project Name** — Description
90
- Priority: Low | Status: NEW | NOTE: This idea was vague — confirm or clarify?
91
- ```
92
-
93
- Then ask:
94
-
95
- > Review the list above. You can:
96
- > - **Confirm all** — I'll create the NEW ones in Linear
97
- > - **Remove items** — tell me which numbers to skip (e.g., "remove 2, 5")
98
- > - **Edit items** — tell me what to change (e.g., "rename 3 to X" or "change 1 priority to Low")
99
- > - **Clarify** — expand on any flagged vague ideas
100
- >
101
- > What would you like to do?
102
-
103
- Wait for the user's response. Apply any edits, removals, or clarifications. If the user says "confirm" or similar affirmative, proceed to Step 5. If they make changes, show the updated list and confirm again.
104
-
105
- ### Step 5 — Create in Linear
106
-
107
- **Resolve the team:**
108
-
109
- If `linearTeam` was set in Step 0, resolve it to a team ID:
110
-
111
- ```
112
- Use mcp__linear__list_teams to get available teams.
113
- ```
114
-
115
- Match the configured `linearTeam` value against the returned teams by key or name. If a match is found, use that team automatically. If no match is found, warn:
116
-
117
- > The configured team "{linearTeam}" was not found in Linear. Available teams are listed below — pick one, or update `linearTeam` in `.forge.json`.
118
-
119
- Then present the available teams for selection.
120
-
121
- If `linearTeam` was NOT configured in Step 0:
122
-
123
- ```
124
- Use mcp__linear__list_teams to get available teams.
125
- ```
126
-
127
- If there is only one team, use it automatically. If there are multiple teams, ask the user which team to use.
128
-
129
- **Create projects:**
130
-
131
- For each confirmed NEW project (skip items marked DUPLICATE that the user did not override):
132
-
133
- ```
134
- Use mcp__linear__create_project with:
135
- - name: the project name
136
- - description: the project description
137
- - teamIds: [the resolved team ID]
138
- - state: "backlog"
139
- ```
140
-
141
- If a project creation fails, report the error and continue with the remaining projects. Do not abort the entire batch for a single failure.
142
-
143
- If ALL project creations fail (e.g., auth expired, MCP tools not responding), print:
144
-
145
- > Linear project creation failed. Check that your Linear MCP tools are configured and your API key is valid. You can create these projects manually in Linear:
146
- >
147
- > {list each project name and description}
148
-
149
- After all projects are created, print a summary:
150
-
151
- ```
152
- ## Created N projects in Linear
153
-
154
- - **Project Name** — created successfully
155
- - **Project Name** — created successfully
156
- - **Project Name** — FAILED: [error message]
157
-
158
- Skipped M duplicates.
159
- ```
160
-
161
- ### Step 6 — Suggest Next Steps
162
-
163
- After creation, print:
164
-
165
- > **Next steps:**
166
- > - Run `/forge:spec` on any of these projects to create a detailed PRD with milestones
167
- > - Run `/forge:triage` again to add more ideas
168
- > - Open Linear to review and organize your new projects
169
-
170
- ## Edge Cases
171
-
172
- - **Empty input**: Prompt the user to provide input. Do not create empty projects.
173
- - **Single idea**: Create one project. The workflow still applies (confirm before creating).
174
- - **10+ ideas**: Process all of them. Group aggressively to avoid near-duplicates.
175
- - **All duplicates**: Report that all ideas already exist in Linear. Suggest reviewing existing projects.
176
- - **Linear MCP tools not configured**: Warn the user with setup instructions at the first point of failure (Step 3 or Step 5). Still extract and present projects — the user can create them manually.
177
- - **Linear auth fails mid-flow**: If dedup succeeds (Step 3) but creation fails (Step 5), print the project list in a copy-friendly format so the user can create them manually.
178
- - **Vague ideas**: Extract them with a clarification flag. Let the user decide whether to keep, clarify, or remove.
179
- - **Multiple teams with no config**: If `linearTeam` is not set in `.forge.json` and multiple teams exist, present a team picker. Suggest the user run `/forge:setup` or set `linearTeam` in `.forge.json` for future runs.