Generate spec
generate_specGenerates a complete rebuild spec—CLAUDE.md, config, and mutation-tested tests—from an existing app's repo, enabling coding agents to rebuild it cleanly.
Instructions
Write CLAUDE.md, .claude/, spec/, tests/, and kickoff-prompt.txt to -rebuild/. Only callable once the case queue is empty. Optional: if the target is a Next.js app with page routes, set GROQ_API_KEY and REBUILD_DOSSIER_ENABLE_VISION_CLASSIFICATION=1 before calling this tool to enable vision-assisted page-content classification (sends each captured page's screenshot and source code to Groq to judge static vs. dynamic content more accurately than plain regex matching) — ask the user for a Groq API key if they want more reliable generated page tests and this isn't already configured. Off by default; nothing changes if unset. Optional: pass authStorageStatePath to reach auth-gated pages during capture — see that field's own description for how to produce it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repoPath | Yes | Repo path that was ingested; output is written to a sibling <repoPath>-rebuild/ directory | |
| authStorageStatePath | No | Optional path to a Playwright storageState JSON file (cookies/localStorage from an already-authenticated session against the target app) — load it once with `npx playwright open <url> --save-storage=state.json` after logging in by hand, or any equivalent one-time export. When set, page capture uses it to reach auth-gated pages instead of only ever seeing a login screen; this tool never logs in itself or handles credentials. The file is copied into the rebuild output (tests/fixtures/auth-storage-state.json, gitignored) so generated page tests can reach the same pages when run standalone. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warning | No | ||
| outputDir | Yes | ||
| weakTests | Yes | ||
| skippedPages | Yes | ||
| capturedPages | Yes | ||
| pageCaptureNote | No | ||
| unrunnableTests | Yes | ||
| mutationsChecked | Yes | ||
| pageVisionFallbacks | No | ||
| pageVisionFallbackNote | No | ||
| visionClassificationNote | No | ||
| visionClassificationEnabled | Yes |