Skip to content

fix(agents): fix YAML frontmatter in 14 agent definitions + validation script#1795

Merged
nick-inkeep merged 2 commits intomainfrom
fix/agent-frontmatter-yaml
Feb 7, 2026
Merged

fix(agents): fix YAML frontmatter in 14 agent definitions + validation script#1795
nick-inkeep merged 2 commits intomainfrom
fix/agent-frontmatter-yaml

Conversation

@nick-inkeep
Copy link
Collaborator

Summary

14 of 18 agent files had broken YAML frontmatter that silently prevented Claude Code from discovering them at runtime. Only pr-review, pr-review-llm, and pr-review-sre were discoverable — all other reviewers silently failed to load, causing the orchestrator to fall back to a single general-purpose agent.

Root Cause

<example> and <commentary> blocks inside description: | block scalars were at column 0 instead of indented by 2+ spaces. YAML treats unindented lines as the end of the block scalar, then fails to parse the remaining content. Claude Code reports "Agent type not found" with no diagnostic about the parse failure.

This is a known issue with Claude Code's stricter YAML parsing in v2.1+ (anthropics/claude-code#11205).

Changes

Frontmatter fixes (14 files)

Indented all description block scalar content by 2 spaces:

  • pr-review-architecture, pr-review-breaking-changes, pr-review-comments
  • pr-review-consistency, pr-review-devops, pr-review-docs
  • pr-review-errors, pr-review-frontend, pr-review-product
  • pr-review-security-iam, pr-review-standards, pr-review-tests
  • pr-review-types, git-rebase-coordinator

Already valid (no changes): pr-review, pr-review-llm, pr-review-sre, code-simplifier

Validation script (new)

scripts/validate-ai-artifacts.ts — TypeScript validation using the yaml package. Validates:

  • Agents (.claude/agents/*.md): YAML parse, required name+description, name/filename match
  • Skills (.agents/skills/**/SKILL.md, .claude/skills/**/SKILL.md, .cursor/skills/**/SKILL.md): YAML parse, required name+description, name/directory match

Run manually:

pnpm validate:ai-artifacts

Runs automatically via lint-staged when agent or skill files are committed.

lint-staged integration

Added hooks in package.json for:

  • .claude/agents/*.md — triggers pnpm validate:ai-artifacts
  • .agents/skills/**/SKILL.md — triggers pnpm validate:ai-artifacts

Test plan

  • pnpm validate:ai-artifacts passes for all 66 files (18 agents + 48 skills)
  • Merge, rebase retry-triggers onto main, verify all 15 reviewers are discovered in PR Retry triggers in trace ui #1789 review

Made with Cursor

nick-inkeep and others added 2 commits February 6, 2026 18:54
…ation

14 of 18 agent files had broken YAML frontmatter that silently prevented
Claude Code from discovering them at runtime. The agents existed on disk
but Claude Code's YAML parser failed on them, reporting "Agent type not
found" with no further diagnostic.

Root cause: <example> and <commentary> blocks inside `description: |`
block scalars were at column 0 instead of indented by 2+ spaces. YAML
treats unindented lines as the end of the block scalar, then fails to
parse the remaining content as valid YAML keys.

Fixed agents (12 pr-review + 1 git-rebase-coordinator + 1 pr-review-docs):
- pr-review-architecture, pr-review-breaking-changes, pr-review-comments
- pr-review-consistency, pr-review-devops, pr-review-docs
- pr-review-errors, pr-review-frontend, pr-review-product
- pr-review-security-iam, pr-review-standards, pr-review-tests
- pr-review-types, git-rebase-coordinator

Already valid (no changes): pr-review, pr-review-llm, pr-review-sre,
code-simplifier

Added:
- scripts/validate-agents.sh: validates YAML frontmatter for all agent
  files, checks required name/description fields, warns on name/filename
  mismatch
- lint-staged hook: runs validate-agents.sh when .claude/agents/*.md
  files are committed

Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace scripts/validate-agents.sh (Python/bash) with
  scripts/validate-ai-artifacts.ts (TypeScript using yaml package)
- Validates both agent files (.claude/agents/*.md) and skill files
  (.agents/skills/**/SKILL.md, .claude/skills/**/SKILL.md, etc.)
