forge-cc 0.1.40 → 1.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 (72) hide show
  1. package/README.md +454 -338
  2. package/dist/cli.js +194 -906
  3. package/dist/cli.js.map +1 -1
  4. package/dist/config/loader.d.ts +1 -1
  5. package/dist/config/loader.js +49 -56
  6. package/dist/config/loader.js.map +1 -1
  7. package/dist/config/schema.d.ts +37 -125
  8. package/dist/config/schema.js +13 -28
  9. package/dist/config/schema.js.map +1 -1
  10. package/dist/doctor.d.ts +10 -0
  11. package/dist/doctor.js +148 -0
  12. package/dist/doctor.js.map +1 -0
  13. package/dist/gates/index.d.ts +14 -12
  14. package/dist/gates/index.js +53 -105
  15. package/dist/gates/index.js.map +1 -1
  16. package/dist/gates/lint-gate.d.ts +2 -2
  17. package/dist/gates/lint-gate.js +60 -66
  18. package/dist/gates/lint-gate.js.map +1 -1
  19. package/dist/gates/tests-gate.d.ts +2 -4
  20. package/dist/gates/tests-gate.js +75 -203
  21. package/dist/gates/tests-gate.js.map +1 -1
  22. package/dist/gates/types-gate.d.ts +2 -2
  23. package/dist/gates/types-gate.js +53 -59
  24. package/dist/gates/types-gate.js.map +1 -1
  25. package/dist/go/linear-sync-cli.js +13 -4
  26. package/dist/go/linear-sync-cli.js.map +1 -1
  27. package/dist/go/linear-sync.d.ts +1 -0
  28. package/dist/go/linear-sync.js +67 -4
  29. package/dist/go/linear-sync.js.map +1 -1
  30. package/dist/linear/client.d.ts +34 -105
  31. package/dist/linear/client.js +85 -365
  32. package/dist/linear/client.js.map +1 -1
  33. package/dist/linear/issues.d.ts +3 -1
  34. package/dist/linear/issues.js +14 -2
  35. package/dist/linear/issues.js.map +1 -1
  36. package/dist/linear/projects.js +3 -2
  37. package/dist/linear/projects.js.map +1 -1
  38. package/dist/linear/sync.d.ts +15 -0
  39. package/dist/linear/sync.js +102 -0
  40. package/dist/linear/sync.js.map +1 -0
  41. package/dist/runner/loop.d.ts +4 -0
  42. package/dist/runner/loop.js +168 -0
  43. package/dist/runner/loop.js.map +1 -0
  44. package/dist/runner/prompt.d.ts +14 -0
  45. package/dist/runner/prompt.js +59 -0
  46. package/dist/runner/prompt.js.map +1 -0
  47. package/dist/runner/update.d.ts +1 -0
  48. package/dist/runner/update.js +72 -0
  49. package/dist/runner/update.js.map +1 -0
  50. package/dist/server.d.ts +6 -2
  51. package/dist/server.js +43 -101
  52. package/dist/server.js.map +1 -1
  53. package/dist/setup.d.ts +5 -0
  54. package/dist/setup.js +208 -0
  55. package/dist/setup.js.map +1 -0
  56. package/dist/state/cache.d.ts +3 -0
  57. package/dist/state/cache.js +23 -0
  58. package/dist/state/cache.js.map +1 -0
  59. package/dist/state/status.d.ts +66 -0
  60. package/dist/state/status.js +96 -0
  61. package/dist/state/status.js.map +1 -0
  62. package/dist/types.d.ts +46 -114
  63. package/dist/worktree/manager.d.ts +6 -103
  64. package/dist/worktree/manager.js +25 -296
  65. package/dist/worktree/manager.js.map +1 -1
  66. package/hooks/pre-commit-verify.js +109 -109
  67. package/package.json +3 -2
  68. package/skills/forge-go.md +583 -575
  69. package/skills/forge-setup.md +149 -388
  70. package/skills/forge-spec.md +367 -342
  71. package/skills/forge-triage.md +179 -133
  72. package/skills/forge-update.md +87 -93
