audit-docs-delegation
Audit skills and memory files for docs-management delegation compliance. Detects hardcoded Claude Code data and verifies proper delegation patterns.
What this skill does
# Audit Docs-Delegation Command Audit skills and memory files for docs-management delegation compliance. ## Initialization Before auditing, initialize the environment: 1. Get the current UTC date for audit timestamps. 2. Capture the project root path for subagent communication. 3. Ensure the temp directory (`.claude/temp/`) exists. 4. Clean up any stale audit files if the user confirms. The `ecosystem-health` skill provides authoritative validation guidance (auto-loaded when this command runs). ## What Gets Audited - **Hardcoded Claude Code data**: Hook event types, YAML frontmatter fields, settings keys - **Volatile information**: GitHub issue references, model names with versions, token limits - **Delegation patterns**: Verification notes, MANDATORY sections, skill references - **Exempt patterns**: Configuration files, educational content, self-specification ## Command Arguments | Argument | Description | | --- | --- | | *(none)* | Smart mode: audit modified, never-audited, or stale (>90 days) files | | `--force` | Audit ALL files regardless of status | | `--plugin-only` | Only audit local plugin skills | | `--project-only` | Only audit project files (`.claude/skills/`, `.claude/memory/`) | | `skill-name` | Audit specific skill(s) by name | ## Step 1: Discover Audit Targets Search for files that may contain Claude Code references: **Skills:** - `plugins/*/skills/*/SKILL.md` (local plugins) - `.claude/skills/*/SKILL.md` (project skills) **Memory Files:** - `.claude/memory/*.md` (project memory) - `plugins/*/skills/*/references/*.md` (skill references) **Audit Framework Files:** - `plugins/*/skills/*/references/audit-framework.md` (audit validation rules) - `plugins/*/skills/*/references/*-criteria.md` (validation criteria files) **Exclusions (auto-exempt):** - `hooks.json` files (configuration specification) - `hooks/*.py`, `hooks/*.sh` (hook implementations) - `canonical/` directories (scraped documentation cache) - `plugins/tac/lessons/` (educational content) Build a list of discovered files with their scope (plugin, project) and full path. ## Step 2: Parse Arguments Check for `--force`, `--plugin-only`, `--project-only` flags or specific skill names. Build the audit queue based on discovered files and arguments: - **Smart mode**: Filter to modified, never-audited, or stale (>90 days) files - **Force mode**: Include all discovered files - **Scoped modes**: Filter to matching scope only ## Step 3: Present Audit Plan Display audit mode (SMART or FORCE), targets discovered, and list each with scope and last modified date. ```text ## Audit Plan **Mode**: SMART **Files discovered**: 15 1. [plugin:claude-ecosystem] skills/hook-management/SKILL.md 2. [plugin:claude-ecosystem] skills/skill-development/SKILL.md 3. [project] .claude/memory/workflows.md ... **Will audit**: 8 files (7 skipped - recently audited) ``` ## Step 4: Execute Audits For each file, spawn the `docs-delegation-auditor` subagent with the following context: - Scope (plugin:name or project) - Full path to the file - Last audit date or "Never audited" - Current audit date - Project root path Run subagents in parallel batches of 3-5. Subagents write findings to `.claude/temp/` as both JSON (for recovery/aggregation) and markdown (for human review). The main conversation thread collects results and updates audit logs using its Write/Edit tools. **CRITICAL:** After ALL audits complete, sync results to the audit log at `.claude/audit/docs-delegation.md`. ## Step 5: Final Summary Report total files audited, results by scope, and details table. List any compliance issues with remediation steps. ```text ## Audit Complete ### Summary - **Total audited**: 8 files - **COMPLIANT**: 5 (62%) - **PARTIALLY COMPLIANT**: 2 (25%) - **NON-COMPLIANT**: 1 (13%) ### Results | Scope | File | Classification | Score | | --- | --- | --- | --- | | plugin | hook-management/SKILL.md | ✅ COMPLIANT | 95/100 | | plugin | skill-development/SKILL.md | ✅ COMPLIANT | 100/100 | | project | workflows.md | ⚠️ PARTIAL | 78/100 | | plugin | lesson-014-analysis.md | ❌ NON-COMPLIANT | 65/100 | ### Issues Found 1. **lesson-014-analysis.md** (Score: 65) - HIGH: Hardcoded `PreToolUse`, `PostToolUse` without delegation note - Missing MANDATORY section - **Action**: Add verification note pointing to docs-management ``` ## Scoring Files are scored out of 100 points with deductions for hardcoded patterns: | Deduction | Amount | Condition | | --- | --- | --- | | HIGH risk pattern | -15 each | Hardcoded without delegation note | | MEDIUM risk pattern | -8 each | Hardcoded without delegation note | | Missing MANDATORY section | -20 | File has hardcoded data but no delegation section | | Missing verification notes | -15 | Hardcoded data without verification blockquote | **Thresholds:** - **COMPLIANT** (85+): Ready for use, proper delegation - **PARTIALLY COMPLIANT** (70-84): Functional with improvement opportunities - **NON-COMPLIANT** (<70): Hardcoded data that should be delegated ## Important Notes ### HIGH Risk Patterns These indicate hardcoded Claude Code information that should delegate to docs-management: | Pattern | Example | | --- | --- | | Hook event types | `PreToolUse`, `PostToolUse`, `SessionStart` | | YAML frontmatter fields (in prose) | `allowed-tools`, `permissionMode`, `color` | | Settings keys | `CLAUDE_HOOK_*`, `apiChoice`, `sandboxMode` | ### MEDIUM Risk Patterns | Pattern | Example | | --- | --- | | GitHub issue references | `#10437`, `#15326` | | Model names with versions | `Opus 4.5`, `claude-opus-4-5` | | Token limits | `25K tokens`, `context window` | ### Compliance Patterns (What Makes Files Compliant) | Pattern | Description | | --- | --- | | Verification note | `> **Documentation Verification:**` blockquote | | MANDATORY section | `## MANDATORY:` or `## 🚨.*MANDATORY` | | Query pattern table | Table with `docs-management` query patterns | | Skill reference | `invoke the X-management skill` | ### Exempt Patterns (Not Flagged) | Pattern | Reason | | --- | --- | | `hooks.json` event names | Configuration specification | | `allowed-tools` in YAML frontmatter | Self-specification | | `tools` in agent YAML frontmatter | Agent definition | | Educational content | Instructional, not authoritative | | `canonical/` directories | Scraped docs cache | ## Audit Log Location All audit results are written to `.claude/audit/docs-delegation.md`. Use `/audit-log docs-delegation` to view current audit status. ## Example Usage ### Example 1: Audit All Files ```text User: /audit-docs-delegation Claude: Discovering audit targets... ## Audit Plan **Mode**: SMART **Files discovered**: 25 1. [plugin:claude-ecosystem] skills/hook-management/SKILL.md 2. [plugin:claude-ecosystem] skills/skill-development/SKILL.md 3. [plugin:tac] analysis/lesson-014-analysis.md ... **Will audit**: 12 files (13 skipped - recently audited) [Spawns docs-delegation-auditor subagents] ## Audit Complete | Scope | File | Classification | Score | | --- | --- | --- | --- | | plugin | hook-management/SKILL.md | ✅ COMPLIANT | 95/100 | ``` ### Example 2: Force Audit All ```text User: /audit-docs-delegation --force Claude: Auditing all files (force mode)... ``` ### Example 3: Audit Specific Skill ```text User: /audit-docs-delegation hook-management Claude: Auditing hook-management skill... ``` ### Example 4: Plugin-Only Audit ```text User: /audit-docs-delegation --plugin-only Claude: Auditing plugin skills only... ```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.