- Checks: YAML parse, required name+description, name/filename match
- Added yaml as root devDep, pnpm validate:ai-artifacts script
- lint-staged hooks for both .claude/agents/*.md and .agents/skills/**/SKILL.md

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Building Building Preview, Comment Feb 7, 2026 3:00am
agents-docs Building Building Preview, Comment Feb 7, 2026 3:00am
agents-manage-ui Building Building Preview, Comment Feb 7, 2026 3:00am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 7, 2026

⚠️ No Changeset found

Latest commit: dc92054

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

1 Key Finding | Risk: Low

This PR correctly addresses a critical bug where 14 agent definitions had broken YAML frontmatter that silently prevented Claude Code from discovering them at runtime. The fix (indenting <example> blocks by 2 spaces inside description: | block scalars) is the correct solution.

🟡 Minor (1) 🟡

🟡 1) package.json:40 Script naming convention inconsistency

Issue: The new npm script uses validate:ai-artifacts while the established pattern for validation scripts is check:* (e.g., check:env-descriptions, check:husky, check:prepush).

Why: Inconsistent naming makes script discovery harder. Developers familiar with pnpm check:* may not find pnpm validate:*.

Fix: Rename to check:ai-artifacts to match the established convention.

Refs: package.json:81 shows the existing pattern

📌 Inline Comments (1)

  • 🟡 package.json:40 Script naming inconsistency with suggested fix

✅ APPROVE

Summary: The core fix is correct and well-executed. The validation script is reasonable quality for a developer tool. All 14 agent files now have properly indented frontmatter that will parse correctly. The one minor suggestion (script naming) is non-blocking and can be addressed at your discretion. Nice work catching this silent failure mode and adding automated validation to prevent recurrence! 🎉

Other Findings (6)

Potentially valid

(these are minor or info critically and not confident)

Location Issue Reason Excluded
scripts/validate-ai-artifacts.ts No unit tests for validation script Existing scripts in scripts/*.mjs also lack tests; manual testing confirmed; developer tooling with low risk
package.json:106-111 lint-staged runs full validation on single file change Currently 66 files is fast enough; optimization is a follow-up
scripts/validate-ai-artifacts.ts:73-77 Doesn't check for <example> blocks in descriptions Nice-to-have validation; not blocking
.claude/agents/git-rebase-coordinator.md Uses single-line format unlike other fixed files YAML is valid; formatting preference

Discarded as invalid or not applicable

Location Issue Reason Excluded
package.json:109 lint-staged only hooks .agents/skills, not .claude/skills Works correctly via symlinks
scripts/validate-ai-artifacts.ts yaml package is new dependency Correctly scoped as devDependency, ISC licensed
Reviewer Stats
Reviewer Returned Inline Comments Main Findings Pending Recs Other Findings
pr-review-tests 5 0 0 0 1
pr-review-devops 5 0 0 0 3
pr-review-consistency 3 1 1 0 2
pr-review-standards 0 0 0 0 0
Total 13 1 1 0 6

"check:husky": "turbo check:husky --filter='!agents-cookbook-templates' --filter='!@inkeep/agents-docs'",
"check:prepush": "turbo check:prepush --filter='!agents-cookbook-templates' --filter='!@inkeep/agents-docs'",
"check:fix": "biome check --write",
"validate:ai-artifacts": "tsx scripts/validate-ai-artifacts.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Script naming inconsistency

The new script uses validate: prefix while existing validation scripts use check:* (e.g., check:env-descriptions, check:husky, check:prepush). Consider aligning for discoverability.

package.json L81 shows the existing pattern.

Suggested change
"validate:ai-artifacts": "tsx scripts/validate-ai-artifacts.ts",
"check:ai-artifacts": "tsx scripts/validate-ai-artifacts.ts",

@inkeep
Copy link
Contributor

inkeep bot commented Feb 7, 2026

No docs changes detected.

This PR fixes internal YAML frontmatter in Claude agent definition files and adds a validation script for developer tooling. These changes don't affect user-facing documentation.

@github-actions github-actions bot deleted a comment from claude bot Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments