Skip to content

Commit c39dcda

Browse files
TechNickAINick Sullivanclaude
authored
🐛 Fix agent descriptions for Claude Code YAML parser compatibility (#8)
* 🐛 Fix agent descriptions to work with Claude Code's YAML parser Claude Code's agent discovery system doesn't parse YAML block scalars or multi-line descriptions correctly. Prettier also wraps long lines across different repos with varying configs, breaking agent registration. Solution: Keep all agent descriptions under 88 characters on a single line. Changes: - Rewrote all agent descriptions to be concise (<88 chars) and LLM-focused - Added CLAUDE.md files documenting the 88-char constraint and best practices - Removed unnecessary 'tools' and 'model' frontmatter fields for cleaner config - Descriptions now focus on WHEN to invoke agents (trigger conditions) - Tested with prettier to verify no wrapping occurs This ensures agents work reliably across all installations regardless of prettier config. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * 🐛 Fix prettier wrapping - actual limit is 75 chars not 88 Cursor Bug Bot caught this: prettier was still wrapping descriptions that exceeded 88 chars when including the "description: " prefix (13 chars). The actual limit for the description VALUE is 75 characters, not 88. Changes: - Shortened all agent descriptions to under 75 chars - Updated all 4 CLAUDE.md files with correct 75-char limit - Verified with prettier - all files stay single-line now Math: description: (13) + "value" (75) = 88 total line length (prettier's limit) Thanks to Cursor Bug Bot for catching this immediately! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * 📝 Run prettier on entire directory * 📝 Format markdown prose with prettier * 📝 Remove anti-patterns from CLAUDE.md per prompt-engineering.mdc Claude's review correctly noted that showing 'What does NOT work' violates our own prompt-engineering.mdc guidelines about avoiding anti-patterns. Changes: - Replaced negative examples with positive 'Valid formats' section - Changed emoji markers (✅❌) to text markers (Good:/Too long:) - Fixed inconsistency: now shows quotes in all examples Aligns with prompt-engineering.mdc: 'Minimal bad examples - LLMs encode patterns regardless of labels like wrong or dont do this.' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * 🔄 Trigger CI checks --------- Co-authored-by: Nick Sullivan <nick@technick.ai> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f11131b commit c39dcda

38 files changed

+404
-230
lines changed

.claude/RULE_LOADING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## The Problem
44

5-
You have extensive Cursor rules in `rules/`, but Claude Code doesn't
6-
automatically read them. You need a way to leverage these rules intelligently without:
5+
You have extensive Cursor rules in `rules/`, but Claude Code doesn't automatically read
6+
them. You need a way to leverage these rules intelligently without:
77

88
- Loading everything upfront (wastes context, dilutes focus)
99
- Manually remembering which rules to reference
@@ -199,8 +199,7 @@ This documentation was created using the exact process it describes:
199199
2. **Explored existing structure**: Listed `rules/`, read README and samples
200200
3. **Designed solution**: Dynamic loading via slash command vs static loading via
201201
context
202-
4. **Implemented**: Created `.claude/context.md` and
203-
`.claude/commands/load-rules.md`
202+
4. **Implemented**: Created `.claude/context.md` and `.claude/commands/load-rules.md`
204203
5. **Documented**: Wrote this explanation of the system and process
205204

206205
The system is self-referential: `/load-rules` itself could be improved by loading

.claude/agents/CLAUDE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Creating Claude Code Agents
2+
3+
When creating custom agent files in `.claude/agents/`, the YAML frontmatter format
4+
matters.
5+
6+
## Valid Frontmatter Format
7+
8+
```yaml
9+
---
10+
name: agent-name
11+
description: "Keep under 75 characters"
12+
---
13+
```
14+
15+
**Critical constraints:**
16+
17+
- **Single line only** - Claude Code doesn't parse block scalars (`>` or `|`) correctly
18+
- **Under 75 characters** - With `description: ` prefix (13 chars), total line must be
19+
under 88 to prevent prettier wrapping
20+
- **Use quotes** - Always quote descriptions to handle special characters like colons
21+
22+
**Valid formats:**
23+
24+
- `description: "Double quoted under 75 chars"` (recommended)
25+
- `description: 'Single quoted under 75 chars'`
26+
- `description: Plain text under 75 chars` (only if no special characters)
27+
28+
## Writing Concise Descriptions
29+
30+
Keep descriptions focused on WHEN to invoke the agent:
31+
32+
- Good: "Invoke for design review"
33+
- Too long: "Invoke for design review with Playwright testing checking WCAG
34+
compliance..."
35+
36+
If you need to cut content to stay under 75 chars, move that detail into the agent body
37+
instead.
38+
39+
## Example Agent
40+
41+
```yaml
42+
---
43+
name: test-runner
44+
description: "Invoke to run tests with terse results"
45+
---
46+
I run tests using the specified test runner (bun, pnpm, pytest, etc) and return a terse
47+
summary with pass count and failure details only. This preserves your context by
48+
filtering verbose test output to just what's needed for fixes.
49+
50+
[Rest of agent prompt...]
51+
```

