docs: add claude-native frontmatter format guidance for agents#135
Merged
Conversation
**Changed:**
- Rewrote agent authoring guide to introduce the Claude-native frontmatter format as the recommended approach, replacing Go-template-based examples with plain-prose equivalents that work in both squad and Claude Code
- Updated `system.md` example to include YAML frontmatter block (`name`, `description`, `tools`, `model`) and replaced `{{if .Mode}}` conditionals with prose-based mode dispatch
- Explained squad's frontmatter handling: strips frontmatter before delivery, skips Go-template rendering for all prompt files when frontmatter is detected, and injects a literal `Mode: readonly` line under `--mode readonly`
- Added "Running the Same Agent in Claude Code" section documenting symlink registration and how `description` doubles as Claude's auto-delegation router
- Demoted template variables and mode conditionals to a "Legacy Templated Format" subsection, preserving docs for existing agents while steering new work to the Claude-native path
- Added escaping guidance for literal `{{` in templated files and noted Claude-native files require no escaping
- Updated output format example to use labeled prose sections (`## Edit-mode report`, `## Readonly-mode report`) instead of `{{if .Mode}}` conditionals
- Updated "Mode Not Working" troubleshooting to distinguish Claude-native (prose-dispatched, check assembled bundle for `Mode: readonly`) from legacy templated agents
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
Added:
system.mdformat, showing howname,description,tools, andmodelfields serve both squad and Claude Code from a single file{{...}}syntax to survive untoucheddescriptiondoubles as Claude's auto-delegation router{{if .Mode}}conditionals with plain prose describing edit as default and readonly as opt-in, noting that squad injects aMode: readonlyline and hard-rejects write tools at the runner layer{{"{{"}}is required in templated files but unnecessary in Claude-native files, with a recommendation to prefer the native format for agents covering templated subject matterChanged:
{{if .Mode}}conditional blocks in the sample# OUTPUT FORMATprompt with plain labeled sections (## Edit-mode report,## Readonly-mode report) consistent with the Claude-native prose approachMode: readonlyline) and legacy templated (exact conditional syntax check)