refactor(factory): align agent-author and agent-audit with skill-author pattern

- agent-author: convert template comments from YAML (#) to HTML (<!-- -->)
  - Easier to spot and distinguish from functional comments
  - Add explicit "Delete template comments before shipping" reminders
  - Update SKILL.md Steps 2-3 with removal instruction

- agent-audit: add comment-discipline check
  - Flag excessive frontmatter documentation comments as padding
  - Mirrors skill-audit's body-discipline principle
  - Update coverage line to include comment-discipline dimension

This ensures agents follow the same comment-cleanup discipline as skills,
preventing template documentation from shipping with agent definitions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 15:23:04 +00:00
parent 77dedc3735
commit 19f7fde5e1
4 changed files with 93 additions and 84 deletions

View File

@@ -1,71 +1,72 @@
---
# Claude Code agent definition
# Fill in all FILL IN: placeholders. Remove or uncomment optional fields as needed.
<!-- Claude Code agent definition
Fill in all FILL IN: placeholders. Remove or uncomment optional fields as needed.
Delete template comments before shipping. -->
name: AGENT_NAME
# Required. Lowercase letters and hyphens only. Must be unique within the scope.
# Duplicate names are silently discarded — no warning is emitted.
<!-- Required. Lowercase letters and hyphens only. Must be unique within the scope.
Duplicate names are silently discarded — no warning is emitted. -->
description: FILL IN: Action-first description of what this agent does and when to invoke it.
# Required. The primary signal for autonomous delegation.
# Start with a verb: "Reviews...", "Analyzes...", "Generates..."
# Include "Use proactively" to trigger automatic invocation.
# Be specific about the triggering condition and domain.
# Example: "Reviews pull request diffs for security issues. Use proactively after code changes."
<!-- Required. The primary signal for autonomous delegation.
Start with a verb: "Reviews...", "Analyzes...", "Generates..."
Include "Use proactively" to trigger automatic invocation.
Be specific about the triggering condition and domain.
Example: "Reviews pull request diffs for security issues. Use proactively after code changes." -->
# tools: Read Bash Grep
# Optional. Space-separated allowlist. Omit to inherit all tools from parent.
# Use Agent(type1,type2) to restrict which subagent types this agent can spawn.
# Omit Agent entirely to prevent this agent from spawning subagents.
# Never available to subagents regardless of tools field:
# AskUserQuestion, EnterPlanMode, ExitPlanMode, ScheduleWakeup, WaitForMcpServers
# Exception: ExitPlanMode IS available when parent session runs in permissionMode: plan
<!-- tools: Read Bash Grep
Optional. Space-separated allowlist. Omit to inherit all tools from parent.
Use Agent(type1,type2) to restrict which subagent types this agent can spawn.
Omit Agent entirely to prevent this agent from spawning subagents.
Never available to subagents regardless of tools field:
AskUserQuestion, EnterPlanMode, ExitPlanMode, ScheduleWakeup, WaitForMcpServers
Exception: ExitPlanMode IS available when parent session runs in permissionMode: plan -->
# model: sonnet
# Optional. Aliases: sonnet, opus, haiku, fable. Or full model ID.
# Omit to inherit from the main session.
# Resolution order: CLAUDE_CODE_SUBAGENT_MODEL env var → per-invocation param → this field → session model.
<!-- model: sonnet
Optional. Aliases: sonnet, opus, haiku, fable. Or full model ID.
Omit to inherit from the main session.
Resolution order: CLAUDE_CODE_SUBAGENT_MODEL env var → per-invocation param → this field → session model. -->
# effort: medium
# Optional. low / medium / high / xhigh / max. Overrides session effort level for this agent.
<!-- effort: medium
Optional. low / medium / high / xhigh / max. Overrides session effort level for this agent. -->
# maxTurns: 20
# Optional. Integer cap on agentic turns. Prevents runaway on bounded tasks.
<!-- maxTurns: 20
Optional. Integer cap on agentic turns. Prevents runaway on bounded tasks. -->
# memory: project
# Optional. user / project / local. Enables cross-session MEMORY.md (first 200 lines loaded at startup).
# Auto-enables Read/Write/Edit tools.
<!-- memory: project
Optional. user / project / local. Enables cross-session MEMORY.md (first 200 lines loaded at startup).
Auto-enables Read/Write/Edit tools. -->
# isolation: worktree
# Optional. Set to "worktree" to run in an isolated temporary git worktree.
# Auto-cleaned if no changes are made.
<!-- isolation: worktree
Optional. Set to "worktree" to run in an isolated temporary git worktree.
Auto-cleaned if no changes are made. -->
# color: blue
# Optional. UI color: red, blue, green, yellow, purple, orange, pink, cyan.
<!-- color: blue
Optional. UI color: red, blue, green, yellow, purple, orange, pink, cyan. -->
# background: false
# Optional. Set true to force background execution.
<!-- background: false
Optional. Set true to force background execution. -->
# disallowedTools: mcp__filesystem__write_file
# Optional. Space-separated denylist, applied before the tools allowlist.
# Supports mcp__* glob patterns (e.g. mcp__filesystem__* to block all filesystem tools).
<!-- disallowedTools: mcp__filesystem__write_file
Optional. Space-separated denylist, applied before the tools allowlist.
Supports mcp__* glob patterns (e.g. mcp__filesystem__* to block all filesystem tools). -->
# skills:
# - skill-name
# Optional. Skill names preloaded into this agent's context at startup.
# Different from the source_keys metadata field (which is provenance-only).
<!-- skills:
- skill-name
Optional. Skill names preloaded into this agent's context at startup.
Different from the source_keys metadata field (which is provenance-only). -->
# initialPrompt: "Start by reading the README."
# Optional. Auto-submitted as the first turn when this agent activates as the main session thread.
# Only set when this agent is intended for main-thread (not subagent) activation.
<!-- initialPrompt: "Start by reading the README."
Optional. Auto-submitted as the first turn when this agent activates as the main session thread.
Only set when this agent is intended for main-thread (not subagent) activation. -->
# source_keys:
# - slug-name
# Development-only. Add when research sources informed this agent (slugs must match agents/sources.md).
# Omit when no research was used. Not a runtime field — silently ignored by Claude Code.
<!-- source_keys:
- slug-name
Development-only. Add when research sources informed this agent (slugs must match agents/sources.md).
Omit when no research was used. Not a runtime field — silently ignored by Claude Code. -->
# NOTE: hooks, mcpServers, and permissionMode are silently ignored for plugin agents.
# Those fields only work in .claude/agents/ or ~/.claude/agents/.
<!-- NOTE: hooks, mcpServers, and permissionMode are silently ignored for plugin agents.
Those fields only work in .claude/agents/ or ~/.claude/agents/. -->
---
FILL IN: System prompt body. Write as a direct role instruction.