.claude/agents/design-reviewer.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
---
22
name: design-reviewer
3-
description:
4-
"Invoke for frontend design review. Evaluates visual quality, usability, and
5-
accessibility using Playwright for live UI testing. Checks responsive behavior, WCAG
6-
compliance, and design system consistency with Apple/Stripe-level standards."
3+
description: "Invoke after frontend code changes for design review"
74
color: pink
8-
model: sonnet
95
---
106

117
<identity>

.claude/agents/seo-specialist.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
name: seo-specialist
3-
description:
4-
"Invoke for SEO audits and optimization. Analyzes technical SEO, content strategy,
5-
Core Web Vitals, and structured data. Implements schema markup, improves crawlability,
6-
and provides actionable recommendations for organic traffic growth."
7-
tools: Read, Write, Edit, Bash
3+
description: "Invoke for SEO audits and optimization"
84
---
95

106
<identity>

.claude/agents/site-keeper.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
---
22
name: site-keeper
3-
description:
4-
"Invoke for production health monitoring. Runs comprehensive checks on errors, builds,
5-
and logs. Creates PRs for fixable issues, escalates P0/P1 problems immediately.
6-
Discovers available tooling (Sentry, Render, GitHub) and adapts monitoring approach
7-
per project."
8-
tools: Read, Write, Edit, Grep, Glob, Bash, TodoWrite, Task, WebFetch, WebSearch
9-
model: sonnet
3+
description: "Invoke for production health monitoring and error triage"
104
---
115

126
<identity>

.claude/agents/test-runner.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
name: test-runner
3-
description:
4-
"Run tests and return focused results. Caller specifies the test runner (bun, pnpm,
5-
pytest, etc). Returns terse summary: pass count, and for failures - test name, error
6-
message, file:line, and relevant stack trace. Preserves outer context by filtering
7-
verbose test output to only what's needed to fix issues."
3+
description: "Invoke to run tests with terse, context-efficient results"
84
---
95

106
I run tests and tell you exactly what you need to know. Pass count. Fail count. For

.claude/commands/ai-coding-config.md

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ personalities, and GitHub workflows.
1212
## Usage
1313

1414
- `/ai-coding-config` - Interactive setup for current project
15-
- `/ai-coding-config update` - Update existing configs to latest versions (includes architecture migration)
15+
- `/ai-coding-config update` - Update existing configs to latest versions (includes
16+
architecture migration)
1617
- `/ai-coding-config add` - Add new command/skill/agent/plugin to the repo
1718

1819
## Interaction Guidelines
@@ -45,9 +46,9 @@ Scenarios to handle:
4546
2. **Existing Cursor rules, no AI coding config yet**
4647
- Has `.cursor/rules/` as real directory with user's existing rules
4748
- May have their own customizations to preserve
48-
- Offer choice:
49-
a. "Migrate existing rules to cross-tool structure" - Moves their rules to `rules/`, creates symlinks
50-
b. "Add configs alongside existing rules" - Merges new rules into their `.cursor/rules/`
49+
- Offer choice: a. "Migrate existing rules to cross-tool structure" - Moves their
50+
rules to `rules/`, creates symlinks b. "Add configs alongside existing rules" -
51+
Merges new rules into their `.cursor/rules/`
5152
- ALWAYS preserve their existing rules, never overwrite without asking
5253

5354
3. **Previous v1 (Cursor-first) AI coding config installation**
@@ -64,6 +65,7 @@ Scenarios to handle:
6465
- Proceed with normal setup/update within existing structure
6566

