@guidobuilds/forge-ai 0.2.0 → 0.5.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 ADDED
@@ -0,0 +1,107 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ Versions prior to 0.3.0 are not reconstructed here; see git history for earlier changes.
9
+
10
+ ## [Unreleased]
11
+
12
+ ## [0.5.0] - 2026-06-20
13
+
14
+ ### Added
15
+
16
+ - **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.
17
+
18
+ ### Changed
19
+
20
+ - **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.
21
+ - **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.
22
+
23
+ ### Migration from 0.4.0
24
+
25
+ - 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.
26
+
27
+ ## [0.4.0] - 2026-06-16
28
+
29
+ ### Added
30
+
31
+ - **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.
32
+ - **`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`.
33
+ - **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.
34
+ - **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.
35
+ - **`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.
36
+ - **Persisted handoff/progress**: `progress.md` and `session-handoff.md` templates for cross-session continuity, created adaptively when work spans sessions or blocks.
37
+ - `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.
38
+ - 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.
39
+ - `--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.
40
+ - 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.
41
+ - **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.
42
+ - **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.
43
+ - **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.
44
+ - **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.
45
+ - **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).
46
+ - **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.
47
+ - **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.
48
+
49
+ ### Changed
50
+
51
+ - **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.
52
+
53
+ ### Migration from 0.3.0
54
+
55
+ - 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/`.
56
+ - 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.
57
+ - 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.
58
+
59
+ ## [0.3.0] - 2026-05-15
60
+
61
+ ### Added
62
+
63
+ - Unified canonical **artifact** model: all sources live under `artifacts/<name>/<name>.md` and declare `kind: agent | skill` in frontmatter. Each per-platform block can override `kind`, so one artifact renders as an agent on one platform and a skill on another.
64
+ - `forge` orchestrator installs as a Claude Code **skill** (`/forge`) on Claude Code, while remaining a primary agent on OpenCode and Codex. This fixes the previous setup where `forge` was installed as a Claude subagent and could not delegate to `forge-worker` (Claude subagents cannot call `Task`).
65
+ - Installer **classifies each destination** as one of `new`, `managed-unmodified`, `managed-modified`, or `foreign`, and prints the status next to each file (`[refresh]`, `[overwrite, backup -> …]`, `[foreign overwrite]`, `[new]`).
66
+ - **Automatic backups** of user-edited Forge files before overwrite or prune, stored under `~/.forge-ai/backups/<scope>/<ISO-timestamp>/<relative-path>`. A single timestamp directory groups all backups from one run.
67
+ - **Combined confirmation prompt** in interactive mode listing every file that needs the user's decision (edited overwrites, edited deletions, foreign overwrites) with the destination backup directory.
68
+ - Non-interactive installs refuse with exit code 1 when there are edited or foreign files and neither `--yes` nor `--force` is set, instead of silently overwriting.
69
+ - New diagnostic codes: `MANAGED_FILE_OVERWRITE`, `FOREIGN_FILE_OVERWRITE`, `MISSING_KIND`, `INVALID_KIND`, `INVALID_PLATFORM_KIND`, `OPENCODE_MODE_ON_SKILL`, `SUPPORT_FILES_NOT_COPIED`.
70
+ - Claude tool and model validation (`src/adapters/claude-known.ts`): unknown tools/models in agent frontmatter emit warnings instead of being silently accepted.
71
+ - Skill source directories now allow sibling files (groundwork for future support-file bundling); detected files emit an `info` diagnostic noting that copying is not yet implemented.
72
+
73
+ ### Changed
74
+
75
+ - Source layout: `agents/` and `skills/` directories are gone; everything moved to `artifacts/<name>/<name>.md`.
76
+ - `forge-worker` agent and `forge-worker` skill (previously two files with the same name in separate namespaces) merged into a **single** `forge-worker` artifact rendered as a subagent on every platform. The artificial "thin agent loads a skill" indirection is removed.
77
+ - `package.json` `files` now ships `artifacts/` instead of `agents/` + `skills/`.
78
+ - Refreshing a managed-unmodified file is **silent** — no warning emitted. Previously every existing destination produced an indiscriminate `OVERWRITE_FORCED`.
79
+ - Stale-managed files the user edited are now **backed up and deleted** during `update` (when `--yes`/`--force`); previously they were left on disk with a `CHECKSUM_MISMATCH` warning. Interactive runs prompt before backing up + deleting.
80
+ - OpenCode `permissions` keys switched from boolean (`true`/`false`) to explicit strings (`allow`/`deny`); orchestrator now explicitly denies file/code operations.
81
+ - Adapters consume a unified `CanonicalArtifact` type (with `body` field) instead of separate `CanonicalAgent`/`CanonicalSkill` types.
82
+ - Frontmatter parsing now uses the `yaml` library (replaces the hand-rolled parser), with stricter spec compliance and better edge-case handling (colons in descriptions, horizontal rules in bodies, BOM, CRLF).
83
+ - Claude agent `tools` and skill `allowed-tools` are emitted as comma-separated strings (matches Claude Code's native format).
84
+ - Development tooling migrated from npm to **pnpm**: `packageManager: "pnpm@11.1.1"` pinned via Corepack (no global install needed); `pnpm.onlyBuiltDependencies: []` allowlist is explicit so postinstall script blocking is documented behavior. The published package is unaffected — consumers still install via `npx`.
85
+
86
+ ### Removed
87
+
88
+ - `CanonicalAgent` and `CanonicalSkill` types (replaced by `CanonicalArtifact`).
89
+ - `agents/` and `skills/` source directories.
90
+ - `DESTINATION_EXISTS` error and `OVERWRITE_FORCED` warning (replaced by status-aware `MANAGED_FILE_OVERWRITE` and `FOREIGN_FILE_OVERWRITE`).
91
+ - `CHECKSUM_MISMATCH` warning during prune (the file is now backed up and deleted on consent).
92
+ - `package-lock.json` (replaced by `pnpm-lock.yaml`).
93
+
94
+ ### Fixed
95
+
96
+ - `forge` orchestrator deployment to Claude Code now actually works: it is installed as a `/forge` skill in the main thread, which retains the `Task` tool and can delegate to the `forge-worker` subagent. The previous subagent install was inert because Claude subagents cannot call `Task`.
97
+ - Installer no longer raises spurious overwrite warnings for files Forge installed itself and that have not been edited.
98
+
99
+ ### Security
100
+
101
+ - Migrated the development workflow to pnpm. pnpm 10+ **blocks postinstall scripts by default** (`onlyBuiltDependencies` allowlist), enforces strict `node_modules` (no phantom dependencies), and uses an auditable text lockfile (`pnpm-lock.yaml`). The npm registry is the same, but install-time defaults are hardened.
102
+ - User edits to Forge-managed files are **always backed up** before being overwritten or deleted, eliminating silent data loss when running `update` against a customized install.
103
+
104
+ ### Migration from 0.2.0
105
+
106
+ - Run `npx @guidobuilds/forge-ai update` (not `install`) after upgrading. `update` prunes the now-orphaned `.claude/agents/forge.md` and the old standalone `forge-worker` skill from the previous layout. Local edits to any of those files are backed up automatically to `~/.forge-ai/backups/`.
107
+ - `install` (without `update`) will leave the orphaned files on disk. They are harmless but unmanaged.
package/README.md CHANGED
@@ -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.
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,21 @@ 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`).
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
+ Two rules make "done" mean done:
76
+
77
+ - **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.
78
+ - **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.
79
+
80
+ Trivial, surgical changes skip all of this and stay on the `build -> verify` path.
81
+
65
82
  ## Supported Agents
66
83
 
67
84
  Forge currently installs support for:
@@ -69,6 +86,7 @@ Forge currently installs support for:
69
86
  - OpenCode
70
87
  - Codex
71
88
  - Claude Code
89
+ - Grok Build
72
90
 
73
91
  The same operating model is shared across all supported agents so the workflow stays mostly consistent even when the underlying tool changes.
74
92
 
@@ -106,13 +124,104 @@ Validate a local Forge source tree:
106
124
  npx @guidobuilds/forge-ai validate --source .
107
125
  ```
108
126
 
127
+ ## How to Use
128
+
129
+ 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.
130
+
131
+ ### The pieces
132
+
133
+ Forge is one orchestrator, a universal worker, and a dedicated adversary, with two supporting skills:
134
+
135
+ - **`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.
136
+ - **`forge-worker`** — the worker. It does the inspect / design / plan / build / operate / verify work in its own context and reports back. This is what keeps the orchestrator's context clean.
137
+ - **`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.
138
+ - **`using-forge`** — the shared operating-model skill the orchestrator follows.
139
+ - **`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.
140
+
141
+ What changes per platform is the **kind** each piece is installed as, and therefore how you trigger it.
142
+
143
+ ### Claude Code
144
+
145
+ | Piece | Installed as | How you invoke it |
146
+ |---|---|---|
147
+ | `forge` | skill | type `/forge` in the prompt |
148
+ | `forge-grill` | skill | type `/forge-grill` |
149
+ | `using-forge` | skill | `/using-forge` (usually pulled in by `/forge`) |
150
+ | `forge-worker` | subagent | the main thread delegates to it; or say "use the forge-worker subagent" |
151
+ | `forge-adversary` | subagent | the orchestrator delegates to it after build to gate risk-bearing work |
152
+
153
+ Start a session by typing **`/forge`**. That loads the orchestrator role into your main Claude Code thread, which then delegates each bounded task to the `forge-worker` subagent (via the Task tool), keeping your main conversation thin.
154
+
155
+ > Why a skill and not an agent on Claude? A Claude Code subagent cannot itself spawn subagents (it has no Task tool), so the orchestrator has to live in the main thread — and the way you inject behavior into the main thread is a skill. The trade-off: the "delegate, never do worker work inline" discipline is followed by instruction, not enforced by tool restrictions, because a skill cannot remove tools from the main thread.
156
+
157
+ ### OpenCode
158
+
159
+ | Piece | Installed as | How you invoke it |
160
+ |---|---|---|
161
+ | `forge` | primary agent | switch your active agent to `forge` |
162
+ | `forge-worker` | subagent | the `forge` agent delegates to it |
163
+ | `forge-adversary` | subagent | the `forge` agent delegates to it to gate risk-bearing work after build |
164
+ | `using-forge`, `forge-grill` | skills | loaded by the agent as needed |
165
+
166
+ 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.
167
+
168
+ ### Codex
169
+
170
+ | Piece | Installed as | Location |
171
+ |---|---|---|
172
+ | `forge`, `forge-worker`, `forge-adversary` | agents (`.toml`) | `~/.codex/agents/` (or `.codex/agents/` per project) |
173
+ | `using-forge`, `forge-grill` | skills | `~/.agents/skills/` (or `.agents/skills/` per project) |
174
+
175
+ 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.
176
+
177
+ ### Project vs user scope
178
+
179
+ ### Grok Build
180
+
181
+ | Piece | Installed as | How you invoke it |
182
+ |---|---|---|
183
+ | `forge` | skill | type `/forge` in the prompt |
184
+ | `forge-grill` | skill | type `/forge-grill` |
185
+ | `using-forge` | skill | `/using-forge` (usually pulled in by `/forge`) |
186
+ | `forge-worker` | subagent | the main thread delegates to it via the `task` tool |
187
+ | `forge-adversary` | subagent | the orchestrator delegates to it after build to gate risk-bearing work |
188
+
189
+ 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.
190
+
191
+ > **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.
192
+
193
+ ### Project vs user scope
194
+
195
+ 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.
196
+
197
+ ## Optional: enforce the gate with hooks (Claude Code)
198
+
199
+ 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.
200
+
201
+ ```json
202
+ {
203
+ "hooks": {
204
+ "Stop": [
205
+ { "hooks": [ { "type": "command", "command": "<your project's verification command, e.g. pnpm test --silent>" } ] }
206
+ ],
207
+ "PostToolUse": [
208
+ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "<your fast type/lint check, e.g. pnpm typecheck>" } ] }
209
+ ]
210
+ }
211
+ }
212
+ ```
213
+
214
+ 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.
215
+
109
216
  ## Local Development
110
217
 
218
+ 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.
219
+
111
220
  From a local checkout:
112
221
 
113
222
  ```sh
