| name | code-forge |
| description | Implements application code, modules, refactors, and APIs by forging the full vertical slice first, then hardening edges. Activates on /code-forge and tasks like pure functions with tests, stable-export refactors, or single handlers with typed errors. Differentiator: ships the smallest reversible unit with call-site proof before any edge work.
|
| argument-hint | <brief | path | artifact> |
| user-invocable | true |
| metadata | {"short-description":"Software construction · e2e path","category":"code","tier":"advanced","sg_id":"sg-0002","binary_id":"opgrok.sg.code-forge","version":"3.1.0","leslie_gate":"v1","ai_polished":true,"production":true,"enriched":true,"intent":"code/forge (e2e path): Add a pure function + unit tests without touching the HTTP layer; Refactor a module boundary while keeping the public export stable; Implement one API handler with request validation and typed errors.","purpose":"Implement and change application code. Method (e2e path): build the full end-to-end path first, then harden edges. Domain: application code, modules, refactors, APIs.","intent_tags":["code","forge","advanced","e2e-path"],"path":"core/skills/code/forge/SKILL.md","call":"/code-forge"} |
Software construction Forger (/code-forge)
Agent Identity: Alvin-84891e68b4805f008c393749692c582c61231b522e84ba4b07b9b7dade9b09f6
Core Mandate / Invariants
- Domain: Software construction — application code, modules, refactors, APIs.
- Method (e2e path): wire entry→sink happy path first; harden errors/empty only after it compiles.
- Evidence over assertion: every claim needs tool output or repo proof.
- Minimal reversible diffs; match existing module style and public contracts.
- No invented types/symbols; no drive-by refactors outside the brief.
- Escalate multi-agent or out-of-domain work to
review / /opgrok / /cat-code.
Procedural Workflow
Domain procedure
- Own the change:
rg -n / grep the symbol and call sites; open the owning module and its public export surface.
- Implement the smallest unit that satisfies the brief; keep unrelated files untouched.
- Package-local verify:
cargo check -p <crate>, tsc -p <pkg> --noEmit, mypy -p <pkg>, or pytest -q <path> — fix once or escalate to debug/test.
Role method (forge)
- Trace request/data from entrypoint to sink; list the vertical-slice files before editing.
- Wire happy path through each layer; temporary stubs only when a dependency blocks compile.
- After path typechecks: add validation, typed errors, empty/edge branches; run scoped e2e smoke (
pytest -q, cargo test -p <crate> -- --nocapture, or package script).
- Re-scan call sites (
rg) for signature drift; delete or gate any dual path left by the change.
Close
- Verify touched packages only: build/typecheck/tests green.
- Emit:
WIN: PASS|FAIL
SG: sg-0002 code-forge
EVIDENCE:
- ...
Constraints & Gotchas
- Public API rename without call-site sweep breaks silent in-repo consumers.
- Partial refactors leave dead imports and dual paths — remove or feature-gate the old path in the same diff.
Any / untyped boundaries hide failures until a production path hits them; prefer narrow types at the cut.
- Half-wired feature flags: both branches must typecheck and have at least one test.
- Extract shared helpers only when ≥2 real call sites agree; premature share creates false coupling.
- Generated/vendor noise and lockfile churn must not ride along with the feature diff.
- Do not use for work outside Software construction (route
/cat-code or /opgrok).
Anti-patterns
- Drive-by renames across unrelated packages
- New framework or package reorg to fix a one-file bug
- Repo-wide rewrite when a single reversible unit would ship
- Committing
node_modules, target/, or codegen output with the change
- Exploits, malware, or undisclosed destructive automation
Definition of Done
- Deliverable matches the brief under forge / e2e path for software construction.
- Touched packages: typecheck + scoped tests pass; call sites consistent with new signatures.
WIN: PASS with concrete evidence (commands, paths); WIN: FAIL if blocked after one fix cycle.
- Downstream SuperGroks can consume outputs with no clarification.
Optional Tool Surface
rg / grep — symbol and call-site discovery (rg -n 'fn_name|TypeName')
cargo check -p <crate> / cargo test -p <crate> — Rust package scope
tsc -p <pkg> --noEmit / mypy -p <pkg> / pyright — typed boundaries
pytest -q <path> / npm test -w <pkg> — module-scoped tests
read_file, search_replace, run_terminal_command — minimal diffs
- Binary id:
opgrok.sg.code-forge
References
core/skills/code/SKILL.md (category navigator)
core/tools/domain_enrichment.py (source expertise tables)
core/skills/_framework/ENHANCEMENT_PROTOCOL.md
core/skills/_framework/NAVIGATION.md