@izkac/forgekit 0.3.11 → 0.3.13
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.
- package/bin/forge.mjs +107 -107
- package/bin/forgekit.mjs +83 -83
- package/bin/review.mjs +81 -81
- package/package.json +1 -1
- package/scripts/prepack.mjs +78 -78
- package/scripts/run-tests.mjs +50 -50
- package/src/adr.mjs +236 -236
- package/src/adr.test.mjs +170 -170
- package/src/change.mjs +327 -234
- package/src/change.test.mjs +145 -83
- package/src/cleanup-sessions.mjs +84 -84
- package/src/config.mjs +103 -103
- package/src/defer.mjs +75 -75
- package/src/doctor.mjs +350 -341
- package/src/doctor.test.mjs +114 -114
- package/src/init.mjs +680 -621
- package/src/install.mjs +815 -815
- package/src/install.test.mjs +180 -180
- package/src/integrity-check.mjs +60 -60
- package/src/integrity.mjs +682 -682
- package/src/integrity.test.mjs +566 -566
- package/src/lib.mjs +143 -143
- package/src/models.defaults.json +41 -41
- package/src/new-session.mjs +99 -99
- package/src/openspec-overlays/README.md +19 -19
- package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
- package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
- package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
- package/src/paths.mjs +92 -92
- package/src/plan-engine.mjs +321 -278
- package/src/plan-engine.test.mjs +447 -283
- package/src/preferences.defaults.json +78 -78
- package/src/preferences.mjs +438 -438
- package/src/preferences.test.mjs +174 -174
- package/src/record-evidence.mjs +204 -204
- package/src/resolve-model.mjs +312 -312
- package/src/resolve-model.test.mjs +194 -194
- package/src/review/cli.test.mjs +117 -117
- package/src/review/export.mjs +172 -172
- package/src/review/export.test.mjs +197 -197
- package/src/review/fixtures/valid-review.json +42 -42
- package/src/review/lib.mjs +894 -894
- package/src/review/lib.test.mjs +266 -266
- package/src/review/schema.json +196 -196
- package/src/review/signals.test.mjs +62 -62
- package/src/score-cli.mjs +68 -68
- package/src/score.mjs +568 -566
- package/src/score.test.mjs +366 -340
- package/src/session-reminder.mjs +207 -207
- package/src/session-status.mjs +70 -70
- package/src/set-models.mjs +186 -186
- package/src/set-phase.mjs +205 -205
- package/src/set-prefs.mjs +294 -294
- package/src/specs-sync.mjs +234 -0
- package/src/specs-sync.test.mjs +114 -0
- package/src/spine.mjs +93 -93
- package/src/triage-prompt.mjs +175 -175
- package/src/triage-prompt.test.mjs +50 -50
- package/src/vendor-openspec-overlays.mjs +176 -176
- package/src/vendor-openspec-overlays.test.mjs +62 -62
- package/vendor/skills/archive-to-adr/SKILL.md +149 -149
- package/vendor/skills/forge/SKILL.md +136 -136
- package/vendor/skills/forge/docs/forge.md +650 -647
- package/vendor/skills/forge/phases/brainstorm.md +23 -23
- package/vendor/skills/forge/phases/finish.md +90 -87
- package/vendor/skills/forge/phases/implement.md +77 -77
- package/vendor/skills/forge/phases/plan-openspec.md +60 -60
- package/vendor/skills/forge/phases/plan-specs.md +163 -117
- package/vendor/skills/forge/phases/review.md +25 -25
- package/vendor/skills/forge/phases/verify.md +124 -124
- package/vendor/skills/forge/references/forge-layout.md +85 -85
- package/vendor/skills/forge/references/pace.md +115 -115
- package/vendor/skills/forge/references/plan-routing.md +52 -51
- package/vendor/skills/forge/references/runtime-integrity.md +232 -225
- package/vendor/skills/forge/references/substantial-work.md +37 -37
- package/vendor/skills/forge/references/test-evidence.md +30 -30
- package/vendor/skills/forge/references/test-strategy.md +68 -68
- package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
- package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
- package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
- package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
- package/vendor/skills/thorough-code-review/SKILL.md +290 -290
- package/vendor/skills/thorough-code-review/examples.md +133 -133
- package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
- package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
- package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
- package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
- package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
- package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
- package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
- package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
- package/vendor/templates/adr/README.md +7 -7
- package/vendor/templates/adr/decisions.md +141 -141
- package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
- package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
- package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
- package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
- package/vendor/templates/project/claude/commands/forge-build.md +17 -17
- package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
- package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
- package/vendor/templates/project/claude/commands/forge-status.md +16 -16
- package/vendor/templates/project/claude/commands/forge.md +16 -16
- package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
- package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
- package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
- package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
- package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
- package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
- package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
- package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
- package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
- package/vendor/templates/project/cursor/commands/forge.md +16 -16
- package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
- package/vendor/templates/project/cursor/hooks/forge-session-start.sh +3 -3
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /forge:apply
|
|
3
|
-
description: Forge — apply a tracked change with subagent TDD, verify, and review
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, forge, openspec]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
**Forge-owned command.** Use this instead of bare `/opsx:apply` for disciplined implementation of a tracked change (OpenSpec or built-in specs engine — `.forge/config.json` → `plan.engine`).
|
|
9
|
-
|
|
10
|
-
Read the Forge skill (`~/.claude/skills/forge/SKILL.md`) and `~/.claude/skills/forge/docs/forge.md`.
|
|
11
|
-
|
|
12
|
-
**Input**: Optionally specify a change name (e.g., `/forge:apply add-auth`). If omitted, infer from context or active Forge session.
|
|
13
|
-
|
|
14
|
-
## 0. Forge session
|
|
15
|
-
|
|
16
|
-
1. Announce: "Using Forge apply."
|
|
17
|
-
2. Resume `.forge/active.json` or bootstrap: `forge new <slug>`
|
|
18
|
-
3. Set phase (use the project's engine as plan-type):
|
|
19
|
-
```bash
|
|
20
|
-
forge phase implement --plan-type openspec|specs --openspec "<change>"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## 1–5. Load the change
|
|
24
|
-
|
|
25
|
-
**OpenSpec engine** — vendor CLI, follow `openspec-apply-change` (same as `/opsx:apply` steps 1–5):
|
|
26
|
-
|
|
27
|
-
1. **Select the change** — announce "Using change: \<name\>"
|
|
28
|
-
2. `openspec status --change "<name>" --json`
|
|
29
|
-
3. `openspec instructions apply --change "<name>" --json`
|
|
30
|
-
4. Read all `contextFiles` from CLI output
|
|
31
|
-
5. Show progress (N/M tasks, schema, remaining tasks)
|
|
32
|
-
|
|
33
|
-
Handle blocked / all_done states per vendor skill before implementing.
|
|
34
|
-
|
|
35
|
-
**Specs engine** — no CLI:
|
|
36
|
-
|
|
37
|
-
1. **Select the change** under
|
|
38
|
-
2. Read `proposal.md`, `design.md` (if present), `tasks.md`
|
|
39
|
-
3. Show progress (N/M checkboxes, remaining tasks)
|
|
40
|
-
|
|
41
|
-
## 6. Implement (Forge — REQUIRED)
|
|
42
|
-
|
|
43
|
-
Follow ~/.claude/skills/forge/phases/implement.md`:
|
|
44
|
-
|
|
45
|
-
- **Do not** implement all tasks inline in coordinator context
|
|
46
|
-
- Per pending task: brief → **implementer** subagent (TDD first) → **spec reviewer** → **quality reviewer** → mark `- [x]` in `tasks.md`
|
|
47
|
-
- Bundled skills: `skills/subagent-driven-development` + `skills/test-driven-development`
|
|
48
|
-
|
|
49
|
-
Pause on unclear tasks, design issues, errors, or user interrupt.
|
|
50
|
-
|
|
51
|
-
## 7. Verify (Forge — REQUIRED when all tasks done)
|
|
52
|
-
|
|
53
|
-
Follow ~/.claude/skills/forge/phases/verify.md`:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
forge phase verify
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Run affected workspace tests — **audit per-task `test-evidence.md`**; do not re-run the same commands if subagents already recorded passing runs (see verify phase).
|
|
60
|
-
|
|
61
|
-
## 8. Review (Forge — REQUIRED)
|
|
62
|
-
|
|
63
|
-
Follow ~/.claude/skills/forge/phases/review.md`:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
forge phase review
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Final reviewer; save to `.forge/sessions/<id>/reviews/final-review.md`.
|
|
70
|
-
|
|
71
|
-
## 9. Finish
|
|
72
|
-
|
|
73
|
-
When verify + review pass: suggest archive — `/opsx:archive` (OpenSpec) or
|
|
74
|
-
|
|
75
|
-
**Skip Forge for this task only:** `/forge:skip` (runs work without brainstorm/plan/verify chain).
|
|
1
|
+
---
|
|
2
|
+
name: /forge:apply
|
|
3
|
+
description: Forge — apply a tracked change with subagent TDD, verify, and review
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, forge, openspec]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Forge-owned command.** Use this instead of bare `/opsx:apply` for disciplined implementation of a tracked change (OpenSpec or built-in specs engine — `.forge/config.json` → `plan.engine`).
|
|
9
|
+
|
|
10
|
+
Read the Forge skill (`~/.claude/skills/forge/SKILL.md`) and `~/.claude/skills/forge/docs/forge.md`.
|
|
11
|
+
|
|
12
|
+
**Input**: Optionally specify a change name (e.g., `/forge:apply add-auth`). If omitted, infer from context or active Forge session.
|
|
13
|
+
|
|
14
|
+
## 0. Forge session
|
|
15
|
+
|
|
16
|
+
1. Announce: "Using Forge apply."
|
|
17
|
+
2. Resume `.forge/active.json` or bootstrap: `forge new <slug>`
|
|
18
|
+
3. Set phase (use the project's engine as plan-type):
|
|
19
|
+
```bash
|
|
20
|
+
forge phase implement --plan-type openspec|specs --openspec "<change>"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 1–5. Load the change
|
|
24
|
+
|
|
25
|
+
**OpenSpec engine** — vendor CLI, follow `openspec-apply-change` (same as `/opsx:apply` steps 1–5):
|
|
26
|
+
|
|
27
|
+
1. **Select the change** — announce "Using change: \<name\>"
|
|
28
|
+
2. `openspec status --change "<name>" --json`
|
|
29
|
+
3. `openspec instructions apply --change "<name>" --json`
|
|
30
|
+
4. Read all `contextFiles` from CLI output
|
|
31
|
+
5. Show progress (N/M tasks, schema, remaining tasks)
|
|
32
|
+
|
|
33
|
+
Handle blocked / all_done states per vendor skill before implementing.
|
|
34
|
+
|
|
35
|
+
**Specs engine** — no CLI:
|
|
36
|
+
|
|
37
|
+
1. **Select the change** under `<plan.dir>/changes/<name>/` (default `specs/changes/`) — announce "Using change: \<name\>"
|
|
38
|
+
2. Read `proposal.md`, `design.md` (if present), `tasks.md`
|
|
39
|
+
3. Show progress (N/M checkboxes, remaining tasks)
|
|
40
|
+
|
|
41
|
+
## 6. Implement (Forge — REQUIRED)
|
|
42
|
+
|
|
43
|
+
Follow ~/.claude/skills/forge/phases/implement.md`:
|
|
44
|
+
|
|
45
|
+
- **Do not** implement all tasks inline in coordinator context
|
|
46
|
+
- Per pending task: brief → **implementer** subagent (TDD first) → **spec reviewer** → **quality reviewer** → mark `- [x]` in `tasks.md`
|
|
47
|
+
- Bundled skills: `skills/subagent-driven-development` + `skills/test-driven-development`
|
|
48
|
+
|
|
49
|
+
Pause on unclear tasks, design issues, errors, or user interrupt.
|
|
50
|
+
|
|
51
|
+
## 7. Verify (Forge — REQUIRED when all tasks done)
|
|
52
|
+
|
|
53
|
+
Follow ~/.claude/skills/forge/phases/verify.md`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
forge phase verify
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Run affected workspace tests — **audit per-task `test-evidence.md`**; do not re-run the same commands if subagents already recorded passing runs (see verify phase).
|
|
60
|
+
|
|
61
|
+
## 8. Review (Forge — REQUIRED)
|
|
62
|
+
|
|
63
|
+
Follow ~/.claude/skills/forge/phases/review.md`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
forge phase review
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Final reviewer; save to `.forge/sessions/<id>/reviews/final-review.md`.
|
|
70
|
+
|
|
71
|
+
## 9. Finish
|
|
72
|
+
|
|
73
|
+
When verify + review pass: suggest archive — `/opsx:archive` (OpenSpec) or `forge change archive <name>` (specs; merges deltas into `<plan.dir>/specs/`) — per [finish phase](~/.claude/skills/forge/phases/finish.md).
|
|
74
|
+
|
|
75
|
+
**Skip Forge for this task only:** `/forge:skip` (runs work without brainstorm/plan/verify chain).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Forge — brainstorm phase only
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Brainstorm phase only. Follow ~/.claude/skills/forge/phases/brainstorm.md`.
|
|
6
|
-
|
|
7
|
-
Invoke bundled **skills/brainstorming**. Save notes to `.forge/sessions/<id>/brainstorm/`. Terminal state: **OpenSpec propose** (`/opsx:propose`) — do not implement until artefacts are approved.
|
|
1
|
+
---
|
|
2
|
+
description: Forge — brainstorm phase only
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Brainstorm phase only. Follow ~/.claude/skills/forge/phases/brainstorm.md`.
|
|
6
|
+
|
|
7
|
+
Invoke bundled **skills/brainstorming**. Save notes to `.forge/sessions/<id>/brainstorm/`. Terminal state: **OpenSpec propose** (`/opsx:propose`) — do not implement until artefacts are approved.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /forge:build
|
|
3
|
-
description: Forge — implement phase (subagent-driven + TDD)
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, forge, openspec]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Implement phase. Follow ~/.claude/skills/forge/phases/implement.md`.
|
|
9
|
-
|
|
10
|
-
**REQUIRED:** forge `skills/subagent-driven-development` + `skills/test-driven-development` per task.
|
|
11
|
-
|
|
12
|
-
- OpenSpec plan → **`/forge:apply`** (preferred) or `openspec-apply-change` / `/opsx:apply` wrapped in subagent loop
|
|
13
|
-
- Specs plan (`planType: specs`) → **`/forge:apply`** — tasks from
|
|
14
|
-
- Throwaway plan → tasks from `.forge/.../plan.md`
|
|
15
|
-
- Direct → brief from `.forge/.../brainstorm/notes.md` + `decisions.md`
|
|
16
|
-
|
|
17
|
-
Then verify and review phases.
|
|
1
|
+
---
|
|
2
|
+
name: /forge:build
|
|
3
|
+
description: Forge — implement phase (subagent-driven + TDD)
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, forge, openspec]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Implement phase. Follow ~/.claude/skills/forge/phases/implement.md`.
|
|
9
|
+
|
|
10
|
+
**REQUIRED:** forge `skills/subagent-driven-development` + `skills/test-driven-development` per task.
|
|
11
|
+
|
|
12
|
+
- OpenSpec plan → **`/forge:apply`** (preferred) or `openspec-apply-change` / `/opsx:apply` wrapped in subagent loop
|
|
13
|
+
- Specs plan (`planType: specs`) → **`/forge:apply`** — tasks from `<plan.dir>/changes/<name>/tasks.md`, no vendor CLI steps
|
|
14
|
+
- Throwaway plan → tasks from `.forge/.../plan.md`
|
|
15
|
+
- Direct → brief from `.forge/.../brainstorm/notes.md` + `decisions.md`
|
|
16
|
+
|
|
17
|
+
Then verify and review phases.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Forge — plan phase (tracked change propose)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Plan phase. Follow ~/.claude/skills/forge/references/plan-routing.md`.
|
|
6
|
-
|
|
7
|
-
**Engine from `.forge/config.json` → `plan.engine`** — do not ask for a plan mode:
|
|
8
|
-
|
|
9
|
-
- `openspec` → run `/opsx:propose <prefix>-<slug>` or the `openspec-propose` skill per [plan-openspec.md](~/.claude/skills/forge/phases/plan-openspec.md)
|
|
10
|
-
- `specs` → author
|
|
11
|
-
|
|
12
|
-
Get user approval on the change artefacts before `/forge:build` or `/forge:apply`.
|
|
1
|
+
---
|
|
2
|
+
description: Forge — plan phase (tracked change propose)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Plan phase. Follow ~/.claude/skills/forge/references/plan-routing.md`.
|
|
6
|
+
|
|
7
|
+
**Engine from `.forge/config.json` → `plan.engine`** — do not ask for a plan mode:
|
|
8
|
+
|
|
9
|
+
- `openspec` → run `/opsx:propose <prefix>-<slug>` or the `openspec-propose` skill per [plan-openspec.md](~/.claude/skills/forge/phases/plan-openspec.md)
|
|
10
|
+
- `specs` → author `<plan.dir>/changes/<name>/{proposal,design,tasks}.md` + delta `specs/<cap>/spec.md` per [plan-specs.md](~/.claude/skills/forge/phases/plan-specs.md) (`forge change new <name> --capability <cap>`)
|
|
11
|
+
|
|
12
|
+
Get user approval on the change artefacts before `/forge:build` or `/forge:apply`.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /forge:skip
|
|
3
|
-
description: Explicitly skip Forge for this task
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, forge]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
User opted out of Forge for **this task only**.
|
|
9
|
-
|
|
10
|
-
1. If active session exists: `forge phase skipped`
|
|
11
|
-
2. Do **not** brainstorm or plan
|
|
12
|
-
3. Execute the request under normal project rules
|
|
13
|
-
|
|
14
|
-
Triage defaults to Forge; `/forge:skip` is the explicit override.
|
|
1
|
+
---
|
|
2
|
+
name: /forge:skip
|
|
3
|
+
description: Explicitly skip Forge for this task
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, forge]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
User opted out of Forge for **this task only**.
|
|
9
|
+
|
|
10
|
+
1. If active session exists: `forge phase skipped`
|
|
11
|
+
2. Do **not** brainstorm or plan
|
|
12
|
+
3. Execute the request under normal project rules
|
|
13
|
+
|
|
14
|
+
Triage defaults to Forge; `/forge:skip` is the explicit override.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /forge:status
|
|
3
|
-
description: Forge — show active session progress
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, forge]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Show Forge session status:
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
forge status
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Summarize `phase`, `planType`, `openspecChange`, and task progress for the user.
|
|
15
|
-
|
|
16
|
-
Reference: `~/.claude/skills/forge/docs/forge.md`
|
|
1
|
+
---
|
|
2
|
+
name: /forge:status
|
|
3
|
+
description: Forge — show active session progress
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, forge]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Show Forge session status:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
forge status
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Summarize `phase`, `planType`, `openspecChange`, and task progress for the user.
|
|
15
|
+
|
|
16
|
+
Reference: `~/.claude/skills/forge/docs/forge.md`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /forge
|
|
3
|
-
description: Forge — start or resume disciplined development (brainstorm → plan → build → review)
|
|
4
|
-
category: Workflow
|
|
5
|
-
tags: [workflow, forge, planning]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Run the **Forge** workflow for substantial work.
|
|
9
|
-
|
|
10
|
-
Read and follow the Forge skill (`~/.claude/skills/forge/SKILL.md`) and `~/.claude/skills/forge/docs/forge.md`.
|
|
11
|
-
|
|
12
|
-
1. Triage — substantial work? (skip only if user said `/forge:skip`)
|
|
13
|
-
2. Resume from `.forge/active.json` or `forge new <slug>`
|
|
14
|
-
3. Continue from current `phase` in `session.json`
|
|
15
|
-
|
|
16
|
-
Subcommands: `/forge:brainstorm`, `/forge:plan`, `/forge:apply`, `/forge:build`, `/forge:status`, `/forge:harness`, `/forge:analyze`, `/forge:skip`
|
|
1
|
+
---
|
|
2
|
+
name: /forge
|
|
3
|
+
description: Forge — start or resume disciplined development (brainstorm → plan → build → review)
|
|
4
|
+
category: Workflow
|
|
5
|
+
tags: [workflow, forge, planning]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Run the **Forge** workflow for substantial work.
|
|
9
|
+
|
|
10
|
+
Read and follow the Forge skill (`~/.claude/skills/forge/SKILL.md`) and `~/.claude/skills/forge/docs/forge.md`.
|
|
11
|
+
|
|
12
|
+
1. Triage — substantial work? (skip only if user said `/forge:skip`)
|
|
13
|
+
2. Resume from `.forge/active.json` or `forge new <slug>`
|
|
14
|
+
3. Continue from current `phase` in `session.json`
|
|
15
|
+
|
|
16
|
+
Subcommands: `/forge:brainstorm`, `/forge:plan`, `/forge:apply`, `/forge:build`, `/forge:status`, `/forge:harness`, `/forge:analyze`, `/forge:skip`
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* UserPromptSubmit: when the user invokes /forge or /forge:*, inject session context.
|
|
4
|
-
* Requires `forge` on PATH.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { spawnSync } from 'node:child_process';
|
|
8
|
-
import fs from 'node:fs';
|
|
9
|
-
import path from 'node:path';
|
|
10
|
-
|
|
11
|
-
const REPO_ROOT = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
12
|
-
const ACTIVE_FILE = path.join(REPO_ROOT, '.forge', 'active.json');
|
|
13
|
-
|
|
14
|
-
function readStdin() {
|
|
15
|
-
return new Promise((resolve) => {
|
|
16
|
-
let data = '';
|
|
17
|
-
if (process.stdin.isTTY) return resolve('');
|
|
18
|
-
process.stdin.setEncoding('utf8');
|
|
19
|
-
process.stdin.on('data', (chunk) => {
|
|
20
|
-
data += chunk;
|
|
21
|
-
});
|
|
22
|
-
process.stdin.on('end', () => resolve(data));
|
|
23
|
-
process.stdin.on('error', () => resolve(data));
|
|
24
|
-
setTimeout(() => resolve(data), 1500);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function extractPrompt(raw) {
|
|
29
|
-
if (!raw) return '';
|
|
30
|
-
try {
|
|
31
|
-
const j = JSON.parse(raw);
|
|
32
|
-
return (
|
|
33
|
-
(typeof j?.prompt === 'string' && j.prompt) ||
|
|
34
|
-
(typeof j?.user_prompt === 'string' && j.user_prompt) ||
|
|
35
|
-
(typeof j?.message === 'string' && j.message) ||
|
|
36
|
-
''
|
|
37
|
-
);
|
|
38
|
-
} catch {
|
|
39
|
-
return raw;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function isForgeInvocation(prompt) {
|
|
44
|
-
return /^\s*\/forge(?::|\s|$)/i.test(prompt);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function emit(message) {
|
|
48
|
-
process.stdout.write(`<system-reminder>\n${message}\n</system-reminder>\n`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const raw = await readStdin();
|
|
52
|
-
const prompt = extractPrompt(raw);
|
|
53
|
-
|
|
54
|
-
if (!isForgeInvocation(prompt)) {
|
|
55
|
-
process.exit(0);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!fs.existsSync(ACTIVE_FILE)) {
|
|
59
|
-
emit(
|
|
60
|
-
'[forge] No active session. Bootstrap with `forge new <slug>` then follow the Forge skill.',
|
|
61
|
-
);
|
|
62
|
-
process.exit(0);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const r = spawnSync('forge', ['reminder', '--format', 'plain', '--prompt', prompt], {
|
|
66
|
-
encoding: 'utf8',
|
|
67
|
-
cwd: REPO_ROOT,
|
|
68
|
-
shell: true,
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
if (r.status === 0 && r.stdout.trim()) {
|
|
72
|
-
emit(r.stdout.trim());
|
|
73
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* UserPromptSubmit: when the user invokes /forge or /forge:*, inject session context.
|
|
4
|
+
* Requires `forge` on PATH.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
|
|
11
|
+
const REPO_ROOT = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
12
|
+
const ACTIVE_FILE = path.join(REPO_ROOT, '.forge', 'active.json');
|
|
13
|
+
|
|
14
|
+
function readStdin() {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
let data = '';
|
|
17
|
+
if (process.stdin.isTTY) return resolve('');
|
|
18
|
+
process.stdin.setEncoding('utf8');
|
|
19
|
+
process.stdin.on('data', (chunk) => {
|
|
20
|
+
data += chunk;
|
|
21
|
+
});
|
|
22
|
+
process.stdin.on('end', () => resolve(data));
|
|
23
|
+
process.stdin.on('error', () => resolve(data));
|
|
24
|
+
setTimeout(() => resolve(data), 1500);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function extractPrompt(raw) {
|
|
29
|
+
if (!raw) return '';
|
|
30
|
+
try {
|
|
31
|
+
const j = JSON.parse(raw);
|
|
32
|
+
return (
|
|
33
|
+
(typeof j?.prompt === 'string' && j.prompt) ||
|
|
34
|
+
(typeof j?.user_prompt === 'string' && j.user_prompt) ||
|
|
35
|
+
(typeof j?.message === 'string' && j.message) ||
|
|
36
|
+
''
|
|
37
|
+
);
|
|
38
|
+
} catch {
|
|
39
|
+
return raw;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isForgeInvocation(prompt) {
|
|
44
|
+
return /^\s*\/forge(?::|\s|$)/i.test(prompt);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function emit(message) {
|
|
48
|
+
process.stdout.write(`<system-reminder>\n${message}\n</system-reminder>\n`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const raw = await readStdin();
|
|
52
|
+
const prompt = extractPrompt(raw);
|
|
53
|
+
|
|
54
|
+
if (!isForgeInvocation(prompt)) {
|
|
55
|
+
process.exit(0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!fs.existsSync(ACTIVE_FILE)) {
|
|
59
|
+
emit(
|
|
60
|
+
'[forge] No active session. Bootstrap with `forge new <slug>` then follow the Forge skill.',
|
|
61
|
+
);
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const r = spawnSync('forge', ['reminder', '--format', 'plain', '--prompt', prompt], {
|
|
66
|
+
encoding: 'utf8',
|
|
67
|
+
cwd: REPO_ROOT,
|
|
68
|
+
shell: true,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (r.status === 0 && r.stdout.trim()) {
|
|
72
|
+
emit(r.stdout.trim());
|
|
73
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Claude Code SessionStart: inject active Forge session when present.
|
|
4
|
-
* Requires `forge` on PATH (npm link @izkac/forgekit or global install).
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { spawnSync } from 'node:child_process';
|
|
8
|
-
|
|
9
|
-
const REPO_ROOT = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
-
|
|
11
|
-
const r = spawnSync('forge', ['reminder', '--format', 'claude-session-start'], {
|
|
12
|
-
encoding: 'utf8',
|
|
13
|
-
cwd: REPO_ROOT,
|
|
14
|
-
shell: true,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
if (r.status === 0 && r.stdout.trim()) {
|
|
18
|
-
process.stdout.write(r.stdout);
|
|
19
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Claude Code SessionStart: inject active Forge session when present.
|
|
4
|
+
* Requires `forge` on PATH (npm link @izkac/forgekit or global install).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
|
|
9
|
+
const REPO_ROOT = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
10
|
+
|
|
11
|
+
const r = spawnSync('forge', ['reminder', '--format', 'claude-session-start'], {
|
|
12
|
+
encoding: 'utf8',
|
|
13
|
+
cwd: REPO_ROOT,
|
|
14
|
+
shell: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
if (r.status === 0 && r.stdout.trim()) {
|
|
18
|
+
process.stdout.write(r.stdout);
|
|
19
|
+
}
|