114
- npm install
115
- npm run build
223
+ pnpm install
224
+ pnpm run build
116
225
  node bin/forge-ai.mjs install --source . --platform all --scope user
117
226
  ```
118
227
 
@@ -124,16 +233,28 @@ node bin/forge-ai.mjs install --source . --platform all --scope project --dry-ru
124
233
 
125
234
  ## Updating
126
235
 
127
- Run the npm updater:
236
+ If you have Forge installed globally, the simplest way is:
128
237
 
129
238
  ```sh
130
- npx @guidobuilds/forge-ai update
239
+ forge-ai self-update
240
+ ```
241
+
242
+ 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.
243
+
244
+ 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.
245
+
246
+ If you don't have a global install (running via `npx`):
247
+
248
+ ```sh
249
+ npx @guidobuilds/forge-ai@latest update
131
250
  ```
132
251
 
133
252
  Forge replaces its managed agent and skill definitions in your supported agent configuration directories.
134
253
 
135
254
  Forge records installed files in manifests under `~/.forge-ai/` so updates can safely remove files that are no longer bundled. `update` prunes stale managed files by default only when the current file still matches the recorded checksum; use `--no-prune` to keep stale managed files. `--dry-run` previews writes and deletes without changing files or manifests.
136
255
 
256
+ Forge now routes a single canonical artifact to the right artifact kind per agent: the orchestrator installs as a Claude Code skill (`/forge`) but as an agent on OpenCode and Codex. If you installed an earlier version, run `update` (not `install`) so Forge prunes the now-stale `forge` agent and standalone `forge-worker` skill left by the previous layout.
257
+
137
258
  ## Uninstalling
138
259
 
139
260
  Remove Forge from the agent configuration directories for OpenCode, Codex, or Claude Code by deleting the installed Forge agent and skill entries.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: forge
3
+ description: Forge orchestrator with dynamic runtime routing and a single worker type
4
+ kind: agent
5
+ claude:
6
+ kind: skill
7
+ grok:
8
+ kind: skill
9
+ opencode:
10
+ mode: primary
11
+ permissions:
12
+ task: allow
13
+ question: allow
14
+ todowrite: allow
15
+ read: deny
16
+ write: deny
17
+ edit: deny
18
+ bash: deny
19
+ glob: deny
20
+ grep: deny
21
+ list: deny
22
+ patch: deny
23
+ skill: allow
24
+ webfetch: deny
25
+ ---
26
+
27
+ # Role
28
+ You are Forge, the Forge orchestrator.
29
+
30
+ Load and follow the `using-forge` skill before routing work.
31
+
32
+ You are a coordinator, not an executor.
33
+
34
+ The `using-forge` skill owns runtime routing, operating principles, approval heuristics, artifact conventions, concurrency guidance, and shared definitions.
35
+
36
+ ## Orchestrator rules
37
+ - Never do worker work inline.
38
+ - Never do non-development execution work inline.
39
+ - Delegate all technical and operational work to Forge workers.
40
+ - Keep one thin thread with the user.
41
+ - Choose the lightest safe routing permitted by the skill.
42
+ - Before the first dispatch, state the chosen route to the user (see `using-forge`: Route announcement).
43
+ - 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).
44
+ - Enforce the Forge worker contract strictly.
45
+ - Assign an effort level per dispatch and delegate by size (see `using-forge`: Effort routing, Routing rules).
46
+
47
+ ## Worker model
48
+ - `forge-worker` is the only universal worker type; route all build and operational work to it.
49
+ - `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`.
50
+ - You may launch one worker instance for a bounded task.
51
+ - You may launch multiple `forge-worker` instances in sequence when one result should shape the next delegation.
52
+ - You may launch multiple `forge-worker` instances in parallel when subgoals are sufficiently independent.
53
+ - Keep each worker invocation narrowly scoped so multiple instances do not collide on the same ownership or files unless deliberate.
54
+
55
+ ## State model
56
+ - Size the state model to the work. Keep trivial, surgical changes light: route `build -> verify` with no state artifacts.
57
+ - 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.
58
+ - A feature reaches `passing` only via recorded verification evidence (the Definition of Done in `using-forge`).
59
+ - 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.
60
+ - 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`).
61
+
62
+ ## Contract enforcement
63
+ Each worker response must include:
64
+
65
+ ```text
66
+ STATUS: success|partial|blocked
67
+ WORK_TYPE: inspect|design|plan|build|operate|verify|mixed
68
+ FEATURE_SLUG: <kebab-case>
69
+ ARTIFACTS:
70
+ - <path or None>
71
+ SUMMARY:
72
+ - <point>
73
+ NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|ask-user|none
74
+ RISKS:
75
+ - <risk or None>
76
+ QUESTIONS:
77
+ 1) <question>
78
+ ```
79
+
80
+ `QUESTIONS` appears only when `STATUS: blocked`.
81
+
82
+ If output is malformed:
83
+ 1) request one reformat retry with same task_id
84
+ 2) if malformed again, stop with actionable error
@@ -0,0 +1,122 @@
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
+ - **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.
53
+ - **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.
54
+ - **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.
55
+ - **Minimum noise**: report the highest-severity, reproducible breaks first. Do not pad the report to look thorough.
56
+ - **Honor the effort level** stated in the dispatch; escalate only when the surface warrants it.
57
+
58
+ ## Attack lenses
59
+
60
+ 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.
61
+
62
+ ### Logical / requirements
63
+
64
+ - Map each stated requirement / acceptance criterion to concrete evidence it is met; flag gaps and over-delivery (scope creep).
65
+ - Hunt contradictions, ambiguous acceptance criteria, and behaviors the build assumes but never states.
66
+ - Enumerate edge cases the build ignores: empty, boundary, ordering, idempotency, repeated invocation, and concurrent intent.
67
+
68
+ ### Technical / runtime
69
+
70
+ - Run the existing suite first; then craft adversarial inputs: empty, boundary, malformed, oversized, unexpected types and encodings.
71
+ - Probe error handling and silent failures, invalid or partial states, and resource cleanup.
72
+ - Check for regressions in adjacent behavior the change could disturb.
73
+ - Write a failing reproduction test for each confirmed defect.
74
+
75
+ ### Security
76
+
77
+ 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.
78
+
79
+ ### Performance / scale
80
+
81
+ 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.
82
+
83
+ ## Gate authority
84
+
85
+ You are the Definition-of-Done gate for the targeted feature(s), per the rules in `using-forge`.
86
+
87
+ - For each targeted feature in `feature-list.json`, run its `verification` command AND your adversarial attacks.
88
+ - A confirmed, reproducible break moves the feature to `blocked` with a one-line reason and an `evidence` pointer.
89
+ - For risk-bearing features, refute across up to three distinct lenses; keep `passing` only if at least two lenses fail to refute.
90
+ - Record EVERY attempt — confirmed, refuted, and uncertain — in `verification.md` (command + output excerpt + verdict + timestamp).
91
+ - 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.
92
+ - 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.
93
+
94
+ ## Artifacts
95
+
96
+ - Write reproductions under `.forge/<feature-slug>/adversary/` (failing tests, fuzz scripts, payloads, repro steps).
97
+ - Record outcomes in `.forge/<feature-slug>/verification.md` — the Definition of Done store defined by `using-forge`.
98
+ - Update `state` and `evidence` in `feature-list.json` only for the features you targeted.
99
+ - At closure, flush durable lessons from confirmed breaks to `.forge/lessons.md` and append a line to `.forge/index.md`.
100
+
101
+ ## Contract (strict)
102
+
103
+ 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.
104
+
105
+ ```text
106
+ STATUS: success|partial|blocked
107
+ WORK_TYPE: verify
108
+ FEATURE_SLUG: <kebab-case>
109
+ ARTIFACTS:
110
+ - <path or None>
111
+ SUMMARY:
112
+ - <point>
113
+ NEXT_RECOMMENDED: inspect|design|plan|build|operate|verify|ask-user|none
114
+ RISKS:
115
+ - <risk or None>
116
+ QUESTIONS:
117
+ 1) <question>
118
+ ```
119
+
120
+ `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.
121
+
122
+ If your own output is malformed, reformat once on the same task; if malformed again, stop with an actionable error.
@@ -1,19 +1,21 @@
1
1
  ---
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
+ kind: skill
4
5
  ---
5
6
 
6
7
  # Forge Grill Skill
7
8
 
8
9
  ## Role
9
10
 
10
- Use this skill when the user wants Forge to stress-test, challenge, or "grill" a plan, design, proposal, or implementation approach.
11
+ 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).
11
12
 
12
13
  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.
13
14
 
14
15
  ## Core behavior
15
16
 
16
17
  - Build a decision tree for the plan or design under review.
18
+ - If a `.forge/<feature-slug>/feature-list.json` exists, focus the decision tree on features that are not yet `passing`.
17
19
  - Resolve dependencies between decisions in an order that prevents rework.
18
20
  - Challenge assumptions, edge cases, scope boundaries, sequencing, risks, and validation strategy.
19
21
  - Prefer shared understanding over volume: ask the fewest high-leverage questions that close the next meaningful branch.