Skip to content

docs: add claude-native frontmatter format guidance for agents#135

Merged
l50 merged 1 commit into
mainfrom
docs-claude-native-format
Jul 2, 2026
Merged

docs: add claude-native frontmatter format guidance for agents#135
l50 merged 1 commit into
mainfrom
docs-claude-native-format

Conversation

@l50

@l50 l50 commented Jul 2, 2026

Copy link
Copy Markdown
Member

Key Changes:

  • Introduced the Claude-native frontmatter format as the recommended approach for writing agent prompt files, replacing Go-template syntax as the default
  • Documented how squad handles frontmatter-prefixed prompt files by stripping metadata and skipping template rendering entirely
  • Added instructions for registering squad agents as Claude Code sub-agents via symlink with zero duplication
  • Clarified that legacy Go-template format is still supported but now explicitly secondary for existing agents only

Added:

  • Claude-native frontmatter format - documented the YAML frontmatter block as the preferred system.md format, showing how name, description, tools, and model fields serve both squad and Claude Code from a single file
  • Squad frontmatter behavior - explained that squad strips frontmatter before prompt delivery and skips Go-template rendering for all prompt files when frontmatter is detected, allowing literal {{...}} syntax to survive untouched
  • Claude Code integration guide - added "Running the Same Agent in Claude Code" section with symlink registration pattern and explanation of how description doubles as Claude's auto-delegation router
  • Prose-based mode dispatching guidance - documented how to replace {{if .Mode}} conditionals with plain prose describing edit as default and readonly as opt-in, noting that squad injects a Mode: readonly line and hard-rejects write tools at the runner layer
  • Brace escaping note - added "Escaping Literal Braces" subsection explaining that {{"{{"}} is required in templated files but unnecessary in Claude-native files, with a recommendation to prefer the native format for agents covering templated subject matter

Changed:

  • Template variable and mode conditional sections - demoted from top-level headings to subsections under a new "Legacy Templated Format" heading to reflect their secondary status
  • Output format example - replaced {{if .Mode}} conditional blocks in the sample # OUTPUT FORMAT prompt with plain labeled sections (## Edit-mode report, ## Readonly-mode report) consistent with the Claude-native prose approach
  • Mode troubleshooting guidance - split into two distinct paths: Claude-native (prose-dispatched, check assembled bundle for Mode: readonly line) and legacy templated (exact conditional syntax check)

**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
@github-actions github-actions Bot added the area/docs Changes made to project documentation label Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@l50 l50 merged commit dda9b4a into main Jul 2, 2026
5 checks passed
@l50 l50 deleted the docs-claude-native-format branch July 2, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Changes made to project documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant