Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

fix: Phase 1 audit quick wins - commands, API consistency, protocol

Jez4f9ce2885182
diff --git a/commands/review-skill.md b/commands/review-skill.md
new file mode 100644
index 00000000..57e25c2f
--- /dev/null
+++ b/commands/review-skill.md
@@ -0,0 +1,87 @@
+# /review-skill - Skill Audit Command
+
+Comprehensive skill documentation audit with automated checks and manual review phases.
+
+## Usage
+
+```
+/review-skill <skill-name>
+```
+
+## Examples
+
+```
+/review-skill better-auth
+/review-skill cloudflare-worker-base
+/review-skill tiptap
+```
+
+## What It Does
+
+### Phase 1: Automated Checks
+Runs `./scripts/review-skill.sh <skill-name>` to check:
+- YAML frontmatter syntax
+- Package version currency (npm/PyPI)
+- Broken links
+- TODO/FIXME comments
+- File organization
+- Staleness indicators
+
+### Phase 2: Manual Review
+Systematically reviews:
+1. **Accuracy** - Code examples work, patterns current
+2. **Completeness** - Coverage vs official docs
+3. **Error Prevention** - Known issues documented
+4. **Token Efficiency** - Not bloated, well-organized
+
+### Phase 3: Gap Analysis
+Identifies:
+- Missing features from latest package version
+- Deprecated patterns still recommended
+- Breaking changes not documented
+- Rules file needed but missing
+
+### Phase 4: Remediation
+Applies fixes for:
+- Version updates (after npm verification)
+- Documentation inconsistencies
+- Missing sections
+- Stale dates
+
+## Output
+
+Generates an audit report with:
+
+```markdown
+## Skill Audit: [skill-name]
+
+### Version Status
+| Package | Current | Latest | Status |
+
+### Gaps Found
+1. [Issue] - [Severity] - [Evidence]
+
+### Recommended Updates
+| Priority | Task | Effort |
+
+### Quality Score: X/10
+```
+
+## When to Use
+
+- Before marketplace submission
+- After major package updates (check changelog first)
+- Skill last verified >90 days ago
+- Investigating patterns that seem outdated
+- User reports skill doesn't work
+
+## Related
+
+- **Script**: `./scripts/review-skill.sh` (automated portion)
+- **Skill**: `skill-review` (full methodology)
+- **Protocol**: `planning/SKILL_REVIEW_PROCESS.md` (9-phase guide)
+- **Audit Protocol**: `planning/SKILL_AUDIT_PROTOCOL.md` (verification-first approach)
+
+## Important
+
+**Version Verification**: Per `SKILL_AUDIT_PROTOCOL.md`, always verify package versions with `npm view` before trusting audit agent recommendations. Training data has cutoffs and may suggest deprecated packages as current.
diff --git a/planning/SKILL_AUDIT_PROTOCOL.md b/planning/SKILL_AUDIT_PROTOCOL.md
new file mode 100644
index 00000000..a99e1a94
--- /dev/null
+++ b/planning/SKILL_AUDIT_PROTOCOL.md
@@ -0,0 +1,335 @@
+# Skill Audit Protocol
+
+**Purpose**: Accurate, verified skill audits that avoid propagating errors from stale training data.
+
+**Philosophy**: Quality over speed. Multiple agents, multiple verification steps. Never recommend changes based on training knowledge alone.
+
+---
+
+## The Problem This Solves
+
+Audit agents have training cutoffs. They may:
+- Recommend deprecated packages as "current"
+- Suggest reverting to old patterns
+- Cite wrong version numbers from memory
+- Make confident-sounding but incorrect recommendations
+
+**Example failure**: Agent recommended changing `@google/genai` (correct, current) to `@google/generative-ai` (deprecated). Following this would have broken a working skill.
+
+---
+
+## Multi-Phase Audit Process
+
+### Phase 1: Fact Extraction (No Judgment)
+
+**Agent Task**: Extract raw data only. Do NOT interpret or recommend.
+
+**Prompt Template**:
+```
+You are a fact-extraction agent. Read the skill files and extract:
+
+1. All package names mentioned (npm, pip, etc.)
+2. All version numbers claimed
+3. All API patterns shown (imports, function calls)
+4. Last updated dates
+5. Any version-specific notes or warnings
+
+DO NOT:
+- Recommend changes
+- Judge if versions are current
+- Suggest alternatives
+- Use your training knowledge about "latest" versions
+
+Output format: JSON with extracted facts only.
+
+Skill path: {skill_path}
+```
+
+**Output**: Raw extracted data, no interpretation.
+
+---
+
+### Phase 2: Version Verification (Ground Truth)
+
+**Method**: Direct npm/pip/GitHub API queries - NOT agent knowledge.
+
+**Script Pattern**:
+```bash
+# For each package extracted in Phase 1:
+npm view {package} version # Current version
+npm view {package} time --json # Release dates
+npm view {package} deprecated # Deprecation status
+
+# For GitHub releases:
+gh api repos/{owner}/{repo}/releases/latest
+
+# For Python:
+pip index versions {package}
+```
+
+**Output**: Verified current versions with timestamps.
+
+---
+
+### Phase 3: Rules & Context Loading
+
+**Load relevant correction rules**:
+```bash
+# Check if skill has domain-specific rules
+ls ~/.claude/rules/ | grep -i {skill-domain}
+
+# Load rules that might apply
+cat ~/.claude/rules/{relevant-rule}.md
+```
+
+**Load related skills** that might have corrections:
+- If auditing `google-gemini-embeddings`, check `google-gemini-api` for patterns
+- If auditing `cloudflare-*`, check `cloudflare-worker-base` for conventions
+
+**Output**: Context bundle with current patterns and known corrections.
+
+---
+
+### Phase 4: Gap Analysis (With Verified Data)
+
+**Agent Task**: Compare extracted facts against verified data.
+
+**Prompt Template**:
+```
+You are a gap analysis agent. Compare the skill's claims against VERIFIED current data.
+
+## Skill's Extracted Facts (from Phase 1):
+{phase1_output}
+
+## Verified Current Versions (from Phase 2):
+{phase2_output}
+
+## Relevant Correction Rules (from Phase 3):
+{phase3_output}
+
+## Your Task:
+1. Compare skill's package versions vs verified current versions
+2. Identify version gaps (skill says X, npm says Y)
+3. Check if skill's patterns match correction rules
+4. Flag any API changes between skill's version and current
+
+DO NOT use your training knowledge for versions. Only use the verified data provided.
+
+For each finding, cite your source:
+- "Skill line 42 says v2.0, npm view returned v3.1"
+- "Rules file says use X, skill uses deprecated Y"
+
+Output: List of verified discrepancies with evidence.
+```
+
+---
+
+### Phase 5: Breaking Change Research
+
+**Agent Task**: For significant version gaps, research actual breaking changes.
+
+**Prompt Template**:
+```
+Research breaking changes between {old_version} and {new_version} of {package}.
+
+Use WebFetch to check:
+1. GitHub releases/changelog: {changelog_url}
+2. Migration guides: {migration_url}
+3. NPM package page: https://www.npmjs.com/package/{package}
+
+DO NOT guess what might have changed. Only report what you find documented.
+
+Output: Documented breaking changes with sources, or "No breaking changes found in documentation."
+```
+
+---
+
+### Phase 6: Verification & Report
+
+**Final verification before reporting**:
+
+1. **Cross-check critical findings**: Run npm view again for any "critical" issues
+2. **Uncertainty flagging**: Mark findings as:
+ - ✅ VERIFIED - Confirmed via npm/API query
+ - ⚠️ LIKELY - Found in docs but not independently verified
+ - ❓ UNCERTAIN - Based on incomplete information
+3. **Include reproduction commands**: User should be able to verify themselves
+
+**Report Template**:
+```markdown
+## Skill Audit Report: {skill_name}
+
+### Verification Method
+- Package versions: npm view (timestamp: {date})
+- Rules loaded: {rules_files}
+- Sources checked: {urls}
+
+### Verified Findings
+
+#### Version Gaps
+| Package | Skill Says | Verified Current | Gap | Severity |
+|---------|------------|------------------|-----|----------|
+| {pkg} | {v1} | {v2} | {n} | {level} |
+
+Verification command: `npm view {package} version`
+
+#### Pattern Issues
+- Line {n}: {issue}
+- Source: {rules_file} says {correct_pattern}
+
+### Uncertain Findings (Need Manual Review)
+- {finding} - Could not verify because {reason}
+
+### No Issues Found
+- {aspect} appears current and correct
+```
+
+---
+
+## Agent Composition Per Skill
+
+For thorough audits, use **4-5 specialized agents**:
+
+| Agent | Role | Tools Allowed |
+|-------|------|---------------|
+| **Extractor** | Read files, extract facts | Read, Glob |
+| **Verifier** | Run npm/pip/gh commands | Bash (specific commands only) |
+| **Context Loader** | Load rules, related skills | Read, Glob |
+| **Analyzer** | Compare facts vs verified data | None (pure analysis) |
+| **Researcher** | Fetch changelogs, docs | WebFetch, WebSearch |
+
+---
+
+## Pre-Flight Checklist
+
+Before launching audit agents:
+
+- [ ] Identify all packages skill mentions
+- [ ] Run `npm view` for each to get current versions
+- [ ] Load relevant `~/.claude/rules/` files
+- [ ] Identify related skills to cross-reference
+- [ ] Prepare changelog URLs for major packages
+
+---
+
+## Anti-Patterns to Avoid
+
+### ❌ DON'T: Trust agent training knowledge for versions
+```
+Agent: "The latest version of X is 2.0" ← May be stale!
+```
+
+### ✅ DO: Verify with actual queries
+```
+Bash: npm view X version → "3.1.0" ← Ground truth
+```
+
+### ❌ DON'T: Let agents recommend package changes
+```
+Agent: "Change @google/genai to @google/generative-ai" ← WRONG!
+```
+
+### ✅ DO: Have agents report what they find, not what to change
+```
+Agent: "Skill uses @google/[email protected]. npm view shows 1.34 is latest."
+```
+
+### ❌ DON'T: Run all agents in parallel without coordination
+```
+43 agents → 43 potentially wrong recommendations
+```
+
+### ✅ DO: Sequential phases with verification gates
+```
+Extract → Verify → Analyze → Review
+```
+
+---
+
+## Example: Correct Audit Flow
+
+**Skill**: `google-gemini-embeddings`
+
+**Phase 1 Output** (Extraction):
+```json
+{
+ "packages": ["@google/genai@^1.30.0"],
+ "imports": ["GoogleGenAI from @google/genai"],
+ "last_updated": "2025-11-28"
+}
+```
+
+**Phase 2 Output** (Verification):
+```bash
+$ npm view @google/genai version
+1.34.0
+
+$ npm view @google/generative-ai version
+0.24.1 # Old package, lower version = not actively developed
+```
+
+**Phase 4 Output** (Analysis with verified data):
+```
+VERIFIED GAP:
+- Skill: @google/[email protected]
+- Current: @google/[email protected]
+- Gap: 4 minor versions
+- Severity: LOW (same package, minor updates)
+
+NO ISSUE:
+- Package name is correct (@google/genai is current)
+- Import pattern matches current SDK
+```
+
+**Final Report**:
+```
+✅ Package name: Correct (verified via npm)
+⚠️ Version: 1.30.0 → 1.34.0 (4 minor versions behind)
+ Verification: npm view @google/genai version
+ Recommendation: Update version in SKILL.md line 37
+```
+
+---
+
+## Implementation Commands
+
+### Run Verified Audit for Single Skill
+
+```bash
+# 1. Extract packages from skill
+grep -ohE "@[a-z/-]+@[0-9^~.]+" skills/{name}/SKILL.md | sort -u
+
+# 2. Verify each package
+for pkg in $(grep -ohE "@[a-z/-]+@[0-9^~.]+" skills/{name}/SKILL.md | sort -u); do
+ base=$(echo $pkg | sed 's/@[0-9^~.]*$//')
+ echo "=== $base ==="
+ npm view $base version
+done
+
+# 3. Load relevant rules
+ls ~/.claude/rules/ | grep -i {domain}
+
+# 4. Run analysis agent with verified context
+```
+
+---
+
+## When to Use This Protocol
+
+- **Full audits**: New skill review, quarterly maintenance
+- **Quick checks**: Version bumps, minor updates (Phase 1-2 only)
+- **Critical updates**: Breaking change research (all phases)
+
+---
+
+## Maintenance
+
+- Review this protocol quarterly
+- Update anti-patterns when new failure modes discovered
+- Add package-specific verification patterns as needed
+
+---
+
+**Created**: 2026-01-06
+**Last Updated**: 2026-01-06
+**Author**: Claude Code + Jeremy Dawes
diff --git a/skills/skill-review/README.md b/skills/skill-review/README.md
index a66a6c5c..6ce5493a 100644
--- a/skills/skill-review/README.md
+++ b/skills/skill-review/README.md
@@ -252,7 +252,7 @@ Claude recognizes these phrases and may suggest review:
**Full Process Guide**: `planning/SKILL_REVIEW_PROCESS.md` (~3,500 words)
-**Slash Command**: `.claude/commands/review-skill.md`
+**Slash Command**: `commands/review-skill.md` (symlinked to ~/.claude/commands/)
**Review Script**: `scripts/review-skill.sh`
diff --git a/skills/skill-review/SKILL.md b/skills/skill-review/SKILL.md
index 4a4223cf..30aab0ef 100644
--- a/skills/skill-review/SKILL.md
+++ b/skills/skill-review/SKILL.md
@@ -99,7 +99,7 @@ Invoke: `/review-skill <skill-name>` or use this skill when detecting outdated p
**Scripts**: `scripts/review-skill.sh` (automated validation)
-**Commands**: `.claude/commands/review-skill.md` (slash command)
+**Commands**: `commands/review-skill.md` (slash command, symlinked to ~/.claude/commands/)
---
diff --git a/skills/zustand-state-management/SKILL.md b/skills/zustand-state-management/SKILL.md
index bc28fad0..450cc4e3 100644
--- a/skills/zustand-state-management/SKILL.md
+++ b/skills/zustand-state-management/SKILL.md
@@ -86,7 +86,7 @@ const useStore = create<UserPreferences>()(
✅ Use `set` with updater functions for derived state: `set((state) => ({ count: state.count + 1 }))`
✅ Use unique names for persist middleware storage keys
✅ Handle Next.js hydration with `hasHydrated` flag pattern
-✅ Use `shallow` for selecting multiple values
+✅ Use `useShallow` hook for selecting multiple values
✅ Keep actions pure (no side effects except state updates)
### Never Do
@@ -216,7 +216,7 @@ Creating new object references in selectors causes Zustand to think state change
**Prevention**:
```typescript
-import { shallow } from 'zustand/shallow'
+import { useShallow } from 'zustand/shallow'
// ❌ WRONG - Creates new object every time
const { bears, fishes } = useStore((state) => ({
@@ -228,10 +228,9 @@ const { bears, fishes } = useStore((state) => ({
const bears = useStore((state) => state.bears)
const fishes = useStore((state) => state.fishes)
-// ✅ CORRECT Option 2 - Use shallow for multiple values
+// ✅ CORRECT Option 2 - Use useShallow hook for multiple values
const { bears, fishes } = useStore(
- (state) => ({ bears: state.bears, fishes: state.fishes }),
- shallow,
+ useShallow((state) => ({ bears: state.bears, fishes: state.fishes }))
)
```