6667
Detection commands:
68+
6769
```bash
6870
# Check what exists
6971
test -d .cursor/rules && echo "has .cursor/rules"
@@ -76,10 +78,10 @@ test -f AGENTS.md && echo "has AGENTS.md"
7678
```
7779

7880
When existing Cursor rules are detected:
81+
7982
- List what rules the user already has
8083
- Explain that these will be preserved
81-
- Show where new rules will be added vs merged
82-
</existing-config-detection>
84+
- Show where new rules will be added vs merged </existing-config-detection>
8385

8486
<project-understanding>
8587
Detect project type and framework specifics. Django differs from FastAPI. React differs from Next.js. Look for existing configurations to avoid duplicates. Understand the project's purpose - API server, web app, CLI tool.
@@ -145,15 +147,15 @@ Use AskUserQuestion to confirm skill selection, showing recommended pre-selected
145147
<file-installation>
146148
Copy selected configurations intelligently, respecting existing customizations. Compare files with diff when they exist. For conflicts, use AskUserQuestion to offer choices (overwrite, skip, show diff, or custom action). Never silently overwrite.
147149

148-
Installation mapping: Rules → `rules/` (preserve subdirectory structure, `.cursor/rules/` symlinks here),
149-
Commands → `.claude/commands/` with symlinks in `.cursor/commands/`, Context →
150-
`.claude/context.md`, Agents`.claude/agents/`, Skills`.claude/skills/` (copy
151-
entire skill directories for selected skills only), Personalities →
152-
`rules/personalities/` (common always, additional with `alwaysApply: true`),
153-
VSCode → `.vscode/`, Prettier → `.prettierrc`, GitHub workflows → `.github/workflows/`,
154-
Gitignore → `.cursor/.gitignore` and `.claude/.gitignore`, Directory context →
155-
`.cursor/AGENTS.md` and `.claude/AGENTS.md` (explains directory purpose and references
156-
prompt-engineering rules).
150+
Installation mapping: Rules → `rules/` (preserve subdirectory structure,
151+
`.cursor/rules/` symlinks here), Commands → `.claude/commands/` with symlinks in
152+
`.cursor/commands/`, Context`.claude/context.md`, Agents`.claude/agents/`, Skills
153+
`.claude/skills/` (copy entire skill directories for selected skills only),
154+
Personalities → `rules/personalities/` (common always, additional with
155+
`alwaysApply: true`), VSCode → `.vscode/`, Prettier → `.prettierrc`, GitHub workflows →
156+
`.github/workflows/`, Gitignore → `.cursor/.gitignore` and `.claude/.gitignore`,
157+
Directory context → `.cursor/AGENTS.md` and `.claude/AGENTS.md` (explains directory
158+
purpose and references prompt-engineering rules).
157159

158160
Report what was copied, skipped, and how conflicts were handled. </file-installation>
159161

@@ -190,12 +192,14 @@ Start by pulling latest from `~/.ai_coding_config`.
190192
IMPORTANT: Before updating configs, detect if this project uses the legacy architecture.
191193

192194
Legacy architecture indicators (v1 - Cursor-first):
195+
193196
- `.cursor/rules/` is a real directory (not a symlink)
194197
- `rules/` at root doesn't exist OR symlinks to `.cursor/rules/`
195198
- `CLAUDE.md` is a real file (not a symlink)
196199
- No `AGENTS.md` at project root
197200

198201
Current architecture (v2 - Cross-tool):
202+
199203
- `rules/` at project root is the canonical directory
200204
- `.cursor/rules/` symlinks to `../rules/`
201205
- `AGENTS.md` at project root is canonical
@@ -204,27 +208,29 @@ Current architecture (v2 - Cross-tool):
204208
Detection: `test -L .cursor/rules && test -L CLAUDE.md && test -f AGENTS.md`
205209

