Repository navigation
fix: monorepo fix for subdirectory projects + impact + readme #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e70e68b
fix: monorepo fix for subdirectory projects + impact + readme
mvoutov 1431215
skills
mvoutov c72d1f2
fix: hooks errors
mvoutov 7834abc
hooks, small adjustments, aspens skills
mvoutov 62f3c25
skills
mvoutov 7baa60a
agents/claude
mvoutov 7cecc47
save-tokens
mvoutov df814ae
skills
mvoutov 741c0ad
aspens: save-tokens
mvoutov cdaf457
aspens: agents
mvoutov e55f73f
fixes: cr findings + vulnerabitlities
mvoutov 9e968fc
fix: adding fixes from suggestions via tutor
mvoutov 5c2de15
fix: reduce handoff tokens
mvoutov c02999d
aspens: skills
mvoutov 07d86bb
aspens: agents
mvoutov 2db0678
aspens skills
mvoutov 2c03344
fixes + release ready
mvoutov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| name: doc-impact | ||
| description: Context health analysis — freshness, domain coverage, hub surfacing, drift detection for generated agent context | ||
| --- | ||
|
|
||
| ## Activation | ||
|
|
||
| This skill triggers when editing doc-impact files: | ||
| - `src/commands/doc-impact.js` | ||
| - `src/lib/impact.js` | ||
| - `tests/impact.test.js` | ||
|
|
||
| Keywords: impact, freshness, coverage, drift, health score, context health | ||
|
|
||
| --- | ||
|
|
||
| You are working on **doc impact** — the command that shows whether generated agent context is keeping up with the codebase. | ||
|
|
||
| ## Key Files | ||
| - `src/commands/doc-impact.js` — CLI command: calls `analyzeImpact()`, renders per-target report with health scores, coverage, drift, and recommended actions | ||
| - `src/lib/impact.js` — Core analysis: `analyzeImpact()` orchestrates scan + config + graph + per-target summarization | ||
| - `tests/impact.test.js` — Unit tests for coverage, drift, health score, status, and report summarization | ||
|
|
||
| ## Key Concepts | ||
| - **`analyzeImpact(repoPath, options)`** — Main entry point. Runs `scanRepo()`, loads config from `.aspens.json`, infers targets if not configured, collects source file state, optionally builds import graph, then produces per-target reports. | ||
| - **Target inference:** If no `.aspens.json` config, infers targets from scan results (`.claude/` → claude, `.agents/` → codex). Falls back to `['claude']`. | ||
| - **`summarizeTarget()`** — Per-target analysis: finds skills, checks instruction file existence, computes domain coverage, hub coverage, drift, status, health score, and recommended actions. | ||
| - **Domain coverage:** `computeDomainCoverage()` matches scan-detected domains against installed skills by name match or activation pattern match. Returns covered/missing counts with reasons. | ||
| - **Hub coverage:** `computeHubCoverage()` checks if top 5 graph hub file paths appear in the instruction file + base skill text. | ||
| - **Drift detection:** `computeDrift()` finds source files modified after the latest generated context mtime. Maps changed files to affected domains via directory matching. | ||
| - **Health score:** `computeHealthScore()` starts at 100, deducts for: missing instructions (-35), no skills (-25), domain gaps (up to -25), missed hubs (-4 each), drift (-3 per file, max -20), missing hooks (-10 for Claude). | ||
| - **Source state collection:** `collectSourceState()` walks repo (depth 5, skips dotfiles/node_modules/dist/build/coverage), collects mtime for source extensions only (`SOURCE_EXTS` set). | ||
| - **Recommended actions:** `recommendActions()` suggests `aspens doc init --recommended` for missing context, `aspens doc sync` for stale context, `aspens doc init --hooks-only` for missing hooks. | ||
|
|
||
| ## Critical Rules | ||
| - **No LLM calls** — impact analysis is fully deterministic (scan + filesystem + optional graph). | ||
| - **`--no-graph` flag** — skips import graph build; hub coverage section shows `n/a`. | ||
| - **Graph failure is non-fatal** — if `buildRepoGraph` throws, graph is set to null and analysis continues without hub data. | ||
| - **`SOURCE_EXTS` set** — only these extensions count as source files for drift detection. Adding a language requires updating this set. | ||
| - **Walk depth capped at 5** — deep nested source files won't appear in drift analysis. | ||
| - **Exported functions** — `computeDomainCoverage`, `computeHubCoverage`, `computeDrift`, `computeHealthScore`, `computeTargetStatus`, `recommendActions`, `summarizeReport` are all individually exported for testing. | ||
|
|
||
| ## References | ||
| - **Patterns:** `src/lib/skill-reader.js` — `findSkillFiles()` used for skill discovery per target | ||
|
|
||
| --- | ||
| **Last Updated:** 2026-04-08 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.