feat: add context-audit skill (Vesely/skills)#80
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Ports Vesely/skills/context-audit into the ulk skill ecosystem. Audits MCP servers, CLAUDE.md bloat, skills size, settings gaps, and missing .claudeignore — returns a 0-100 health score with prioritised fixes and optional auto-apply. - community-skills/context-audit/SKILL.md (5-step audit framework) - install.sh: _install_context_audit_skill() → ~/.claude/skills/context-audit/ - CLAUDE.md: listed under Community Skills Invoke with /context-audit after running /context. https://claude.ai/code/session_01GEeL7L13c3xJMNxGPFm6up
Ajoute l'agent 53-context-audit dans agents/session/ : 7 phases (prérequis /context, MCP, CLAUDE.md, skills, settings, housekeeping, score 0-100, auto-fix optionnel). Complète la skill /context-audit (community-skills/) — l'agent expose le même audit via /ulk:context-audit avec le protocole ulk (phases, scoring, rapport formaté, auto-fix guidé). - agents/session/53-context-audit.md - agents/registry.json + registry.md régénérés (74 agents) - CLAUDE.md : prochain numéro → 54 https://claude.ai/code/session_01GEeL7L13c3xJMNxGPFm6up
- README.md : ligne context-audit (1) dans la table Community Skills - install.sh : help · wizard · résumé · options summary mis à jour - site/install.astro : mention context-audit dans les skills bundlés https://claude.ai/code/session_01GEeL7L13c3xJMNxGPFm6up
Les agents 53 (routine) et 54 (ci-guard) étaient déjà pris dans main. - agents/session/53-context-audit.md → 55-context-audit.md - Titre interne mis à jour (53→55) - CLAUDE.md : Context Audit (55) + prochain → 56 - registry.json + registry.md régénérés (76 agents) https://claude.ai/code/session_01GEeL7L13c3xJMNxGPFm6up
68e2b00 to
471b481
Compare
📝 WalkthroughWalkthroughThis PR introduces a new Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Agent as Context-Audit<br/>Agent
participant FS as File System
participant Settings as Settings<br/>System
participant Scorer as Score<br/>Calculator
User->>Agent: /ulk:context-audit<br/>(trigger audit)
Agent->>FS: Request /context output
FS-->>Agent: Context data
Agent->>Settings: Read ~/.claude/settings.json
Settings-->>Agent: MCP server config
Agent->>Agent: Classify servers<br/>(idle/redundant)
Agent->>FS: Scan CLAUDE.md files
FS-->>Agent: File contents & line counts
Agent->>Agent: Filter by rules<br/>(5 categories)
Agent->>FS: List ~/.claude/skills/
FS-->>Agent: Installed skills
Agent->>FS: Check SKILL.md sizes
FS-->>Agent: Skill metadata
Agent->>FS: Check housekeeping<br/>(.claudeignore, memory)
FS-->>Agent: Housekeeping status
Agent->>Scorer: Deductions & thresholds
Scorer-->>Agent: Health score (0–100)
Agent->>User: Structured report<br/>+ auto-fix options
User->>Agent: Confirm auto-fix
Agent->>FS: Apply safe changes
FS-->>Agent: Changes applied
Agent->>User: Results & diffs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
community-skills/context-audit/SKILL.md (1)
55-59: Make fenced blocks markdownlint-compliant.Add code fence languages and keep blank lines around the health-label table to avoid lint warnings.
🧹 Proposed markdown cleanup
-Find all CLAUDE.md files: -``` +Find all CLAUDE.md files: +```text ~/.claude/CLAUDE.md (global) <project>/CLAUDE.md (project) <project>/.claude/rules/*.md (path-specific rules)@@
-Health labels:
-| Score | Label |
+Health labels:
+
+| Score | Label |
|-------|-------|
| 90–100 | ✅ CLEAN |
| 70–89 |⚠️ NEEDS WORK |
| 50–69 | 🔴 BLOATED |
| 0–49 | 💀 CRITICAL |
@@
-Output a structured report:-
+Output a structured report: + +text
CONTEXT AUDIT —
══════════════════════════════════════════
@@
-## Reference — Standard .claudeignore-
+## Reference — Standard .claudeignore + +gitignore
node_modules/
dist/
build/</details> Also applies to: 141-143, 154-184, 211-227 <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@community-skills/context-audit/SKILL.mdaround lines 55 - 59, The markdown
has unlanguaged fenced code blocks and missing blank lines around the
health-label table which triggers markdownlint warnings; update each unlanguaged
fence instances (e.g., the "Find all CLAUDE.md" block, the "Output a structured
report" block, and the "## Reference — Standard .claudeignore" block) to include
an appropriate language tag such astext orgitignore, and ensure there is
a blank line before and after the health labels table (the "| Score | Label |"
table) and any other tables mentioned (also apply the same fenced-language and
surrounding blank-line fixes to the other affected sections noted in the
comment).</details> </blockquote></details> <details> <summary>agents/session/55-context-audit.md (1)</summary><blockquote> `1-17`: **Frontmatter and placement follow agent conventions.** `model: sonnet`, `phase: review`, and the `agents/session/` location are consistent for this new agent. As per coding guidelines: Agent `model` field should be set to 'opus' only for a fixed allowlist; all other agents should use 'sonnet', and agent frontmatter must include a `phase:` field. <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@agents/session/55-context-audit.md` around lines 1 - 17, The frontmatter must use the allowed model and include a phase: verify that the agent's frontmatter contains model: sonnet (not opus) and includes a phase: field; for this agent ensure name: context-audit and invocation remain unchanged and that model: sonnet and phase: review are present in the frontmatter so it complies with the agent allowlist rules and frontmatter requirements (update model or add phase only if missing). ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In@install.sh:
- Around line 607-616: install_context_audit_skill currently copies the skill
into "$SKILLS_DIR/context-audit" which doesn't match the prefixed glob patterns
used by cmd_uninstall and cmd_check, leaving the skill orphaned; update the
install to place the directory with the same prefix used by other community
skills (e.g., copy to "$SKILLS_DIR/community-context-audit" and adjust the
printf label), or alternatively update cmd_uninstall and cmd_check to include
the non-prefixed "context-audit" in their globs — refer to
install_context_audit_skill, cmd_uninstall, cmd_check, SKILL.md and the
"$SKILLS_DIR/context-audit" target when making the change.
Nitpick comments:
In@agents/session/55-context-audit.md:
- Around line 1-17: The frontmatter must use the allowed model and include a
phase: verify that the agent's frontmatter contains model: sonnet (not opus) and
includes a phase: field; for this agent ensure name: context-audit and
invocation remain unchanged and that model: sonnet and phase: review are present
in the frontmatter so it complies with the agent allowlist rules and frontmatter
requirements (update model or add phase only if missing).In
@community-skills/context-audit/SKILL.md:
- Around line 55-59: The markdown has unlanguaged fenced code blocks and missing
blank lines around the health-label table which triggers markdownlint warnings;
update each unlanguaged fence instances (e.g., the "Find all CLAUDE.md" block,
the "Output a structured report" block, and the "## Reference — Standard
.claudeignore" block) to include an appropriate language tag such as ```text orlabels table (the "| Score | Label |" table) and any other tables mentioned (also apply the same fenced-language and surrounding blank-line fixes to the other affected sections noted in the comment).🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
1105e755-4f40-42e1-90c7-aac74d06dd4e📒 Files selected for processing (8)
CLAUDE.mdREADME.mdagents/registry.jsonagents/registry.mdagents/session/55-context-audit.mdcommunity-skills/context-audit/SKILL.mdinstall.shsite/src/pages/install.astro
| _install_context_audit_skill() { | ||
| local src="$SCRIPT_DIR/community-skills/context-audit" | ||
| if [ ! -f "${src}/SKILL.md" ]; then | ||
| printf " ${WARN} %-14s ${D}community-skills/context-audit/SKILL.md not found${NC}\n" "context-audit" | ||
| return | ||
| fi | ||
| run rm -rf "$SKILLS_DIR/context-audit" | ||
| run cp -r "$src" "$SKILLS_DIR/context-audit" | ||
| printf " ${OK} %-14s ${D}/context-audit — token waste + health score${NC}\n" "context-audit" | ||
| } |
There was a problem hiding this comment.
context-audit gets installed, but uninstall/check flows don’t track it.
This installs to ~/.claude/skills/context-audit, but cmd_uninstall and cmd_check only handle prefixed globs, so this default skill becomes orphaned after uninstall and invisible in diagnostics.
🔧 Proposed fix
@@
# Flutter skills (community)
local n_flutter=0
for d in "$SKILLS_DIR"/flutter-*/; do
@@
if [ $n_flutter -gt 0 ]; then
printf " ${OK} Removed ${D}%s Flutter skills${NC}\n" "$n_flutter"
removed=$((removed + 1))
fi
+
+ # context-audit skill (community, default)
+ if [ -d "$SKILLS_DIR/context-audit" ]; then
+ run rm -rf "$SKILLS_DIR/context-audit"
+ printf " ${OK} Removed ${D}context-audit skill${NC}\n"
+ removed=$((removed + 1))
+ fi
@@
- for d in "$SKILLS_DIR"/ulk-*/ "$SKILLS_DIR"/addy-*/ "$SKILLS_DIR"/a11y-*/ "$SKILLS_DIR"/figma-*/ "$SKILLS_DIR"/kepano-*/ "$SKILLS_DIR"/nothing-*/ "$SKILLS_DIR"/swift-*/ "$SKILLS_DIR"/flutter-*/; do
+ for d in "$SKILLS_DIR"/ulk-*/ "$SKILLS_DIR"/addy-*/ "$SKILLS_DIR"/a11y-*/ "$SKILLS_DIR"/figma-*/ "$SKILLS_DIR"/kepano-*/ "$SKILLS_DIR"/nothing-*/ "$SKILLS_DIR"/swift-*/ "$SKILLS_DIR"/flutter-*/ "$SKILLS_DIR"/context-audit/; do🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@install.sh` around lines 607 - 616, install_context_audit_skill currently
copies the skill into "$SKILLS_DIR/context-audit" which doesn't match the
prefixed glob patterns used by cmd_uninstall and cmd_check, leaving the skill
orphaned; update the install to place the directory with the same prefix used by
other community skills (e.g., copy to "$SKILLS_DIR/community-context-audit" and
adjust the printf label), or alternatively update cmd_uninstall and cmd_check to
include the non-prefixed "context-audit" in their globs — refer to
install_context_audit_skill, cmd_uninstall, cmd_check, SKILL.md and the
"$SKILLS_DIR/context-audit" target when making the change.
Ports Vesely/skills/context-audit into the ulk skill ecosystem.
Audits MCP servers, CLAUDE.md bloat, skills size, settings gaps,
and missing .claudeignore — returns a 0-100 health score with
prioritised fixes and optional auto-apply.
Invoke with /context-audit after running /context.
https://claude.ai/code/session_01GEeL7L13c3xJMNxGPFm6up
Summary by CodeRabbit
context-auditagent and community skill for auditing Claude Code setup efficiency.