Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
feat(deep-audit): Add Phase 2 - Sub-agent comparison system
Jez5f168e635b52
diff --git a/commands/deep-audit.md b/commands/deep-audit.mdindex f63a517c..8f99094f 100644--- a/commands/deep-audit.md+++ b/commands/deep-audit.md@@ -181,3 +181,123 @@ metadata:- **Completely different ecosystems!**This error passed all version checks because the npm version exists - but the skill is for Python!++---++## Execution Instructions++When `/deep-audit <skill-name>` is invoked, execute the following steps:++### Step 1: Validate and Scrape++```bash+# Check skill exists+ls skills/<skill-name>/SKILL.md++# Run scraper (uses cached content if fresh)+FIRECRAWL_API_KEY=fc-e9df4ba6d5184b3a876d2bba3ffcee06 \+ /home/jez/Documents/claude-skills/.venv/bin/python \+ scripts/deep-audit-scrape.py <skill-name>+```++If scrape fails due to missing `doc_sources`, inform user they need to add metadata.++### Step 2: Read Content++Read these files into context:+1. `skills/<skill-name>/SKILL.md` - The skill being audited+2. `archive/audit-cache/<skill-name>/*.md` - All scraped doc files++### Step 3: Launch 4 Parallel Comparison Agents++Use the Task tool to launch 4 agents **in parallel** (single message, multiple Task calls):++**Reference**: See `planning/deep-audit-agent-prompts.md` for full prompt templates.++```+Agent 1: API Coverage+- Compare documented APIs in scraped docs vs skill coverage+- Find missing features, deprecated methods++Agent 2: Pattern Validation+- Check code examples for outdated syntax+- Find import changes, config changes++Agent 3: Error/Issues+- Verify error documentation is current+- Check if fixed issues are still documented++Agent 4: Ecosystem Validation+- Verify correct package registry (npm/pypi/github)+- Check install commands, version references+```++Each agent receives:+- Scraped documentation content+- Skill SKILL.md content+- Skill metadata (ecosystem, package_name)++### Step 4: Aggregate and Report++After all 4 agents complete:++1. **Calculate Overall Score**: Average of 4 agent scores (X/10)++2. **Prioritize Findings**:+ - CRITICAL: Wrong ecosystem, major API gaps+ - HIGH: Deprecated patterns, missing features+ - MEDIUM: Minor updates, new features not covered+ - LOW: Style improvements, optional enhancements++3. **Generate Report**: Write to `planning/CONTENT_AUDIT_<skill>.md`:++```markdown+# Content Audit: <skill-name>++**Date**: YYYY-MM-DD+**Overall Score**: X.X/10+**Status**: [PASS | NEEDS_UPDATE | CRITICAL]++## Summary++| Category | Score | Status |+|----------|-------|--------|+| API Coverage | X/10 | ✅/⚠️/❌ |+| Pattern Validation | X/10 | ✅/⚠️/❌ |+| Error Documentation | X/10 | ✅/⚠️/❌ |+| Ecosystem Accuracy | X/10 | ✅/⚠️/❌ |++## Critical Issues+[List any critical findings that need immediate attention]++## Recommended Updates+[Prioritized list of updates to make]++## Agent Reports++### API Coverage Agent+[Full report from Agent 1]++### Pattern Validation Agent+[Full report from Agent 2]++### Error/Issues Agent+[Full report from Agent 3]++### Ecosystem Agent+[Full report from Agent 4]++## Sources Audited+- primary: [URL] ([X] chars)+- api: [URL] ([X] chars)+- changelog: [URL] ([X] chars)+```++4. **Inform User**: Display summary and path to full report.++### Step 5: Offer Next Steps++After report is generated, offer:+1. Open report for review: `cat planning/CONTENT_AUDIT_<skill>.md`+2. Start fixing issues (if any critical/high findings)+3. Mark audit complete if score >= 8/10diff --git a/planning/CONTENT_AUDIT_fastmcp.md b/planning/CONTENT_AUDIT_fastmcp.mdnew file mode 100644index 00000000..be59a4b9--- /dev/null+++ b/planning/CONTENT_AUDIT_fastmcp.md@@ -0,0 +1,217 @@+# Content Audit: fastmcp++**Date**: 2026-01-09+**Overall Score**: 8.5/10+**Status**: PASS++---++## Summary++| Category | Score | Status | Key Finding |+|----------|-------|--------|-------------|+| API Coverage | 8.5/10 | ✅ | Comprehensive, missing `Depends()`, `@mcp.custom_route`, Context logging methods |+| Pattern Validation | 8.5/10 | ✅ | Image import path needs `.types` submodule correction |+| Error Documentation | 7/10 | ⚠️ | Missing `mask_error_details` security note, `*args/**kwargs` limitation |+| Ecosystem Accuracy | 10/10 | ✅ | Perfect - correct registry, versions, dependencies |++**Score Legend**:+- ✅ 8-10: Accurate, minor updates only+- ⚠️ 5-7: Needs attention, some gaps+- ❌ 1-4: Critical issues, major updates needed++---++## Critical Issues++> No critical issues found. The skill is production-ready.++---++## Recommended Updates++### High Priority++- [ ] Fix Error 28 Image import path: `from fastmcp.utilities.types import Image, Audio, File` (not just `fastmcp.utilities`)+- [ ] Add `mask_error_details=True` security note to error handling section+- [ ] Document `*args/**kwargs` limitation (functions with these are not supported as tools)++### Medium Priority++- [ ] Add `Depends()` parameter hiding pattern with examples (v2.14.0+)+- [ ] Add `@mcp.custom_route` decorator documentation for HTTP endpoints+- [ ] Document Context logging methods (`ctx.debug()`, `ctx.info()`, `ctx.warning()`)+- [ ] Add `ToolResult` import path: `from fastmcp.tools.tool import ToolResult`+- [ ] Add `ToolError` import path: `from fastmcp.exceptions import ToolError`++### Low Priority++- [ ] Add `result_type` parameter to sampling section (v2.14.1+)+- [ ] Expand `@mcp.prompt` decorator parameters documentation+- [ ] Document `Audio` and `File` media helper types alongside `Image`+- [ ] Add `tool_names` parameter on `mount()` (v2.14.1+)++---++## Agent Reports++### 1. API Coverage Agent++**Score**: 8.5/10++#### Missing APIs (documented but not in skill)+| API/Method | Description | Priority |+|------------|-------------|----------|+| `@mcp.custom_route` | HTTP endpoint registration alongside MCP | MED |+| `Depends()` | Parameter hiding from LLM (v2.14.0+) | HIGH |+| `ctx.debug()`, `ctx.info()`, `ctx.warning()` | Context logging methods | MED |+| `result_type` parameter | Typed responses in sampling (v2.14.1+) | LOW |+| `tool_names` parameter | Mount tool naming (v2.14.1+) | LOW |+| `FastMCP.as_proxy()` | Proxy server composition | LOW |++#### Deprecated APIs (in skill but removed from docs)+| API/Method | Replacement | Notes |+|------------|-------------|-------|+| `BearerAuthProvider` | `JWTVerifier` or `OAuthProxy` | Correctly documented in Error 26 |+| `Context.get_http_request()` | Middleware access | Correctly documented in Error 27 |+| `fastmcp.Image` import | `fastmcp.utilities.types.Image` | Correctly documented in Error 28 |++#### New Features Not Covered+- **Structured output via `result_type`**: `ctx.sample(..., result_type=MyModel)` for typed responses+- **Full `annotations` support**: `title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`+- **`exclude_args` deprecation**: Migration path to `Depends()` not documented++#### Accurate Coverage+- Core decorators (`@mcp.tool()`, `@mcp.resource()`, `@mcp.prompt()`)+- Background tasks (`task=True`)+- Sampling with tools (`ctx.sample(tools=[...])`)+- Storage backends (Memory, Disk, Redis)+- Server lifespans with v2.13.0 breaking change+- Middleware system (all 8 types)+- Server composition (`import_server()` vs `mount()`)+- OAuth patterns (4 authentication strategies)+- All 28 documented errors++---++### 2. Pattern Validation Agent++**Score**: 8.5/10++#### Deprecated Patterns Found+| Skill Shows | Docs Show | Location | Priority |+|-------------|-----------|----------|----------|+| `from fastmcp.utilities import Image` | `from fastmcp.utilities.types import Image, Audio, File` | Error 28 | HIGH |+| Missing `ToolResult` import | `from fastmcp.tools.tool import ToolResult` | Not documented | MED |+| Missing `ToolError` import | `from fastmcp.exceptions import ToolError` | Not documented | MED |++#### Import Changes+| Old Import | New Import | Notes |+|------------|------------|-------|+| `from fastmcp import Image` | `from fastmcp.utilities.types import Image` | v2.14.0 breaking change |+| `from fastmcp.auth import BearerAuthProvider` | `from fastmcp.auth import JWTVerifier` | v2.14.0 breaking change |++#### Configuration Changes+- None - all configuration patterns are current++#### Accurate Patterns+- `from fastmcp import FastMCP` at module level+- `from fastmcp import Context` for context injection+- `@mcp.tool()` decorator with parentheses+- Async/await patterns for I/O operations+- Resource URI syntax with schemes+- OAuth Proxy with consent screens+- Storage with `FernetEncryptionWrapper`+- Middleware execution order+- `import_server()` vs `mount()` distinction+- Background tasks with `task=True`+- Sampling with tools++---++### 3. Error/Issues Agent++**Score**: 7/10++#### Missing Error Coverage+| Error | Cause | Fix | Priority |+|-------|-------|-----|----------|+| `mask_error_details` security | Not documented | Add note that only `ToolError` messages exposed when enabled | HIGH |+| `*args/**kwargs` not supported | Functions with these fail as tools | Document as limitation | HIGH |+| Pydantic model JSON constraint | Models must be JSON objects, not stringified | Add note to Error 6 | MED |++#### Fixed Issues Still Documented+| Issue | Fixed In | Notes |+|-------|----------|-------|+| All v2.14.0 breaking changes | v2.14.0 | Correctly documented as migrations, not bugs |++#### New Common Errors+- **`$ref` resolution in outputSchema**: Fixed in v2.14.2, may affect v2.14.0-2.14.1 users+- **Lazy import of DiskStore missing sqlite3**: Fixed in v2.14.2++#### Accurate Error Docs+- All 28 errors correctly identified and explained+- Breaking changes (v2.13.0, v2.14.0) properly documented+- Migration paths provided for deprecated APIs++---++### 4. Ecosystem Agent++**Score**: 10/10++#### Registry Validation+- **Expected**: pypi+- **Skill Shows**: pypi+- **Status**: ✅++#### Package Name Validation+- **Expected**: fastmcp+- **Skill Shows**: fastmcp+- **Status**: ✅++#### Install Command Validation+| Skill Shows | Should Be | Status |+|-------------|-----------|--------|+| `pip install fastmcp` | `pip install fastmcp` | ✅ |+| `uv pip install fastmcp` | `uv pip install fastmcp` | ✅ |++#### Version Validation+- **Current Version**: 2.14.2+- **Skill References**: 2.14.2+- **Breaking Changes**: All documented (v2.14.0)++#### Dependency Validation+- httpx ✅+- pydantic ✅+- py-key-value-aio ✅+- cryptography ✅+- MCP SDK <2.x ✅++---++## Sources Audited++| Source | URL | Size | Status |+|--------|-----|------|--------|+| primary | https://gofastmcp.com/getting-started/welcome | 8 KB | ✅ |+| tools | https://gofastmcp.com/servers/tools | 43 KB | ✅ |++---++## Audit Metadata++- **Audited By**: /deep-audit command+- **Cache Used**: Yes (age: 0 days)+- **Firecrawl Credits**: ~$0.003+- **Agent Tokens**: ~35k (4 parallel agents)++---++## Next Steps++1. [x] ~~Fix critical issues~~ (None found)+2. [ ] Update Image import path in Error 28 (add `.types` submodule)+3. [ ] Add missing security documentation (`mask_error_details`)+4. [ ] Add `*args/**kwargs` limitation to errors+5. [ ] Re-run `/deep-audit fastmcp` to verify fixesdiff --git a/planning/deep-audit-agent-prompts.md b/planning/deep-audit-agent-prompts.mdnew file mode 100644index 00000000..450a0bae--- /dev/null+++ b/planning/deep-audit-agent-prompts.md@@ -0,0 +1,229 @@+# Deep Audit Sub-Agent Prompts++These prompts are used by `/deep-audit` to launch 4 parallel comparison agents.++---++## Agent 1: API Coverage++**Purpose**: Compare documented APIs/methods against what the skill covers.++**Prompt Template**:+```+You are auditing a Claude Code skill for API coverage accuracy.++## Task+Compare the OFFICIAL DOCUMENTATION against the SKILL CONTENT to identify:+1. APIs/methods documented officially but MISSING from the skill+2. APIs/methods in the skill that are DEPRECATED or REMOVED+3. New features added since the skill was last updated++## Official Documentation (scraped)+{scraped_docs}++## Skill Content+{skill_content}++## Output Format+Return a structured assessment:++### Coverage Score: X/10++### Missing APIs (in docs, not in skill)+- `methodName()` - [brief description of what it does]++### Deprecated APIs (in skill, not in docs)+- `oldMethod()` - [what replaced it]++### New Features Not Covered+- Feature name - [brief description]++### Accurate Coverage+- List major APIs that ARE correctly documented++### Recommendation+[1-2 sentence summary of most important updates needed]+```++---++## Agent 2: Pattern Validation++**Purpose**: Check code examples for deprecated syntax or patterns that don't match current best practices.++**Prompt Template**:+```+You are auditing a Claude Code skill for code pattern accuracy.++## Task+Compare code examples in the SKILL against patterns shown in OFFICIAL DOCUMENTATION:+1. Syntax that has changed (old vs new way)+2. Import statements that have changed+3. Configuration patterns that are outdated+4. Best practices that have evolved++## Official Documentation (scraped)+{scraped_docs}++## Skill Content+{skill_content}++## Output Format++### Pattern Accuracy Score: X/10++### Deprecated Patterns Found+| Skill Shows | Docs Show | Location in Skill |+|-------------|-----------|-------------------|+| `old code` | `new code` | Section name |++### Import Changes+| Old Import | New Import | Notes |+|------------|------------|-------|++### Configuration Changes+- [List any config format changes]++### Accurate Patterns+- [List patterns that are still correct]++### Recommendation+[1-2 sentence summary of most critical pattern updates]+```++---++## Agent 3: Error/Known Issues++**Purpose**: Verify error documentation and known issues are current.++**Prompt Template**:+```+You are auditing a Claude Code skill for error documentation accuracy.++## Task+Compare error handling and known issues between OFFICIAL DOCUMENTATION and SKILL:+1. Errors that are documented in docs but missing from skill+2. Known issues that have been FIXED but skill still warns about+3. New common errors not covered in skill+4. Troubleshooting steps that have changed++## Official Documentation (scraped)+{scraped_docs}++## Skill Content+{skill_content}++## Changelog/Releases (if available)+{changelog_content}++## Output Format++### Error Documentation Score: X/10++### Missing Error Coverage+- Error: `ErrorName` - [what causes it, how to fix]++### Fixed Issues Still Documented+- Issue: [description] - Fixed in version X.X++### New Common Errors+- Error: [description] - [when it occurs]++### Accurate Error Docs+- [List errors that are correctly documented]++### Recommendation+[1-2 sentence summary of error doc updates needed]+```++---++## Agent 4: Ecosystem Validation++**Purpose**: Validate package registry, install commands, version references.++**Prompt Template**:+```+You are auditing a Claude Code skill for ecosystem/package accuracy.++## Task+Verify the skill correctly references:+1. Package registry (npm vs pypi vs github)+2. Package name (scoped vs unscoped, exact name)+3. Install commands (correct package manager, flags)+4. Version numbers and compatibility+5. Dependencies and peer dependencies++## Official Documentation (scraped)+{scraped_docs}++## Skill Content+{skill_content}++## Skill Metadata+ecosystem: {ecosystem}+package_name: {package_name}++## Output Format++### Ecosystem Accuracy Score: X/10++### Registry Issues+- [ ] Correct registry: {expected} vs skill shows: {actual}++### Package Name Issues+- [ ] Correct name: {expected} vs skill shows: {actual}++### Install Command Issues+| Skill Shows | Should Be | Notes |+|-------------|-----------|-------|++### Version Issues+- Current version: X.X.X+- Skill references: Y.Y.Y+- Breaking changes between versions: [list if any]++### Dependency Issues+- [List any missing or outdated dependencies]++### Accurate Ecosystem Info+- [List what is correct]++### Recommendation+[1-2 sentence summary - CRITICAL if wrong ecosystem like npm vs pypi]+```++---++## Orchestration Notes++### Parallel Execution+All 4 agents run in parallel using Claude Code's Task tool:+```+Task(subagent_type="general-purpose", prompt=agent1_prompt)+Task(subagent_type="general-purpose", prompt=agent2_prompt)+Task(subagent_type="general-purpose", prompt=agent3_prompt)+Task(subagent_type="general-purpose", prompt=agent4_prompt)+```++### Input Preparation+Before launching agents:+1. Run `deep-audit-scrape.py` to get cached docs+2. Read skill's SKILL.md content+3. Parse skill metadata for ecosystem info+4. Prepare prompts with actual content++### Output Aggregation+After all agents complete:+1. Collect all 4 reports+2. Calculate overall accuracy score (average of 4 scores)+3. Prioritize findings (CRITICAL > HIGH > MEDIUM > LOW)+4. Generate unified report to `planning/CONTENT_AUDIT_[skill].md`++### Scoring Guide+- 10/10: Perfect match, no updates needed+- 8-9/10: Minor updates, low priority+- 6-7/10: Several updates needed, medium priority+- 4-5/10: Significant gaps, high priority+- 1-3/10: Major rewrite needed, critical prioritydiff --git a/templates/CONTENT_AUDIT_TEMPLATE.md b/templates/CONTENT_AUDIT_TEMPLATE.mdnew file mode 100644index 00000000..f1a706a7--- /dev/null+++ b/templates/CONTENT_AUDIT_TEMPLATE.md@@ -0,0 +1,176 @@+# Content Audit: [SKILL_NAME]++**Date**: [YYYY-MM-DD]+**Overall Score**: [X.X]/10+**Status**: [PASS | NEEDS_UPDATE | CRITICAL]++---++## Summary++| Category | Score | Status | Key Finding |+|----------|-------|--------|-------------|+| API Coverage | X/10 | ✅/⚠️/❌ | [Brief summary] |+| Pattern Validation | X/10 | ✅/⚠️/❌ | [Brief summary] |+| Error Documentation | X/10 | ✅/⚠️/❌ | [Brief summary] |+| Ecosystem Accuracy | X/10 | ✅/⚠️/❌ | [Brief summary] |++**Score Legend**:+- ✅ 8-10: Accurate, minor updates only+- ⚠️ 5-7: Needs attention, some gaps+- ❌ 1-4: Critical issues, major updates needed++---++## Critical Issues++> Issues requiring immediate attention before skill should be used++1. **[Issue Title]**+ - Location: [Section/line in SKILL.md]+ - Problem: [Description]+ - Fix: [Recommended action]++---++## Recommended Updates++### High Priority++- [ ] [Update description]+- [ ] [Update description]++### Medium Priority++- [ ] [Update description]+- [ ] [Update description]++### Low Priority++- [ ] [Update description]++---++## Agent Reports++### 1. API Coverage Agent++**Score**: X/10++#### Missing APIs (documented but not in skill)+| API/Method | Description | Priority |+|------------|-------------|----------|+| `methodName()` | [What it does] | HIGH/MED/LOW |++#### Deprecated APIs (in skill but removed from docs)+| API/Method | Replacement | Notes |+|------------|-------------|-------|+| `oldMethod()` | `newMethod()` | Removed in vX.X |++#### New Features Not Covered+- **Feature Name**: [Description, why it matters]++#### Accurate Coverage+- [List of correctly documented APIs]++---++### 2. Pattern Validation Agent++**Score**: X/10++#### Deprecated Patterns Found+| Skill Shows | Docs Show | Location | Priority |+|-------------|-----------|----------|----------|+| `old syntax` | `new syntax` | Section X | HIGH/MED |++#### Import Changes+| Old Import | New Import | Breaking? |+|------------|------------|-----------|+| `from x import y` | `from x.z import y` | Yes/No |++#### Configuration Changes+- [List config format changes]++#### Accurate Patterns+- [List patterns that are correct]++---++### 3. Error/Issues Agent++**Score**: X/10++#### Missing Error Coverage+| Error | Cause | Fix | Priority |+|-------|-------|-----|----------|+| `ErrorName` | [Cause] | [Fix] | HIGH/MED |++#### Fixed Issues Still Documented+| Issue | Fixed In | Notes |+|-------|----------|-------|+| [Issue] | vX.X | Remove from skill |++#### New Common Errors+- **ErrorName**: [Description, when it occurs]++#### Accurate Error Docs+- [List correctly documented errors]++---++### 4. Ecosystem Agent++**Score**: X/10++#### Registry Validation+- **Expected**: [npm | pypi | github]+- **Skill Shows**: [what skill says]+- **Status**: ✅/❌++#### Package Name Validation+- **Expected**: [correct name]+- **Skill Shows**: [what skill says]+- **Status**: ✅/❌++#### Install Command Validation+| Skill Shows | Should Be | Status |+|-------------|-----------|--------|+| `pip install x` | `pip install y` | ❌ |++#### Version Validation+- **Current Version**: X.X.X+- **Skill References**: Y.Y.Y+- **Breaking Changes**: [List if any]++#### Dependency Validation+- [List dependency issues]++---++## Sources Audited++| Source | URL | Size | Status |+|--------|-----|------|--------|+| primary | [URL] | X KB | ✅/❌ |+| api | [URL] | X KB | ✅/❌ |+| changelog | [URL] | X KB | ✅/❌ |++---++## Audit Metadata++- **Audited By**: /deep-audit command+- **Cache Used**: Yes/No (age: X days)+- **Firecrawl Credits**: ~$0.00X+- **Agent Tokens**: ~Xk++---++## Next Steps++1. [ ] Fix critical issues+2. [ ] Update deprecated patterns+3. [ ] Add missing API coverage+4. [ ] Update version references+5. [ ] Re-run `/deep-audit [skill]` to verify fixes