batch-mechanics
Skill331 starsChanged 4 months agoApache-2.0View on GitHub
Use when implementing multiple unimplemented mechanics in batch. Creates an agent team that groups items by relevance, plans each group with review loops, then executes sequentially with post-implementation verification. Append the list of mechanics to address after invoking.
In this repository33 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-ai-feature-policySkill
- add-card-data-pipelineSkill
- add-engine-effectSkill
- add-engine-variantSkill
- add-frontend-componentSkill
- add-interactive-effectSkill
- add-keywordSkill
- add-replacement-effectSkill
- address-reviewSkill
- add-static-abilitySkill
- add-triggerSkill
- ai-duelSkill
- audit-card-parsingSkill
- bug-coverage-classifierSkill
- bug-triageSkill
- card-testSkill
- casting-stack-conditionsSkill
- changelogSkill
- engine-implementerSkill
- engine-plannerSkill
- oracle-parserSkill
- parser-velocitySkill
- pr-contribution-handlerSkill
- pr-flow-auditSkill
- project-referenceSkill
- pr-review-loopSkill
- retrain-ai-weightsSkill
- review-engine-implSkill
- review-engine-planSkill
- ship-commitsSkill
- unlock-setSkill
- validate-cr-annotationsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Small batch shortcut: If the user has only 1-2 items, skip the agent team — implement them directly without the team overhead.
- Distinctive: line 60
When a teammate finishes their plan:
- Distinctive: line 64
When the teammate finishes revisions, you spawn another review subagent (model: opus) with the revised plan
- Distinctive: line 80
When a teammate finishes implementing, direct them through these steps in order:
- Distinctive: line 86
When the teammate finishes fixes, you spawn another review subagent (model: opus)
- Distinctive: line 113
After all groups are complete:
- Very specific: line 123
Run cargo coverage (one-shot binary, always direct) to verify reduced Unimplemented count
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Batch Mechanics Implementation
Orchestrate an agent team to plan and implement multiple mechanics from UNIMPLEMENTED-MECHANICS.md.
Prerequisites:
- Agent Teams must be enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1in settings) - The lead session should be running Opus (it handles grouping and coordination decisions)
Instructions for the Team Lead
You are orchestrating a multi-phase workflow. Follow each phase exactly. If any phase isn't possible, stop and discuss with the user before proceeding.
Small batch shortcut: If the user has only 1-2 items, skip the agent team — implement them directly without the team overhead.
Phase 1 — Group & Classify
- Read
.planning/rules-audit/UNIMPLEMENTED-MECHANICS.md - Review the items the user has appended below
- Group items by relevance to each other. Consider:
- Items that touch the same files or subsystems (e.g., two SBA items → group together)
- Items that share a pattern (e.g., multiple keyword implementations)
- Items that have dependencies (e.g., damage prevention must exist before protection prevention pipeline)
- Balance group sizes — fold small items into related groups rather than having a teammate do only 1-2 trivial tasks
- For each group, identify which existing skill(s) apply. A mechanic may need multiple skills:
/add-engine-effect— new effects or stub completions/add-keyword— keyword abilities/add-trigger— triggered abilities/add-static-ability— static/continuous effects/add-replacement-effect— replacement effects/add-interactive-effect— effects requiring player choices (WaitingFor/GameAction round-trip)/oracle-parser— parser-only changes/casting-stack-conditions— casting flow or stack changes
- Order groups by dependency — if Group A must be done before Group B can start, note this
- Present the groupings to the user for approval before spawning teammates
Phase 2 — Plan (Parallel Teammates)
For each group, spawn a planning teammate (model: opus) with these instructions. Replace all bracketed placeholders with concrete values before spawning:
Your task: Create an implementation plan for the following mechanics: {list the specific items}.
How to plan:
- Read the relevant skill(s): {list the specific skill names, e.g.,
/add-engine-effect}- For each mechanic, look up the CR rule in
docs/MagicCompRules.txt- Trace how an existing analogous mechanic works end-to-end (the skill tells you which to trace)
- Read the current state of all files you'll need to modify
- Create a detailed implementation plan covering every file change, using the skill's checklist as your guide
Require plan approval before making any changes.
Plan review loop (lead-orchestrated — teammates cannot spawn subagents):
When a teammate finishes their plan:
- The teammate messages the lead with their plan
- You (the lead) spawn a review subagent (model: opus) with the teammate's plan, asking it to check for: missed files from the skill checklist, incorrect CR references, building-block violations, composability issues, and CLAUDE.md adherence
- Send the review feedback back to the teammate and direct them to address all gaps
- When the teammate finishes revisions, you spawn another review subagent (model: opus) with the revised plan
- Repeat until the reviewer finds no gaps (max 3 rounds)
- Once clean, approve the plan
Phase 3 — Execute (Sequential by Default)
Important: Execute groups one at a time unless the user explicitly requests parallel execution AND the groups touch completely different files.
For each approved plan, direct the teammate:
"Before implementing, re-read all files listed in your plan to ensure you have their current state — a previous group may have modified shared files like
types/ability.rsoreffects/mod.rs.Then implement your plan. Follow the skill checklist exactly. After each file change, verify it compiles. Do not skip any checklist step."
Phase 4 — Post-Implementation Verification
When a teammate finishes implementing, direct them through these steps in order:
Step 1 — Lead-orchestrated review (teammates cannot spawn subagents):
- The teammate messages the lead summarizing what they implemented
- You (the lead) spawn a review subagent (model: opus) asking it to review the teammate's changes for: logic errors, missed checklist steps, missing CR annotations, missing tests, and building-block violations
- Send the review feedback back to the teammate and direct them to address all gaps
- When the teammate finishes fixes, you spawn another review subagent (model: opus)
- Repeat until the reviewer finds no gaps (max 3 rounds)
Step 2 — Run verification (prefer Tilt; fall back to direct cargo when Tilt is down — see CLAUDE.md § 'Canonical verification pattern'):
"Run these commands and fix any failures:
cargo fmt --all(always direct)- Verify clippy + tests:
if tilt get uiresource clippy >/dev/null 2>&1; then ./scripts/tilt-wait.sh --timeout 240 clippy test-engine card-data else cargo clippy --all-targets -- -D warnings cargo test -p phase-engine ./scripts/gen-card-data.sh fi- If you added or changed parser output, accept new snapshots:
cargo insta accept- Run coverage (one-shot, always direct):
cargo coverage"
Step 3 — Update tracking:
"Edit
.planning/rules-audit/UNIMPLEMENTED-MECHANICS.md— remove every item you've successfully implemented. Update the Summary Statistics table."
Step 4 — Commit:
"Commit your work with a descriptive message. Stage only the files you changed."
Phase 5 — Cleanup
After all groups are complete:
- Verify the workspace:
if tilt get uiresource clippy >/dev/null 2>&1; then ./scripts/tilt-wait.sh --timeout 300 clippy test-engine card-data else cargo test --all ./scripts/gen-card-data.sh fi - Run
cargo coverage(one-shot binary, always direct) to verify reduced Unimplemented count - Report results to the user: which mechanics were implemented, coverage delta, any items that couldn't be completed
- Clean up the team — gracefully cull each teammate by sending a
shutdown_requestand waiting for itsshutdown_responseacknowledgment (teammates now carrySendMessage, so they can ack a graceful shutdown instead of being tmux-pane-killed, which left zombie roster entries). Only force-terminate a teammate that fails to acknowledge.
Constraints
- Max 4 teammates at once — more creates diminishing returns and coordination overhead
- Sequential execution is the default — parallel only when groups have zero file overlap
- Teammates must use existing skills — no ad-hoc implementation approaches
- Every CR annotation must be verified against
docs/MagicCompRules.txt - No mega-effects — if a teammate creates an Effect variant that does multiple things, send them back to decompose it
- Plan review max 3 rounds — if still finding gaps after 3 rounds, escalate to the user
- Re-read before executing — teammates must re-read shared files before implementing, since a prior group may have modified them
- Stuck teammates — if a teammate hits a wall (can't resolve review feedback, encounters a conflict, or the problem is more complex than expected), escalate to the user with context rather than spinning
Items to Implement
<!-- The user appends their list below this line -->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.

