Repository navigation
[AI-1019] kcap curate apply: write curated guidelines to CLAUDE.md/AGENTS.md - #191
Conversation
… cover all malformed cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e-dup, null-content guard
…s malformed (exit 1)
PR Summary by QodoAdd Description
Diagram
High-Level Assessment
Files changed (16)
|
Code Review by Qodo
Context used✅ Tickets:
AI-1019 1.
|
| case "curate": { | ||
| if (args.Length < 2) { | ||
| Console.Error.WriteLine("Usage: kcap curate apply [--dry-run] [--yes]"); | ||
| return 1; | ||
| } | ||
| switch (args[1]) { | ||
| case "apply": { | ||
| var dryRun = args.Contains("--dry-run"); | ||
| var yes = args.Contains("--yes") || args.Contains("-y"); | ||
| return await CurateCommand.HandleApply(baseUrl!, dryRun, yes); | ||
| } | ||
| default: | ||
| Console.Error.WriteLine($"Unknown curate subcommand: {args[1]}"); | ||
| Console.Error.WriteLine("Usage: kcap curate apply [--dry-run] [--yes]"); | ||
| return 1; |
There was a problem hiding this comment.
1. curate apply undocumented in readme 📘 Rule violation ⚙ Maintainability
The PR adds a new user-facing CLI command kcap curate apply (and flags --dry-run, --yes/-y) but does not document it in README.md. This can mislead users because the public command reference won’t match the shipped CLI surface.
Agent Prompt
## Issue description
A new user-facing CLI command `kcap curate apply` (with `--dry-run` and `--yes/-y`) was added, but `README.md` was not updated to reflect the new CLI surface.
## Issue Context
The compliance checklist requires README updates in the same PR for user-visible CLI changes, not only updates to `help-*.txt`.
## Fix Focus Areas
- README.md[134-170]
- src/Capacitor.Cli/Program.cs[311-325]
- src/Capacitor.Cli.Core/Resources/help-usage.txt[51-53]
- src/Capacitor.Cli.Core/Resources/help-curate.txt[1-18]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Fixed in da94005a3 — added a 'Curate guidelines' section to README.md documenting kcap curate apply and its --dry-run / --yes/-y flags, matching the existing command-reference style.
…ad of replacing it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Follow-up commit |
…ves content outside markers untouched Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks @qodo-code-review — all four findings addressed:
Full unit suite green (1825). |
Thanks for the update — looks good.
I also see the unit suite is green, so I’m satisfied with the current state. |
Implements the deferred curation write-back (provisional DEV-1678, now AI-1019) — the follow-up to the curation queue (AI-170). Promotions to
claude_mdpreviously only recorded intent; nothing wrote local files. This addskcap curate applyto actually sync them.What it does
kcap curate applydetects the current repo, fetches its promoted curation guidelines from the server, keeps theclaude_md-targeted ones, and writes them into the repo's project-instruction file(s) inside an idempotent managed block.CLAUDE.mdand/orAGENTS.md— updates whichever exist, createsAGENTS.mdif neither does. No personal-memory write-back (harness memory systems differ/unknown).GET /api/repositories/{hash}/curation?status=promoted.GitRepository.FindRoot(never the cwd-fallbackAppConfig.RepoRoot).-->) so a promoted guideline can't corrupt the block.--dry-run;--yes; atomic write preserving the existing file mode (not forced 0600); symlink de-dup; distinct errors for not-in-repo / no-remote / 404 / 401 / unreachable / malformed / IO.Structure
Pure, independently-tested building blocks in
Capacitor.Cli.Core/Curation/(CuratedTextNormalizer,CuratedBlock,CuratedTargets,CurationApplyPlanner) composed by a thinCurateCommand. Newcurateverb in the dispatcher +help-curate.txt+ usage section. New AOT-registered DTOs.Tests
TDD throughout; full unit suite green (1823 passing). Covers normalization, render/splice idempotency + all four malformed-marker cases, target resolution, planner actions/diffs, and atomic mode-preserving writes. The live network end-to-end (
applyagainst a server with real promotions) is manual — not runnable in CI without a seeded server.Companion / follow-ups
kcap-server, plus asrc/clisubmodule bump once this merges.NewContent==nullassertion; a null/missing-itemsDTO test; a code comment on symlink replacement inWriteFileAtomic.Spec + plan:
docs/superpowers/specs/2026-06-26-curate-apply-writeback-design.mdanddocs/superpowers/plans/2026-06-26-curate-apply-writeback.mdin kcap-server.🤖 Generated with Claude Code