206210
If legacy architecture detected:
211+
207212
1. Explain the architecture change clearly:
208-
- "Your project uses the older Cursor-first structure. There's a newer cross-tool architecture that works better with Claude Code, Cursor, Windsurf, Aider, and other AI coding tools."
209-
- "The key change: `rules/` becomes the canonical location at project root, with `.cursor/rules/` symlinked to it. This follows the emerging AGENTS.md standard (20,000+ GitHub repos)."
213+
- "Your project uses the older Cursor-first structure. There's a newer cross-tool
214+
architecture that works better with Claude Code, Cursor, Windsurf, Aider, and other
215+
AI coding tools."
216+
- "The key change: `rules/` becomes the canonical location at project root, with
217+
`.cursor/rules/` symlinked to it. This follows the emerging AGENTS.md standard
218+
(20,000+ GitHub repos)."
210219

211220
2. Use AskUserQuestion to offer migration:
212221
- "Migrate to cross-tool architecture (Recommended)" - Performs full migration
213222
- "Skip migration, just update configs" - Updates within current structure
214223
- "Show me what would change" - Explains changes in detail
215224

216-
3. If migration accepted:
217-
a. Create backup: `cp -r .cursor/rules rules-backup`
218-
b. Move rules: `mv .cursor/rules rules`
219-
c. Create symlink: `ln -s ../rules .cursor/rules`
220-
d. Create AGENTS.md (copy from CLAUDE.md if exists, or create new)
221-
e. Replace CLAUDE.md: `rm CLAUDE.md && ln -s AGENTS.md CLAUDE.md`
222-
f. Update @ references in AGENTS.md from `.cursor/rules/` to `rules/`
223-
g. Rename load-cursor-rules symlink to load-rules if exists
224-
h. Report migration complete, then continue with normal update
225-
226-
4. If migration skipped, continue updating within legacy structure (but warn that some new features may not work correctly)
227-
</architecture-check>
225+
3. If migration accepted: a. Create backup: `cp -r .cursor/rules rules-backup` b. Move
226+
rules: `mv .cursor/rules rules` c. Create symlink: `ln -s ../rules .cursor/rules` d.
227+
Create AGENTS.md (copy from CLAUDE.md if exists, or create new) e. Replace CLAUDE.md:
228+
`rm CLAUDE.md && ln -s AGENTS.md CLAUDE.md` f. Update @ references in AGENTS.md from
229+
`.cursor/rules/` to `rules/` g. Rename load-cursor-rules symlink to load-rules if
230+
exists h. Report migration complete, then continue with normal update
231+
232+
4. If migration skipped, continue updating within legacy structure (but warn that some
233+
new features may not work correctly) </architecture-check>
228234

229235
Now compare against the current project.
230236

.claude/commands/autotask.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ Implement the solution following project patterns and standards. Available agent
5050
refinement
5151
- Explore (general-purpose): Investigation, research, evaluates trade-offs
5252

53-
Build an execution plan based on task type. Use /load-rules to load relevant
54-
project standards. Execute agents in parallel when possible, sequentially when they
55-
depend on each other.
53+
Build an execution plan based on task type. Use /load-rules to load relevant project
54+
standards. Execute agents in parallel when possible, sequentially when they depend on
55+
each other.
5656

5757
Provide targeted context when launching agents: task requirements, implementation
5858
decisions, relevant standards, and specific focus area. Tailor context to agent type.

.claude/commands/generate-AGENTS-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ constraints that differ from root context.
229229

230230
Scan for candidates by checking:
231231

232-
1. **Directory-scoped cursor rules**: Rules in `rules/` with `globs` patterns
233-
targeting specific directories (e.g., `globs: ["tests/**"]`, `globs: ["src/db/**"]`)
232+
1. **Directory-scoped cursor rules**: Rules in `rules/` with `globs` patterns targeting
233+
specific directories (e.g., `globs: ["tests/**"]`, `globs: ["src/db/**"]`)
234234

235235
2. **High-risk directories**: Places where AI mistakes are costly or common:
236236
- `migrations/`, `drizzle/migrations/`, `prisma/migrations/` - Never edit manually

.claude/commands/load-rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Analyze the current task and load ONLY relevant rules from `rules/`.
66

77
PROCESS:
88

9-
1. Discover available rules: use glob_file_search with pattern "\*.mdc" in rules/
10-
to find all rule files recursively
9+
1. Discover available rules: use glob_file_search with pattern "\*.mdc" in rules/ to
10+
find all rule files recursively
1111
2. Analyze task to identify what domains apply (languages, tools, frameworks,
1212
operations)
1313
3. Select relevant rules based on task requirements

0 commit comments

Comments
 (0)