ai-forge-cli 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {ai_forge_cli-2.0.0/src/ai_forge_cli.egg-info → ai_forge_cli-2.0.1}/PKG-INFO +1 -1
  2. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/README.md +4 -4
  3. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/pyproject.toml +2 -2
  4. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1/src/ai_forge_cli.egg-info}/PKG-INFO +1 -1
  5. ai_forge_cli-2.0.1/src/ai_forge_cli.egg-info/SOURCES.txt +57 -0
  6. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/init.py +89 -6
  7. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/update.py +3 -0
  8. ai_forge_cli-2.0.1/src/cli/skills/forge-build/SKILL.md +146 -0
  9. ai_forge_cli-2.0.1/src/cli/skills/forge-build/references/framework.md +564 -0
  10. ai_forge_cli-2.0.1/src/cli/skills/forge-build/references/framework.yaml +228 -0
  11. ai_forge_cli-2.0.1/src/cli/skills/forge-build/references/templates.yaml +364 -0
  12. ai_forge_cli-2.0.1/src/cli/skills/forge-cast/SKILL.md +136 -0
  13. ai_forge_cli-2.0.1/src/cli/skills/forge-cast/references/framework.md +564 -0
  14. ai_forge_cli-2.0.1/src/cli/skills/forge-cast/references/framework.yaml +228 -0
  15. ai_forge_cli-2.0.1/src/cli/skills/forge-cast/references/templates.yaml +364 -0
  16. ai_forge_cli-2.0.1/src/cli/skills/forge-design/SKILL.md +107 -0
  17. ai_forge_cli-2.0.1/src/cli/skills/forge-design/references/framework.md +564 -0
  18. ai_forge_cli-2.0.1/src/cli/skills/forge-design/references/framework.yaml +228 -0
  19. ai_forge_cli-2.0.1/src/cli/skills/forge-design/references/templates.yaml +364 -0
  20. ai_forge_cli-2.0.1/src/cli/skills/forge-review/SKILL.md +218 -0
  21. ai_forge_cli-2.0.1/src/cli/skills/forge-review/references/framework.md +564 -0
  22. ai_forge_cli-2.0.1/src/cli/skills/forge-review/references/framework.yaml +228 -0
  23. ai_forge_cli-2.0.1/src/cli/skills/forge-review/references/templates.yaml +364 -0
  24. ai_forge_cli-2.0.1/src/cli/skills/forge-spec/SKILL.md +144 -0
  25. ai_forge_cli-2.0.1/src/cli/skills/forge-spec/references/framework.md +564 -0
  26. ai_forge_cli-2.0.1/src/cli/skills/forge-spec/references/framework.yaml +228 -0
  27. ai_forge_cli-2.0.1/src/cli/skills/forge-spec/references/templates.yaml +364 -0
  28. ai_forge_cli-2.0.1/src/cli/skills/forge-validate/SKILL.md +143 -0
  29. ai_forge_cli-2.0.1/src/cli/skills/forge-validate/references/framework.md +564 -0
  30. ai_forge_cli-2.0.1/src/cli/skills/forge-validate/references/framework.yaml +228 -0
  31. ai_forge_cli-2.0.1/src/cli/skills/forge-validate/references/templates.yaml +364 -0
  32. ai_forge_cli-2.0.0/src/ai_forge_cli.egg-info/SOURCES.txt +0 -33
  33. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/LICENSE +0 -0
  34. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/setup.cfg +0 -0
  35. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/ai_forge_cli.egg-info/dependency_links.txt +0 -0
  36. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/ai_forge_cli.egg-info/entry_points.txt +0 -0
  37. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/ai_forge_cli.egg-info/requires.txt +0 -0
  38. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/ai_forge_cli.egg-info/top_level.txt +0 -0
  39. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/__init__.py +0 -0
  40. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/__main__.py +0 -0
  41. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/bundle.py +0 -0
  42. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/__init__.py +0 -0
  43. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/base.py +0 -0
  44. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/context.py +0 -0
  45. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/find.py +0 -0
  46. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/graph.py +0 -0
  47. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/inspect.py +0 -0
  48. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/list_cmd.py +0 -0
  49. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/commands/validate.py +0 -0
  50. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/common.py +0 -0
  51. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/forge.py +0 -0
  52. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/framework.yaml +0 -0
  53. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/index.py +0 -0
  54. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/src/cli/walker.py +0 -0
  55. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_cli.py +0 -0
  56. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_find.py +0 -0
  57. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_index.py +0 -0
  58. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_init.py +0 -0
  59. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_update.py +0 -0
  60. {ai_forge_cli-2.0.0 → ai_forge_cli-2.0.1}/tests/test_walker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ai-forge-cli
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Context walker for the Forge spec system
5
5
  Requires-Python: >=3.11