@@ -1,133 +1,179 @@
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
- ## Instructions
6
-
7
- Follow these steps exactly. Do not skip confirmation.
8
-
9
- ### Step 1 Collect Input
10
-
11
- 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:
12
-
13
- > 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.
14
-
15
- Wait for the user's input before continuing. Do not proceed with an empty input.
16
-
17
- If the input is extremely short or vague (fewer than 5 words with no actionable idea), ask:
18
-
19
- > 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.
20
-
21
- ### Step 2 Extract Projects
22
-
23
- Parse the input to identify distinct project ideas. For each idea, determine:
24
-
25
- - **Name**: Short, descriptive project name (2-5 words, title case)
26
- - **Description**: 1-2 sentence summary capturing the core intent
27
- - **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)
28
-
29
- Rules for extraction:
30
- - Group related ideas into a single project. If someone mentions "mobile app redesign" and "fix the mobile nav", that is one project, not two.
31
- - If an idea is extremely vague (e.g., "maybe something with AI"), still extract it but flag it for clarification in Step 4.
32
- - For a single idea, create one project. For 10+ ideas, create as many projects as are genuinely distinct do not artificially limit or pad.
33
- - Do not invent projects that were not in the input. Only extract what is there.
34
-
35
- ### Step 3 — Deduplicate Against Linear
36
-
37
- Fetch existing projects from Linear:
38
-
39
- ```
40
- Use mcp__linear__list_projects to get all existing projects.
41
- ```
42
-
43
- For each extracted project, compare its name and description against existing projects. A project is a potential duplicate if:
44
- - The name is very similar (e.g., "Mobile Redesign" vs "Mobile App Redesign")
45
- - The description covers the same scope
46
-
47
- Mark duplicates with status `DUPLICATE` and reference the existing project name. Mark new projects with status `NEW`.
48
-
49
- If `mcp__linear__list_projects` fails (auth issue, Linear not configured), warn the user:
50
-
51
- > Could not connect to Linear to check for duplicates. Make sure your Linear MCP tools are configured. I'll proceed without dedup you can review for duplicates manually.
52
-
53
- Then skip dedup and mark all projects as `NEW`.
54
-
55
- ### Step 4 — Present for Confirmation
56
-
57
- Show the user a formatted list:
58
-
59
- ```
60
- ## Extracted Projects (N total)
61
-
62
- 1. **Project Name** Description
63
- Priority: High | Status: NEW
64
-
65
- 2. **Project Name** Description
66
- Priority: Medium | Status: DUPLICATE of "Existing Project Name"
67
-
68
- 3. **Project Name** Description
69
- Priority: Low | Status: NEW | NOTE: This idea was vague — confirm or clarify?
70
- ```
71
-
72
- Then ask:
73
-
74
- > Review the list above. You can:
75
- > - **Confirm all** — I'll create the NEW ones in Linear
76
- > - **Remove items** tell me which numbers to skip (e.g., "remove 2, 5")
77
- > - **Edit items** — tell me what to change (e.g., "rename 3 to X" or "change 1 priority to Low")
78
- > - **Clarify** expand on any flagged vague ideas
79
- >
80
- > What would you like to do?
81
-
82
- 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.
83
-
84
- ### Step 5 Create in Linear
85
-
86
- First, get the team ID (you only need to do this once):
87
-
88
- ```
89
- Use mcp__linear__list_teams to get available teams.
90
- ```
91
-
92
- If there is only one team, use it automatically. If there are multiple teams, ask the user which team to use.
93
-
94
- For each confirmed NEW project (skip items marked DUPLICATE that the user did not override):
95
-
96
- ```
97
- Use mcp__linear__create_project with:
98
- - name: the project name
99
- - description: the project description
100
- - state: "backlog"
101
- ```
102
-
103
- If a project creation fails, report the error and continue with the remaining projects. Do not abort the entire batch for a single failure.
104
-
105
- After all projects are created, print a summary:
106
-
107
- ```
108
- ## Created N projects in Linear
109
-
110
- - **Project Name** — created successfully
111
- - **Project Name** — created successfully
112
- - **Project Name** FAILED: [error message]
113
-
114
- Skipped M duplicates.
115
- ```
116
-
117
- ### Step 6Suggest Next Steps
118
-
119
- After creation, print:
120
-
121
- > **Next steps:**
122
- > - Run `/forge:spec` on any of these projects to create a detailed PRD with milestones
123
- > - Run `/forge:triage` again to add more ideas
124
- > - Open Linear to review and organize your new projects
125
-
126
- ## Edge Cases
127
-
128
- - **Empty input**: Prompt the user to provide input. Do not create empty projects.
129
- - **Single idea**: Create one project. The workflow still applies (confirm before creating).
130
- - **10+ ideas**: Process all of them. Group aggressively to avoid near-duplicates.
131
- - **All duplicates**: Report that all ideas already exist in Linear. Suggest reviewing existing projects.
132
- - **Linear auth fails**: Warn the user, skip dedup, but still attempt creation. If creation also fails, provide manual instructions.
133
- - **Vague ideas**: Extract them with a clarification flag. Let the user decide whether to keep, clarify, or remove.
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 distinctdo 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 4Present 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.
@@ -1,93 +1,87 @@
1
- # /forge:update — Update Forge to Latest Version
2
-
3
- Check for updates and install the latest version of forge-cc.
4
-
5
- ## Instructions
6
-
7
- ### Step 1 — Check Versions
8
-
9
- Run these commands to get version info:
10
-
11
- ```bash
12
- # Current installed version
13
- forge --version
14
-
15
- # Latest available version
16
- npm view forge-cc version
17
- ```
18
-
19
- Parse both versions. If the command fails, handle gracefully:
20
- - If `forge` is not found: print "forge-cc is not installed globally. Install with: `npm install -g forge-cc`"
21
- - If npm view fails (offline): print "Could not reach npm registry. Check your internet connection."
22
-
23
- ### Step 2 — Compare and Report
24
-
25
- Print the version status:
26
-
27
- ```
28
- ## Forge Version Check
29
-
30
- **Installed:** v{current}
31
- **Latest:** v{latest}
32
- **Status:** {Up to date / Update available}
33
- ```
34
-
35
- If already up to date, stop here with: "You're on the latest version."
36
-
37
- ### Step 3 — Update
38
-
39
- If an update is available, run:
40
-
41
- ```bash
42
- npm install -g forge-cc@latest
43
- ```
44
-
45
- This does two things automatically:
46
- 1. Installs the new version globally
47
- 2. The `postinstall` hook runs `forge setup --skills-only`, which syncs all skills to `~/.claude/commands/forge/`
48
-
49
- Verify the update succeeded:
50
-
51
- ```bash
52
- forge --version
53
- ```
54
-
55
- If the version matches the latest, the update is complete. If it doesn't match, check if the user needs to restart their terminal or if there's a local `node_modules` shadowing the global install.
56
-
57
- ### Step 4 — Verify Skills Synced
58
-
59
- Confirm skills were updated by listing the target directory:
60
-
61
- ```bash
62
- ls ~/.claude/commands/forge/
63
- ```
64
-
65
- If the directory is empty or missing, the postinstall hook may have failed silently. Run the manual fallback:
66
-
67
- ```bash
68
- forge setup --skills-only
69
- ```
70
-
71
- ### Step 5 Post-Update Check
72
-
73
- After updating, check if the current project's forge files need refreshing:
74
-
75
- 1. Check if `.forge.json` exists in the current directory
76
- 2. If it does (this is a forge project), suggest: "Run `/forge:setup` with Refresh mode to update project files to the latest templates."
77
- 3. If it doesn't, just confirm the update.
78
-
79
- Print final summary:
80
-
81
- ```
82
- ## Update Complete
83
-
84
- **Previous:** v{old}
85
- **Current:** v{new}
86
- **Skills:** Synced to ~/.claude/commands/forge/
87
-
88
- {If forge project: "Consider running `/forge:setup` (Refresh) to update project files."}
89
- ```
90
-
91
- ---
92
-
93
- Do NOT stage, commit, or push anything. This skill only manages the npm package.
1
+ # /forge:update — Update Forge to Latest Version
2
+
3
+ Check for updates and install the latest version of forge-cc.
4
+
5
+ ## Instructions
6
+
7
+ ### Step 1 — Check Versions
8
+
9
+ Run the forge update CLI to check for a newer version:
10
+
11
+ ```bash
12
+ npx forge update
13
+ ```
14
+
15
+ Also get the exact installed version:
16
+
17
+ ```bash
18
+ npx forge --version
19
+ ```
20
+
21
+ If `forge` is not found, print: "forge-cc is not installed. Install with: `npm install -g forge-cc`"
22
+
23
+ ### Step 2 — Compare and Report
24
+
25
+ Print the version status:
26
+
27
+ ```
28
+ ## Forge Version Check
29
+
30
+ **Installed:** v{current}
31
+ **Latest:** v{latest}
32
+ **Status:** {Up to date / Update available}
33
+ ```
34
+
35
+ If already up to date, stop here with: "You're on the latest version."
36
+
37
+ ### Step 3 — Update
38
+
39
+ If an update is available, run:
40
+
41
+ ```bash
42
+ npm install -g forge-cc@latest
43
+ ```
44
+
45
+ The `postinstall` hook automatically runs `forge setup --skills-only` to sync all skills to `~/.claude/commands/forge/`.
46
+
47
+ Verify the update succeeded:
48
+
49
+ ```bash
50
+ npx forge --version
51
+ ```
52
+
53
+ If the version matches the latest, the update is complete. If not, check if the user needs to restart their terminal or if a local `node_modules` is shadowing the global install.
54
+
55
+ ### Step 4 Verify Skills Synced
56
+
57
+ Confirm skills were updated:
58
+
59
+ ```bash
60
+ ls ~/.claude/commands/forge/
61
+ ```
62
+
63
+ If the directory is empty or missing, the postinstall hook may have failed. Run the manual fallback:
64
+
65
+ ```bash
66
+ npx forge setup --skills-only
67
+ ```
68
+
69
+ ### Step 5 — Post-Update Check
70
+
71
+ If `.forge.json` exists in the current directory, suggest: "Run `/forge:setup` with Refresh mode to update project files to the latest templates."
72
+
73
+ Print final summary:
74
+
75
+ ```
76
+ ## Update Complete
77
+
78
+ **Previous:** v{old}
79
+ **Current:** v{new}
80
+ **Skills:** Synced to ~/.claude/commands/forge/
81
+
82
+ {If forge project: "Consider running `/forge:setup` (Refresh) to update project files."}
83
+ ```
84
+
85
+ ---
86
+
87
+ Do NOT stage, commit, or push anything. This skill only manages the npm package.