gm-emit
Original:🇺🇸 English
Translated
EMIT phase. Pre-emit debug, write files, post-emit verify from disk. Any new unknown triggers immediate snake back to planning — restart chain.
5installs
Sourceanentrypoint/plugforge
Added on
NPX Install
npx skill4agent add anentrypoint/plugforge gm-emitTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GM EMIT — Writing and Verifying Files
You are in the EMIT phase. Every mutable is KNOWN. Prove the write is correct, write, confirm from disk. Any new unknown = snake to , restart chain.
planningGRAPH POSITION:
PLAN → EXECUTE → [EMIT] → VERIFY → COMPLETE- Entry: All .prd mutables resolved. Entered from or via snake from VERIFY.
gm-execute
TRANSITIONS
FORWARD: All gate conditions true simultaneously → invoke skill
gm-completeSELF-LOOP: Post-emit variance with known cause → fix immediately, re-verify, do not advance until zero variance
BACKWARD:
- Pre-emit reveals logic error (known mutable) → invoke skill, re-resolve, return here
gm-execute - Pre-emit reveals new unknown → invoke skill, restart chain
planning - Post-emit variance with unknown cause → invoke skill, restart chain
planning - Scope changed → invoke skill, restart chain
planning - From VERIFY: end-to-end reveals broken file → re-enter here, fix, re-verify, re-advance
MUTABLE DISCIPLINE
Each gate condition is a mutable. Pre-emit run witnesses expected value. Post-emit run witnesses current value. Zero variance = resolved. Variance with unknown cause = new unknown = snake to .
planningCODE EXECUTION
exec:<lang> is the only way to run code. Bash tool body:
exec:<lang>\n<code>exec:nodejsexec:bashexec:pythonexec:typescriptexec:goexec:rustexec:javaexec:denoexec:cmdOnly git in bash directly. = violations. File writes via exec:nodejs + require('fs').
Bash(node/npm/npx/bun)PRE-EMIT DEBUGGING (before writing any file)
- Import actual module from disk via — witness current on-disk behavior
exec:nodejs - Run proposed logic in isolation WITHOUT writing — witness output with real inputs
- Debug failure paths with real error inputs — record expected values
exec:nodejs
const { fn } = await import('/abs/path/to/module.js');
console.log(await fn(realInput));Pre-emit revealing unexpected behavior → new unknown → snake to .
planningWRITING FILES
exec:nodejsrequire('fs')resolved=truePOST-EMIT VERIFICATION (immediately after writing)
- Re-import the actual file from disk — not in-memory version
- Run same inputs as pre-emit — output must match exactly
- For browser: reload from disk, re-inject globals, re-run, compare captures
__gm - Known variance → fix and re-verify | Unknown variance → snake to
planning
GATE CONDITIONS (all true simultaneously before advancing)
- Pre-emit debug passed with real inputs and error inputs
- Post-emit verification matches pre-emit exactly
- Hot reloadable: state outside reloadable modules, handlers swap atomically
- Crash-proof: catch at every boundary, recovery hierarchy
- No mocks/fakes/stubs anywhere
- Files ≤200 lines, no duplicate code, no comments, no hardcoded values
- CLAUDE.md reflects actual behavior
CODEBASE EXPLORATION
exec:codesearch
<natural language description>Alias: . Glob, Grep, Explore = blocked.
exec:searchBROWSER DEBUGGING
Invoke skill. Escalation: (1) → (2) skill + globals → (3) navigate/click → (4) screenshot last resort.
agent-browserexec:agent-browser\n<js>__gmSELF-CHECK (before and after each file)
File ≤200 lines | No duplication | Pre-emit passed | No mocks | No comments | Docs match | All spotted issues fixed
CONSTRAINTS
Never: write before pre-emit passes | advance with post-emit variance | absorb surprises silently | comments | hardcoded values | defer spotted issues
Always: pre-emit debug before writing | post-emit verify from disk | snake to planning on any new unknown | fix immediately
→ FORWARD: All gates pass → invoke skill.
↺ SELF-LOOP: Known post-emit variance → fix, re-verify.
↩ SNAKE to EXECUTE: Known logic error → invoke skill.
↩ SNAKE to PLAN: Any new unknown → invoke skill, restart chain.
gm-completegm-executeplanning