forge
CLAUDE.md0 starsChanged 7 months agoMITView on GitHub
Multi-domain MVP portfolio with 95 projects across 11 domains. New agent? Read docs/AGENT_QUICK_START.md first — 5 minutes to productive. Then return here for your role details. Step 1: Detect your role. Run echo $FORGE_AGENT_TYPE in your shell. The result tells you who you are: Step 2: Follow your role section below. You are: $FORGE_AGENT_NAME (minimax / glm / kimi / gemini / pi / kilo / opencode / open-max) Agent capability table — lead consults this to pick the right…
- Commits and pushes
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- harness/CLAUDE.mdCLAUDE.md
- auto-security-scanSkill
- auto-test-runnerSkill
- compactSkill
- content-library-producerSkill
- content-publisherSkill
- fastapi-service-templateSkill
- frontend-designSkill
- human-review-gateSkill
- integration-testerSkill
- ios-agentSkill
- ios-designSkill
- mvp-spec-writerSkill
- niche-explorerSkill
- overnight-dispatchSkill
- pwa-frontend-liteSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
18 rules. About 0 are common, 10 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Step 1: Detect your role: Run echo $FORGE_AGENT_TYPE in your shell.
- Very specific: line 39
Hotswap rule: if primary agent is offline, pick the next agent in the same row's pattern (e.g.
- Distinctive: line 47
Read your dispatch file
- Distinctive: line 49
ONLY modify files listed in your dispatch: If you need to modify other files, STOP and write to your results file explaining why.
- Very specific: line 51
Write results to .forge/heartbeat/results/
- Very specific: line 90
Read docs/PROMPT.md for sprint state
- Distinctive: line 93
Commit all work after review
- Distinctive: line 108
Must delegate: All source code, tests, migrations
- Very specific: line 111
Update lead-context.md for each domain you touched this session
- Distinctive: line 120
Read your task prompt — files, expected behavior, test command
- Distinctive: line 122
Run the test command to verify acceptance criteria
- Distinctive: line 133
No MCP: Do not use or recommend MCP (Model Context Protocol).
- Distinctive: line 145
No long-lived feature branches.
- Very specific: line 149
Long-running processes in forge-monitor: Start background services (relay, xnode, forged daemon) in forge-monitor tmux session — never bare …
- Distinctive: line 150
Error messages must include recovery steps: Every CLI error should tell the user what went wrong AND how to fix it.
- Very specific: line 153
Test file convention (Council S118): When writing tests for cmd/forged/, ALWAYS check if a canonical test file for that module already …
- Distinctive: line 203
When context > 50% or switching tasks:
- Very specific: line 257
All nodes point to FORGE_API_URL=http://node-1:8081 — no local daemon needed (ADR-025 deferred).
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
FORGE Portfolio Agent Instructions
Multi-domain MVP portfolio with 95 projects across 11 domains.
Agent Quick-Start (Read This First)
New agent? Read
docs/AGENT_QUICK_START.mdfirst — 5 minutes to productive. Then return here for your role details.
Step 1: Detect your role. Run echo $FORGE_AGENT_TYPE in your shell. The result tells you who you are:
$FORGE_AGENT_TYPE | You are | Follow section |
fleet | A Fleet Agent | Fleet Agent below |
orchestrator | The Lead Orchestrator | Lead Orchestrator below |
| (empty/unset) | Run tmux display-message -p '#W' | If output = hostname → Orchestrator; if output = agent name (glm/kimi/etc) → Fleet Agent; else → Worktree Agent |
Step 2: Follow your role section below.
I am a Fleet Agent ($FORGE_AGENT_TYPE=fleet)
You are: $FORGE_AGENT_NAME (minimax / glm / kimi / gemini / pi / kilo / opencode / open-max)
Agent capability table — lead consults this to pick the right agent for a task:
| Agent pattern | Best for | Avoid |
claude | Primary implementation: features, refactors, hard bugs, production code | — |
gemini* | Research, audits, architecture, planning | Long-running code tasks |
minimax* | Implementation, docs, runbooks, multi-file features | go-test |
glm* | Implementation, scaffolding, refactors | go-test, ios-builds |
opencode* | Implementation, multi-file refactors | — |
kilo* | Implementation, multi-file features, docs | — |
kimi* | Coverage, triage, rapid fix loops | Large refactors |
pi* | Fast triage, quick edits, analysis | Heavy code tasks |
cursor* | Human-steered interactive editing | Autonomous tasks |
Hotswap rule: if primary agent is offline, pick the next agent in the same row's pattern (e.g. kimi → kimi-2).
You are NOT the orchestrator. You do NOT commit, push, create handoffs, or dispatch to other agents.
Find your task: ls .forge/dispatches/
Dispatch pattern: .forge/dispatches/AGENT-TASKID-DATE.md
Results pattern: .forge/heartbeat/results/AGENTNAME-TASKID.md
- Read your dispatch file
- Execute the task — no research, no planning docs, no handoffs
- ONLY modify files listed in your dispatch. If you need to modify other files, STOP and write to your results file explaining why.
- NEVER modify source code (
.py,.go,.tsx,.ts) unless your dispatch explicitly says to. Fleet agents do research, content, and analysis. Code changes go through worktree agents. - Write results to
.forge/heartbeat/results/ - Your scope ends when results are written to the results file
- DO NOT COMMIT — lead commits all work
- DO NOT PUSH
- DO NOT create handoff documents — orchestrator-only
- DO NOT dispatch to other agents — orchestrator-only
- DO NOT run these lead-only operations:
forge dispatch send(dispatching to others),git commit,git push,forge approval decide,forge lane promote— fleet agents never commit, push, approve, or dispatch
Your tools:
Read— read files (NOT Bash cat)Grep— search code (NOT Bash grep)Glob— find files by pattern (NOT Bash find)Edit/Write— modify filesBash— only for:git,go build/go test,npm,uvcommands
Dispatch protocol: See forge-shared/modules/dispatch-decision.md
Domain context: See forge-shared/modules/royal-jelly.md
On every handoff or session end, update your domain's context:
# Your domain's persistent context lives here:
.forge/context/{domain-short}/lead-context.md # Current state — ALWAYS update
.forge/context/{domain-short}/decisions.md # Append architectural decisions
.forge/context/{domain-short}/failures.md # Append what didn't work and whyOn session start, read your domain's context:
cat .forge/context/{domain-short}/lead-context.mdI am the Lead Orchestrator ($FORGE_AGENT_TYPE=orchestrator)
Verification: Your tmux window name matches $(hostname). If it doesn't, you are NOT the orchestrator.
You plan, delegate, review, unblock. You do NOT write code.
- Read
docs/PROMPT.mdfor sprint state - Check fleet:
forge status - Delegate via Task tool or dispatch files
- Commit all work after review
- Context budget: >50% = handoff, >75% = compact
Dispatch: Three paths — pick the right one:
| Task type | Tool | Notes |
| Code changes | Agent tool (worktree) | 100% reliable — always use for code |
| Fleet agent interactive | forge dispatch send forge:AGENT --file dispatch.md | Sends tmux notify (fixed S89) |
| Continuous autonomous | forge work --daemon --interval 15s in agent window | Self-assigns from queue — most resilient |
See forge-shared/modules/dispatch-decision.md for full detail.
Commit protocol: git commit with conventional commits (see forge-shared/modules/git-workflow.md)
Can edit directly: docs/*.md, CLAUDE.md, AGENTS.md, PROMPT.md, .forge/**
Must delegate: All source code, tests, migrations
Royal Jelly (persistent context): On every handoff, ensure .forge/context/ is current:
- Update
lead-context.mdfor each domain you touched this session - Append to
decisions.mdif you made architectural choices - Append to
failures.mdif approaches failed (prevents agents from retrying) - See
forge-shared/modules/royal-jelly.mdfor full protocol
I am a Worktree Agent (Task tool)
- Read your task prompt — files, expected behavior, test command
- Make the change
- Run the test command to verify acceptance criteria
- Report results in your response — orchestrator commits
- DO NOT COMMIT unless explicitly told
- DO NOT PUSH
Your scope ends when acceptance criteria pass.
Critical Rules
- No MCP. Do not use or recommend MCP (Model Context Protocol). Prefer CLIs. Final decision—never bring up MCPs.
- Use the right tool for the job (see decision matrix below)
- Orchestrators: delegate, don't edit code. See
forge-shared/modules/orchestrator-rules.md - CONTEXT_CRITICAL is a HARD STOP. When heartbeat shows
CONTEXT_CRITICAL(ctx > 75%): immediately stop current work, run/handoffto save state, then tell the user to run/clear. Do not continue other tasks. Do not "finish one more thing." This is enforced by a Stop hook — if you try to stop normally, you will be blocked until handoff is done. - Context > 50%: run
/handoff-clean - Read
docs/PROMPT.mdfirst for current state - Commit rules by agent type — push immediately after every commit:
Agent type Commit? Where? Push? Fleet agent NEVER — NEVER Worktree agent (Task tool) YES assigned branch only (e.g. feat/TASK-X) YES — immediately Lead orchestrator YES main only YES — after every commit No long-lived feature branches. Merge to main and push within the same session. - Orchestrator = forge:${HOSTNAME}. Convention over config. See
docs/ORCHESTRATOR_CONVENTION.md. - Use
forgeCLI v4 (cmd/forge/) — NOTforge-harness(deprecated), NOTuv run python -m forge_harness.cli_v2. - CLI-first for all operations.
forge(cmd/forge/) is THE CLI for all fleet operations.forged(cmd/forged/) is THE daemon (HTTP API :8081, SQLite). No Python harness for fleet ops. Seeforge-shared/modules/dispatch-decision.mdfor dispatch. - Long-running processes in forge-monitor. Start background services (relay, xnode, forged daemon) in
forge-monitortmux session — never barenohupor&. CRITICAL: No agents should run in the forge-monitor session; it is for monitoring only. - Error messages must include recovery steps. Every CLI error should tell the user what went wrong AND how to fix it.
grep -Eis broken (aliased to rg in this environment). Use the Grep tool,rg, or plaingrepinstead..forge/dispatches/is gitignored — local only. Fleet agents read dispatch files but must NOT edit or commit them.- Test file convention (Council S118). When writing tests for
cmd/forged/, ALWAYS check if a canonical test file for that module already exists (e.g.,patrol_test.go,task_queue_test.go). Extend the existing file — never create a newcoverage_wave*_test.go. Seecmd/forged/TEST_MAP.mdfor the canonical test file map and coverage skip-list.
The Two Canonical Binaries
| Binary | Source | Role |
forge | cmd/forge/ | CLI — all fleet operations |
forged | cmd/forged/ | Daemon — HTTP API :8081, SQLite |
Everything else is either deleted or iOS/portfolio-specific Python harness.
Key commands: forge up, forge down, forge monitor, forge daemon restart
Tool Selection
| Need | Use |
| Architecture / "what does X do" | qmd search "query" (BM25, .md only) |
| Find docs / guides | qmd search "topic" --files |
| Search files by name | Glob pattern |
| Search code | Grep regex |
| Read files | Read tool |
| Dispatch | forge dispatch send — see .claude/rules/fleet-dispatch.md |
Full tool selection, dispatch rules, tmux patterns, and agent start commands: See
.claude/rules/fleet-dispatch.md
Current Focus (March 2026)
- Sprint: See
docs/PLAN.md+docs/PROMPT.mdfor live state - Infrastructure: CLI v4 Go (
cmd/forge/) + forged daemon (cmd/forged/) + iOS harness only - Coverage: forged 83.4% (structural ceiling), 4000+ tests
Reading order: See docs/INFRASTRUCTURE_MAP.md for progressive disclosure (Tier 1 → Tier 3).
Infrastructure Discovery
Full map:
docs/INFRASTRUCTURE_MAP.md— progressive disclosure (Tier 1 → Tier 3)
| Need | Where |
| Current state | docs/PROMPT.md |
| Fleet dispatch | forge-shared/modules/dispatch-decision.md |
| Git & code quality | forge-shared/modules/git-workflow.md + code-quality.md |
| iOS | harness/CLAUDE.md + /ios-agent skill |
| Skills | .claude/skills/README.md |
| Path-scoped rules | .claude/rules/ (go-development, fleet-dispatch, git-conventions, iOS) |
| Domain context | .forge/context/{domain}/lead-context.md |
| ADR decisions | docs/adr/INDEX.md |
Session Hygiene
When context > 50% or switching tasks:
- Capture to
docs/PROMPT.mdor/handoff-clean - Include: decisions, patterns, blockers, next steps
- Update Royal Jelly:
.forge/context/{domain}/lead-context.mdfor every domain you touched
Unified State Directory
.forge/ consolidates all persistent state (memories, heartbeat, research, config).
Content Workflow
/content generate <domain> <project> --type blog_posts
/content batch <domain> --count 10Notion Integration
export NOTION_API_TOKEN="ntn_xxx"
export NOTION_DATA_SOURCE_ID="14636e9f-74a5-8151-8ddd-000bd1c0cc0a"
export NOTION_LINKED_DATABASE_ID="14636e9f-74a5-8175-a3ff-f0993a288e9a"Forge CLI Quick Reference
CLI: forge (Go, cmd/forge/). Run forge --help for full command list.
| Essential Commands | Purpose |
forge status | System health |
forge task list/create/complete | Task queue |
forge dispatch send forge:AGENT | Dispatch to fleet agent |
forge fleet windows | Live tmux agent windows |
forge agent list | Connected agents |
forge daemon start/stop/restart | Daemon control |
forge patrol list | Background patrols |
iOS only: cd harness && uv run python -m forge_harness.cli_v2 ios <cmd>
Full CLI reference + daemon + state locations: See
docs/INFRASTRUCTURE_MAP.md
Node Resource Budget (CRITICAL — OOM risk on node-1)
| Node | RAM | Max Agents | Allowed Models |
| node-1 | 16 GB | 2 max | Claude Code (minimax/glm), Kimi — NO OpenCode/Kilo |
| node-2 | 64 GB | 5-6 | OpenCode, Kilo, Kimi, GLM — heavy workloads |
| node-3 | 48 GB | 3-4 | Worktree agents, iOS builds |
| node-4 | 16 GB | 1-2 | Auxiliary only (no iOS — Ventura too old) |
| node-5 | 16 GB | 2-3 | M1 Pro laptop, off-hours only |
NEVER spawn OpenCode or Kilo on node-1 — causes OOM at 93% RAM.
Node setup (new node / migration): git pull && bash bin/node-migrate-v3
All nodes point to FORGE_API_URL=http://node-1:8081 — no local daemon needed (ADR-025 deferred).
See docs/NODE_SETUP.md for full setup guide.
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.

