spiral
Bootstrap and audit the structural-discipline scaffold (GDD tree, coverage ledger, progress log, open questions, followups, playtest gate) that takes a vision into a delivered system through small iterations whose state lives in git, not the agent's head. Each cycle returns to the same artifacts and finds them advanced. Pairs with /randroid:loop and task-tracking-dots. Use when bootstrapping a new project or auditing an existing one. Slash commands /spiral, /spiral-init, /spiral-audit live under commands/.
What this skill does
# Spiral
The methodology for sustaining a multi-week autonomous PR loop without the agent losing context, running out of work prematurely, or accumulating debt.
The agent does not remember the project. The project remembers itself. Every kind of state lives in git-tracked ledger files with rigid templates. The agent's job collapses to: read ledgers, pick the next slice, run the loop, update ledgers. Every iteration returns to the same artifacts and finds them advanced. The shape is not a loop, it is a spiral: forward-while-circling.
## When to invoke
- **`/spiral init`**: at the start of a fresh project. Writes the canonical scaffold (rules, plan, agreement, GDD tree, coverage ledger, progress log, open questions, followups, playtest, fun-factor audit) into the current repo.
- **`/spiral audit`**: on an existing project. Diffs the repo against the canonical structure and prints a remediation checklist. Catches the three known failure modes (monolith GDD, chapter-granular coverage, missing qualitative gate) plus generic drift (stale progress log, missing ledgers, open questions without recommended defaults, followups without priorities).
Per-slice execution (read context, branch, implement, PR, merge, repeat) is the job of `randroid:loop`. Per-task tracking is the job of `task-tracking-dots`. This skill is the substrate those two run against.
## Why this exists: the three case studies
Three multi-week autonomous-loop projects produced three outcomes. The pattern is in `docs/case-studies.md`. The short version:
- **VibeRacer (14 days, 184 commits)**: shipped a complete v1. Single-file 28-section GDD with explicit out-of-scope §18 fence. The loop terminated cleanly.
- **VibeGear2 (7 days, 298 commits)**: still actively shipping P0/P1 fun work a week in. Sectioned `docs/gdd/` tree, 102 atomic coverage rows, plus `FUN_FACTOR_GAP_AUDIT.md` and `RELEASE_FUN_PLAYTEST.md` as a second qualitative gate that re-opens the loop after systems land.
- **Flatline (3 days, 94 commits)**: self-terminated with 0 open dots, 0 open questions, 1 deferred doc cleanup. The product was not fun. Coverage rows were chapter-granular (11 rows, all `implemented` once *any* code shipped). No qualitative gate.
Flatline is the failure case this skill explicitly prevents. The audit script flags both the chapter-granular coverage anti-pattern and the missing qualitative gate.
## The scaffold
`/spiral init` writes these files into the target repo:
| Path | Role |
|------|------|
| `AGENTS.md` | Rules-as-contract: em-dash ban, pre-slice reading list, stack constraints, commit style, autonomous PR loop reference, secrets policy, testing expectations, pre-commit checklist. Read by Codex natively and by Claude Code via the CLAUDE.md import |
| `CLAUDE.md` | One-line `@AGENTS.md` import shim. Lets Claude Code pick up the same rules Codex reads, so the same repo works in both tools |
| `docs/IMPLEMENTATION_PLAN.md` | The 16-step loop contract. Slice selection priority. Definition of done |
| `docs/WORKING_AGREEMENT.md` | Process: branches, commits, PR template, bot-review settled-wait gate, verification minimums, merge-and-deploy expectations, risk gates |
| `docs/gdd/README.md` | GDD tree index. Each requirement is its own file. Build logs grow per-section as work ships |
| `docs/GDD_COVERAGE.json` | Atomic-row spec to code traceability. One row per requirement, not per chapter |
| `docs/PROGRESS_LOG.md` | Append-only slice receipts (Branch / Changed / Verification / Assumptions / GDD coverage / Followups). Newest on top |
| `docs/OPEN_QUESTIONS.md` | Q-NNN entries with options, recommended default, status, resolution. Defaults let the loop ship without blocking |
| `docs/FOLLOWUPS.md` | F-NNN entries with priority (blocks-release, nice-to-have, polish), blocker condition, unblock condition |
| `docs/DEPENDENCY_LEDGER.md` | Watched dependencies with currently-pinned version + per-dep upgrade procedure. The Dependency Upgrade Gate fires every loop iteration that touches `main` |
| `docs/PLAYTEST.md` | Qualitative second-gate checklist. The loop is not done until this resolves |
| `docs/FUN_FACTOR_AUDIT.md` | Qualitative gap-finder. Run when coverage is ≥80% done. Source of P0/P1 polish work |
| `.claude/rules/slice-discipline.md` | Path-scoped Rule. Loads when editing source. Enforces "no drive-by refactors, no speculative abstractions, refactor-in-slice" |
| `.claude/rules/ledger-append-only.md` | Path-scoped Rule. Loads when editing the four ledger files. Enforces append-only, never-rewrite-past-entries |
| `.claude/rules/gdd-build-log.md` | Path-scoped Rule. Loads when editing GDD section files. Enforces build-log-on-every-shipped-feature |
## Cross-tool compatibility
The scaffold is designed to work in both Claude Code and Codex without modification.
- `AGENTS.md` is the cross-tool standard ([agents.md](https://agents.md/)) and is read natively by Codex.
- `CLAUDE.md` imports `AGENTS.md` via `@AGENTS.md` so Claude Code reads the same rules.
- `.claude/rules/` is Claude Code's path-scoped Rules mechanism. Codex ignores these but they do not interfere with Codex operation.
- `SKILL.md` in this plugin follows the cross-tool [Agent Skills open standard](https://www.agensi.io/learn/agent-skills-open-standard) shape (frontmatter `name` plus `description`, plain markdown body), making the plugin invocable from Codex's `.agents/skills/` mechanism if symlinked or copied there.
## The seven parts of the spiral
1. **Vision**: the canonical spec (GDD tree, atomic requirements).
2. **Contract**: the three docs that govern every iteration (rules, plan, agreement).
3. **Slice**: the bounded unit of work (one PR, one log entry, small enough that a botched slice is reverted in one click).
4. **Ledgers**: externalized memory (progress log, open questions, followups, coverage). Append-only.
5. **Gates**: what blocks merge AND what triggers a slice. Mechanical (CI green, type-check, tests, no em-dash, bot-review settled). Qualitative (playtest, fun-factor audit). Dependency Upgrade Gate (see `docs/DEPENDENCY_LEDGER.md`): a watched-dep release is the same kind of fresh state as a new commit on `main`; the agent observes and acts at every loop boundary that touches `main`. The qualitative gate is the second gate that prevents Flatline-style early termination.
6. **Selection rule**: what to work on next: red CI > pending dep upgrade > P0/P1 dot > answered open question > high-priority followup > coverage gap > partial GDD section > cleanup.
7. **Loop**: the continuous operation. Read context, pick slice, branch, implement, test, update ledgers, PR, handle review, wait for bot + CI, merge, pull main, smoke prod, close item, start next. Never voluntarily idles. Executed by `randroid:loop`.
## How `init` works
Invocation: `/spiral init` from inside a target git repo, or `bash ${CLAUDE_PLUGIN_ROOT}/scripts/init.sh "<ProjectName>" "<one-line-pitch>" "<stack>"`.
The script:
1. Refuses to run if `AGENTS.md` already exists at the repo root. Use `audit` instead.
2. Prompts for project name, one-line pitch, and stack if not passed as args.
3. Copies every template file into the target repo, substituting `{{PROJECT_NAME}}`, `{{PITCH}}`, `{{STACK}}`, `{{TODAY}}`.
4. Creates `docs/gdd/` for the GDD tree and `.claude/rules/` for the path-scoped Rules.
5. Writes `CLAUDE.md` as a `@AGENTS.md` import shim so Claude Code and Codex read the same rules.
6. Verifies em-dash cleanliness on every written file.
7. Prints a next-steps note: draft the first GDD section under `docs/gdd/`, then run `/randroid:loop implement` to start the spiral.
## How `audit` works
Invocation: `/spiral audit` from inside any git repo, or `bash ${CLAUDE_PLUGIN_ROOT}/scripts/audit.sh`.
The script runs nine checks and prints a remediation checklist:
1. **Missing canonical files.** Verifies the full scaffold (AGENTS.md, CLAUDE.md, the docs ledger set including DEPENDENCY_LEDGER.md, the three .claude/rules files) is present. Lists Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.