doc-sync
Skill100 starsChanged 6 months agoMITView on GitHub
Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook
34 other projects use a version of this.
Adopted by
Most recently taken up by
- onegunsamurai/OpenLearningtheir own version, first seen Nov 8, 2026
- bas1l/claude-skillstheir own version, first seen Nov 3, 2026
- sayeediftekhar/Keeltheir own version, first seen Nov 1, 2026
- michaelalber/ai-toolkittheir own version, first seen Nov 1, 2026
- Cassandra-Collective/Ephesustheir own version, first seen Nov 1, 2026
- Univers42/harness42their own version, first seen Nov 1, 2026
Used with
Projects with it also use api-endpoint, perf-budget and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
tadoEngSkillapi-endpoint
Add or change a backend API endpoint on this product, keeping Pydantic as the single contract authority and regenerating the TypeScript client. Use when asked to add an endpoint, expose data to the frontend, change a request or response shape, or wire a new backend capability into a page.
Also in 4 projects that use this
vindreshsinghSkillperf-budget
Optimizes performance by measuring first and fixing the real bottleneck. Use when something is slow, before optimizing, when setting latency or bundle targets, or reviewing changes for performance traps — not for speculative micro-tuning.
Also in 3 projects that use this
AnasX7Skillimprove
Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.
Also in 3 projects that use this
dillonluiSkilldesign-review
Review a view or flow for UX and UI issues. Provides severity-ranked, actionable findings grounded in established design heuristics. Use when the user asks for design feedback, UX review, or UI critique.
Also in 3 projects that use this
Microsoft AzureSkilldesign
Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.
Also in 3 projects that use this
NVIDIASkillresearch
Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.
Also in 3 projects that use this
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- JetBrains/ideavim★ 10ksame name
- taruma/SceneFlow★ 382same name
- PLC-lang/rusty★ 372same name
- chmouel/lazyworktree★ 315same name
- NVIDIA/TensorRT-Model-Connect★ 290same name
- fancyboi999/open-tag★ 181same name
- nrjdalal/zerostarter★ 65same name
- tykisgod/quick-question★ 12same name
- foryouself83/harness-tier★ 10same name
- Reef123/OpenVera★ 9same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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-impactSkill
- 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. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Graceful response handling: After LLM returns, if output has content but no <file> tags, treats it as "no updates needed" with a …
- Distinctive: line 39
Interactive file picker: When diff exceeds 80k chars and TTY is available, offers multiselect with skill-relevant files pre-selected.
- Very specific: line 43
Skill-rules regeneration: After writing, regenerates skill-rules.json via extractRulesFromSkills() — only for targets with supportsHooks: …
“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “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-sync, the incremental skill update command (aspens doc sync).
Key Concepts
- Monorepo-aware:
getGitRoot(repoPath)resolves the actual git root.projectPrefix(toGitRelative) computes the subdirectory offset.scopeProjectFiles()filters changed files to the project subdirectory. Diffs are fetched fromgitRootbut file paths are project-relative. - Multi-target publish:
configuredTargets()reads.aspens.jsonfor all configured targets.chooseSyncSourceTarget()picks the best source (prefers Claude if both exist). LLM generates for the source target;publishFilesForTargets()transforms output for all other configured targets.graphSerializedandrepoPathare passed through to the transform context for conditional architecture references and disk-based instructions file loading. - Backend routing:
runLLM()fromrunner.jsdispatches torunClaude()orrunCodex()based onconfig.backend(defaults to source target's id). - Diff-based flow: Gets
git diff HEAD~N..HEADfrom git root, scopes changed files to project prefix, then feeds diff plus existing skill contents and graph context to the selected backend. - Changetype filter (Phase 1):
isNoOpDiff()fromdiff-classifier.jsskips the LLM call entirely on lockfile-only diffs and diffs touching zero code-bearing files.LOCK_FILESandCODE_BEARING_EXTSare the source of truth — extend them here, not at call sites. - Prompt path variables: Passes
{ skillsDir, skillFilename, instructionsFile, configDir }from source target toloadPrompt()for path substitution in prompts. - Refresh mode (
--refresh): Skips diff entirely. Reviews every skill against the current codebase. Base skill refreshed first, then domain skills in parallel batches ofPARALLEL_LIMIT(3). Also refreshes instructions file and reports uncovered domains. Refresh mode runsensureRootKeyFilesSection(legacy stripper) beforesyncSkillsSectionso any leftover## Key Filesblocks from old docs are removed. - Deterministic section repair:
repairDeterministicSections()runs a no-LLM pass that re-injects## Skillsand## Behaviorinto the root instructions file from on-disk state and strips any legacy## Key Filesblock viaensureRootKeyFilesSection. Called from the no-op / "up to date" sync paths so missing-section drift is fixed every invocation. The normal sync flow also runs the same Skills + Behavior + legacy-strip block on the canonical instructions file after the LLM step. - Graph rebuild on every sync: Calls
buildRepoGraph+persistGraphArtifacts(with source target) to keep graph fresh.graphSerializedreturn value is captured and forwarded topublishFilesForTargetsfor conditional Codex architecture refs. Graph failure is non-fatal. - Legacy v0.7 hub-block cleanup:
notifyLegacyHubBlockIfPresent()surfaces a one-line notice on the first sync after upgrade whenCLAUDE.md/AGENTS.mdstill carries the legacy## Key Fileshub-counts block, so the diff that strips it isn't alarming.regenerateStaleCodeMap()force-rebuilds.claude/code-map.mdon no-op syncs when it still carries the legacy**Hub files**block. - Graceful response handling: After LLM returns, if output has content but no
<file>tags, treats it as "no updates needed" with a verbose-only warning. The prompt explicitly requests an empty response when nothing needs updating. - Graph-aware skill mapping:
mapChangesToSkills()checks direct file matches viafileMatchesActivation()(fromskill-reader.js) and also whether changed files are imported by files matching a skill's activation block. - Interactive file picker: When diff exceeds 80k chars and TTY is available, offers multiselect with skill-relevant files pre-selected.
- Prioritized diff:
buildPrioritizedDiff()gives skill-relevant files 60k char budget, everything else 20k (80k total). Cuts atdiff --gitboundaries. - Token optimization: Affected skills sent in full; non-affected skills send only path + description line.
- Split writes: Direct-write files (
.claude/,CLAUDE.md, rootAGENTS.md) usewriteSkillFiles(). Directory-scopedAGENTS.mdfiles (e.g.src/AGENTS.md) usewriteTransformedFiles(). - Skill-rules regeneration: After writing, regenerates
skill-rules.jsonviaextractRulesFromSkills()— only for targets withsupportsHooks: true(Claude). UseshookTargetfrom publish targets list. findExistingSkillsis target-aware: Usestarget.skillsDirandtarget.skillFilenameto locate skills for any target.- Git hook (monorepo-aware):
installGitHook()installs at the git root with per-project scoping. Hook usesPROJECT_PATHderived from project-relative offset. Each subproject gets its own labeled hook block (# >>> aspens doc-sync hook (label) >>>) with a unique function name (__aspens_doc_sync_<slug>). Multiple subprojects can coexist in one post-commit hook. Hook skips aspens-only commits scoped to the project prefix. 5-minute per-project cooldown via/tmp/aspens-sync-<hash>.lock; logs to/tmp/aspens-sync-<hash>.log(truncated to last 100 lines past 200). Unlabeled v0.6-era blocks are auto-upgraded on re-install. - Force writes: doc-sync always calls
writeSkillFileswithforce: true.
Critical Rules
runLLMis called withallowedTools: ['Read', 'Glob', 'Grep']— doc-sync must never grant write tools.parseOutputrestricts paths based ongetAllowedPaths([sourceTarget])— paths outside the allowed set are silently dropped.- Unparseable output is a soft warning — if LLM returns text without any
<file>tags, doc-sync logs a verbose warning and treats it as "no updates needed" instead of throwing. getGitDiffgracefully falls back from N commits to 1 if fewer available.actualCommitstracks what was used.- The command exits early with
CliErrorif the source target's skills directory doesn't exist. checkMissingHooks()inbin/cli.jsonly checks for Claude skills (not Codex — Codex doesn't use hooks).dedupeFiles()ensures no duplicate paths when publishing across multiple targets.- Git operations use
gitRoot— diffs, logs, and changed files are fetched from git root, notrepoPath. File paths are then scoped viaprojectPrefix. diff-classifier.jsis a leaf module —graph-builder.jsimportsLOCK_FILESfrom it; never import fromgraph-builderback into the classifier.
References
- Patterns:
src/lib/skill-reader.js—GENERIC_PATH_SEGMENTS,fileMatchesActivation(),getActivationBlock()
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.

