tinyorbit-ai/skills/tree/main/mods/forge-gate
forge-gate
forge 단계 게이트를 강제하는 Claude Code mod입니다. 현재 가진 파일만으로 현재 단계의 Verifiable gate가 green인지 보여 주고, 그렇지 않으면 gate green이라고 주장한 forge 단계를 되돌립니다. /gate로 실행합니다.
이 mod 소개
forge-gate
Claude Code 안에서 forge 단계 게이트를 강제합니다.
Phase 3 繚 Billing API ??gate green 4m ago + written checks [ Run gate ]
Phase 3 繚 Billing API ??changed since the last run [ Run gate ]
Phase 3 繚 Billing API ??gate red: bun run gate:phase-03 [ Run gate ]
Phase 5 繚 App icon ??written checks, not checked [ Checked ]
- 어느 단계인지: 현재 git 브랜치를 wiki/plan.md의 Branch: 행과 대조합니다. 단계 브랜치가 아니면 mod는 아무것도 하지 않습니다. /gate 3은 단계를 고정하고 /gate auto는 해제합니다.
- 어떤 명령인지: 게이트의 백틱 구간 중 첫 단어가 실제 실행 파일인 것을 대상으로 합니다. 배포, 릴리스, 설치, 전송, rm형 명령과 <placeholders>가 있는 구간은 실행하지 않습니다.
- green: 모든 게이트 명령이 현재 가진 파일에서 성공한 상태입니다. 실행 전에 얻은 git tree id로 내용을 비교하므로 커밋은 오래되게 만들지 않지만 편집은 오래되게 만듭니다. forge가 실행 후 빌드 로그와 학습 기록을 쓰므로 wiki/는 제외합니다. 통과 결과는 세션 사이에도 기억됩니다.
- 증거:
- Claude Bash 실행은 게이트 명령이 명령 전체의 일부이고 저장소 루트에서 포그라운드로 끝난 경우에만 셉니다. 앞에는 && 또는 ;, 뒤에는 &&만 올 수 있습니다. true || bun test, echo bun test, cd sub && bun test, bun test | tail, 백그라운드 실행은 포함되지 않습니다.
- bun run gate && tsc --noEmit 같은 체인은 안의 모든 게이트 명령을 셉니다. 체인이 실패하면 마지막 명령만 실패로 표시합니다.
- 서브 agent 실행은 셸 디렉터리를 알 수 없으므로 앞에 명시적인 cd <repo root> &&가 있을 때만 셉니다.
- 실행은 브랜치와 관계없이 저장소와 명령별로 보관됩니다. git switch -c phase/3-?圳 직후의 실행도 포함됩니다.
- /gate(또는 Run gate)도 포함됩니다. 명령을 나열하고 실행 전에 묻습니다.
- forge stage 수호: 모든 forge stage는 FORGE_RESULT {"skill":"...","phase":3,"gate":"green",...} 결과 행으로 끝납니다. gate가 green이면 현재 파일에서 실제로 실행된 내용과 대조합니다. 참이 아니면 부족한 내용을 알려 한 번 되돌리고, 게이트를 실행하거나 gate를 red 또는 deferred로 바꾸라고 합니다. 단계는 행이 지정한 것을 사용하므로 forge-ship의 행도 main에 도착한 뒤 검사됩니다. 메인 세션과 서브 agent에서 작동하며 정직한 red, deferred, blocked는 항상 통과합니다.
- 그 외의 수호: 결과 행이 없으면 문구를 감시합니다. Claude가 단계 완료, review 가능, ship 가능 또는 게이트 통과라고 말했는데 green이 아니면 한 번 되돌립니다. 질문으로 멈춘 턴은 되돌리지 않습니다.
- 작성된 검사: 명령으로 증명할 수 없는 문장 검사를 모든 보고서와 함께 표시합니다. 명령이 전혀 없는 게이트는 Checked를 누를 때까지 기다립니다.
- Run gate: 밴드 버튼 또는 /gate가 현재 파일에서 단계의 게이트 명령을 실행하고 결과를 표시합니다. Claude에게 묻지 않고 done을 믿기 전에 확인하는 방법입니다. 대부분 누를 필요 없이 Claude의 실행이 밴드를 업데이트합니다.
명령: /gate는 확인 후 실행, /gate status는 실행하지 않고 보고, /gate <n>은 다른 브랜치에서 단계 n을 고정, /gate auto는 해제합니다.
forge 루프에 맞추기
forge-plan은 각 단계의 Verifiable gate:를 작성하고 mod는 읽기만 합니다. forge-build는 넘기기 전에 게이트를 한 번 실행하며 결과 행과 review로 넘긴다는 주장을 검사합니다. forge-review는 실행 검증과 수정 루프에서 다시 실행합니다. forge-ship은 먼저 rebase해 파일을 바꾸므로 이전 통과가 오래되고, 규칙에 따라 다시 실행한 뒤 반영합니다. crack-on과 Arnold workers는 자동으로 실행되며 수호자가 각 green을 확인합니다.
일반 루프에서는 skills가 이미 하는 일을 확인합니다. 가치는 상태 표시, 건너뛰었거나 오래된 실행 감지, 세션 사이의 통과 기억에 있습니다.
제한: 종료 코드만 확인하고 인용된 예상 출력은 검사하지 않습니다. 수동 검사만 있는 게이트는 검증할 수 없습니다. .gitignore 밖에 쓰는 게이트는 tree를 바꾸므로 green으로 읽히지 않으며 출력을 무시해야 합니다. 자체 worktree의 서브 agent는 이 저장소 루트로 cd하지 않으면 추적되지 않습니다. 밴드는 브랜치를 따르며 다른 브랜치에서는 /gate <n>으로 고정합니다.
guardDoneClaims 설정을 끄면 결과 행과 문구 수호자가 모두 비활성화됩니다. 밴드와 /gate는 계속 작동합니다.
설치는 ../README.md를 참조하세요.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add tinyorbit-ai/skills claude plugin install forge-gate
원문 / README
forge-gate
The forge phase gate, enforced inside Claude Code.
Phase 3 · Billing API ✓ gate green 4m ago + written checks [ Run gate ]
Phase 3 · Billing API ◐ changed since the last run [ Run gate ]
Phase 3 · Billing API ✗ gate red: bun run gate:phase-03 [ Run gate ]
Phase 5 · App icon ◐ written checks, not checked [ Checked ]
- Which phase: your current git branch, matched against the
**Branch:**lines inwiki/plan.md. Off a phase branch the mod does nothing./gate 3pins a phase and/gate autounpins it. - Which commands: the gate's backticked spans whose first word is a real
executable. Deploy, release, install, send and rm-style commands are never run, and
nor are spans with
<placeholders>. - Green: every gate command passed on exactly the files you have now. It
compares file contents (a git tree id, taken before the command ran), so committing
doesn't make a pass stale, but any edit does.
wiki/is left out, because forge writes its build log and learnings after the gate runs. A pass is remembered across sessions. - Evidence:
- A Claude Bash run counts when the gate command is a whole piece of the command,
run in the repo root, finished in the foreground. Only
&∨may come before it, and only&&after it. Sotrue || bun test,echo bun test,cd sub && bun test,bun test | tailand a run moved to the background don't count. - A chain like
bun run gate && tsc --noEmitcounts every gate command in it. If the chain fails, only its last command is marked failed. - A subagent's run counts only with an explicit
cd <repo root> &&in front, since its shell directory isn't known. - Runs are kept per repo and command, whichever branch is out. So a run made right
after
git switch -c phase/3-…counts. /gate(or Run gate) also counts. It lists the commands and asks before it runs anything.
- A Claude Bash run counts when the gate command is a whole piece of the command,
run in the repo root, finished in the foreground. Only
- The guard, for forge stages: every forge stage ends with a result line,
FORGE_RESULT {"skill":…,"phase":3,"gate":"green",…}. When that line says"gate":"green", it's checked against what actually ran on the current files. If it isn't true, the stage is sent back once with what's missing, told to run the gate or to change"gate"to"red"or"deferred". The phase is the one the line names, so forge-ship's line is still checked after it lands on main. It works in the main session and in subagents. An honestred,deferredorblockedline always passes. - The guard, everywhere else: with no result line, it watches for phrases. When Claude says the phase is done, ready for review or ship, or that the gate passes, while it isn't green, it's sent back once. A turn that stops to ask a question is never sent back.
- Written checks: prose the commands can't prove is shown with every report. A gate with no commands at all waits for you to press Checked.
- Run gate (the band's button, or
/gate) runs the phase's gate commands now, on the files as they are, and shows the result in the band. It's your own way to check without asking Claude, e.g. before trusting a "done". Most of the time you never press it: Claude's runs update the band by themselves.
Commands: /gate runs the gate (it asks first), /gate status reports without
running, /gate <n> pins phase n when you're off its branch, /gate auto unpins.
How it fits the forge loop
- forge-plan writes each phase's
**Verifiable gate:**. The mod only reads it. - forge-build must run the gate once before handing off. Its result line and its "handing to review" claim are checked.
- forge-review reruns the gate during runtime verification and its fix loop. Each run updates the band.
- forge-ship rebases first, which changes the files, so the old pass goes stale. Ship reruns the gate as its own rules require, then lands. Its result line is checked by phase number after the merge.
- crack-on and Arnold workers run unattended. The guard is what checks each "green" there.
Inside the normal loop the mod mostly confirms what the skills already do. Its value is the visible state, catching a skipped or stale run, and remembering a pass across sessions.
Limits:
- Exit codes only, so a gate's quoted expected output isn't checked.
- Gates with only manual checks can't be verified.
- A gate that writes files outside
.gitignorechanges the tree it ran on, so it never reads green. Ignore its outputs. - A subagent in its own worktree isn't tracked unless it
cds to this repo's root. - The band follows the branch. Off a phase branch,
/gate <n>pins a phase.
Turn the guardDoneClaims setting off to disable both guards (result lines and
phrases). The band and /gate keep working.
Install: see ../README.md.
