fix(cli): print the skills staleness notice on stdout under --format markdown - #272
Conversation
…markdown `--format markdown` promises that everything a command produces arrives on stdout as one document, so an agent reads a single stream. The skills staleness notice was written to stderr regardless of format, and the suppression list never mentioned markdown, so under markdown it landed off-stream. Under `--format markdown` (or `--format=markdown`) the notice now goes to stdout as a trailing `### Notice` section, after the command's document. Every other format keeps the existing stderr line. Fixes #267 Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Summary by CodeRabbit
WalkthroughThe skills staleness notice now uses stdout as a trailing Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No concrete merge-blocking issue is established by the available evidence. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The implementation meets the main behavior in issue Resolution Update Full details: Docstring CoverageExplanation Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
commit: |
--format markdown(added in #260, cli-engine 0.4.0) makes one promise: everything the run produces — blocks, next actions, diagnostics, structured errors, help,--version, live events — lands on stdout, and nothing is written to stderr, so an agent reads a single stream.The skills staleness notice did not honour it.
packages/cli/src/skills-check.tsalways wrote toruntime.stderr, and its suppression list (--json,--quiet,-q,--version,--format json,--format=json) never mentioned markdown, so under markdown the notice landed on the stream the format promises is empty.The notice is kept — agents are exactly its audience. Under
--format markdownor--format=markdownit is now written to stdout as a trailing section, after the command's own document, in the heading-then-bullet shape the engine uses for### Diagnostics:The leading blank line is the one-blank-line separator between sections that
joinSectionsinpackages/cli-engine/src/execution/markdown.tsuses. Under every other format the behaviour is unchanged: the same one-line notice on stderr, and the same silence under--json,--quiet,-q,--version,--format json, CI,PRISMA_SKILLS_CHECK=0, the persisted opt-out, and theskills/initcommands.Argv detection for markdown reuses the same helper the json check now calls, so
--format=markdownand--format markdownare both recognised, and both are ignored after a bare--.Tests in
packages/cli/tests/skills-check.test.tscover: the notice on stdout with nothing on stderr for both spellings, a never-synced project, silence on both streams when the copies are current, an unchanged exit code on a failing command,--format humanstaying on stderr, and a markdown format after a bare--staying on stderr. The existing off-switch cases now also assert stdout is empty.docs/product/output-conventions.mdis updated in both places that state the rule: the "Out-Of-Date Agent Skills" section and the--format markdownsection.docs/product/cli-style-guide.mddoes not mention the notice, so it needed no change.Fixes #267
Commands run
pnpm --filter @prisma/cli testpnpm typecheckpnpm linte2e and conformance were not run.
🤖 Generated with Claude Code