forge-plugins / forge-opencode
CLAUDE.md2 starsChanged 5 months agoMITView on GitHub
Forge ported from Claude Code to OpenCode. Same 12-stage gated SDLC pipeline, same learning system, different plugin API. OpenCode plugin (plugin.js) routes lifecycle events to Python hook scripts. Skills/agents/scripts are identical to the Claude Code version. Same as Claude Code version: /forge:init, /forge:srs, /forge:status, etc., plus two OpenCode-only additions: - /forge:orchestrate — full-pipeline driver (agents/orchestrator.md + skills/forge-orchestrate/SKILL.md). OpenCode's session.idle payload never carries a transcript_path (no OpenCode event exposes one), so stop-reflect.py's automatic done-signal detection is permanently False here — there…
In this repository46 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- forge-adoptSkill
- forge-arch-proSkill
- forge-archSkill
- forge-autopilotSkill
- forge-autopilot-stopSkill
- forge-build-proSkill
- forge-buildSkill
- forge-deploySkill
- forge-doctorSkill
- dreamer-runSkill
- forge-evalSkill
- forge-feedbackSkill
- flowSkill
- forge-force-advanceSkill
- graduateSkill
- health-checkSkill
- forge-initSkill
- forge-monitorSkill
- forge-orchestrateSkill
- forge-plan-proSkill
- forge-planSkill
- preflightSkill
- forge-product-proSkill
- forge-productSkill
- forge-releaseSkill
- forge-resolveSkill
- forge-resumeSkill
- forge-retroSkill
- forge-reviewSkill
- forge-rulesSkill
- forge-set-profileSkill
- skill-creatorSkill
- forge-spec-proSkill
- forge-specSkill
- forge-sprint-proSkill
- forge-sprintSkill
- forge-srs-proSkill
- forge-srsSkill
- forge-statusSkill
- forge-trace-matrixSkill
- forge-uninstallSkill
- forge-validateSkill
- watchSkill
- watch-stopSkill
- forge-whySkill
The file
Files
CLAUDE.md — Forge for OpenCode
What This Is
Forge ported from Claude Code to OpenCode. Same 12-stage gated SDLC pipeline, same learning system, different plugin API.
How It Works
OpenCode plugin (plugin.js) routes lifecycle events to Python hook scripts.
Skills/agents/scripts are identical to the Claude Code version.
Hook Files
hooks/session-start.py— state injection at session starthooks/prompt-submit.py— intent detection on user messageshooks/pre-tool-write.py— design system enforcementhooks/post-tool-use.py— session logging, pattern trackinghooks/stop-reflect.py— reflection, lesson extraction, gate checkhooks/pre-compact.py— autopilot checkpoint before compactionhooks/session-end.py— session summary, cleanuphooks/_state_lib.py,_state_read.py,_hook_runner.py— shared helpers
Commands
Same as Claude Code version: /forge:init, /forge:srs, /forge:status, etc., plus
two OpenCode-only additions:
/forge:orchestrate— full-pipeline driver (agents/orchestrator.md+skills/forge-orchestrate/SKILL.md). OpenCode'ssession.idlepayload never carries atranscript_path(no OpenCode event exposes one), sostop-reflect.py's automatic done-signal detection is permanentlyFalsehere — there is no passive path to a per-stagestate.mdadvance. This agent is the active replacement: it explicitly runsstate-manager.py advanceafter every stage's gate passes and re-readsstate.mdto confirm the write landed, rather than assuming it./forge:validate— pipeline gap analysis (scripts/validate-traceability.py+skills/forge-validate/SKILL.md): malformed/misplaced ID detection, unimplemented (orphaned) requirement detection, and a rollup of the existing traceability/gate scripts into one report./forge:trace-matrix— full id x stage traceability matrix (scripts/trace-matrix.py+agents/traceability-matrix.md+skills/forge-trace-matrix/SKILL.md): same gap categories as/forge:validate, but each one attributed to the specific stage agent responsible for it, and written to.forge/traceability-gaps.jsonl—hooks/session-start.pysurfaces an advisory note to that agent when their stage becomes active.
Differences from Claude Code Version
- Event model: OpenCode has more granular events (32+ vs 6)
- Blocking: OpenCode uses
override: { decision: 'deny' }instead of exit code 2 - Context injection: OpenCode uses
console.log()instead ofadditionalContextJSON - Plugin location:
~/.config/opencode/plugin/forge-opencode/or.opencode/plugin/forge-opencode/
Environment Variables Set by Plugin
FORGE_ROOT→ plugin root directoryFORGE_PROJECT_ROOT→ user's working directoryCLAUDE_PLUGIN_ROOT→ same as FORGE_ROOT (backward compat)CLAUDE_PROJECT_DIR→ same as FORGE_PROJECT_ROOT (backward compat)
Scripts
Most Python scripts work unchanged — they read FORGE_ROOT env var for their path.
scripts/extract-lessons.py's --propose fix and scripts/validate-traceability.py
scripts/trace-matrix.py+scripts/_trace_scan.pywere built in this port first, then ported back to the root Claude Code plugin — both trees are back in parity for these files (no intentional divergence remains):
scripts/extract-lessons.py's--proposeflag emits YAML to stdout instead of writingtasks/lessons.mddirectly —hooks/stop-reflect.py's Step 2 calls it with--cwd/--input/--proposeandcwd=pinned on the subprocess. It used to be called with--transcript/--since-flag, which don't exist in the script's argparse — every invocation failed with an argparse usage error (exit 2), so lessons were never written until this fix.scripts/_trace_scan.pyis the shared module bothvalidate-traceability.pyandtrace-matrix.pyimport — ID-scanning primitives (malformed/misplaced/ duplicate/unimplemented detection) plus theattribute()helper that resolves a gap to its responsible(stage, agent)via_stage_table.py.scripts/validate-traceability.pyandscripts/trace-matrix.py— see Commands above.
Dependencies
Python 3.11+, pyyaml. Same as Claude Code version.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

