Agent skill

Doc Sync

by aspenkit in aspenkit/aspens

Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook

MITAuto-check passedDevelopment

Install Doc Sync

skills CLI
$ npx skills add aspenkit/aspens --skill doc-sync -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aspenkit/aspens doc-sync --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aspenkit/aspens.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/doc-sync .claude/skills/doc-sync && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
doc-sync
GitHub stars
102
Token cost
~1.8k tokens
SKILL.md length
817 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook

  • Development work in your project
  • SKILL.md covers Key Concepts, Critical Rules and References
  • Calls git

What it does

Doc Sync is an agent skill from aspenkit/aspens. Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Git. The repository describes itself as: Your CLAUDE.md stopped working at 200 lines. Generate scoped skill files from your import graph, auto-sync on every commit. Claude Code, Codex and OpenCode. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/doc-sync”

What it can do on your machine

Read from SKILL.md and the folder at commit 8dde826. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Doc Sync loads about 1.8k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 817 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~31
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aspenkit/aspens at commit 8dde826, republished under its MIT licence (© aspenkit). 817 words, ~1,815 tokens.

Download SKILL.mdSave it as .claude/skills/doc-sync/SKILL.md (or your agent's skills folder).
name
doc-sync
description
Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook
triggers.files
src/commands/doc-sync.js, src/lib/diff-classifier.js, src/lib/diff-helpers.js, src/lib/git-hook.js, src/lib/git-helpers.js, src/prompts/doc-sync.md…
triggers.keywords
doc sync, doc-sync, refresh, post-commit hook, install-hook, diff classifier, changetype filter

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 from gitRoot but file paths are project-relative.
  • Multi-target publish: configuredTargets() reads .aspens.json for 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. graphSerialized and repoPath are passed through to the transform context for conditional architecture references and disk-based instructions file loading.
  • Backend routing: runLLM() from runner.js dispatches to runClaude() or runCodex() based on config.backend (defaults to source target's id).
  • Diff-based flow: Gets git diff HEAD~N..HEAD from 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() from diff-classifier.js skips the LLM call entirely on lockfile-only diffs and diffs touching zero code-bearing files. LOCK_FILES and CODE_BEARING_EXTS are the source of truth — extend them here, not at call sites.
  • Prompt path variables: Passes { skillsDir, skillFilename, instructionsFile, configDir } from source target to loadPrompt() 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 of PARALLEL_LIMIT (3). Also refreshes instructions file and reports uncovered domains. Refresh mode runs ensureRootKeyFilesSection before syncSkillsSection so the root file always carries a current Key Files block.
  • Deterministic section repair: repairDeterministicSections() runs a no-LLM pass that re-injects ## Skills, ## Behavior, and ## Key Files into the root instructions file from on-disk state. 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 + Key Files injection block on the canonical instructions file after the LLM step, so drift gets repaired whether or not the LLM produced an update.
  • Graph rebuild on every sync: Calls buildRepoGraph + persistGraphArtifacts (with source target) to keep graph fresh. graphSerialized return value is captured and forwarded to publishFilesForTargets for 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 when AGENTS.md/AGENTS.md still carries the legacy ## Key Files hub-counts block, so the diff that strips it isn't alarming. regenerateStaleCodeMap() force-rebuilds .claude/code-map.md on 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 via fileMatchesActivation() (from skill-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 at diff --git boundaries.
  • Token optimization: Affected skills sent in full; non-affected skills send only path + description line.
  • Split writes: Direct-write files (.claude/, AGENTS.md, root AGENTS.md) use writeSkillFiles(). Directory-scoped AGENTS.md files (e.g. src/AGENTS.md) use writeTransformedFiles().
  • Skill-rules regeneration: After writing, regenerates skill-rules.json via extractRulesFromSkills() — only for targets with supportsHooks: true (Claude). Uses hookTarget from publish targets list.
  • findExistingSkills is target-aware: Uses target.skillsDir and target.skillFilename to locate skills for any target.
  • Git hook (monorepo-aware): installGitHook() installs at the git root with per-project scoping. Hook uses PROJECT_PATH derived 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 writeSkillFiles with force: true.
Show full SKILL.md (164 more words)Show less

Critical Rules

  • runLLM is called with allowedTools: ['Read', 'Glob', 'Grep'] — doc-sync must never grant write tools.
  • parseOutput restricts paths based on getAllowedPaths([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.
  • getGitDiff gracefully falls back from N commits to 1 if fewer available. actualCommits tracks what was used.
  • The command exits early with CliError if the source target's skills directory doesn't exist.
  • checkMissingHooks() in bin/cli.js only 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, not repoPath. File paths are then scoped via projectPrefix.
  • diff-classifier.js is a leaf module — graph-builder.js imports LOCK_FILES from it; never import from graph-builder back into the classifier.

References

  • Patterns: src/lib/skill-reader.js — GENERIC_PATH_SEGMENTS, fileMatchesActivation(), getActivationBlock()

Last Updated: 2026-05-11

© aspenkit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/doc-sync of aspenkit/aspens.

Open the folder on GitHubat commit 8dde826

Compare with similar skills

Doc Sync next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Doc Sync compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Doc Sync this skillaspenkit/aspens102—~1.8kAutomated safety check: PassMIT
Commit Context Lookuprohitg00/agentmemory29k—~522Automated safety check: PassApache-2.0
Review Triage Phaseprisma/orm48k—~995Automated safety check: PassApache-2.0
Leon Coding Agentleon-ai/leon18k—~1.1kAutomated safety check: PassMIT
Git Worktree IsolationjnMetaCode/superpowers-zh8.3k1 repos~982Automated safety check: PassMIT
WorktreeAgentsMesh/AgentsMesh2.4k—~553Automated safety check: NotesCustom licence

Similar skills

  • Commit Context Lookup

    rohitg00/agentmemory

    Traces a file, function or line back to the agent session behind its current commit, using git blame and a memory lookup, and reports only what the records show.

    29k GitHub stars~522 tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Runs the triage step of the review-framework loop: reads fetched PR review state, builds `review-actions.json`, validates it and renders `review-actions.md`.

    48k GitHub stars~995 tokensUpdated today
    DevelopmentAuto-check passed
  • Leon Coding Agent

    leon-ai/leon

    Has Leon's agent investigate, change and verify code in a repository with its file, search and shell tools, staying inside the scope the owner authorized.

    18k GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    DevelopmentAuto-check passed
  • Worktree

    AgentsMesh/AgentsMesh

    Creates or reuses an isolated AgentsMesh Git worktree from a verified base branch, preserves existing changes, and optionally starts the worktree-scoped development environment.

    2.4k GitHub stars~553 tokensUpdated 14 days ago
    DevelopmentAuto-check: notes
  • Cursor Composer Task Delegate

    Chachamaru127/claude-code-harness

    Hands one implementation task to Cursor Composer in an isolated git worktree, then reviews its diff and cherry-picks the result into the main branch.

    3.2k GitHub stars~4.4k tokensUpdated 2 days ago
    DevelopmentAuto-check: notes

More from aspenkit/aspens

All 12 skills in this repo
  • Injects a project's own skills and AGENTS.md content into generic bundled agent template files, adding a tech-stack line and real conventions without touching an agent's core logic.

    102 GitHub stars~898 tokensUpdated 24 days ago
    Auto-check passed
  • Orientation to the aspens codebase for agents working on the CLI itself: its Node.js stack, commands, module layout and debug settings.

    102 GitHub stars~1.6k tokensUpdated 24 days ago
    Auto-check passed
  • Aspens CLI Shell

    aspenkit/aspens

    Project context for the aspens CLI entry point: Commander wiring, the welcome screen, missing-hook warnings, CliError exit handling and the public programmatic exports.

    102 GitHub stars~1.1k tokensUpdated 24 days ago
    Auto-check passed
  • Explains how the aspens generator routes output to Claude Code or Codex CLI targets and transforms generated skills and instruction files between their formats.

    102 GitHub stars~1.9k tokensUpdated 24 days ago
    Auto-check passed
  • Doc Impact

    aspenkit/aspens

    Context health analysis — freshness, domain coverage, hub surfacing, drift detection, LLM-powered interpretation, and auto-repair for generated agent context

    102 GitHub stars~1.3k tokensUpdated 24 days ago
    Auto-check passed
  • Import Graph

    aspenkit/aspens

    Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings

    102 GitHub stars~1.1k tokensUpdated 24 days ago
    Auto-check passed

Works with

Questions about Doc Sync

What does Doc Sync do?

Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook. Doc Sync is an agent skill from aspenkit/aspens.

When should I use Doc Sync?

Doc Sync fits situations like: development work in your project.

How do I install Doc Sync in Claude Code?

Run `npx skills add aspenkit/aspens --skill doc-sync -a claude-code`. Or copy the skill folder (.agents/skills/doc-sync in aspenkit/aspens) into .claude/skills/doc-sync in your project. Claude Code loads it when a task matches its description.

How do I install Doc Sync in Codex?

Run `npx skills add aspenkit/aspens --skill doc-sync -a codex`. Or copy the skill folder (.agents/skills/doc-sync in aspenkit/aspens) into .agents/skills/doc-sync in your project. Codex loads it when a task matches its description.

Can I use Doc Sync in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aspenkit/aspens --skill doc-sync -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/doc-sync, .gemini/skills/doc-sync, .github/skills/doc-sync and .opencode/skills/doc-sync in your project.

What does Doc Sync need to run?

Going by SKILL.md and its folder, Doc Sync needs the command-line tools its instructions call (git).

Does Doc Sync access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Doc Sync safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Doc Sync use?

Doc Sync is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Doc Sync use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Doc Sync?

Skills that share tags, products or a category with Doc Sync: Commit Context Lookup (rohitg00/agentmemory, 29k stars), Review Triage Phase (prisma/orm, 48k stars), Leon Coding Agent (leon-ai/leon, 18k stars) and Git Worktree Isolation (jnMetaCode/superpowers-zh, 8.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Doc Sync?

aspenkit (a GitHub organization) maintains it in aspenkit/aspens, which has 102 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on September 12, 2026.

Source: aspenkit/aspens on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.