feat: agent doctor cli for agent with --json flag#136
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
Greptile SummaryThis PR adds a One minor documentation inaccuracy worth noting: README, the website docs page, and SKILL.md all state "Warnings still go to stderr" but Confidence Score: 5/5Safe to merge; the only finding is a minor documentation inaccuracy, not a code defect. All changed logic is correct and thoroughly tested. The single finding (stderr claim in docs) is P2 and does not affect runtime behaviour. README.md, website/app/docs/cli/page.mdx, and skills/farming-labs/cli/SKILL.md contain the misleading stderr claim. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as CLI (index.ts)
participant Parser as parseDoctorArgs
participant Doctor as runDoctor
participant Inspector as inspectAgent/HumanReadiness
participant Serializer as serializeDoctorJsonReport
participant Stdout as stdout
CLI->>Parser: argv (e.g. ["--agent","--json"])
Parser-->>CLI: { mode: "agent", json: true }
CLI->>Doctor: runDoctor({ mode, json })
Doctor->>Inspector: inspectAgentReadiness / inspectHumanReadiness
Inspector-->>Doctor: AgentDoctorReport { mode: "agent" } or HumanDoctorReport { mode: "human" }
alt json: true
Doctor->>Serializer: serializeDoctorJsonReport(report)
note over Serializer: "human" to "site" rename
Serializer-->>Doctor: serialized report
Doctor->>Stdout: console.log(JSON.stringify(serialized, null, 2))
else json: false (default)
Doctor->>Stdout: printAgentDoctorReport / printHumanDoctorReport
end
Doctor-->>CLI: report (internal mode preserved)
Reviews (1): Last reviewed commit: "chore: format" | Re-trigger Greptile |
| - GitHub Actions summaries or PR comments | ||
| - dashboards that track docs quality over time | ||
| - automation that reruns `docs agent compact --stale` | ||
| - other agents that need structured readiness signals instead of terminal text |
There was a problem hiding this comment.
"Warnings go to stderr" claim is not backed by the implementation
doctor.ts has no console.warn, console.error, or process.stderr writes of its own. All check results — including those with warn or fail status — are embedded in the JSON payload sent to stdout via console.log. The only stderr path is an incidental console.warn in config.ts that fires when config module evaluation falls back to static parsing, which is an unrelated infrastructure edge case.
The same claim appears in website/app/docs/cli/page.mdx ("Warnings still go to stderr, so stdout stays safe to parse") and skills/farming-labs/cli/SKILL.md ("JSON stays on stdout while warnings stay on stderr").
Consider either updating the copy to reflect actual behavior ("The full report, including any check warnings, is written as JSON to stdout") or adding a deliberate stderr path (e.g., process.stderr.write(...)) for operational messages such as config load failures before the JSON claim is made.
Summary by cubic
Adds JSON output to the
docs doctorCLI for agent and site scoring so CI, scripts, and other agents can consume results. JSON prints to stdout; warnings stay off the payload; docs, help, and tests updated.docs doctor --agent --jsonanddocs doctor --site --jsonemit structured JSON to stdout; warnings remain on stderr.parseDoctorArgs,runDoctor, and CLI help (indoctorand top-levelindex) support--json; human mode serializes as"site"in JSON.--jsonparsing and output, and expanded docs with examples and a sample JSON shape.Written for commit c74eaee. Summary will update on new commits. Review in cubic