Skip to main content
Glama
Parker-Fawcett

rebuild-dossier

Generate spec

generate_spec
Destructive

Generate a rebuild spec (CLAUDE.md, config, and tests) from a previously ingested repo, writing output to a sibling directory. Use after the case queue is empty to enable clean app recreation.

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

TableJSON Schema
NameRequiredDescriptionDefault
repoPathYesRepo path that was ingested; output is written to a sibling <repoPath>-rebuild/ directory
authStorageStatePathNoOptional 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

TableJSON Schema
NameRequiredDescriptionDefault
warningNo
outputDirYes
weakTestsYes
apiTestNoteNo
skippedPagesYes
capturedPagesYes
unrunnableNoteNo
pageCaptureNoteNo
unrunnableTestsYes
mutationsCheckedYes
unrunnableReasonsNo
noVisibleTestsNoteNo
pageVisionFallbacksNo
pageVisionFallbackNoteNo
visionClassificationNoteNo
visionClassificationEnabledYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.16-paper
    • addedOutput schema / properties / noVisibleTestsNote
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / unrunnableNote
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / unrunnableReasons
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.2.12
    • addedOutput schema / properties / apiTestNote
      Added value: +{
      +  "type": "string"
      +}
  3. Changed1 schema field changedv0.2.6-paper
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "capturedPages": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "mutationsChecked": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "outputDir": {
      +      "type": "string"
      +    },
      +    "pageCaptureNote": {
      +      "type": "string"
      +    },
      +    "pageVisionFallbackNote": {
      +      "type": "string"
      +    },
      +    "pageVisionFallbacks": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "reason": {
      +            "type": "string"
      +          },
      +          "routeFile": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "routeFile",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "skippedPages": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "reason": {
      +            "type": "string"
      +          },
      +          "routeFile": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "routeFile",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "unrunnableTests": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "visionClassificationEnabled": {
      +      "type": "boolean"
      +    },
      +    "visionClassificationNote": {
      +      "type": "string"
      +    },
      +    "warning": {
      +      "type": "string"
      +    },
      +    "weakTests": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "outputDir",
      +    "mutationsChecked",
      +    "weakTests",
      +    "unrunnableTests",
      +    "capturedPages",
      +    "skippedPages",
      +    "visionClassificationEnabled"
      +  ],
      +  "type": "object"
      +}
  4. Changed1 schema field changedv0.2.2-paper
    • addedInput schema / properties / authStorageStatePath
      Added value: +{
      +  "description": "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.",
      +  "type": "string"
      +}
  5. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds several behavioral details beyond the annotations: the vision classification is off by default with no effect if unset, the tool never logs in or handles credentials, and the auth file is copied into the output. These details clarify side effects and limitations. It does not contradict the destructiveHint annotation, and the description's transparency about what it does not do (e.g., never logs in) is valuable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is relatively long, with a substantial conditional block about vision classification and a lengthy explanation of authStorageStatePath usage. While it is front-loaded with the primary action, the optional features are described in more detail than necessary for a tool definition, making it somewhat verbose. It is structured but not a model of conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the primary action, preconditions, optional features, and the purpose of the auth parameter. Since an output schema exists, return values are already documented. The description is sufficient for an agent to understand when and how to invoke the tool, though it could explicitly state the consequences of calling it when the case queue is not empty. Overall, it is complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are fully documented in the schema. The description does not add much beyond the schema; it briefly references authStorageStatePath and points to its own description. The vision classification environment variables are not parameters. Thus the description provides minimal additional semantic value over the schema, warranting the baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb 'Write' and lists specific resources (CLAUDE.md, .claude/, spec/, tests/, kickoff-prompt.txt) and the target directory <repo>-rebuild/. This clearly differentiates it from siblings like ingest_repo or crawl_site, which perform different actions. The precondition about the case queue adds further specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear precondition (only callable once case queue is empty) and explains optional usage for vision classification and authStorageStatePath. However, it does not explicitly contrast with alternative tools or state when not to use it. The purpose is clear enough that usage context is implied, but explicit exclusions are absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.