Skip to content

test: guard plugin csp-search agent/skill copies against template drift #124

Open

Description

@amondnet

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.mdx snippet copies (those are prose docs, not shipped agent definitions).

Context

Activity

  1. added theissue type on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:proposalProposal for discussiontype:testTesting improvements or additions

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions