Skip to content

feat: cache discovery results for domain retry #22

@mvoutov

Description

@mvoutov

Problem

When a domain fails during doc init, retrying with --mode chunked --domains "failed-domain" currently re-runs the full discovery (2 parallel Claude agents, ~2 min) even though we already have the results from the first run.

Solution

Cache discovery findings to .claude/skills/.discovery-cache.json after the first successful discovery run. Structure:

{
  "timestamp": "2026-03-23T...",
  "domains": [...],
  "findings": "...",
  "repoHash": "abc123"
}

When --domains is used with --mode chunked:

  1. Check if cache exists and is recent (< 1 hour or same repo hash)
  2. If yes, load cached domains + findings, skip discovery
  3. If no, run discovery as normal

This makes domain retries instant — scan only, no LLM calls until actual generation.

Current workaround

The --domains flag now skips discovery (merged in latest), but it also loses the discovery findings context that helps Claude write better skills.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions