Skip to content

Add leadtype doctor to explain resolved config and project health #155

Description

@KayleeWilliams

Problem

Leadtype has strong task-specific commands (generate, sync, lint, score) and machine-readable output, but no single read-only command that explains the resolved project before work begins.

As the config gains source acquisition, inheritance, mounts, navigation, redirects, agent surfaces, and compatibility aliases, users and coding agents need to answer questions such as:

  • Which config file was discovered?
  • Is this a local, remote, or multi-repo project?
  • Which values were explicit, inferred, inherited, or deprecated?
  • Which collections share a Git acquisition?
  • Which source revision is currently cached?
  • What public routes and output files will be produced?
  • Are human and agent-facing navigation using the same graph?
  • Which command fixes the current problem?

Blume’s doctor command is good inspiration, but Leadtype’s version should focus on its pipeline and supply-chain model.

Proposal

Add a read-only leadtype doctor command with concise human output and stable structured output via --json.

Checks should include:

Config

  • discovered config path and config mode;
  • schema errors, mutually exclusive fields, and deprecated aliases;
  • explicit versus inferred values;
  • source-owned inheritance with field-level provenance.

Sources

  • local directories and config files exist;
  • remote repository/ref/cache resolution;
  • mutable versus pinned revisions;
  • collections sharing one acquisition;
  • whether sync is required or the cache is stale/missing;
  • include/exclude patterns that match no content.

Routes and navigation

  • route-prefix and mount collisions;
  • unresolved, duplicate, or unrepresented pages;
  • summary of the resolved navigation tree;
  • human/agent navigation parity.

Outputs and integrations

  • output root and expected artifacts;
  • artifact freshness relative to config/content;
  • enabled MCP/NLWeb/skills/robots/redirect/feed surfaces;
  • detected framework adapter and obvious missing wiring where it can be checked safely.

UX requirements

  • Read-only by default; no cloning, refreshing, rewriting, or generating.
  • Every failure names the owning config field/file and a concrete next command.
  • Exit 0 when healthy, non-zero when required inputs are invalid/missing.
  • --json uses stable issue IDs and includes provenance so agents can act without parsing prose.
  • Warnings and failures should be reusable by config loading, generate, and sync, rather than creating a separate validation implementation.

A later --fix mode can be considered separately after the diagnostics are proven.

Acceptance criteria

  • leadtype doctor explains config discovery, sources, routes, navigation, and output surfaces without mutating state.
  • Human output is concise and includes actionable next commands.
  • JSON output has documented stable issue IDs and provenance fields.
  • Deprecation and compatibility information from Introduce a canonical config API with backward-compatible normalization #151 is represented.
  • Local, remote, offline, stale-cache, and multi-collection fixtures are covered.
  • Public c15t and Leadtype docs configs produce useful, understandable reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumMedium — valuable, not blocking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions