agentsclimarketplace

Context gap analyzer

Skill AndurilCode/craftwork/skills/context-gap-analyzer

Identify implicit context missing from a codebase that would most improve agent performance. Use whenever someone asks to audit, assess, or improve context for a codebase; asks 'what context is my codebase missing?', 'why do agents keep making mistakes here?', 'what should I put in my CLAUDE.md?', 'audit my codebase context', 'context gaps', or any variation. Also trigger when setting up agent context infrastructure for the first time, or when agent-generated code keeps violating implicit conventions.From its SKILL.md

Install
npx -y skills add AndurilCode/craftwork --skill context-gap-analyzer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.3 KB, as published. Nobody here has run it

Context Gap Analyzer

Code is necessary but insufficient context. The delta between "what the code says" and "what a competent team member knows" is where agents fail most expensively. Identify that delta, prioritize by agent impact, surface focused questions a human can answer.

What agents cannot derive from code: Why (rationale), What conventions aren't enforced by tooling, How things interact beyond repo boundaries, When to break vs. follow a pattern, Who owns what.


PHASE 1 — Context Harness Discovery

Discover all context infrastructure already in place. Actively explore — don't rely on a checklist.

Layer 1: File-level — Scan repo root + 2-3 levels deep for "instructions for someone working here." For each: read it, inventory topics, note scope (repo/dir/module), format, audience.

Layer 2: Toolchain — MCP servers, skills/plugins, hooks/middleware (git hooks, CI, pre-commit, linting), IDE/editor configs.

Layer 3: Runtime — Connected services (Drive, Notion, Confluence, Slack), env/secrets, package metadata.

Layer 4: Delivery classification

DeliveryExamplesImplication
StaticAGENTS.md, .cursorrules, system promptsToken cost; must be concise
On-demandMCP servers, search, skill filesRicher; agent must know when to fetch
TriggeredGit hooks, CI checks, pre-commitEnforcement without why
ImplicitTypes, tests, linter configsPartial; rationale missing

Output: inventory of static files (path, topics, scope, format), toolchain context (MCP, skills, hooks), runtime context (services, config injection), delivery map with counts, already-documented topics, primary delivery format (determines Phase 6 output).

Be thorough before concluding "nothing exists" — .eslintrc, Makefile, docker-compose.yml are all context. Question is sufficiency.


PHASE 2 — Codebase Topology Scan

Map: directory structure (modules, depth), technology fingerprint (languages, frameworks, build tools), complexity indicators (file counts, nesting, config variety), integration surface (external services, APIs, DBs, queues), entry points (routes, CLI, event handlers).

Output: codebase type, languages, framework, top-level modules ranked by complexity, integration surface, high-traffic areas for agents.


PHASE 3 — Gap Analysis

Cross-reference Phase 1 (documented) against Phase 2 (code). Evaluate nine categories:

CatNameAgent needsGap indicator
C1Architecture & BoundariesComponent topology, data flow, module dependency rulesCross-boundary imports, code in wrong module
C2Domain Model & Business RulesLogic rationale, vocabulary, invariantsTechnically correct but domain-wrong code
C3Conventions & PatternsNaming, file org, error handling, loggingCode that works but "feels wrong"
C4Integration & External DepsAPI patterns, retry/fallback, rate limits, authIncorrect service calls, missing retry
C5Operations & DeploymentCI/CD, feature flags, rollback, monitoringCode that breaks CI, unmonitored failures
C6Testing PhilosophyUnit vs. integration, mocking, fixturesWrong test type, mocks at wrong boundaries
C7Security ModelAuth patterns, data classification, secretsAuth bypasses, logged sensitive data
C8Performance ConstraintsBottlenecks, caching, query patterns, paginationN+1 queries, skipped caching, unbounded queries
C9Historical Decisions & DebtWhy this way, migrations, deprecated patternsExtending deprecated, building on doomed code

Scoring

FactorRangeMeaning
Documentation coverage0-30=nothing, 1=mentioned, 2=partial, 3=thorough
Code complexity1-31=simple, 2=moderate, 3=complex/non-obvious
Agent exposure1-31=rarely touched, 2=sometimes, 3=frequently modified

Gap severity = Complexity x Exposure - Doc coverage (range: -2 to 9)

ScorePriority
>= 5Critical
3-4Significant
<= 2Acceptable

Output: table with all 9 categories scored, overall coverage % (Doc sum / 27 x 100), critical gaps listed.


PHASE 4 — Prioritized Question Generation

For each gap >= 3, generate focused questions answerable in 2-5 minutes. Each targets one piece of implicit knowledge; the answer must be directly usable as agent context.

Q[N] — [Category] — Priority: [Critical/High/Medium]
[Specific, focused question]

Why this matters: [what goes wrong without this context]
Good answer example: [3-5 sentence template showing detail level]

Generate 10-20 questions. At least 2 per critical gap, 1 per significant gap. Order by gap severity x actionability.


PHASE 5 — Coverage Map

CONTEXT COVERAGE MAP — [repo] — [date]

C1 Architecture      [████░░░░░░]  40%  ⚠️ Significant
C2 Domain Model      [█░░░░░░░░░]  10%  🔴 Critical
...
OVERALL: [X]% | Questions: [N] | Est. time to close critical gaps: ~[N] min

Use interactive visualization (radar, heatmap) when supported.


PHASE 6 — Tracking & Integration

Create .context-coverage.json at repo root with: version, repo, dates, harness info (primary format, static sources, toolchain, delivery summary), per-category scores, questions (id, category, priority, question, status, answer, integrated_to), overall coverage.

When the user answers a question:

  1. Store answer, mark "answered"
  2. Write into the harness matching existing conventions (tone, structure, format, scope)
  3. Record integrated_to path, recalculate coverage, show updated map

Integration principle: Adapt to the harness, never prescribe. Match existing voice and format. If no writable harness exists, ask where to write.


Incremental Modes

  • First run: Full Phases 1-6, baseline + all questions
  • Answer session: Integrate answers, update coverage
  • Re-audit: Re-run Phases 2-5 after significant changes
  • Coverage check: Phase 5 only from existing .context-coverage.json

Detect mode from whether .context-coverage.json exists and what the user asks.


Calibration

  1. Agent-first: Frame every question as "what would an agent get wrong?" not "what's undocumented?"
  2. Precision over completeness: 10 high-impact questions beat 50 thorough ones. Human time is the bottleneck.
  3. Respect existing context: Cross-reference before asking — don't duplicate.
  4. Harness humility: Detect and work within existing systems. Don't prescribe.
  5. Actionable answers: The example answer prevents both one-word and novel-length responses.
  6. Coverage honesty: Score based on what an agent would find useful, not what technically exists.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.