agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/docs-hook/SKILL.md

docs-hook

Skill2 starsChanged 9 days agoMITView on GitHub

Lightweight git hook integration for updating agents-docs with minimal tokens. Use this skill when updating agents-docs on commit or merge events to sync documentation — even if they just say "update the docs" or "sync the agent docs". Not for learn, agents-md.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Done: No ML, no logging, no metrics

    line 59

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Docs Hook

Ultra-lightweight documentation sync via git hooks.

When to Use

  • User asks to update agents-docs on commit or merge events
  • Need to sync documentation with minimal tokens
  • Even if they just say "update the docs" or "sync the agent docs"

Trigger

  • "git hook", "on commit", "pre-commit"
  • "sync docs", "update docs"
  • "merge sync", "push docs"

Usage

# Full automatic sync (recommended):
./scripts/post-commit-docs-sync.sh

# Or use the lightweight docs-sync only:
./scripts/docs-sync.sh HEAD~1 HEAD

Automatic Sync on Commit

The post-commit-docs-sync.sh script provides comprehensive documentation syncing:

  1. Skill table updates: Regenerates AGENTS.md skill table when .agents/skills/ changes
  2. LLM context regeneration: Updates llms.txt and llms-full.txt when markdown changes
  3. Agent registry sync: Updates AGENTS_REGISTRY.md when agent configs change
  4. Docs file sync: Copies changed docs to appropriate directories
  5. Commit amendment: Automatically amends commit with updated documentation

Configuration

Environment variables control behavior:

VariableDefaultDescription
DOCS_SYNC_ENABLEDtrueEnable/disable docs sync
DOCS_SYNC_QUIETfalseSuppress output messages
DOCS_SYNC_LLM_TXTtrueRegenerate LLM context files

Minimal Token Workflow

  1. Diff: Get changed .md files between commits
  2. Sync: Copy to target directory
  3. Done: No ML, no logging, no metrics

Working Scripts

  • scripts/post-commit-docs-sync.sh - Full documentation sync orchestrator
  • scripts/docs-sync.sh - Lightweight file synchronization only

See Also

  • learn — Extract learnings into AGENTS.md
  • agents-md — AGENTS.md best practices

Rationalizations

RationalizationReality
"Docs can sync manually, no need for automation"Manual sync is forgotten within days. Automation ensures consistency.
"The hook is slow, I'll skip it"A few seconds of sync time prevents hours of out-of-date documentation debt.
"Only production docs need syncing"Stale developer docs cause onboarding confusion and incorrect assumptions.

Red Flags

  • Disabling the docs hook to speed up commits
  • Manually copying docs instead of using the sync script
  • Ignoring sync failures after documentation changes

Voice & Context

  • Default: professional + blog
  • Reference: voice-profiles skill for definitions and auto-detection.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.