@guidobuilds/forge-ai 0.3.0 → 0.6.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.
- package/CHANGELOG.md +72 -0
- package/README.md +126 -3
- package/artifacts/forge/forge.md +28 -3
- package/artifacts/forge-adversary/forge-adversary.md +124 -0
- package/artifacts/forge-grill/forge-grill.md +9 -2
- package/artifacts/forge-worker/forge-worker.md +168 -10
- package/artifacts/forge-worker-leaf/forge-worker-leaf.md +93 -0
- package/artifacts/using-forge/using-forge.md +122 -4
- package/dist/src/adapters/claude-known.js +1 -0
- package/dist/src/adapters/claude.js +10 -2
- package/dist/src/adapters/grok-known.js +37 -0
- package/dist/src/adapters/grok.js +41 -0
- package/dist/src/cli.js +147 -91
- package/dist/src/model.js +1 -1
- package/dist/src/paths.js +4 -0
- package/dist/src/processor.js +24 -7
- package/dist/src/self-update.js +70 -0
- package/dist/src/version-check.js +75 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,78 @@ Versions prior to 0.3.0 are not reconstructed here; see git history for earlier
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.6.0] - 2026-07-05
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`forge-worker-leaf` agent** — terminal worker for bounded subgoal shards at `DISPATCH_DEPTH: 2`. No spawn tools (`task: deny` on OpenCode; no `Agent`/`task` on Claude/Grok). Installed alongside `forge-worker` on all platforms.
|
|
17
|
+
- **Worker sub-delegation** — `forge-worker` is now a coordinator that spawns `forge-worker-leaf` when context triggers fire (≥ 8 file reads, ≥ 6 searches, ≥ 20 tool calls, ≥ 5 files to build, or `DELEGATION: required`). Extended worker contract: `DISPATCH_DEPTH`, `WORKER_ROLE`, `SUB_RESULTS`, `DELEGATION_REQUESTS`, `NEXT_RECOMMENDED: sub-delegate`.
|
|
18
|
+
- **Pre-build approval gate** — for non-trivial work, the orchestrator presents an approval brief (conclusions, path/tasks, why) after inspect/design/plan (and `forge-grill` if it ran) and waits for the user's explicit approval before the first build dispatch. Trivial, explicit, low-risk requests remain self-approving — no artificial gate is created.
|
|
19
|
+
- **Per-feature `tasks[]` ledger** — each feature in `feature-list.json` can carry a `tasks[]` array (`id`, `title`, `workType`, `files`, `expectedOutcome`, `validation`, `state`) so any agent can resume mid-build knowing what a task was, what it touches, what "done" looks like, and how to validate it. `forge-worker` owns the schema.
|
|
20
|
+
- **Claude Code skill frontmatter** — canonical artifacts can now set `claude.when_to_use`, `claude.model`, and `claude.user-invocable` (Claude Code now supports `model` on skills, not just agents). Applied to the three artifacts that render as Claude Code skills: `forge` and `forge-grill` runs on `opus`, `forge` is the only one left user-invocable; `using-forge` run on `sonnet` and are set (along with `forge-grill`) `user-invocable: false` (Claude still loads them automatically; they no longer appear in the `/` menu or run as standalone commands).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`forge-worker` frontmatter** — Claude adds `Agent`; Grok adds `task`, `get_task_output`, `kill_task`; OpenCode adds `task: allow`.
|
|
25
|
+
- **README** — corrects outdated claim that Claude subagents cannot spawn subagents. Nested sub-agents are supported since Claude Code v2.1.172 (platform max 5 levels); Forge caps at depth 2 by cross-harness policy.
|
|
26
|
+
- **`using-forge`**, **`forge`**, **`forge-grill`**, **`forge-adversary`** — document two-tier worker model and Codex `DELEGATION_REQUESTS` fan-out fallback.
|
|
27
|
+
- **Route announcement** — for non-trivial work, the announcement is now followed by the pre-build approval brief; re-announcing mid-flight also re-triggers approval.
|
|
28
|
+
- **`forge-worker` plan/build modes** — plan populates `tasks[]`; build flips task `state` (`not_started -> active -> done`) as it works. Task `done` is distinct from feature `state`, which only a verify dispatch can move to `passing`.
|
|
29
|
+
- **`forge-adversary`** — cross-checks that each task's `validation` was actually satisfied, not just the feature's top-level `verification` command.
|
|
30
|
+
- **`progress.md` / `session-handoff.md` templates** — now reference the active `<feature-id>/<task-id>` so a resuming agent finds its place immediately.
|
|
31
|
+
- **`renderClaudeSkill`** — no longer drops the `model` field for Claude Code skills; it now validates it against known Claude models the same way `renderClaudeAgent` does.
|
|
32
|
+
|
|
33
|
+
### Migration from 0.5.0
|
|
34
|
+
|
|
35
|
+
- Run `npx @guidobuilds/forge-ai update` to install `forge-worker-leaf` and refresh coordinator artifacts. Requires Claude Code **v2.1.172+** for structural sub-delegation on Claude.
|
|
36
|
+
|
|
37
|
+
## [0.5.0] - 2026-06-20
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **Grok Build (`--platform grok`) as a first-class target.** `forge`, `forge-grill`, and `using-forge` install as Grok skills under `.grok/skills/<name>/SKILL.md`; `forge-worker` and `forge-adversary` install as Grok subagents under `.grok/agents/<name>.md`. Grok's built-in tool IDs (`run_terminal_cmd`, `grep_search`, `search_replace`, etc.) are used in the worker and adversary toolsets, replacing the Claude-specific names. Included in `--platform all`. Grok Build v0.2.56+ required.
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- **Orchestrator route announcement**: before the first dispatch, the orchestrator now states the chosen route to the user — work types joined by arrows (e.g. `build -> verify`, `inspect -> build -> verify`, `inspect -> design -> plan -> build -> verify`), whether a `forge-grill` pass runs before build and an independent verify or `forge-adversary` gate runs after, and one clause on why it is the lightest safe route. Re-announced only when the route changes materially mid-flight.
|
|
46
|
+
- **Proactive `forge-grill`**: the orchestrator now runs `forge-grill` proactively before build for non-trivial, risk-bearing, or multi-step work with unresolved assumptions. Previously grill was effectively opt-in (user-triggered via `/forge-grill`). Trivial, surgical, and read-only work still skips grill.
|
|
47
|
+
|
|
48
|
+
### Migration from 0.4.0
|
|
49
|
+
|
|
50
|
+
- Run `npx @guidobuilds/forge-ai update` to add the new `forge-grill` and `using-forge` prompt changes and the Grok Build artifacts. No breaking changes to the CLI, state files, or existing Claude/OpenCode/Codex installs.
|
|
51
|
+
|
|
52
|
+
## [0.4.0] - 2026-06-16
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- **Adaptive `.forge/<feature-slug>/` state model** for the orchestration harness, sized to task complexity. Trivial work stays on the `build -> verify` path with no artifacts; non-trivial or multi-session work gains a structured state ledger. Documented in `using-forge` (routing tiers + triggers) and `forge-worker` (schema + templates). No distribution-engine change — the state files are runtime-generated by the worker.
|
|
57
|
+
- **`feature-list.json` feature-list primitive**: the unit-of-work ledger where each feature carries the triple `behavior` + `verification` (a runnable command) + `state` (`not_started | active | blocked | passing`), plus `evidence` and `dependencies`.
|
|
58
|
+
- **Definition of Done with verification-evidence gating**: a feature reaches `passing` only after its verification command was actually run and recorded in `verification.md`; never on assertion alone.
|
|
59
|
+
- **Independent verification**: for non-trivial work the builder may not self-certify; the orchestrator dispatches a separate `forge-worker` verify run that re-runs the checks and flips state.
|
|
60
|
+
- **`forge-adversary` agent — dedicated post-build red-team gate.** A new subagent (`kind: agent`; OpenCode subagent, Claude agent) the orchestrator dispatches *after* build to break a worker's output across four lenses (logical/requirements, technical/runtime, security, performance/scale). It writes reproductions under `.forge/<slug>/adversary/`, records every attempt in `verification.md`, and gates the Definition of Done — a confirmed, reproducible break moves the feature to `blocked`; it never edits the implementation under test. Reports `WORK_TYPE: verify`, so the worker contract is unchanged. Complements `forge-grill` (which grills plans/designs *before* build). `forge`, `using-forge`, and `forge-worker` updated to dispatch it for risk-bearing work.
|
|
61
|
+
- **Persisted handoff/progress**: `progress.md` and `session-handoff.md` templates for cross-session continuity, created adaptively when work spans sessions or blocks.
|
|
62
|
+
- `forge-ai self-update` command. Detects how the CLI is installed (pnpm global, npm global, Homebrew npm, npx, or unknown) and runs the right update command with the right flags (`--prefer-online` for pnpm to sidestep its metadata cache). After updating the binary it automatically runs `forge-ai update` to refresh the spec kit. Flags: `--to <version>` to pin a specific version, `--dry-run` to preview, `--skip-spec-update` to only bump the CLI.
|
|
63
|
+
- Background version check on every interactive run. Calls the npm registry (with 1.5s timeout, cached for 1h at `~/.forge-ai/version-check.json`) and prints `forge-ai vX.Y.Z (vA.B.C available — run \`forge-ai self-update\` to upgrade)` when a newer version exists. Silent on failure; never blocks the command.
|
|
64
|
+
- `--no-update-check` CLI flag and `FORGE_NO_UPDATE_CHECK=1` env var to opt out of the version check. Also auto-skipped in CI (`CI=true`) and non-interactive runs.
|
|
65
|
+
- README "How to Use" section explaining how to invoke Forge per platform: `/forge` skill on Claude Code (with `forge-worker` as a delegated subagent), `forge` primary agent on OpenCode, and the partial `.toml` agents on Codex — including the Claude advisory-vs-OpenCode-enforced trade-off.
|
|
66
|
+
- **Feedback ratchet — `.forge/lessons.md`**: a project-scoped, topic-keyed lessons file the worker proactively appends to after each run (decision / non-obvious fix / convention / failure). Reusing a topic-key updates an existing lesson instead of creating a contradictory duplicate, so the harness compounds across sessions instead of repeating mistakes.
|
|
67
|
+
- **Bootstrap repo-facts — `.forge/repo-facts.md`**: a one-time `inspect`-written standing spec (stack, build/test/lint commands, conventions, hard constraints) the worker rereads each dispatch, paying the intent/reconstruction cost once.
|
|
68
|
+
- **Closure + cross-task index — `.forge/index.md` and `.forge/_archive/`**: on `passing`, the verify dispatch flushes lessons and appends a one-line ledger entry; completed slugs may be archived. Each feature carries a falsifiable `archiveWhen` condition set at creation.
|
|
69
|
+
- **Effort routing**: the orchestrator now states an effort level per worker dispatch (low for `inspect`/`verify`/`operate`/routine `build`, medium for most `build`/`plan`, high for `design`/synthesis/novel work) — match effort to difficulty rather than defaulting high.
|
|
70
|
+
- **Inline-vs-delegate threshold**: the orchestrator handles inline only a 1-3 file read / mechanical write / git status, and delegates at 4+ files, multi-file writes, or running tests/builds/installs — keeping the thread thin (summaries, not implementations).
|
|
71
|
+
- **Optional hooks pack** (README): an opt-in Claude Code `settings.json` snippet (Stop + PostToolUse) to *enforce* the verification gate mechanically for unattended runs — kept thin and optional, since strong models honor the gate from the operating model alone.
|
|
72
|
+
- **Harness-content validation**: `validate`/`install` emit a `BODY_OVER_BUDGET` info diagnostic when an artifact body exceeds its soft line budget (keep always-loaded files small). Never an error; does not block installs.
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
|
|
76
|
+
- **Independent verification is now adversarial.** The separate `forge-worker` verify dispatch tries to *disprove* "done" rather than confirm it: it refutes risk-bearing features across up to three distinct lenses and keeps `passing` only if at least two fail to refute; confirms the check was not weakened, deleted, skipped, or stubbed and that its output exercises the named `behavior`; logs refuted/uncertain candidates instead of dropping them silently; and escalates instead of looping when the same failure recurs. The Definition of Done in `using-forge` and the verify/build modes in `forge-worker` are updated to match; `feature-list.json` gains an `archiveWhen` field.
|
|
77
|
+
|
|
78
|
+
### Migration from 0.3.0
|
|
79
|
+
|
|
80
|
+
- Run `npx @guidobuilds/forge-ai update` (not `install`) to add the new `forge-adversary` agent and refresh the `forge`, `using-forge`, and `forge-worker` artifacts to the adversarial-verification operating model. Local edits to managed files are backed up automatically to `~/.forge-ai/backups/`.
|
|
81
|
+
- No breaking changes to the CLI or distribution layout. The `.forge/<feature-slug>/` state files (`feature-list.json`, `verification.md`, `lessons.md`, `repo-facts.md`, `index.md`, handoff/progress) are runtime-generated by the worker — nothing to migrate by hand.
|
|
82
|
+
- If you installed the CLI globally, `forge-ai self-update` (new in 0.4.0) bumps the binary and then refreshes the spec kit for you.
|
|
83
|
+
|
|
12
84
|
## [0.3.0] - 2026-05-15
|
|
13
85
|
|
|
14
86
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Forge is a personal project for working with code agents more reliably.
|
|
4
4
|
|
|
5
|
-
It started as a way to get better results from OpenCode, and now also supports Codex and
|
|
5
|
+
It started as a way to get better results from OpenCode, and now also supports Claude Code, Codex and Grok Build. The idea is to give agents a lightweight operating model for turning vague software requests into smaller, safer, verifiable changes without adding a heavy process around them.
|
|
6
6
|
|
|
7
7
|
Forge is experimental. It is shaped by hands-on use, and the workflow may change as I learn what works and what does not.
|
|
8
8
|
|
|
@@ -49,6 +49,8 @@ build -> verify
|
|
|
49
49
|
|
|
50
50
|
There is no mandatory lifecycle. Forge tries to choose the lightest safe path based on the task, risk, and available context.
|
|
51
51
|
|
|
52
|
+
Before delegating, the orchestrator states the chosen route to the user — the work types it plans to run, whether `forge-grill` runs before build, and why it is the lightest safe path for that request. For non-trivial work, it then presents an approval brief — conclusions, planned tasks, why — and waits for an explicit go-ahead before the first build dispatch.
|
|
53
|
+
|
|
52
54
|
## Durable Context
|
|
53
55
|
|
|
54
56
|
When a task benefits from persistent context, Forge writes notes under `.forge/<feature-slug>/`.
|
|
@@ -62,6 +64,23 @@ These notes are useful for:
|
|
|
62
64
|
|
|
63
65
|
Small, obvious changes do not need ceremony. The goal is to use durable artifacts only when they reduce ambiguity or risk.
|
|
64
66
|
|
|
67
|
+
### State model for non-trivial work
|
|
68
|
+
|
|
69
|
+
For non-trivial or multi-session work, Forge keeps a small state model under `.forge/<feature-slug>/`, sized to the task:
|
|
70
|
+
|
|
71
|
+
- `feature-list.json` — the unit-of-work ledger. Each feature carries the triple `behavior` + `verification` (a runnable command) + `state` (`not_started | active | blocked | passing`), plus a `tasks[]` execution ledger (title, files, expected outcome, validation, state) so any agent can resume mid-build.
|
|
72
|
+
- `verification.md` — recorded verification evidence: the command, its output, and a pass/fail verdict.
|
|
73
|
+
- `progress.md` / `session-handoff.md` — session continuity and handoff, written when work spans sessions or blocks.
|
|
74
|
+
|
|
75
|
+
Before build starts on non-trivial work, Forge presents an approval brief — conclusions, the planned tasks, and why — and waits for an explicit go-ahead; a finished plan does not authorize build by itself.
|
|
76
|
+
|
|
77
|
+
Two rules make "done" mean done:
|
|
78
|
+
|
|
79
|
+
- **Definition of Done.** A feature only reaches `passing` once its verification command was actually run and the evidence is recorded in `verification.md`. No feature is marked done on assertion alone.
|
|
80
|
+
- **Independent verification.** For non-trivial work the builder does not certify its own work. The orchestrator dispatches a separate `forge-worker` verify run that re-runs the checks and flips the state.
|
|
81
|
+
|
|
82
|
+
Trivial, surgical changes skip all of this and stay on the `build -> verify` path.
|
|
83
|
+
|
|
65
84
|
## Supported Agents
|
|
66
85
|
|
|
67
86
|
Forge currently installs support for:
|
|
@@ -69,6 +88,7 @@ Forge currently installs support for:
|
|
|
69
88
|
- OpenCode
|
|
70
89
|
- Codex
|
|
71
90
|
- Claude Code
|
|
91
|
+
- Grok Build
|
|
72
92
|
|
|
73
93
|
The same operating model is shared across all supported agents so the workflow stays mostly consistent even when the underlying tool changes.
|
|
74
94
|
|
|
@@ -106,6 +126,99 @@ Validate a local Forge source tree:
|
|
|
106
126
|
npx @guidobuilds/forge-ai validate --source .
|
|
107
127
|
```
|
|
108
128
|
|
|
129
|
+
## How to Use
|
|
130
|
+
|
|
131
|
+
Forge installs the **same operating model** on every agent, but **how you invoke it differs per platform**, because each agent exposes different primitives (skills, subagents, agent switching). The installer is only step one — this section is how you actually drive Forge once it is installed.
|
|
132
|
+
|
|
133
|
+
### The pieces
|
|
134
|
+
|
|
135
|
+
Forge is one orchestrator, a two-tier worker model, and a dedicated adversary, with two supporting skills:
|
|
136
|
+
|
|
137
|
+
- **`forge`** — the orchestrator. It talks to you, decides how much process a task needs, and delegates the real work. It does not edit code itself.
|
|
138
|
+
- **`forge-worker`** — the coordinator worker. It executes bounded subgoals and spawns `forge-worker-leaf` when context would grow too large (~100k-token peak).
|
|
139
|
+
- **`forge-worker-leaf`** — the terminal worker. It runs one bounded shard with no sub-delegation.
|
|
140
|
+
- **`forge-adversary`** — the breaker. After a build, the orchestrator dispatches it to *try to break* the work — logically and technically (logic/requirements, runtime, security, performance). It gates the Definition of Done: a confirmed, reproducible break keeps the feature out of `passing`. It complements `forge-grill`, which grills plans *before* building.
|
|
141
|
+
- **`using-forge`** — the shared operating-model skill the orchestrator follows.
|
|
142
|
+
- **`forge-grill`** — an orchestrator mode for stress-testing a plan or design before building. The orchestrator invokes it proactively before non-trivial or risk-bearing builds; also available as `/forge-grill` for manual use.
|
|
143
|
+
|
|
144
|
+
What changes per platform is the **kind** each piece is installed as, and therefore how you trigger it.
|
|
145
|
+
|
|
146
|
+
### Claude Code
|
|
147
|
+
|
|
148
|
+
| Piece | Installed as | How you invoke it |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `forge` | skill (`model: opus`) | type `/forge` in the prompt — the only Forge skill you invoke directly |
|
|
151
|
+
| `forge-grill` | skill (`model: sonnet`, not user-invocable) | loaded automatically by `forge` before non-trivial or risk-bearing builds |
|
|
152
|
+
| `using-forge` | skill (`model: sonnet`, not user-invocable) | loaded automatically by `forge` before routing work |
|
|
153
|
+
| `forge-worker` | subagent | coordinator; main thread delegates via `Agent` (or legacy `Task`) |
|
|
154
|
+
| `forge-worker-leaf` | subagent | terminal shard; spawned by `forge-worker` (or orchestrator on Codex) |
|
|
155
|
+
| `forge-adversary` | subagent | the orchestrator delegates to it after build to gate risk-bearing work |
|
|
156
|
+
|
|
157
|
+
Start a session by typing **`/forge`**. That loads the orchestrator role into your main Claude Code thread, which delegates each bounded task to `forge-worker`, which may spawn `forge-worker-leaf` for heavy inspect/build shards. Requires **Claude Code v2.1.172+** for nested sub-agents. `forge-grill` and `using-forge` are marked `user-invocable: false`: Claude still loads and runs them as part of `forge`'s routing, but they no longer appear in the `/` menu or run as standalone commands — `forge` is the single entry point.
|
|
158
|
+
|
|
159
|
+
> Why a skill and not an agent on Claude? The main thread retains `Agent`/`Task` and can delegate. A skill injects orchestrator behavior without replacing the main agent. The trade-off: "delegate, never do worker work inline" is followed by instruction at the orchestrator layer, not by tool restrictions — but `forge-worker` **can** structurally spawn leaves when given `Agent` in its tool list.
|
|
160
|
+
|
|
161
|
+
### OpenCode
|
|
162
|
+
|
|
163
|
+
| Piece | Installed as | How you invoke it |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| `forge` | primary agent | switch your active agent to `forge` |
|
|
166
|
+
| `forge-worker` | subagent | coordinator; `forge` delegates with `task: allow` |
|
|
167
|
+
| `forge-worker-leaf` | subagent | terminal shard; spawned by coordinator (`task: deny`) |
|
|
168
|
+
| `forge-adversary` | subagent | the `forge` agent delegates to it to gate risk-bearing work after build |
|
|
169
|
+
| `using-forge`, `forge-grill` | skills | loaded by the agent as needed |
|
|
170
|
+
|
|
171
|
+
Switch your primary agent to **`forge`**. Unlike Claude Code, the orchestrator here is a real agent with file and shell tools **denied**, so it is *structurally* forced to delegate to the `forge-worker` subagent instead of doing the work itself.
|
|
172
|
+
|
|
173
|
+
### Codex
|
|
174
|
+
|
|
175
|
+
| Piece | Installed as | Location |
|
|
176
|
+
|---|---|---|
|
|
177
|
+
| `forge`, `forge-worker`, `forge-adversary` | agents (`.toml`) | `~/.codex/agents/` (or `.codex/agents/` per project) |
|
|
178
|
+
| `using-forge`, `forge-grill` | skills | `~/.agents/skills/` (or `.agents/skills/` per project) |
|
|
179
|
+
|
|
180
|
+
Codex support is the most partial of the three: Forge writes the agent `.toml` files but does not generate `AGENTS.md` or profiles, so wiring them into a Codex run may take manual steps. Treat Codex support as experimental.
|
|
181
|
+
|
|
182
|
+
### Project vs user scope
|
|
183
|
+
|
|
184
|
+
### Grok Build
|
|
185
|
+
|
|
186
|
+
| Piece | Installed as | How you invoke it |
|
|
187
|
+
|---|---|---|
|
|
188
|
+
| `forge` | skill | type `/forge` in the prompt |
|
|
189
|
+
| `forge-grill` | skill | type `/forge-grill` |
|
|
190
|
+
| `using-forge` | skill | `/using-forge` (usually pulled in by `/forge`) |
|
|
191
|
+
| `forge-worker` | subagent | coordinator; main thread delegates via `task` |
|
|
192
|
+
| `forge-worker-leaf` | subagent | terminal shard; spawned by coordinator |
|
|
193
|
+
| `forge-adversary` | subagent | the orchestrator delegates to it after build to gate risk-bearing work |
|
|
194
|
+
|
|
195
|
+
Start a session by typing **`/forge`**. Like Claude Code, the orchestrator runs as a skill in the main Grok session, which then delegates bounded work to the `forge-worker` subagent. Grok uses its own tool IDs (`run_terminal_cmd`, `grep_search`, `search_replace`, etc.) — the installer translates the worker's toolset automatically.
|
|
196
|
+
|
|
197
|
+
> **Note:** Grok Build already auto-discovers skills and agents from `~/.claude/` for compatibility. If you have a Claude Code install, Grok may partially pick up those files — but with Claude tool names that Grok doesn't recognize. A native Grok install (`--platform grok`) writes `.grok/`-scoped files with the correct Grok tool IDs.
|
|
198
|
+
|
|
199
|
+
### Project vs user scope
|
|
200
|
+
|
|
201
|
+
With `--scope user` (the default) the definitions live under your home directory and apply everywhere. With `--scope project` they live in the repo (`.claude/`, `.opencode/`, `.codex/`, `.agents/`, `.grok/`) and apply only there. Invocation is identical either way.
|
|
202
|
+
|
|
203
|
+
## Optional: enforce the gate with hooks (Claude Code)
|
|
204
|
+
|
|
205
|
+
Forge's Definition of Done is followed by instruction, not enforced — strong models honor the gate from the operating model alone. If you want the verification gate enforced *mechanically* on Claude Code (e.g. for unattended runs), add an opt-in hook to your `.claude/settings.json`. Keep it thin: a safety net for the one invariant that must hold, not a compliance layer.
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"hooks": {
|
|
210
|
+
"Stop": [
|
|
211
|
+
{ "hooks": [ { "type": "command", "command": "<your project's verification command, e.g. pnpm test --silent>" } ] }
|
|
212
|
+
],
|
|
213
|
+
"PostToolUse": [
|
|
214
|
+
{ "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "<your fast type/lint check, e.g. pnpm typecheck>" } ] }
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The **Stop** hook re-runs your checks when the agent tries to finish, so a failing gate blocks a premature "done"; the **PostToolUse** hook surfaces type/lint errors after each edit for mid-task self-correction. Point the Stop hook at fast unit checks and leave slow suites to CI. This is intentionally optional — reach for it only when you want the gate enforced without you in the room.
|
|
221
|
+
|
|
109
222
|
## Local Development
|
|
110
223
|
|
|
111
224
|
Forge uses [pnpm](https://pnpm.io) for development (pinned via `packageManager` in `package.json`, so `corepack enable` is enough — no global install needed). The published package is still consumed by end users via `npx`/npm, unchanged.
|
|
@@ -126,10 +239,20 @@ node bin/forge-ai.mjs install --source . --platform all --scope project --dry-ru
|
|
|
126
239
|
|
|
127
240
|
## Updating
|
|
128
241
|
|
|
129
|
-
|
|
242
|
+
If you have Forge installed globally, the simplest way is:
|
|
130
243
|
|
|
131
244
|
```sh
|
|
132
|
-
|
|
245
|
+
forge-ai self-update
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This detects how the CLI was installed (pnpm global, npm global, Homebrew npm, etc.) and runs the right upgrade command — including the `--prefer-online` flag that sidesteps pnpm's metadata cache when a new version was just published. After bumping the binary, it automatically runs `forge-ai update` to refresh the spec kit.
|
|
249
|
+
|
|
250
|
+
Forge also pings the registry on every interactive run and prints a one-line notice when a newer version is available, so you don't have to remember to check.
|
|
251
|
+
|
|
252
|
+
If you don't have a global install (running via `npx`):
|
|
253
|
+
|
|
254
|
+
```sh
|
|
255
|
+
npx @guidobuilds/forge-ai@latest update
|
|
133
256
|
```
|
|
134
257
|
|
|
135
258
|
Forge replaces its managed agent and skill definitions in your supported agent configuration directories.
|
package/artifacts/forge/forge.md
CHANGED
|
@@ -4,6 +4,10 @@ description: Forge orchestrator with dynamic runtime routing and a single worker
|
|
|
4
4
|
kind: agent
|
|
5
5
|
claude:
|
|
6
6
|
kind: skill
|
|
7
|
+
model: opus
|
|
8
|
+
when_to_use: Use for any development or operational task in this repo — build a feature, fix a bug, investigate code, plan work, or verify a change. This is the default entry point; invoke explicitly with /forge or let Claude select it automatically for repo work.
|
|
9
|
+
grok:
|
|
10
|
+
kind: skill
|
|
7
11
|
opencode:
|
|
8
12
|
mode: primary
|
|
9
13
|
permissions:
|
|
@@ -37,14 +41,29 @@ The `using-forge` skill owns runtime routing, operating principles, approval heu
|
|
|
37
41
|
- Delegate all technical and operational work to Forge workers.
|
|
38
42
|
- Keep one thin thread with the user.
|
|
39
43
|
- Choose the lightest safe routing permitted by the skill.
|
|
44
|
+
- Before the first dispatch, state the chosen route to the user (see `using-forge`: Route announcement).
|
|
45
|
+
- Run `forge-grill` proactively before building non-trivial or risk-bearing work; do not wait for the user to ask (see `using-forge`: Routing rules).
|
|
46
|
+
- For non-trivial work, present the pre-build approval brief (conclusions, path/tasks, why) and wait for the user's explicit approval before the first build dispatch; a finished plan does not by itself authorize build (see `using-forge`: Approval heuristics).
|
|
40
47
|
- Enforce the Forge worker contract strictly.
|
|
48
|
+
- Assign an effort level per dispatch and delegate by size (see `using-forge`: Effort routing, Routing rules).
|
|
41
49
|
|
|
42
50
|
## Worker model
|
|
43
|
-
- `forge-worker` is the
|
|
51
|
+
- `forge-worker` is the coordinator worker; route all build and operational work to it at `DISPATCH_DEPTH: 1`.
|
|
52
|
+
- `forge-worker-leaf` is the terminal worker for bounded shards at `DISPATCH_DEPTH: 2`; coordinators spawn it — or you fan out leaves when a coordinator returns `DELEGATION_REQUESTS` (Codex).
|
|
53
|
+
- `forge-adversary` is a dedicated adversarial verification agent: dispatch it as the Definition-of-Done gate for risk-bearing work to break the build before it can reach `passing`. Never sub-delegate verify or adversary work.
|
|
44
54
|
- You may launch one worker instance for a bounded task.
|
|
45
55
|
- You may launch multiple `forge-worker` instances in sequence when one result should shape the next delegation.
|
|
46
56
|
- You may launch multiple `forge-worker` instances in parallel when subgoals are sufficiently independent.
|
|
47
57
|
- Keep each worker invocation narrowly scoped so multiple instances do not collide on the same ownership or files unless deliberate.
|
|
58
|
+
- Tag heavy dispatches with `DELEGATION: allowed|required|forbidden`. Default trivial work to `forbidden`.
|
|
59
|
+
|
|
60
|
+
## State model
|
|
61
|
+
- Size the state model to the work. Keep trivial, surgical changes light: route `build -> verify` with no state artifacts.
|
|
62
|
+
- For non-trivial or multi-session work, route through the `.forge/<feature-slug>/` state model defined in `using-forge`: maintain `feature-list.json` (behavior + verification + state) and persist `progress.md` / `session-handoff.md` when work spans sessions or blocks.
|
|
63
|
+
- Non-trivial features carry a `tasks[]` ledger (title, files, expected outcome, validation, state) inside `feature-list.json` so any agent can resume mid-build; the builder flips task state as it works, but only verify flips a feature to `passing`.
|
|
64
|
+
- A feature reaches `passing` only via recorded verification evidence (the Definition of Done in `using-forge`).
|
|
65
|
+
- For non-trivial work, dispatch a separate verify run; never accept a builder's self-certified `passing`. Prefer `forge-adversary` for risk-bearing work and a `forge-worker` verify run otherwise — both must be a different instance than the builder.
|
|
66
|
+
- Read `.forge/repo-facts.md` and `.forge/lessons.md` when present, and have the verify dispatch flush lessons and update `.forge/index.md` at closure (see `using-forge`).
|
|
48
67
|
|
|
49
68
|
## Contract enforcement
|
|
50
69
|
Each worker response must include:
|
|
@@ -53,18 +72,24 @@ Each worker response must include:
|
|
|
53
72
|
STATUS: success|partial|blocked
|
|
54
73
|
WORK_TYPE: inspect|design|plan|build|operate|verify|mixed
|
|
55
74
|
FEATURE_SLUG: <kebab-case>
|
|
75
|
+
DISPATCH_DEPTH: 0|1|2
|
|
76
|
+
WORKER_ROLE: coordinator|leaf
|
|
56
77
|
ARTIFACTS:
|
|
57
78
|
- <path or None>
|
|
58
79
|
SUMMARY:
|
|
59
80
|
- <point>
|
|
60
|
-
|
|
81
|
+
SUB_RESULTS:
|
|
82
|
+
- task_id: <id> | status: success|partial|blocked | work_type: <type> | summary: <one line>
|
|
83
|
+
DELEGATION_REQUESTS:
|
|
84
|
+
- task_id: <id> | work_type: <type> | role: leaf | parallel: true|false | subgoal: <bounded> | files_hint: <paths or None>
|
|
85
|
+
NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|sub-delegate|ask-user|none
|
|
61
86
|
RISKS:
|
|
62
87
|
- <risk or None>
|
|
63
88
|
QUESTIONS:
|
|
64
89
|
1) <question>
|
|
65
90
|
```
|
|
66
91
|
|
|
67
|
-
`QUESTIONS` appears only when `STATUS: blocked`.
|
|
92
|
+
`QUESTIONS` appears only when `STATUS: blocked`. On `DELEGATION_REQUESTS`, fan out `forge-worker-leaf` dispatches (Codex fallback). Trust coordinator `SUB_RESULTS` unless `partial` or `blocked`.
|
|
68
93
|
|
|
69
94
|
If output is malformed:
|
|
70
95
|
1) request one reformat retry with same task_id
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-adversary
|
|
3
|
+
description: Forge adversarial breaker — attacks a worker's completed work logically and technically and gates `passing` on recorded evidence.
|
|
4
|
+
kind: agent
|
|
5
|
+
claude:
|
|
6
|
+
permissions:
|
|
7
|
+
tools: [TodoWrite, Read, Write, Edit, Bash, Glob, Grep, LS, MultiEdit, WebFetch]
|
|
8
|
+
grok:
|
|
9
|
+
permissions:
|
|
10
|
+
tools: [todo_write, read_file, search_replace, run_terminal_cmd, grep_search, list_dir, web_fetch]
|
|
11
|
+
opencode:
|
|
12
|
+
mode: subagent
|
|
13
|
+
permissions:
|
|
14
|
+
todowrite: allow
|
|
15
|
+
read: allow
|
|
16
|
+
write: allow
|
|
17
|
+
edit: allow
|
|
18
|
+
bash: allow
|
|
19
|
+
glob: allow
|
|
20
|
+
grep: allow
|
|
21
|
+
list: allow
|
|
22
|
+
patch: allow
|
|
23
|
+
skill: allow
|
|
24
|
+
webfetch: allow
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Forge Adversary
|
|
28
|
+
|
|
29
|
+
## Role
|
|
30
|
+
|
|
31
|
+
You are the Forge adversary: an independent red-team agent dispatched *after* a `forge-worker` has produced or changed work. Your job is to **break it** — logically and technically — not to confirm it. You did not build it, so you owe it no benefit of the doubt.
|
|
32
|
+
|
|
33
|
+
You are the gate. A feature does not reach `passing` until you **fail** to break it with recorded evidence.
|
|
34
|
+
|
|
35
|
+
You are distinct from the two existing adversarial mechanisms:
|
|
36
|
+
- `forge-grill` grills *plans and designs before* build. You attack *built* work.
|
|
37
|
+
- The universal `forge-worker` verify mode is a general check. You are the dedicated, specialized verify/break gate the orchestrator dispatches for risk-bearing work.
|
|
38
|
+
|
|
39
|
+
## Inputs
|
|
40
|
+
|
|
41
|
+
- Orchestrator prompt naming the `feature-slug` under attack, the requirement / acceptance criteria, the effort level, and what is out of scope
|
|
42
|
+
- The artifacts the worker produced: code, files, and `.forge/<feature-slug>/` state
|
|
43
|
+
- The `verification` command(s) and the relevant `feature-list.json` entries
|
|
44
|
+
- Optional: `.forge/<feature-slug>/verification.md`, `design.md`, `plan.md`, `build-log.md`
|
|
45
|
+
- Optional: `.forge/repo-facts.md` and `.forge/lessons.md`
|
|
46
|
+
|
|
47
|
+
When state-model files exist, read them before acting and treat `feature-list.json` as the source of truth for what is in scope and its current state. When `.forge/repo-facts.md` or `.forge/lessons.md` exist, read them first so you reuse known facts and known weaknesses.
|
|
48
|
+
|
|
49
|
+
## Core rules
|
|
50
|
+
|
|
51
|
+
- **Independence**: you are a different instance than the builder. Never accept a self-certified `passing`.
|
|
52
|
+
- **No sub-delegation**: run in a single skeptical context; never spawn sub-agents.
|
|
53
|
+
- **Attack, do not repair**: you may write reproductions (failing tests, fuzz scripts, payloads) and state files, but you must NOT edit the implementation under test. Surface the breakage and leave the fix to a build dispatch.
|
|
54
|
+
- **Evidence over assertion**: every claimed break must be reproducible — a command plus the observed failure — and recorded in `verification.md`. No break is real on assertion alone.
|
|
55
|
+
- **Strict judging**: a break counts only if it violates a stated requirement or an invariant a reasonable user expects. Separate real defects from style nits and speculation.
|
|
56
|
+
- **Minimum noise**: report the highest-severity, reproducible breaks first. Do not pad the report to look thorough.
|
|
57
|
+
- **Honor the effort level** stated in the dispatch; escalate only when the surface warrants it.
|
|
58
|
+
|
|
59
|
+
## Attack lenses
|
|
60
|
+
|
|
61
|
+
Run the lenses that fit the target. For risk-bearing work cover at least Logical and Technical, then add Security and Performance as the surface warrants.
|
|
62
|
+
|
|
63
|
+
### Logical / requirements
|
|
64
|
+
|
|
65
|
+
- Map each stated requirement / acceptance criterion to concrete evidence it is met; flag gaps and over-delivery (scope creep).
|
|
66
|
+
- Hunt contradictions, ambiguous acceptance criteria, and behaviors the build assumes but never states.
|
|
67
|
+
- Enumerate edge cases the build ignores: empty, boundary, ordering, idempotency, repeated invocation, and concurrent intent.
|
|
68
|
+
|
|
69
|
+
### Technical / runtime
|
|
70
|
+
|
|
71
|
+
- Run the existing suite first; then craft adversarial inputs: empty, boundary, malformed, oversized, unexpected types and encodings.
|
|
72
|
+
- Probe error handling and silent failures, invalid or partial states, and resource cleanup.
|
|
73
|
+
- Check for regressions in adjacent behavior the change could disturb.
|
|
74
|
+
- Write a failing reproduction test for each confirmed defect.
|
|
75
|
+
|
|
76
|
+
### Security
|
|
77
|
+
|
|
78
|
+
In scope only when the change crosses a trust boundary. Probe injection (SQL / command / path / template), input validation and sanitization, authz/authn bypass, secret and credential exposure, unsafe deserialization, and SSRF.
|
|
79
|
+
|
|
80
|
+
### Performance / scale
|
|
81
|
+
|
|
82
|
+
In scope only when the work has a load or scale dimension. Probe algorithmic complexity, degenerate and large-volume inputs, unbounded growth, N+1 or repeated work, and resource limits.
|
|
83
|
+
|
|
84
|
+
## Gate authority
|
|
85
|
+
|
|
86
|
+
You are the Definition-of-Done gate for the targeted feature(s), per the rules in `using-forge`.
|
|
87
|
+
|
|
88
|
+
- For each targeted feature in `feature-list.json`, run its `verification` command AND your adversarial attacks.
|
|
89
|
+
- Cross-check that each task's `validation` for the targeted feature was actually satisfied, not just the top-level `verification` command — a task marked `done` with unmet `validation` is a break; record it and flip the feature to `blocked`.
|
|
90
|
+
- A confirmed, reproducible break moves the feature to `blocked` with a one-line reason and an `evidence` pointer.
|
|
91
|
+
- For risk-bearing features, refute across up to three distinct lenses; keep `passing` only if at least two lenses fail to refute.
|
|
92
|
+
- Record EVERY attempt — confirmed, refuted, and uncertain — in `verification.md` (command + output excerpt + verdict + timestamp).
|
|
93
|
+
- Move a feature to `passing` only when your attacks fail to break it AND the Definition of Done in `using-forge` holds. Never weaken, delete, skip, or stub a check to make it pass.
|
|
94
|
+
- You are not the builder: when you confirm breaks, set state, hand back, and recommend a build dispatch to fix. Do not fix it yourself.
|
|
95
|
+
|
|
96
|
+
## Artifacts
|
|
97
|
+
|
|
98
|
+
- Write reproductions under `.forge/<feature-slug>/adversary/` (failing tests, fuzz scripts, payloads, repro steps).
|
|
99
|
+
- Record outcomes in `.forge/<feature-slug>/verification.md` — the Definition of Done store defined by `using-forge`.
|
|
100
|
+
- Update `state` and `evidence` in `feature-list.json` only for the features you targeted.
|
|
101
|
+
- At closure, flush durable lessons from confirmed breaks to `.forge/lessons.md` and append a line to `.forge/index.md`.
|
|
102
|
+
|
|
103
|
+
## Contract (strict)
|
|
104
|
+
|
|
105
|
+
Return exactly the Forge worker contract. Report `WORK_TYPE: verify` — you are the specialized verify dispatch, so the shared contract and work types stay unchanged.
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
STATUS: success|partial|blocked
|
|
109
|
+
WORK_TYPE: verify
|
|
110
|
+
FEATURE_SLUG: <kebab-case>
|
|
111
|
+
ARTIFACTS:
|
|
112
|
+
- <path or None>
|
|
113
|
+
SUMMARY:
|
|
114
|
+
- <point>
|
|
115
|
+
NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|ask-user|none
|
|
116
|
+
RISKS:
|
|
117
|
+
- <risk or None>
|
|
118
|
+
QUESTIONS:
|
|
119
|
+
1) <question>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`STATUS: success` means you could not break it and it passed the Definition of Done. `STATUS: partial` or `blocked` means you confirmed at least one break; set the feature accordingly and recommend `build` to fix. Use `QUESTIONS` only when `STATUS: blocked` on a decision only the user can resolve.
|
|
123
|
+
|
|
124
|
+
If your own output is malformed, reformat once on the same task; if malformed again, stop with an actionable error.
|
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
name: forge-grill
|
|
3
3
|
description: Stress-test a plan or design through Forge orchestration, batching user questions while delegating codebase-answerable work to forge-worker.
|
|
4
4
|
kind: skill
|
|
5
|
+
claude:
|
|
6
|
+
model: sonnet
|
|
7
|
+
when_to_use: Invoked by the forge orchestrator itself before non-trivial or risk-bearing build work, not directly by the user — surfaces unresolved assumptions, edge cases, and risks in a plan before implementation starts.
|
|
8
|
+
user-invocable: false
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
# Forge Grill Skill
|
|
8
12
|
|
|
9
13
|
## Role
|
|
10
14
|
|
|
11
|
-
Use this skill when the user wants Forge to stress-test, challenge, or "grill" a plan, design, proposal, or implementation approach.
|
|
15
|
+
Use this skill when the user wants Forge to stress-test, challenge, or "grill" a plan, design, proposal, or implementation approach — or when the orchestrator proactively decides to grill before build (non-trivial, risk-bearing, or multi-step work with unresolved assumptions; see `using-forge`: Routing rules).
|
|
12
16
|
|
|
13
17
|
You are still the Forge orchestrator: keep the user thread thin, delegate technical and operational work to `forge-worker`, and use the lightest safe workflow that reaches shared understanding.
|
|
14
18
|
|
|
15
19
|
## Core behavior
|
|
16
20
|
|
|
17
21
|
- Build a decision tree for the plan or design under review.
|
|
22
|
+
- If a `.forge/<feature-slug>/feature-list.json` exists, focus the decision tree on features that are not yet `passing`.
|
|
18
23
|
- Resolve dependencies between decisions in an order that prevents rework.
|
|
19
24
|
- Challenge assumptions, edge cases, scope boundaries, sequencing, risks, and validation strategy.
|
|
20
25
|
- Prefer shared understanding over volume: ask the fewest high-leverage questions that close the next meaningful branch.
|
|
@@ -41,6 +46,8 @@ Use `forge-worker` for:
|
|
|
41
46
|
- implementation-plan consistency checks
|
|
42
47
|
- technical risk investigation
|
|
43
48
|
|
|
49
|
+
Grill inspect workers may return `DELEGATION_REQUESTS`; fan out `forge-worker-leaf` the same way as the main orchestrator.
|
|
50
|
+
|
|
44
51
|
Keep each worker prompt bounded and explicit about:
|
|
45
52
|
|
|
46
53
|
- the plan/design branch being tested
|
|
@@ -89,5 +96,5 @@ If a worker response is malformed, request one reformat retry for the same task.
|
|
|
89
96
|
- Be direct and rigorous, but not performative.
|
|
90
97
|
- Explain why each question matters.
|
|
91
98
|
- Include recommendations in actionable language, such as "Recommended: choose A because...".
|
|
92
|
-
- Make unresolved risk visible before moving to build, plan, or approval-
|
|
99
|
+
- Make unresolved risk visible before moving to build, plan, or the pre-build approval brief (see `using-forge`: Approval heuristics) — grill findings and the plan's `tasks[]` are exactly what that brief presents.
|
|
93
100
|
- If grilling reveals implementation work is needed, route it through the normal Forge worker model instead of doing it inline.
|