doc-impact
Skill100 starsChanged 6 months agoMITView on GitHub
Context health analysis — freshness, domain coverage, hub surfacing, drift detection, LLM-powered interpretation, and auto-repair for generated agent context
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-customizationSkill
- architectureSkill
- baseSkill
- claude-runnerSkill
- cli-shellSkill
- codex-supportSkill
- doc-impactSkill
- doc-syncSkill
- import-graphSkill
- repo-scanningSkill
- save-tokensSkill
- skill-generationSkill
- template-librarySkill
- agent-customizationSkill
- baseSkill
- claude-runnerSkill
- cli-shellSkill
- codex-supportSkill
- doc-syncSkill
- import-graphSkill
- repo-scanningSkill
- save-tokensSkill
- skill-generationSkill
- template-librarySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Target inference: If .aspens.json is absent, targets are inferred from scan results (.claude/ → claude, .agents/ → codex).
- Very specific: line 30
Graph failure is non-fatal: If buildRepoGraph throws (or --no-graph is passed), graph is null and hub coverage is skipped/n/a.
- Very specific: line 50
Don't surface root-context hub warnings when codeMapMissing is true — emit the code-map-missing item instead and tell the user to run …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are working on doc impact — the command that shows whether generated agent context is keeping up with the codebase, optionally interprets results via LLM, and can interactively apply recommended repairs.
Domain purpose
Audits the agent context generated by aspens against the live source tree, reports per-target health (Claude, Codex), and offers an interactive --apply flow that re-runs the right aspens doc init/sync variant to repair gaps. The LLM interpretation is a thin layer on top of deterministic metrics — the metrics are the contract.
Business rules / invariants
- Target inference: If
.aspens.jsonis absent, targets are inferred from scan results (.claude/→ claude,.agents/→ codex). Falls back to['claude']. - LLM is optional and tool-less. Runs only when a CLI backend is detected.
runLLMis invoked withdisableTools: true; prompt must return pure JSON (bottom_line,improves,risks,next_step). Failure is caught and reported as "Analysis unavailable" — never fatal. - Graph failure is non-fatal. If
buildRepoGraphthrows (or--no-graphis passed),graphisnulland hub coverage is skipped/n/a. - Hub coverage haystack is the code-map, not CLAUDE.md. Post-Phase 1,
## Key Filesno longer lives in root instructions.computeHubCoveragereads.claude/code-map.md(claude) or.agents/skills/architecture/references/code-map.md(codex). If the code-map file is missing, it reportscodeMapMissing: trueinstead of spurious "missing hub" warnings. Older callers withoutrepoPathfall back to the legacycontextTexthaystack. - Health score deductions (start 100): missing instructions −35; no skills −25; domain gaps proportional up to −25; missed hubs −4 each; drift −3 per file (cap −20); unhealthy hooks −10 (hook-capable targets only); broken save-tokens −5 (claude only).
LOW_SIGNAL_DOMAIN_NAMES(config,test,tests,__tests__,spec,e2e) are excluded from coverage scoring but tracked inexcluded.SOURCE_EXTSextends the scanner set with.scala,.clj,.elm,.vue,.sveltefor drift detection. Adding a language for drift requires updating this set.- Walk depth capped at 5 — deep nested source files won't appear in drift analysis.
Non-obvious behaviors
- Agent skill-ref check (Phase 6):
checkAgentSkillReferences()scans.claude/agents/*.mdfrontmatter forskills: [a, b]and verifies each.claude/skills/<name>/skill.mdexists. Broken refs surface asagent-skill-refsopportunities. - Save-tokens health is Claude-only and only activates when
config.saveTokens.enabledis true andclaude.enabled !== false. Required hook/command files vary by sub-config (saveHandoff,warnAtTokens/compactAtTokensthresholds). Legacy.mjssiblings of the.shhooks must be cleaned up — their presence is an issue. buildApplyPlandedupes withaspens doc syncas a target-agnostic key; everything else is keyed${target.id}:${action}.applyRecommendedActionis a hand-maintained dispatch table mapping action strings todocInitCommand/docSyncCommandoption shapes. Adding a new recommendation inrecommendActions()requires a matching branch here, otherwise it warns "Cannot apply automatically".
Critical files (purpose, not inventory)
src/commands/doc-impact.js— CLI rendering, LLM prompt assembly,buildApplyPlan, and the action dispatch intodocInitCommand/docSyncCommand.src/lib/impact.js— All deterministic analysis (analyzeImpact, target summarization, scoring, drift, hub/code-map coverage, hook/save-tokens health, opportunities, missing rollup, value comparison).src/prompts/impact-analyze.md— Strict JSON contract the LLM must honor; do not change shape without updatingparseAnalysis.
Critical Rules
- Skills/
activationPatternsare matched viafindMatchingSkill(substring or/domain/path hit). Renaming the skill-reader contract breaks coverage scoring. - Don't surface root-context hub warnings when
codeMapMissingis true — emit thecode-map-missingitem instead and tell the user to runaspens doc graph. - Exported surface used by tests/consumers:
computeDomainCoverage,computeHubCoverage,computeDrift,evaluateHookHealth,evaluateSaveTokensHealth,computeHealthScore,computeTargetStatus,recommendActions,summarizeReport,summarizeMissing,summarizeOpportunities,summarizeValueComparison,checkAgentSkillReferencesfromimpact.js;buildApplyPlan,buildApplyConfirmationMessagefromdoc-impact.js.
Last Updated: 2026-05-11
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

