test: guard plugin csp-search agent/skill copies against template drift #124
Copy link
Copy link
Open
Labels
status:proposalProposal for discussionProposal for discussiontype:testTesting improvements or additionsTesting improvements or additions
Description
Problem
plugins/csp/agents/csp-search.md and plugins/csp/skills/csp-search/SKILL.md are hand-synced copies of the csp init agent templates in crates/csp/src/bin/csp/agents/*.md. Only the embedded templates are covered by a unit test (agent_templates_match_cli_output_and_auto_cache in crates/csp/src/bin/csp/main.rs). If someone edits a template and forgets the plugin copies, nothing catches it. PR #122 had to update all of these files by hand.
Proposal
Add a guard that fails when the plugin copies drift from the templates. Two options:
- A Rust test that reads the plugin files (via
CARGO_MANIFEST_DIR, skipped when the files are absent, so isolated crate builds such as crates.io packaging still pass) and runs the same assertions, or compares bodies after stripping frontmatter. - A CI script that strips frontmatter and the skill-only header from each copy and diffs the bodies against an agent template.
Acceptance criteria
- A change to the shared template body that is not mirrored in both plugin copies fails CI.
- Isolated crate builds (
cargo package/ crates.io) are unaffected.
Out of scope
- The README / README.ko /
docs/src/content/docs/agents-md.mdxsnippet copies (those are prose docs, not shipped agent definitions).
Context
- Review thread: fix(init): align agent templates with csp output and auto-cache #122 (comment)
- PR: fix(init): align agent templates with csp output and auto-cache #122 (closes csp init / plugin agent templates: wrong
filePathkey, stale "index not auto-updated" guidance, missing --max-snippet-lines #111)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:proposalProposal for discussionProposal for discussiontype:testTesting improvements or additionsTesting improvements or additions
Activity