--- name: spiral-html description: Bootstrap or audit an HTML-first structural-discipline scaffold for long-running product work, with semantic ledgers for GDD coverage, progress, questions, follow-ups, dependencies, and playtest gates. Use when a project wants Spiral's durable agent state in HTML rather than Markdown. ---
The methodology for sustaining a multi-week autonomous PR loop without the agent losing context, running out of work prematurely, or accumulating debt. This is the HTML-first variant of spiral: the scaffold is identical in shape, but every ledger, rule, and contract is authored as HTML rather than Markdown.
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.
HTML is the new way to communicate to agents. Structured elements (<section>, <article>, <table>, <ol>, <dl>, <details>) carry semantics that Markdown discards. An agent reading <section data-role="rule" data-id="rule-1"> can locate, cite, and update content without parsing prose. The audit script in this skill exploits that: it grep-checks for HTML attributes rather than heading prefixes.
Two files must stay Markdown: AGENTS.md and CLAUDE.md. Codex's native root-down walk only picks up AGENTS.md, and Claude Code's project-memory import only resolves CLAUDE.md. The contract therefore lives in AGENTS.md as Markdown; CLAUDE.md is a one-liner (@AGENTS.md) so Claude Code imports the same rules. Everything else under docs/ is HTML.
Path-scoped Rules under .claude/rules/ retain YAML frontmatter (Claude Code requires it for path globbing); only the body becomes HTML.
Per-slice execution is the job of randroid-loop. Per-task tracking is the job of task-tracking-dots-html (the HTML-backed dot-html fork, not the Markdown task-tracking-dots). This skill is the substrate those two run against.
Three multi-week autonomous-loop projects produced three outcomes. The pattern is in docs/case-studies.html. The short version:
docs/gdd/ tree, 102 atomic coverage rows, plus FUN_FACTOR_GAP_AUDIT and RELEASE_FUN_PLAYTEST as a second qualitative gate that re-opens the loop after systems land.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.
/spiral-html init writes these files into the target repo:
| Path | Role |
|---|---|
AGENTS.md | Rules-as-contract in Markdown (stays Markdown so Codex's root-down walk works): em-dash ban, pre-slice reading list, stack constraints, commit style, autonomous PR loop reference, secrets policy, testing expectations, pre-commit checklist. The pre-slice reading list points at the .html ledgers. |
CLAUDE.md | One line: @AGENTS.md. Claude Code's project-memory import only resolves CLAUDE.md, so the file exists to forward the same rules. |
docs/IMPLEMENTATION_PLAN.html | The 18-step loop contract. Slice selection priority. Definition of done. |
docs/WORKING_AGREEMENT.html | Process: branches, commits, PR template, bot-review settled-wait gate, verification minimums, merge-and-deploy expectations, risk gates. |
docs/gdd/index.html | 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. Stays JSON (data, not prose). |
docs/PROGRESS_LOG.html | Append-only slice receipts as <article data-slice="..."> elements (Branch / Changed / Verification / Assumptions / GDD coverage / Followups). Newest on top. |
docs/OPEN_QUESTIONS.html | <section data-q="Q-NNN"> entries with options, recommended default, status, resolution. Defaults let the loop ship without blocking. |
docs/FOLLOWUPS.html | <section data-f="F-NNN"> entries with priority (blocks-release, nice-to-have, polish), blocker condition, unblock condition. |
docs/DEPENDENCY_LEDGER.html | Watched dependencies with currently-pinned version + per-dep upgrade procedure. The Dependency Upgrade Gate fires every loop iteration that touches main. |
docs/PLAYTEST.html | Qualitative second-gate checklist. The loop is not done until this resolves. |
docs/FUN_FACTOR_AUDIT.html | Qualitative gap-finder. Run when coverage is ≥80% done. Source of P0/P1 polish work. |
.claude/rules/slice-discipline.md | Path-scoped Rule. YAML frontmatter for path globbing; HTML body. Loads when editing source. Enforces "no drive-by refactors, no speculative abstractions, refactor-in-slice". |
.claude/rules/ledger-append-only.md | Path-scoped Rule. YAML frontmatter for path globbing; HTML body. Loads when editing the four ledger files. Enforces append-only, never-rewrite-past-entries. |
.claude/rules/gdd-build-log.md | Path-scoped Rule. YAML frontmatter for path globbing; HTML body. Loads when editing GDD section files. Enforces build-log-on-every-shipped-feature. |
The HTML-first scaffold cannot rely on every discovery contract the Markdown version uses. Two files stay Markdown so the canonical discovery paths keep working:
AGENTS.md (the Codex-required filename) carries the full contract as Markdown. Codex's root-down walk finds and reads it directly. The reading list inside points at the .html ledgers.CLAUDE.md (the Claude Code project-memory filename) contains one line: @AGENTS.md. Claude Code's import mechanism resolves the pointer and loads the same contract..claude/rules/*.md keep YAML frontmatter and the .md filename because Claude Code's path-scoped Rules system parses the frontmatter to decide when to load. The body inside each rule is HTML.AGENTS.md symlinks point at the rules files (still .md); Codex reads the YAML frontmatter and HTML body uniformly.AGENTS.md, plan, agreement).data-* ids.docs/DEPENDENCY_LEDGER.html): 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.randroid-loop.init worksResolve scripts/init.sh relative to this skill directory and run it from inside the target repository with "<ProjectName>" "<one-line-pitch>" "<stack>".
The script:
AGENTS.md already exists at the repo root. Use audit instead.{{PROJECT_NAME}}, {{PITCH}}, {{STACK}}, {{TODAY}}.docs/gdd/ for the GDD tree and .claude/rules/ for the path-scoped Rules.AGENTS.md (the full Markdown contract) and CLAUDE.md (one-line @AGENTS.md import).docs/gdd/, then use randroid-loop in implementation mode to start the spiral.audit worksResolve scripts/audit.sh relative to this skill directory and run it from inside the repository to audit.
The script runs nine checks and prints a remediation checklist:
AGENTS.md, CLAUDE.md), the docs HTML ledger set including DEPENDENCY_LEDGER.html, and the three .claude/rules files.docs/GDD.html exists alone without a docs/gdd/ directory.docs/GDD_COVERAGE.json. Warns if row count is implausibly low for project age (heuristic: fewer than 14 rows per project-week).docs/PLAYTEST.html or docs/FUN_FACTOR_AUDIT.html is missing.<article data-date="YYYY-MM-DD"> in docs/PROGRESS_LOG.html. Warns if older than 7 days.<section data-q="..."> missing a <dt>Recommended default</dt> entry.<section data-f="..."> missing a data-priority attribute.docs/DEPENDENCY_LEDGER.html is missing or empty (no <section id="watch-list"> recorded).The output is a checklist, not a generated remediation file. One canonical place per kind of state.
randroid-loop reads the ledgers this skill writes. The loop's research and implement modes both name OPEN_QUESTIONS and FOLLOWUPS as required reads. With this skill, those references resolve to the .html files.task-tracking-dots-html (the dot-html CLI, HTML dots under .dots/) is the work-item tracker, NOT the Markdown task-tracking-dots. Q-NNN entries that resolve into work become Dots. F-NNN entries with data-priority="blocks-release" become Dots.spiral-html/
├── SKILL.md # This file (YAML frontmatter + HTML body)
├── README.md # Human-facing one-pager (HTML body)
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── commands/
│ ├── spiral-html-init.md # /spiral-html init slash command
│ └── spiral-html-audit.md # /spiral-html audit slash command
├── templates/
│ ├── AGENTS.md # The contract, in Markdown (Codex root-down walk)
│ ├── CLAUDE.md # One-line @AGENTS.md import (Claude Code project memory)
│ ├── IMPLEMENTATION_PLAN.html
│ ├── WORKING_AGREEMENT.html
│ ├── docs-gdd-index.html
│ ├── GDD_COVERAGE.json
│ ├── PROGRESS_LOG.html
│ ├── OPEN_QUESTIONS.html
│ ├── FOLLOWUPS.html
│ ├── DEPENDENCY_LEDGER.html
│ ├── PLAYTEST.html
│ ├── FUN_FACTOR_AUDIT.html
│ ├── dot-claude-rules-slice-discipline.md
│ ├── dot-claude-rules-ledger-append-only.md
│ └── dot-claude-rules-gdd-build-log.md
├── scripts/
│ ├── init.sh # Bootstrap into a target repo
│ └── audit.sh # Diff target repo against canon
└── docs/
├── methodology.html # The meta-pattern essay
└── case-studies.html # VibeRacer / VibeGear2 / Flatline