zstack-mode
Skill15 starsChanged 4 days agoMITView on GitHub
Runs an interactive task execution loop that asks for a task and backward-compatibility preference (default no), applies preferred code structure, enforces code-review and changes-verification via a deterministic gate script after every completed task, and prompts to open a pull request via create-pr on approval. Manual invocation only — do not auto-invoke unless explicitly requested by the user.
In this repository14 other files it gives its agents.
- agent-instruction-auditSkill
- agent-tool-auditSkill
- changes-verificationSkill
- cheap-ui-auditSkill
- code-reviewSkill
- create-prSkill
- debuggingSkill
- engineering-decisionSkill
- formal-verificationSkill
- micro-animationSkill
- optimistic-uiSkill
- optimize-ciSkill
- oxlint-setupSkill
- test-auditSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 17
Follow these steps strictly in order for every task:
- Distinctive: line 21
If the user has not yet specified a task, ask clearly what task they want to work on (and clarify any ambiguous scope or acceptance …
- Distinctive: line 22
Ask whether backward compatibility is required (default: No).
- Very specific: line 24
If the user already supplied a task when invoking zstack-mode, confirm scope and backward-compatibility preference (defaulting to No if not …
- Very specific: line 33
Read references/code-structure.md when creating new modules, files, routes, services, or greenfield structure (always respecting existing …
- Very specific: line 35
Use supporting skills when applicable during implementation (debugging for root-cause triage, test-audit when writing or deleting tests, …
- Very specific: line 39
After completing the task—and BEFORE reporting the task done or offering to create a PR—run BOTH skills in sequence and verify through …
- Very specific: line 51
If check exits non-zero (for example, post-review edits changed HEAD), re-run the stale gate(s) until check exits 0.
- Very specific: line 63
If the user says no: Do not push or open a PR; run bash <skill-dir>/scripts/zstack_gate.sh complete and ask whether the user wants to start …
- Very specific: line 80
If code-review triggers edits after changes-verification has already run, HEAD changes and zstack_gate.sh check will reject the stale …
- Very specific: line 81
Never auto-invoke zstack-mode.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill 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
ZStack Mode
Operate in a disciplined, gated task loop where every completed task automatically passes independent code review and deterministic change verification before offering to open a pull request.
- Invocation: Manual-only (
disable-model-invocation: true). Run only when explicitly invoked by the user. - Gate script: Resolve
<skill-dir>to the directory containing thisSKILL.mdand use<skill-dir>/scripts/zstack_gate.shto enforce every phase deterministically. - Optional runtime hooks: See
references/hooks-setup.mdfor Antigravity, Codex, Claude Code, OpenCode, Pi, and Gitpre-pushhook templates wired toscripts/zstack_gate.sh.
Execution Loop
Follow these steps strictly in order for every task:
Step 1: Ask for the Task & Compatibility Requirement
- If the user has not yet specified a task, ask clearly what task they want to work on (and clarify any ambiguous scope or acceptance criteria before editing code).
- Ask whether backward compatibility is required (default: No).
- Unless the user explicitly says Yes, do NOT add backward-compatibility shims, legacy fallbacks, deprecated aliases, or dual-path bridges—replace or delete old code cleanly.
- If the user already supplied a task when invoking
zstack-mode, confirm scope and backward-compatibility preference (defaulting to No if not requested) before editing. - Initialize the task gate before editing:
(Passbash <skill-dir>/scripts/zstack_gate.sh start --task "<short task summary>"--backward-compatonly if the user explicitly requested backward compatibility.)
Step 2: Implement the Task
- Read
references/code-structure.mdwhen creating new modules, files, routes, services, or greenfield structure (always respecting existing repo conventions when they differ). - Complete the task cleanly with focused, well-scoped changes and meaningful tests.
- Use supporting skills when applicable during implementation (
debuggingfor root-cause triage,test-auditwhen writing or deleting tests,engineering-decisionfor architectural decisions,micro-animation/optimistic-uifor frontend UI).
Step 3: Run Mandatory Post-Task Gates
After completing the task—and BEFORE reporting the task done or offering to create a PR—run BOTH skills in sequence and verify through zstack_gate.sh:
- Invoke
code-review: Delegate the diff to an independent review subagent. Resolve everyCritical:and required finding, then record the verdict on the final commit:bash <skill-dir>/scripts/zstack_gate.sh record-review --status pass --summary "<brief verdict>" - Invoke
changes-verification: Execute change-related tests and locally runnable CI checks against the final commit so.changes-verification-receipt.jsonpasses forHEAD. - Run the deterministic gate check:
bash <skill-dir>/scripts/zstack_gate.sh checkcheckverifies that bothcode-reviewand.changes-verification-receipt.jsonpassed for the exact currentHEADcommit SHA.- If
checkexits non-zero (for example, post-review edits changedHEAD), re-run the stale gate(s) untilcheckexits0.
Step 4: Ask to Create a Pull Request
Present a concise summary of:
- What was implemented
code-reviewoutcomechanges-verificationreceipt evidence (HEADSHA and verified commands)
Then explicitly ask the user: "Would you like me to create a pull request for this task?"
- If the user says yes: Invoke the
create-prskill, then runbash <skill-dir>/scripts/zstack_gate.sh complete. - If the user says no: Do not push or open a PR; run
bash <skill-dir>/scripts/zstack_gate.sh completeand ask whether the user wants to start the next task inzstack-modeor exit.
Step 5: Next Task
Once the PR is opened (or skipped), ask what the next task is. Every subsequent task repeats Steps 1 through 4 with full code-review, changes-verification, and zstack_gate.sh check gates.
Red Flags
- Adding backward-compatibility shims, deprecated aliases, or legacy fallbacks when the user did not explicitly request backward compatibility
- Skipping
code-review,changes-verification, orzstack_gate.sh checkafter finishing a task, even for "small" changes - Running
code-reviewinline in the main context instead of delegating to a subagent - Opening a PR without asking the user first
- Committing
.changes-verification-receipt.json - Bundling multiple unrelated tasks into one unverified pass instead of gating each task individually
Gotchas
- If
code-reviewtriggers edits afterchanges-verificationhas already run,HEADchanges andzstack_gate.sh checkwill reject the stale receipt; re-run the stale gate(s) on the final commit. - Never auto-invoke
zstack-mode; wait for explicit user activation.
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.

