From agent-skills
Use when auditing, optimizing, or architecting the AI agent context layer (CLAUDE.md files, hooks, slash commands, skills, IDE rules) for any codebase, bootstrapping context engineering from scratch, diagnosing agent underperformance, or when the user mentions CLAUDE.md strategy, context quality, agent instructions, or context architecture.
npx claudepluginhub agentic-assets/agent-skillsThis skill uses the workspace's default tool permissions.
Architect, audit, and optimize the context layer that governs AI agent effectiveness in any codebase.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Share bugs, ideas, or general feedback.
Architect, audit, and optimize the context layer that governs AI agent effectiveness in any codebase.
Context engineering is the practice of structuring project information so AI coding agents understand the codebase, follow conventions, and operate effectively without repeated prompting. It encompasses CLAUDE.md files, hooks, slash commands, skills, and IDE rules.
| Mechanism | Loaded | Persistence | Purpose |
|---|---|---|---|
| CLAUDE.md | Auto (startup) | Persistent | Project standards, architecture, rules |
| Hooks | Event-triggered | Per-session | Automated enforcement, validation |
| Slash Commands | User-invoked | On-demand | Frequent workflows, templates |
| Skills | Model-invoked | On-demand | Domain expertise, complex capabilities |
| IDE Rules (.cursor/rules, .agent/rules) | Auto/contextual | Persistent | IDE-specific guidance |
This skill supports five primary workflows:
Assess context engineering maturity and produce a scored report with recommendations.
scripts/scan-context.sh at the project root to inventory all context artifactsreferences/audit-checklist.md and score each item (0/1/2) based on scan results and file qualityreferences/anti-patterns.md and check for each one# Context Engineering Audit Report
## Score: XX/70 — [Maturity Level]
## Strengths
- [What's working well]
## Critical Gaps (P0-P1)
- [What's missing or broken, ordered by impact]
## Recommendations
1. [Specific, actionable recommendation]
2. [Next recommendation]
## Detailed Scores
[Section-by-section from checklist]
Refine existing context files for maximum agent effectiveness.
references/anti-patterns.md — look for each of the 12 anti-patternsPass 1 — Prune: Remove stale, duplicated, vague, or irrelevant content. Every line must earn its token cost. Ask: "If this line were missing, would the agent make a concrete mistake?"
Pass 2 — Sharpen: Replace vague instructions with specific, testable ones:
'use client' only for hooks."Pass 3 — Structure: Ensure correct information architecture:
Pass 4 — Fortify: Add missing guardrails:
Pass 5 — Budget: Check total auto-loaded context size:
Identify missing context that would improve agent effectiveness.
references/context-patterns.md and match the project to its archetype (web app, API, library, data pipeline, ML, monorepo, research, mobile)references/feature-selection.md and evaluate whether each rule/knowledge piece uses the right mechanism. Are deterministic rules in hooks? Is domain reference in skills? Is always-needed context in CLAUDE.md?| Layer | Status | Impact if Missing |
|---|---|---|
| CLAUDE.md (root) | ? | Agent starts blind every session |
| CLAUDE.md (modules) | ? | Agent misses module-specific patterns |
| Hooks | ? | No automated enforcement of standards |
| Slash commands | ? | Frequent workflows require manual prompting |
| Skills | ? | Complex domain tasks are error-prone |
| IDE rules | ? | IDE-specific agent lacks project context |
| Plugins | ? | Distributable context bundles not leveraged |
| Subagents | ? | Complex tasks lack context isolation |
references/audit-checklist.mdSet up context engineering from scratch for a project with little or no existing context.
references/context-patterns.md to know what context this project type needs# [Project Name]
[One-sentence description]
## Critical Rules
1. **[RULE]**: [Specific, testable instruction]
2. **[RULE]**: [Specific, testable instruction]
## Tech Stack
- **Runtime**: [e.g., Node.js 20, Python 3.12]
- **Framework**: [e.g., Next.js 16, FastAPI]
- **Database**: [e.g., PostgreSQL via Drizzle ORM]
- **Package Manager**: [e.g., pnpm]
## Commands
\`\`\`bash
[cmd] # [description]
[cmd] # [description]
[cmd] # [description]
\`\`\`
## Architecture
### Key Paths
- `[path]` — [purpose]
- `[path]` — [purpose]
### Patterns
- **[Pattern]**: [brief explanation]
## Code Style
- **Files**: [naming convention]
- **Components/Functions**: [naming convention]
- **Imports**: [convention]
## Common Mistakes
- **NEVER** [anti-pattern] — [why]
- **ALWAYS** [required practice] — [why]
.claude/settings.json with:
PostToolUse → auto-format edited files (if project uses a formatter)SessionStart → dependency installation (if not trivial)scripts/scan-context.sh to confirm the new context layer scores above "Developing" levelSystematic troubleshooting when an AI agent is underperforming despite having context files.
scripts/scan-context.sh at the project root — does context even exist? What's the inventory?references/anti-patterns.md (10-item checklist covering all 12 anti-patterns)references/feature-selection.md and verify each rule uses the right mechanism. Are deterministic rules in CLAUDE.md instead of hooks? Is domain reference bloating root context instead of living in skills?Every token of context competes for attention. A 200-line CLAUDE.md where every line prevents a concrete mistake beats a 2000-line CLAUDE.md where 80% is noise. Apply the token cost test: "Does this line justify its place in the ~120K token attention budget?"
The agent is already smart. Don't tell it to "write good code." Tell it the specific conventions, patterns, and constraints unique to THIS project. The value of context is the delta between what the agent already knows and what it needs to know for this codebase.
For rules that must ALWAYS be followed (formatting, file protection, env setup), use hooks rather than CLAUDE.md instructions. Hooks execute deterministically; text instructions are probabilistic (the agent may miss them under attention pressure).
Load the minimum context needed for the current task. Critical rules auto-load via CLAUDE.md. Domain details load on demand via module docs, skills, and references. This preserves attention budget for what matters most right now.
Each fact lives in exactly one place. Root CLAUDE.md defines project-wide rules. Module CLAUDE.md files define module-specific rules. Neither duplicates the other. Cross-reference with @path links.
Different context mechanisms serve different purposes. CLAUDE.md is for advisory always-on context. Hooks are for deterministic enforcement. Skills are for on-demand domain knowledge. MCP is for external service connections. Subagents are for context isolation. Choosing the wrong mechanism reduces effectiveness — a critical formatting rule in CLAUDE.md may be ignored, but the same rule as a PostToolUse hook runs every time. See references/feature-selection.md for the full decision framework.
| Resource | Path | Use When |
|---|---|---|
| Scan Script | scripts/scan-context.sh | Starting any audit — inventories all context artifacts |
| Audit Checklist | references/audit-checklist.md | Scoring context maturity (70-point rubric) |
| Context Patterns | references/context-patterns.md | Determining what context a project type needs |
| Anti-Patterns | references/anti-patterns.md | Diagnosing why context isn't working |
| Feature Selection | references/feature-selection.md | Choosing the right context mechanism for each rule/knowledge type |
Authoritative references for context engineering and Claude Code: