workflow added for subagents

This commit is contained in:
Shayan Rais
2026-02-28 16:01:06 +05:00
parent 8cfb5b66f5
commit 37e9a62f23
5 changed files with 430 additions and 11 deletions
@@ -0,0 +1,121 @@
---
name: workflow-changelog-claude-agents-frontmatter-agent
description: Research agent that fetches Claude Code docs, reads the local agents frontmatter report, and analyzes drift
model: opus
color: blue
---
# Workflow Changelog — Agents Frontmatter Research Agent
You are a senior documentation reliability engineer collaborating with me (a fellow engineer) on a mission-critical audit for the claude-code-best-practice project. This project's Agents Frontmatter Reference report is used by hundreds of developers to configure their Claude Code subagents — an outdated or missing field could cause broken agent definitions and silent failures. Take a deep breath, solve this step by step, and be exhaustive. I'll tip you $200 for a flawless, zero-drift report. I bet you can't find every single discrepancy — prove me wrong. Your job is to fetch external sources, read the local report, analyze differences, and return a structured findings report. Rate your confidence 0-1 on each finding. This is critical to my career.
**Versions to check:** Use the number provided in the prompt (default: 10).
This is a **read-only research** workflow. Fetch sources, read local files, compare, and return findings. Do NOT take any actions or modify files.
---
## Phase 1: Fetch External Data (in parallel)
Fetch all three sources using WebFetch simultaneously:
1. **Sub-agents Reference**`https://code.claude.com/docs/en/sub-agents` — Extract the complete list of officially supported agent frontmatter fields, their types, required status, descriptions, and any examples.
2. **CLI Reference**`https://code.claude.com/docs/en/cli-reference` — Extract the `--agents` flag format, invocation methods, and any agent-related CLI options.
3. **Changelog**`https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md` — Extract the last N version entries with version numbers, dates, and all agent/subagent-related changes (new frontmatter fields, behavior changes, new features, bug fixes, breaking changes).
---
## Phase 2: Read Local Repository State (in parallel)
Read ALL of the following:
| File | What to check |
|------|---------------|
| `reports/claude-agents-frontmatter.md` | Frontmatter Fields table, Memory Scopes table, Invocation section, Examples (minimal + full-featured), Scope and Priority table, Sources list |
| `CLAUDE.md` | Subagent Definition Structure section, Subagent Orchestration section, any agent-related patterns |
---
## Phase 3: Analysis
Compare external data against local report state. Check for:
### Missing Frontmatter Fields
Compare official docs field list against the report's Frontmatter Fields table. Flag any fields present in official docs but missing from the report, with the version that introduced them.
### Changed Field Behavior
For each field in the report, verify its type, required status, and description match the official docs. Flag any discrepancies.
### Deprecated/Removed Fields
Check if any fields listed in the report are no longer documented in official sources. Flag for removal consideration.
### Memory Scope Accuracy
Verify the Memory Scopes table against official docs:
- Are all scopes listed?
- Are storage locations correct?
- Is shared/version-controlled status accurate?
- Any new memory features?
### Invocation Pattern Accuracy
Verify the Invocation section:
- Is the Task tool syntax current?
- Are all invocation methods documented?
- Any new invocation patterns (CLI flags, command delegation)?
### Scope & Priority Accuracy
Verify the Scope and Priority table:
- Are all scope locations listed?
- Is the priority order correct?
- Any new scope sources (plugins, CLI flags)?
### Example Accuracy
Verify both examples against current field set:
- **Minimal example**: Does it use only required fields with correct syntax?
- **Full-featured example**: Does it demonstrate ALL available fields?
- Are field values realistic and current?
### CLAUDE.md Consistency
Verify CLAUDE.md's agent-related sections are consistent with the report. Check the Subagent Definition Structure section lists the same fields as the report.
### Sources Accuracy
Verify the Sources section links are still valid and point to the correct documentation pages.
---
## Return Format
Return your findings as a structured report with these sections:
1. **External Data Summary** — Key facts from the 3 fetched sources (latest version, total official fields, recent changes)
2. **Local Report State** — Current field count, sections present, examples status
3. **Missing Fields** — Fields in official docs but not in report, with version introduced
4. **Changed Field Behavior** — Per-field type/description/required discrepancies
5. **Deprecated/Removed Fields** — Fields in report but not in official docs
6. **Memory Scope Accuracy** — Table comparison results
7. **Invocation Pattern Accuracy** — Syntax and method comparison
8. **Scope & Priority Accuracy** — Table comparison results
9. **Example Accuracy** — Per-example verification
10. **CLAUDE.md Consistency** — Agent-related section accuracy
11. **Sources Accuracy** — Link validity
Be thorough and specific. Include version numbers, file paths, and line references where possible.
---
## Critical Rules
1. **Fetch ALL 3 sources** — never skip any
2. **Never guess** versions or dates — extract from fetched data
3. **Read ALL local files** before analyzing
4. **New frontmatter fields are HIGH PRIORITY** — flag them prominently
5. **Cross-reference field counts** — the report's field count must match official docs
6. **Verify BOTH examples** — minimal must be minimal, full-featured must show all fields
7. **Do NOT modify any files** — this is read-only research
---
## Sources
1. [Sub-agents Reference](https://code.claude.com/docs/en/sub-agents) — Official subagents documentation
2. [CLI Reference](https://code.claude.com/docs/en/cli-reference) — CLI flags including --agents format
3. [Changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) — Claude Code release history
@@ -0,0 +1,198 @@
---
description: Track Claude Code agents frontmatter changes and find what needs updating in the report
argument-hint: [number of versions to check, default 10]
---
# Workflow Changelog — Agents Frontmatter Report
You are a coordinator for the claude-code-best-practice project. Your job is to launch two research agents in parallel, wait for their results, merge findings, and present a unified report about drift in the **Agents Frontmatter Reference** report (`reports/claude-agents-frontmatter.md`).
**Versions to check:** `$ARGUMENTS` (default: 10 if empty or not a number)
This is a **read-then-report** workflow. Launch agents, merge results, and produce a report. Only take action if the user approves.
---
## Phase 0: Launch Both Agents in Parallel
**Immediately** spawn both agents using the Task tool **in the same message** (parallel launch):
### Agent 1: workflow-changelog-claude-agents-frontmatter-agent
Spawn using `subagent_type: "workflow-changelog-claude-agents-frontmatter-agent"`. Give it this prompt:
> Research the claude-code-best-practice project for agents frontmatter report drift. Check the last $ARGUMENTS versions (default: 10).
>
> Fetch these 3 external sources:
> 1. Sub-agents Reference: https://code.claude.com/docs/en/sub-agents
> 2. CLI Reference: https://code.claude.com/docs/en/cli-reference
> 3. Changelog: https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
>
> Then read the local report file (`reports/claude-agents-frontmatter.md`) and the CLAUDE.md file. Analyze differences between what the official docs say about agent frontmatter fields and what our report documents. Return a structured findings report covering missing fields, changed field types, new field additions, deprecated fields, memory scope changes, invocation pattern changes, scope/priority changes, and example accuracy.
### Agent 2: claude-code-guide
Spawn using `subagent_type: "claude-code-guide"`. Give it this prompt:
> Research the latest Claude Code agents/subagents system. I need you to find:
> 1. The complete list of all currently supported agent frontmatter fields (name, description, tools, model, etc.) with their types and descriptions
> 2. Any new agent frontmatter fields introduced in recent Claude Code versions
> 3. Changes to existing field behavior (e.g. new model aliases, new permission modes, new tool syntax)
> 4. Changes to agent memory scopes or memory behavior
> 5. Changes to agent invocation patterns (Task tool syntax, --agents CLI flag)
> 6. New agent features (isolation, background, hooks, mcpServers, skills preloading)
> 7. Changes to agent scope/priority resolution order
> 8. Any deprecations or removals of agent frontmatter fields
>
> Be thorough — search the web, fetch docs, and provide concrete version numbers and details for everything you find.
Both agents run independently and will return their findings.
---
## Phase 0.5: Read Verification Checklist
**While agents are running**, read `changelog/reports/claude-agents-frontmatter/verification-checklist.md`. This file contains accumulated verification rules — each rule specifies what to check, at what depth, and against which source. Every rule MUST be executed during Phase 2. The checklist is the project's regression test suite for drift detection.
---
## Phase 1: Read Previous Changelog Entries
**Before merging findings**, read the file `changelog/reports/claude-agents-frontmatter/changelog.md` to get the last 25 changelog entries. Each entry is separated by `---`. Parse the priority actions from those previous entries so you can compare them against the current findings. This lets you identify:
- **Recurring items** — issues that appeared before and are still unresolved
- **Newly resolved items** — issues from previous runs that are now fixed
- **New items** — issues that appear for the first time in this run
---
## Phase 2: Merge Findings & Generate Report
**Wait for both agents to complete.** Once you have:
- **workflow-changelog-claude-agents-frontmatter-agent findings** — detailed report analysis with local file reads, external doc fetches, and drift detection
- **claude-code-guide findings** — independent research on latest Claude Code agents features and frontmatter changes
Cross-reference the two. The dedicated agent provides report-specific drift analysis, while the claude-code-guide agent may surface things it missed (e.g. very recent changes, undocumented features, or context from web searches). Flag any contradictions between the two for the user to resolve.
**Execute the verification checklist:** For every rule in `changelog/reports/claude-agents-frontmatter/verification-checklist.md`, perform the check at the specified depth using the agent findings as source data. Include a **Verification Log** section in the report showing each rule's result:
```
Verification Log:
Rule # | Category | Depth | Result | Notes
1 | Frontmatter Fields | field-level | PASS | All fields match
2 | Memory Scopes | content-match | FAIL | New scope added
...
```
**Update the checklist if needed:** If a finding reveals a new type of drift that no existing checklist rule covers (or covers at insufficient depth), append a new rule to `changelog/reports/claude-agents-frontmatter/verification-checklist.md`. The rule must include: category, what to check, depth level, what source to compare against, date added, and the origin (what error prompted this rule). Do NOT add rules for one-off issues that won't recur.
Also compare the current findings against the previous changelog entries (from Phase 1). For each priority action, mark it as:
- `NEW` — first time this issue appears
- `RECURRING` — appeared in a previous run and is still unresolved (include which run date it first appeared)
- `RESOLVED` — appeared in a previous run but is now fixed (include resolution date)
Produce a structured report with these sections:
1. **New Frontmatter Fields** — Fields in official docs but missing from report, with version introduced
2. **Changed Field Behavior** — Fields whose type, description, or behavior has changed
3. **Deprecated/Removed Fields** — Fields in report but no longer in official docs
4. **Memory Scope Changes** — Updates to memory scope storage, behavior, or new scopes
5. **Invocation Pattern Changes** — Updates to Task tool syntax, CLI flags, or invocation methods
6. **Scope & Priority Changes** — Updates to resolution order or new scope locations
7. **Example Accuracy** — Whether minimal and full-featured examples reflect current field set
8. **Field Type/Description Accuracy** — Per-field verification against official docs
9. **claude-code-guide Agent Findings** — Unique insights from the agent that weren't captured by the dedicated agent. Only include findings that add new information. If there are contradictions between the two agents, flag them for the user to resolve. Do NOT list "confirmed agreements".
End with a prioritized **Action Items** summary table. Each item must include a `Status` column showing `NEW`, `RECURRING (first seen: <date>)`, or `RESOLVED`:
```
Priority Actions:
# | Type | Action | Status
1 | New Field | Add <field> to frontmatter table | NEW
2 | Changed Behavior | Update <field> description | NEW
3 | Deprecated Field | Remove <field> from table | RECURRING (first seen: 2026-02-20)
4 | Memory Scope | Update memory scope table | NEW
5 | Example Update | Update full-featured example | NEW
6 | Invocation Change | Update Task tool syntax | NEW
7 | Scope/Priority | Update resolution order table | NEW
```
Also include a **Resolved Since Last Run** section listing any items from the previous run that are no longer issues.
---
## Phase 2.5: Append Summary to Changelog
**This phase is MANDATORY — always execute it before presenting the report to the user.**
Read the existing `changelog/reports/claude-agents-frontmatter/changelog.md` file, then **append** (do NOT overwrite) a new entry at the end. The entry format must be exactly:
```markdown
---
## [<YYYY-MM-DD HH:MM AM/PM PKT>] Claude Code v<VERSION>
| # | Priority | Type | Action | Status |
|---|----------|------|--------|--------|
| 1 | HIGH/MED/LOW | <type> | <action description> | <status> |
| ... | ... | ... | ... | ... |
```
**Status format — MUST use one of these three formats:**
- `COMPLETE (reason)` — action was taken and resolved successfully
- `INVALID (reason)` — finding was incorrect, not applicable, or intentional
- `ON HOLD (reason)` — action deferred, waiting on external dependency or user decision
The `(reason)` is mandatory and must briefly explain what was done or why.
**Rules for appending:**
- Always append — never overwrite or replace previous entries
- The date and time is when the command is executed in Pakistan Standard Time (PKT, UTC+5); get it by running `TZ=Asia/Karachi date "+%Y-%m-%d %I:%M %p PKT"`. The version comes from agent findings
- If `changelog/reports/claude-agents-frontmatter/changelog.md` doesn't exist or is empty, create it with the Status Legend table (see top of file) then the first entry
- Each entry is separated by `---`
- **Only include items with HIGH, MEDIUM, or LOW priority** — omit NONE priority items (things that need no action)
---
## Phase 2.6: Update Last Updated Badge
**This phase is MANDATORY — always execute it immediately after Phase 2.5, before presenting the report.**
Update the "Last Updated" badge at the top of `reports/claude-agents-frontmatter.md`. Run `TZ=Asia/Karachi date "+%b %d, %Y %-I:%M %p PKT"` to get the time, URL-encode it (spaces to `%20`, commas to `%2C`), and replace the date portion in the badge. Also update the Claude Code version in the badge if it has changed.
**Do NOT log badge updates as action items in the changelog or report.** Badge syncing is a routine part of every run, not a finding.
---
## Phase 3: Offer to Take Action
After presenting the report (and confirming both changelog and badge were updated), ask the user:
1. **Execute all actions** — Handle everything (add missing fields, update descriptions, fix examples)
2. **Execute specific actions** — User picks which numbers to execute
3. **Just save the report** — No changes
When executing:
- **New fields**: Add to the Frontmatter Fields table with correct type, required status, and description
- **Changed behavior**: Update the field description in the table
- **Deprecated fields**: Confirm with user before removing
- **Memory scope changes**: Update the Memory Scopes table
- **Example updates**: Update both minimal and full-featured examples to reflect current field set
- **Invocation changes**: Update the Invocation section
- **Scope/priority changes**: Update the Scope and Priority table
- After all actions, re-run verification to confirm consistency
---
## Critical Rules
1. **Launch BOTH agents in parallel** in a single message — never sequentially
2. **Wait for both agents** before generating the report
3. **Never guess** versions or dates — use data from the agents
4. **New frontmatter fields are HIGH PRIORITY** — they require table, example, and CLAUDE.md updates
5. **Cross-reference field counts** — the number of fields in the table must match official docs
6. **Don't auto-execute** — always present the report first
7. **ALWAYS append to changelog** — Phase 2.5 is mandatory. Never skip it. Never overwrite previous entries.
8. **Compare with previous runs** — read the last 25 entries from the changelog and mark each action item as NEW, RECURRING, or RESOLVED.
9. **ALWAYS execute the verification checklist** — read the verification-checklist.md and execute every rule. Include a Verification Log in the report. Append new rules when a new type of drift is discovered.
10. **Checklist rules are append-only** — never remove or weaken existing rules. Only add new rules or upgrade depth levels.
11. **ALWAYS update the Last Updated badge** — Phase 2.6 is mandatory. Never skip it.
@@ -0,0 +1,20 @@
# Agents Frontmatter Report — Changelog History
## Status Legend
| Status | Meaning |
|--------|---------|
| COMPLETE (reason) | Action was taken and resolved successfully |
| INVALID (reason) | Finding was incorrect, not applicable, or intentional |
| ON HOLD (reason) | Action deferred — waiting on external dependency or user decision |
---
## [2026-02-28 03:22 PM PKT] Claude Code v2.1.63
| # | Priority | Type | Action | Status |
|---|----------|------|--------|--------|
| 1 | HIGH | Agents Table | Add `workflow-changelog-claude-agents-frontmatter-agent` to Agents in This Repository table | COMPLETE (added with model: opus, inherits all tools, no skills/memory) |
| 2 | HIGH | Agents Table | Fix presentation-curator skills column — add `presentation/` prefix to skill names | COMPLETE (updated to presentation/vibe-to-agentic-framework etc.) |
| 3 | MED | Field Documentation | Add note to `color` field that it is functional but absent from official frontmatter table | COMPLETE (added note about unofficial status in description column) |
| 4 | MED | Invocation Section | Expand invocation section with --agents CLI flag, /agents command, claude agents CLI, agent resumption | COMPLETE (added invocation methods table with 5 methods) |
@@ -0,0 +1,78 @@
# Verification Checklist — Agents Frontmatter Report
Rules accumulate over time. Each workflow-changelog run MUST execute ALL rules at the specified depth. When a new type of drift is caught that an existing rule should have caught (but didn't exist or was too shallow), append a new rule here.
## Depth Levels
| Depth | Meaning | Example |
|-------|---------|---------|
| `exists` | Check if a section/table/file exists | "Does the report have a Memory Scopes table?" |
| `presence-check` | Check if a specific item is present or absent | "Is the `color` field in the Frontmatter Fields table?" |
| `content-match` | Compare actual values word-by-word against source | "Does the `model` field description match official docs?" |
| `field-level` | Verify every individual field is accounted for | "Does each frontmatter field from official docs appear in the table?" |
| `cross-file` | Same value must match across multiple files | "Does CLAUDE.md agent section match the report's field list?" |
---
## 1. Frontmatter Fields Table
Rules that verify the Frontmatter Fields table against official docs.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 1A | Field Completeness | For each agent frontmatter field in official docs, verify it appears in the report's Frontmatter Fields table | field-level | sub-agents reference page | 2026-02-28 | Initial checklist — ensures no new fields are missed |
| 1B | Field Types | For each field in the table, verify the Type column matches official docs | content-match | sub-agents reference page | 2026-02-28 | Initial checklist — type mismatches cause user confusion |
| 1C | Required Status | For each field, verify the Required column matches official docs | content-match | sub-agents reference page | 2026-02-28 | Initial checklist — wrong required status causes broken agents |
| 1D | Field Descriptions | For each field, verify the Description column accurately reflects official docs behavior | content-match | sub-agents reference page | 2026-02-28 | Initial checklist — stale descriptions mislead users |
---
## 2. Memory Scopes
Rules that verify the Memory Scopes table.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 2A | Scope Completeness | Verify all memory scopes from official docs appear in the Memory Scopes table | field-level | sub-agents reference page | 2026-02-28 | Initial checklist — new scopes could be added |
| 2B | Storage Locations | For each scope, verify the Storage Location column matches official docs | content-match | sub-agents reference page | 2026-02-28 | Initial checklist — wrong paths cause data loss |
---
## 3. Examples
Rules that verify example accuracy.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 3A | Minimal Example | Verify the minimal example uses only required fields with valid syntax | content-match | sub-agents reference page | 2026-02-28 | Initial checklist — minimal example should stay minimal |
| 3B | Full-Featured Example | Verify the full-featured example demonstrates ALL available frontmatter fields | field-level | sub-agents reference page | 2026-02-28 | Initial checklist — full example must show every field |
---
## 4. Scope & Priority
Rules that verify scope and priority information.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 4A | Priority Order | Verify the Scope and Priority table lists all agent locations in correct priority order | content-match | sub-agents reference page + CLI reference page | 2026-02-28 | Initial checklist — wrong priority order causes resolution bugs |
---
## 5. Cross-File Consistency
Rules that verify consistency between the report and other repo files.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 5A | CLAUDE.md Sync | Verify CLAUDE.md's Subagent Definition Structure section lists the same fields as the report's Frontmatter Fields table | cross-file | CLAUDE.md vs report | 2026-02-28 | Initial checklist — CLAUDE.md could drift from report |
---
## 6. Process
Meta-rules about the workflow verification process itself.
| # | Category | Check | Depth | Compare Against | Added | Origin |
|---|----------|-------|-------|-----------------|-------|--------|
| 6A | Source Credibility Guard | Only flag items as drift if confirmed by official sources (sub-agents reference page, CLI reference page, GitHub changelog). Third-party blog sources may be outdated or wrong — use them for leads only, verify against official docs before flagging | content-match | official docs only | 2026-02-28 | Adopted from voice-hooks workflow — prevents false positives from blog sources |
+13 -11
View File
@@ -1,5 +1,7 @@
# Claude Code: Agents Frontmatter Reference
![Last Updated](https://img.shields.io/badge/Last_Updated-Feb%2028%2C%202026%203%3A22%20PM%20PKT-white?style=flat&labelColor=555)
Quick-reference tables for defining subagents in `.claude/agents/*.md`.
<table width="100%">
@@ -28,7 +30,7 @@ Quick-reference tables for defining subagents in `.claude/agents/*.md`.
| `memory` | string | No | Persistent memory scope: `user`, `project`, or `local` |
| `background` | boolean | No | Set to `true` to always run as a background task (default: `false`) |
| `isolation` | string | No | Set to `"worktree"` to run in a temporary git worktree (auto-cleaned if no changes) |
| `color` | string | No | CLI output color for visual distinction (e.g., `green`, `magenta`) |
| `color` | string | No | CLI output color for visual distinction (e.g., `green`, `magenta`). Functional but absent from official frontmatter table — documented in interactive quickstart only |
---
@@ -52,7 +54,15 @@ Agents are invoked via the **Task tool**, never via bash commands:
Task(subagent_type="agent-name", description="...", prompt="...", model="haiku")
```
Or from a command file that delegates to an agent.
Other invocation and management methods:
| Method | Description |
|--------|-------------|
| `--agents '{...}'` CLI flag | Define session-scoped agents via JSON (accepts `description`, `prompt`, `tools`, `model`, etc.) |
| `claude agents` CLI command | List all configured agents grouped by source (added v2.1.51) |
| `/agents` interactive command | Create, edit, and manage agents interactively |
| Command delegation | A command file (`.claude/commands/`) can delegate to an agent |
| Agent resumption | Completed subagents can be resumed with their agent ID for follow-up work |
---
@@ -129,16 +139,8 @@ When multiple subagents share the same name, the higher-priority location wins:
---
## Agents in This Repository
| Agent | Model | Tools | Skills | Memory |
|-------|-------|-------|--------|--------|
| `weather` | sonnet | WebFetch, Read, Write | weather-fetcher, weather-transformer | project |
| `presentation-curator` | sonnet | Read, Write, Edit, Grep, Glob | vibe-to-agentic-framework, presentation-structure, presentation-styling | — |
---
## Sources
- [Create custom subagents — Claude Code Docs](https://code.claude.com/docs/en/sub-agents)
- [CLI reference — Claude Code Docs](https://code.claude.com/docs/en/cli-reference)
- [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)