skills/godmode/SKILL.md
Orchestrator. Routes to skills, detects stack/phase, dispatches multi-agent worktrees. Triggers on: /godmode, /godmode:<skill>.
npx skillsauth add arbazkhan971/godmode godmodeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
/godmode without subcommand/godmode:<skill> — read skills/<skill>/SKILL.mdIF $GODMODE_TERSE is set OR /godmode:terse on was invoked this session:
compress all emitted output per skills/terse/SKILL.md. TSV rows, code blocks,
error messages, commit messages, and the final user-facing summary stay
verbose. Terse is an emit contract only — loops, decisions, commits, and
TSV writes are identical in both modes. See skills/terse/SKILL.md for the
full contract and the before/after examples.
Also check .godmode/session-state.json for auto-activation. If the file
exists and consecutive_rounds_without_human >= 2 AND
terse_user_opted_out != true: auto-enable terse for this round and emit
the activation message defined in skills/terse/SKILL.md § Auto-Activation.
The threshold was lowered from 5 to 2 in Phase E so that normal /godmode
commands get terse compression by round 2 instead of waiting 5 rounds —
first round stays verbose for human context, all subsequent rounds are terse.
This check runs at the START of every round, before the loop body. The
counter is incremented at the END of each round (immediately after DECIDE
and LOG) and reset to 0 at the START of any round that was triggered by a
new user prompt. A user-issued /godmode:terse off sets terse_user_opted_out
to true for the remainder of the session and disables auto-activation.
Read .godmode/session-state.json if it exists.
IF stop_reason is null: resume the interrupted skill at the saved round.
IF stop_reason is set OR file missing: proceed with fresh detection.
Print resume status at start of every session.
Read .godmode/lessons.md if it exists.
Surface relevant lessons for the detected skill.
After session: append 1-3 new lessons.
IF lessons.md exceeds 100 lines: compress before loading. Keep entries from
the last 30 days AND entries referenced (cited) more than twice. Mark stale
entries [OBSOLETE] rather than deleting — the file is append-only history.
After compression, re-read and continue. Target post-compression length: ≤60
lines. This keeps the lesson-loading context lean on long-running sessions
where the file would otherwise grow unbounded.
Unless GODMODE_TOKENS=0 is set in the environment, token logging per
skills/tokens/SKILL.md is ON by default for this session. At the end of
every round (after DECIDE and LOG), append one row to .godmode/token-log.tsv
with the 10-column schema defined in the tokens skill. The logger uses the
chars / 4 heuristic documented there. Opt out with GODMODE_TOKENS=0 only
for privacy-sensitive workflows. This is part of Phase E Default Activations
(SKILL.md §14) — no explicit /godmode:tokens invocation needed.
# Detect project stack from root files
ls package.json pyproject.toml Cargo.toml go.mod \
Gemfile pom.xml 2>/dev/null
# Detect lockfile for package manager
ls yarn.lock pnpm-lock.yaml uv.lock \
package-lock.json 2>/dev/null
# Verify commands work
$test_cmd --version 2>/dev/null
$lint_cmd --version 2>/dev/null
STACK DETECTION:
| Files | Stack | test_cmd | lint_cmd | build_cmd |
|-------------------------------|------------|---------------|---------------|----------------|
| package.json + next.config.* | Next.js | npm test | eslint --fix | npm run build |
| package.json + tsconfig.json | TypeScript | npx vitest | eslint --fix | tsc --noEmit |
| pyproject.toml | Python | pytest | ruff check . | — |
| Cargo.toml | Rust | cargo test | cargo clippy | cargo build |
| go.mod | Go | go test ./... | golangci-lint | go build ./... |
IF no match: ask user for test/lint/build commands
IF lockfile found: use matching package manager
Read ONLY Tier 1 of each skill file to match the user's request. Tier 1 =
frontmatter + the ## Activate When block. The Tier 1 boundary is the
first ## header that follows ## Activate When. Everything after that
boundary is Tier 2 (loaded only once a skill is matched) or Tier 3 (loaded
only on edge cases, marked by a literal tier-3 HTML comment).
# Tier 1 extractor — POSIX awk. Reads frontmatter + the Activate When block,
# stopping at the next `##` header. Skills without `## Activate When`
# (currently only `principles`) emit only their frontmatter.
for f in skills/*/SKILL.md; do
awk '
NR == 1 && $0 == "---" { in_fm = 1; print; next }
in_fm && $0 == "---" { in_fm = 0; print; next }
in_fm { print; next }
/^## Activate When/ { in_aw = 1; print; next }
in_aw && /^## / { exit }
in_aw { print }
' "$f"
done
Measured Tier 1 cost (via tests/token-bench.sh): about 4,000 tokens
across 134 skills, vs. about 54,000 tokens for full reads — roughly 92%
reduction. Stacks with skills/terse/ (output-side compression),
skills/stdio/ (input-side canonical commands), and rtk (if installed)
for compound context savings.
Match process:
description:
plus ## Activate When bullets.## Activate When list wins (more specific trigger).tier-3 HTML comment marker if present (Tier 2 auto-included).SKILL.md §8 (error recovery, quality target verification,
platform fallback), read past the marker.Canonical trigger shortcuts (fastest path — if a request matches one of these exactly, skip the Tier 1 scan):
| Trigger | Skill |
|--------------------------------------------------------------|-------------|
| "integration test", "integration testing" | integration |
| "end to end", "end-to-end", "e2e test" | e2e |
| "load test", "stress test" | loadtest |
| "docker image", "dockerfile", "container image" | docker |
| "rate limiting", "rate limit", "throttling" | ratelimit |
| "react component", "react hook", "jsx" | react |
| "vue page", "vue component", "composition api" | vue |
| "nextjs", "next.js", "app router" | nextjs |
| "django view", "django model", "django orm" | django |
| "fastapi route", "fastapi endpoint" | fastapi |
| "rails controller", "rails model", "active record" | rails |
| "openapi spec", "openapi schema", "rest api spec" | api |
| "design the architecture", "system architecture" | architect |
| "event sourcing", "event-driven architecture" | event |
| "make faster", "optimize", "slow", "response time", "p99", "latency" | optimize |
| "debug", "why is this", "leaking", "segfault", "trace this" | debug |
| "is red", "failing", "errored", "fix", "broken", "error" | fix |
| "secure", "vulnerabilities" | secure |
| "review", "check my code", "look over this pr", "pull request" | review |
| "research", "prior art" | research |
| "plan", "break down" | plan |
| "ship", "deploy" | ship |
| "finish", "done", "clean up", "wrap up" | finish |
| "terse", "compress output" | terse |
| "tokens", "token budget" | tokens |
| "stdio", "command patterns" | stdio |
| "team", "bundle" | team |
| "tutorial", "onboarding", "get started", "first run" | tutorial |
| "bench", "benchmark" | bench |
| "test", "coverage" | test |
| "build", "implement", "create" | build |
IF no match: fall through to phase detection (Step 3).
Skills whose Tier 1 block fails to parse (missing ## Activate When,
malformed frontmatter) are routing-invisible. The only skill without
## Activate When is skills/principles/SKILL.md, which is imported
directly as a prelude via @./skills/principles/SKILL.md and not
routable — this is intentional.
PHASE DETECTION:
non-trivial feature, no research → RESEARCH (see auto-dispatch below)
no spec, no plan → THINK
spec exists, no plan → PLAN
plan exists, tasks incomplete → BUILD
code exists, tests failing → FIX
tests passing, unreviewed → REVIEW
reviewed, metrics unoptimized → OPTIMIZE
all green → SHIP
THRESHOLDS:
Stuck recovery: > 5 consecutive discards
→ try opposite approach
→ if still stuck: escalate to previous phase
→ if still stuck: log reason, move to next task
Research auto-dispatch rule (Phase E Default Activations — SKILL.md §14).
Before routing to THINK, check whether the task is "non-trivial":
.godmode/research.md exists for the featureIf ANY of these is true AND the user did NOT pass --no-research: dispatch
skills/research/SKILL.md first. Research writes .godmode/research.md;
THINK then reads it at its own Step 2 (Scan Codebase) instead of rescanning.
Research auto-dispatch turns the "prior art gap" into a no-op for every
normal command. Skip for trivial tasks (one-line fixes, typos, renames).
Before routing to any skill, check .godmode/<skill>-failures.tsv if it exists.
If the target skill has >10 consecutive failures: suggest an alternative skill or approach.
Surface failure patterns in the session summary: "optimize had 5 noise failures — metric may be non-deterministic."
Read skills/{skill}/SKILL.md. Follow it literally.
Pass: stack, test_cmd, lint_cmd, build_cmd.
Print: Godmode: stack={stack}, skill={skill}, phase={phase}. Dispatching.
After: Godmode: {skill} complete. Next: {next}.
Never ask to continue. Loop autonomously until done.
.godmode/session-log.tsv.Iterations: N = run exactly N times then stop.git reset --hard HEAD~1..godmode/<skill>-results.tsv (append only)..godmode/session-log.tsv with stop_reason:
target_reached | budget_exhausted |
diminishing_returns | stuck | user_interruptKEEP if: metric improved AND guard passed
(build_cmd && lint_cmd && test_cmd)
DISCARD if: metric worsened OR guard failed
On discard: git reset --hard HEAD~1. Log reason.
After each skill completes, analyze results and decide the next skill:
WHILE project_goal_not_met:
result = run_current_skill()
IF result.status == "DONE" AND result.findings > 0:
next_skill = route_findings(result) # e.g., optimize found security issue → secure
ELIF result.status == "DONE" AND result.findings == 0:
next_skill = advance_phase() # move to next phase in chain
ELIF result.status == "STUCK":
next_skill = escalate_or_skip() # try alternative skill
LOG to session-log.tsv
The meta-loop enables: optimize → review finds issue → fix → re-optimize → secure → ship. Without it, each skill runs in isolation. With it, skills chain automatically.
If session ends mid-loop, .godmode/session-state.json preserves state. The stop hook notifies the user to run /godmode to resume. For fully autonomous overnight runs: use Ralph Loop or /loop with godmode.
STOP when FIRST of:
- target_reached: spec/goal fully achieved
- budget_exhausted: max iterations hit
- diminishing_returns: last 3 iters each < 1%
- stuck: > 5 consecutive discards
timestamp skill iterations kept discarded stop_reason outcome
| Failure | Action | |---------|--------| | No stack match | Ask user for commands. Cache. | | SKILL.md missing | List available, suggest closest. | | Stuck in loop | Escalate to previous phase. | | Merge conflict | Discard agent, re-queue narrower. |
# Detect project stack from root files
ls package.json pyproject.toml Cargo.toml go.mod 2>/dev/null
git log --oneline -5
development
Web performance optimization. Lighthouse, bundle analysis, code splitting, image optimization, critical CSS, fonts, service workers, CDN.
development
Webhook design, delivery, retry, HMAC verification, event subscriptions, dead letter queues.
development
Vue.js mastery. Composition API, Pinia, Vue Router, Nuxt SSR/SSG, Vite optimization, testing.
development
Evidence gate. Run command, read full output, confirm or deny claim. No trust, only proof.