6
6
  License-File: LICENSE
@@ -25,7 +25,7 @@ A hierarchical YAML spec system, a Python CLI for context assembly, and **six ag
25
25
 
26
26
  Built on the premise that **people explain systems well under questioning but poorly when cold-prompted**. Forge inverts the default "human prompts agent → agent implements" loop into "agent interviews human → structured spec emerges → agent implements from spec".
27
27
 
28
- Runs in **Claude Code** and any **agentskills.io-compatible client** (VS Code Copilot, Cursor).
28
+ Runs in any agent client that supports skills: **Claude Code**, **OpenAI Codex CLI**, **VS Code Copilot**, **Cursor**, and any other agentskills.io-compatible client.
29
29
 
30
30
  ---
31
31
 
@@ -64,7 +64,7 @@ uv venv --python 3.13 .venv && uv pip install -e . pytest
64
64
  ./scripts/install-skills.sh install
65
65
  ```
66
66
 
67
- This wires the `forge` binary into `~/.local/bin/` and symlinks the six skills into `~/.claude/skills/` and `~/.agents/skills/` — discoverable by every supported client.
67
+ This wires the `forge` binary into `~/.local/bin/` and symlinks the six skills into `~/.claude/skills/`, `~/.codex/skills/`, and `~/.agents/skills/` — discoverable by every supported client.
68
68
 
69
69
  ### Verify
70
70
 
@@ -80,7 +80,7 @@ forge --help # shows: init, update, context, list, inspect, find, v
80
80
  |---|---|
81
81
  | Python | ≥ 3.13 |
82
82
  | Package manager | [`uv`](https://docs.astral.sh/uv/) recommended; pip works |
83
- | Agent client | Claude Code or an agentskills.io-compatible client |
83
+ | Agent client | Claude Code, Codex CLI, or any agentskills.io-compatible client |
84
84
 
85
85
  If `forge: command not found`: add `~/.local/bin` to PATH.
86
86
 
@@ -156,7 +156,7 @@ Spec-dir resolution order: `--spec-dir` flag > `$FORGE_SPEC_DIR` env var > auto-
156
156
  | **forge-build** | Implementation orchestrator | Reviewed spec corpus | Code + tests dispatched via parallel subagents, each using `forge context <id>` |
157
157
  | **forge-validate** | Post-implementation validator | Implemented system + spec | Static analysis, test coverage, behavioral probes, workbench/validation.md |
158
158
 
159
- Skills activate via natural-language prompts (universal) or slash-commands (Claude Code only).
159
+ Skills activate via natural-language prompts in any supported client, or slash-commands where the client supports them.
160
160
 
161
161
  ---
162
162
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ai-forge-cli"
7
- version = "2.0.0"
7
+ version = "2.0.1"
8
8
  description = "Context walker for the Forge spec system"
9
9
  requires-python = ">=3.11"
10
10
  dependencies = ["pyyaml>=6.0"]
@@ -17,7 +17,7 @@ where = ["src"]
17
17
  include = ["cli*"]
18
18
 
19
19
  [tool.setuptools.package-data]
20
- cli = ["framework.yaml"]
20
+ cli = ["framework.yaml", "skills/*/SKILL.md", "skills/*/references/*", "skills/*/assets/**/*"]
21
21
 
22
22
  [tool.pytest.ini_options]
23
23
  testpaths = ["tests"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ai-forge-cli
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Context walker for the Forge spec system
5
5
  Requires-Python: >=3.11
6
6
  License-File: LICENSE
@@ -0,0 +1,57 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ai_forge_cli.egg-info/PKG-INFO
5
+ src/ai_forge_cli.egg-info/SOURCES.txt
6
+ src/ai_forge_cli.egg-info/dependency_links.txt
7
+ src/ai_forge_cli.egg-info/entry_points.txt
8
+ src/ai_forge_cli.egg-info/requires.txt
9
+ src/ai_forge_cli.egg-info/top_level.txt
10
+ src/cli/__init__.py
11
+ src/cli/__main__.py
12
+ src/cli/bundle.py
13
+ src/cli/common.py
14
+ src/cli/forge.py
15
+ src/cli/framework.yaml
16
+ src/cli/index.py
17
+ src/cli/walker.py
18
+ src/cli/commands/__init__.py
19
+ src/cli/commands/base.py
20
+ src/cli/commands/context.py
21
+ src/cli/commands/find.py
22
+ src/cli/commands/graph.py
23
+ src/cli/commands/init.py
24
+ src/cli/commands/inspect.py
25
+ src/cli/commands/list_cmd.py
26
+ src/cli/commands/update.py
27
+ src/cli/commands/validate.py
28
+ src/cli/skills/forge-build/SKILL.md
29
+ src/cli/skills/forge-build/references/framework.md
30
+ src/cli/skills/forge-build/references/framework.yaml
31
+ src/cli/skills/forge-build/references/templates.yaml
32
+ src/cli/skills/forge-cast/SKILL.md
33
+ src/cli/skills/forge-cast/references/framework.md
34
+ src/cli/skills/forge-cast/references/framework.yaml
35
+ src/cli/skills/forge-cast/references/templates.yaml
36
+ src/cli/skills/forge-design/SKILL.md
37
+ src/cli/skills/forge-design/references/framework.md
38
+ src/cli/skills/forge-design/references/framework.yaml
39
+ src/cli/skills/forge-design/references/templates.yaml
40
+ src/cli/skills/forge-review/SKILL.md
41
+ src/cli/skills/forge-review/references/framework.md
42
+ src/cli/skills/forge-review/references/framework.yaml
43
+ src/cli/skills/forge-review/references/templates.yaml
44
+ src/cli/skills/forge-spec/SKILL.md
45
+ src/cli/skills/forge-spec/references/framework.md
46
+ src/cli/skills/forge-spec/references/framework.yaml
47
+ src/cli/skills/forge-spec/references/templates.yaml
48
+ src/cli/skills/forge-validate/SKILL.md
49
+ src/cli/skills/forge-validate/references/framework.md
50
+ src/cli/skills/forge-validate/references/framework.yaml
51
+ src/cli/skills/forge-validate/references/templates.yaml
52
+ tests/test_cli.py
53
+ tests/test_find.py
54
+ tests/test_index.py
55
+ tests/test_init.py
56
+ tests/test_update.py
57
+ tests/test_walker.py
@@ -1,8 +1,8 @@
1
1
  """`forge init` — scaffold a new Forge project in the current directory.
2
2
 
3
3
  Creates spec/ with framework.yaml (bundled vocabulary) and a blank
4
- conception.yaml stub. The directory layout under spec/ is created by the
5
- user as they build out the spec; init only provides the anchors.
4
+ conception.yaml stub. Also symlinks the six Forge skills into the agent
5
+ skill directories used by Claude Code, Codex CLI, and agentskills.io clients.
6
6
  """
7
7
 
8
8
  from __future__ import annotations
@@ -18,15 +18,32 @@ import cli
18
18
  NAME = "init"
19
19
  HELP = "Scaffold a new Forge project in the current directory."
20
20
  DESCRIPTION = (
21
- "Creates the spec/ directory and copies framework.yaml (the bundled "
22
- "framework vocabulary: enums, built-in scalars, built-in errors) into it. "
23
- "Also writes a blank conception.yaml stub. Run in a new or empty project "
24
- "directory to bootstrap."
21
+ "Creates the spec/ directory, copies framework.yaml (the bundled "
22
+ "framework vocabulary: enums, built-in scalars, built-in errors), "
23
+ "writes a blank conception.yaml stub, and symlinks the six Forge skills "
24
+ "into ~/.claude/skills/, ~/.codex/skills/, and ~/.agents/skills/."
25
25
  )
26
26
 
27
27
  # Markers that indicate an existing Forge project.
28
28
  _EXISTING_MARKERS = ("conception.yaml", "framework.yaml")
29
29
 
30
+ # Skill names bundled with the package.
31
+ SKILL_NAMES = (
32
+ "forge-design",
33
+ "forge-spec",
34
+ "forge-review",
35
+ "forge-build",
36
+ "forge-validate",
37
+ "forge-cast",
38
+ )
39
+
40
+ # Global skill scan directories (one per supported agent client).
41
+ _SKILL_SCAN_DIRS = (
42
+ Path.home() / ".claude" / "skills",
43
+ Path.home() / ".codex" / "skills",
44
+ Path.home() / ".agents" / "skills",
45
+ )
46
+
30
47
  # --- Banner -------------------------------------------------------------------
31
48
 
32
49
  _RESET = "\033[0m"
@@ -132,6 +149,10 @@ def register(sub: argparse._SubParsersAction) -> None:
132
149
  "--no-banner", action="store_true",
133
150
  help="Skip the init banner animation.",
134
151
  )
152
+ p.add_argument(
153
+ "--skip-skills", action="store_true",
154
+ help="Skip skill symlink installation.",
155
+ )
135
156
  p.set_defaults(handler=run)
136
157
 
137
158
 
@@ -170,6 +191,11 @@ def run(args: argparse.Namespace) -> int:
170
191
  # Write blank conception.yaml stub.
171
192
  _install_conception(spec_dir, force=args.force, ok=ok)
172
193
 
194
+ # Symlink skills into agent client scan directories.
195
+ if not args.skip_skills:
196
+ print()
197
+ _install_skills(force=args.force, ok=ok)
198
+
173
199
  print()
174
200
  print(_divider("Next steps"))
175
201
  print()
@@ -217,3 +243,60 @@ def _install_conception(spec_dir: Path, *, force: bool, ok: str) -> None:
217
243
  return
218
244
  dest.write_text(_CONCEPTION_STUB, encoding="utf-8")
219
245
  print(f" {ok} spec/conception.yaml {_dim('(fill in your conception details)')}")
246
+
247
+
248
+ def _skills_src() -> Path | None:
249
+ """Return the bundled skills directory, or None if not found."""
250
+ cli_dir = Path(cli.__file__).resolve().parent
251
+ skills_dir = cli_dir / "skills"
252
+ return skills_dir if skills_dir.is_dir() else None
253
+
254
+
255
+ def _install_skills(*, force: bool, ok: str) -> None:
256
+ """Symlink each bundled skill into all agent client scan directories."""
257
+ skills_dir = _skills_src()
258
+ if skills_dir is None:
259
+ print(_dim(" - skills directory not found in package; skipping"))
260
+ return
261
+
262
+ linked = 0
263
+ skipped = 0
264
+ errors = 0
265
+
266
+ for scan_dir in _SKILL_SCAN_DIRS:
267
+ try:
268
+ scan_dir.mkdir(parents=True, exist_ok=True)
269
+ except OSError:
270
+ continue
271
+
272
+ for name in SKILL_NAMES:
273
+ src = skills_dir / name
274
+ if not src.is_dir():
275
+ continue
276
+ dest = scan_dir / name
277
+
278
+ if dest.is_symlink():
279
+ if force:
280
+ dest.unlink()
281
+ else:
282
+ skipped += 1
283
+ continue
284
+ elif dest.exists():
285
+ errors += 1
286
+ print(f" {_color(160, '✗')} {dest} exists and is not a symlink — skipping")
287
+ continue
288
+
289
+ try:
290
+ dest.symlink_to(src)
291
+ linked += 1
292
+ except OSError as e:
293
+ errors += 1
294
+ print(f" {_color(160, '✗')} could not link {dest}: {e}")
295
+
296
+ if linked:
297
+ short_dirs = ", ".join(f"~/{d.relative_to(Path.home())}" for d in _SKILL_SCAN_DIRS)
298
+ print(f" {ok} {linked} skill link{'s' if linked != 1 else ''} → {short_dirs}")
299
+ if skipped:
300
+ print(_dim(f" - {skipped} skill link{'s' if skipped != 1 else ''} already present; use --force to refresh"))
301
+ if not linked and not skipped and not errors:
302
+ print(_dim(" - no skills to install"))
@@ -64,6 +64,9 @@ def run(args: argparse.Namespace) -> int:
64
64
 
65
65
  init_cmd._install_framework(spec_dir, force=args.force, ok=ok)
66
66
 
67
+ print()
68
+ init_cmd._install_skills(force=args.force, ok=ok)
69
+
67
70
  print()
68
71
  print(init_cmd._divider("Done"))
69
72
  print()
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: forge-build
3
+ description: >
4
+ Forge implementation orchestrator. Use when the spec is complete and reviewed (forge-review
5
+ has run clean) and the user wants to generate working implementation code and tests.
6
+ Writes a dynamic task list to workbench/build-plan.md, then dispatches subagents to implement
7
+ each task using `forge context` to pull their own context from the CLI. Subagent granularity
8
+ is determined dynamically based on system size. Orchestrator retries failures automatically
9
+ before surfacing to the human.
10
+ Triggers on: "implement this", "build the code", "forge-build", or any request to generate
11
+ implementation from a complete Forge spec.
12
+ ---
13
+
14
+ # forge-build
15
+
16
+ Read `references/framework.md` before starting. Read `workbench/discovery.md` for system context.
17
+
18
+ ## Purpose
19
+
20
+ Orchestrate implementation of a complete, reviewed Forge spec. The orchestrator plans, dispatches subagents, tracks progress, and retries failures. Subagents are isolated — each one receives only a task ID and runs `forge context` to get everything it needs.
21
+
22
+ ## Step 1 — System Assessment
23
+
24
+ Before writing anything:
25
+
26
+ ```bash
27
+ forge list --kind element --ids-only # enumerate all elements
28
+ forge list --kind module # understand module boundaries
29
+ forge validate # must be clean before proceeding
30
+ ```
31
+
32
+ If `forge validate` has errors, stop and tell the human to run `forge-review` first.
33
+
34
+ Count elements and determine task granularity:
35
+
36
+ | System size | Granularity |
37
+ |-------------|-------------|
38
+ | < 10 elements | module-level tasks (one subagent implements all elements in a module) |
39
+ | 10–40 elements | element-level tasks (one subagent per element) |
40
+ | > 40 elements | element-level tasks with parallel dispatch (multiple subagents concurrently) |
41
+
42
+ ## Step 2 — Build Plan
43
+
44
+ Write `workbench/build-plan.md` before dispatching any subagents:
45
+
46
+ ```markdown
47
+ # Build Plan — <date>
48
+
49
+ ## System: <system-id>
50
+ ## Granularity: <module | element>
51
+ ## Total tasks: <N>
52
+
53
+ ## Tasks
54
+
55
+ | ID | Target | Dependencies | Status | Attempts |
56
+ |----|--------|-------------|--------|----------|
57
+ | task_001 | <element-or-module-id> | [] | pending | 0 |
58
+ | task_002 | <element-or-module-id> | [task_001] | pending | 0 |
59
+ ...
60
+
61
+ ## Architecture Decisions
62
+ [Extract from workbench/discovery.md: language, runtime, framework, DI pattern, error handling style, test framework]
63
+ ```
64
+
65
+ **Dependency ordering**: tasks whose target element has operations called by other elements must complete before their dependents. Use `forge inspect <id>` to discover caller/callee relationships. Tasks with no inter-dependencies can run in parallel.
66
+
67
+ Present the build plan to the human and get confirmation before dispatching.
68
+
69
+ ## Step 3 — Subagent Dispatch
70
+
71
+ For each task in dependency order:
72
+
73
+ ### Subagent prompt template
74
+
75
+ ```
76
+ You are implementing a single unit of a Forge spec.
77
+
78
+ Target: <element-or-module-id>
79
+ Task ID: <task_id>
80
+
81
+ ## Your context
82
+
83
+ Run this command to get your full implementation context:
84
+ forge context <element-or-module-id> --format markdown
85
+
86
+ The output contains: the element with all properties and operations, parent module/domain/system,
87
+ all referenced types (transitive), errors, contracts, interactions, cascaded policies, and datastores.
88
+
89
+ ## Architecture
90
+
91
+ <paste the Architecture Decisions section from build-plan.md>
92
+
93
+ ## What to produce
94
+
95
+ For each operation in the element:
96
+ 1. Tests first — write tests derived from the operation's declared inputs, outputs, errors,
97
+ and any example/edge cases in the spec. Tests must be runnable and specific to the spec values.
98
+ 2. Implementation — write the minimal code that satisfies the spec contract. No extra abstractions,
99
+ no error handling beyond what's declared, no feature flags.
100
+
101
+ ## Rules
102
+
103
+ - Implement exactly what the spec declares. Nothing more.
104
+ - Every output field declared in an operation must be present in the implementation.
105
+ - Every error declared in `raises` must have a corresponding error-return path.
106
+ - Integration tests (flows, interactions) must run against live infrastructure — no internal mocks.
107
+ - External third-party APIs (integrations) may be mocked with test credentials or sandbox environments.
108
+ - If the spec is ambiguous on a decision the architecture block doesn't resolve, report it as
109
+ an `architecture_conflict` instead of guessing. Do not write files on conflict.
110
+
111
+ ## Output
112
+
113
+ Write files to the paths implied by the module's `packaging.runtime` and the project's source structure.
114
+ Report: files written, tests passing, or architecture_conflict with the specific ambiguity.
115
+ ```
116
+
117
+ ### Tracking
118
+
119
+ After each subagent completes, update `workbench/build-plan.md`:
120
+ - Mark task as `done` with files written.
121
+ - On failure: increment attempts, note failure reason.
122
+
123
+ ## Step 4 — Failure Handling
124
+
125
+ On subagent failure:
126
+ 1. **Attempt 1 retry**: Re-dispatch the same subagent with the error reason appended to the prompt.
127
+ 2. **Attempt 2 retry**: Re-dispatch with explicit guidance targeting the reported error.
128
+ 3. **After 2 retries**: Surface to the human with the full failure reason. Ask whether to skip, fix the spec, or provide manual guidance.
129
+
130
+ On `architecture_conflict`:
131
+ - Do not retry. Surface immediately with the specific ambiguity.
132
+ - Ask the human to resolve it (add to `workbench/discovery.md` or update relevant spec files), then re-dispatch.
133
+
134
+ ## Step 5 — Completion
135
+
136
+ When all tasks are `done`:
137
+ 1. Run `forge validate` to confirm spec is still clean.
138
+ 2. Provide a summary: modules implemented, files written, any skipped tasks.
139
+ 3. Recommend running `forge-validate` to verify behavioral correctness.
140
+
141
+ ## Key Constraints
142
+
143
+ - Do not dispatch subagents until `workbench/build-plan.md` is written and human-confirmed.
144
+ - Subagents never read other subagents' output files — isolation is strict.
145
+ - Orchestrator never writes implementation code directly — only subagents do.
146
+ - `forge validate` must pass before dispatch and should pass after completion.