Skip to content

csp init / plugin agent templates: wrong filePath key, stale "index not auto-updated" guidance, missing --max-snippet-lines #111

Closed

Description

@amondnet

Summary

The agent instructions that csp init writes and the ones the csp plugin ships have drifted from both upstream semble and csp's own behavior. Three problems affect every csp init and plugin user. Two of them are outright wrong.

Problems

  1. Wrong result key (bug). The templates say "pass filePath and line from a prior search result". The CLI/MCP wire dict is snake_case file_path (crates/csp/src/utils.rs:30), so an agent that looks for filePath finds nothing.
  2. Stale indexing guidance (bug). The templates tell agents to run csp index -o cached_index first and say "an index is not automatically updated". csp auto-caches under $HOME/.csp/index/ and invalidates the cache by content hash (ADR-0002, cache_orchestrator.rs). Following the template pins agents to a stale --index copy and bypasses the fresh auto-cache. Upstream now says the index is "cached automatically on first run and invalidated when files change".
  3. Missing --max-snippet-lines guidance (upstream #198). Upstream examples use --max-snippet-lines 10 and say "do not re-search or grep for the same content". csp's CLI defaults to the full chunk, so agents following the csp templates spend more tokens than they need to.

Affected files

  • crates/csp/src/bin/csp/agents/*.md (all 10 templates; e.g. claude.md:27,37,51,55)
  • plugins/csp/agents/csp-search.md
  • plugins/csp/skills/csp-search/SKILL.md (:28,38,52,56)
  • README.md / README.ko.md (the sub-agent / AGENTS.md snippets carry the same "not automatically updated" wording)

Acceptance

  • Every template and plugin copy says file_path.
  • The workflow no longer requires csp index -o; the text describes the auto-cache and keeps --index only as an option.
  • Examples use --max-snippet-lines 10, matching upstream agents/claude.md.
  • Both READMEs are updated together.
  • A test asserts that no bundled template contains filePath.

Found during the upstream sync review 6bbbd32..0e5e028.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:proposalProposal for discussiontype:bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions