j.doc-sync
Skill0 starsChanged 21 days agoApache-2.0View on GitHub
Compare the current state of a project with its documentation and update documentation to reflect changes. Accepts `update:`, `source:`, `exclude:`, and `minify:` arguments to control scope. Use when documentation may be out of date with implementation, or when the user asks to sync, refresh, update, or shrink docs.
In this repository151 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- j.brainstormSkill
- j.breakSkill
- j.btwSkill
- j.check-inSkill
- j.clearifySkill
- j.close-storySkill
- j.cloud-connectSkill
- j.commitSkill
- j.connectSkill
- j.continueSkill
- j.conventionsSkill
- j.dashboard-shareSkill
- j.dashboardSkill
- j.deep-diveSkill
- j.distributeSkill
- j.docSkill
- j.doooSkill
- j.doSkill
- j.jenga-configSkill
- j.jenga-permission-levelSkill
- j.jengaSkill
- j.errorSkill
- j.evaluateSkill
- j.examplifySkill
- j.gitignoreSkill
- j.helpSkill
- j.ideaSkill
- j.improveSkill
- j.initSkill
- j.jbpSkill
- j.lgtmSkill
- j.pi-planSkill
- j.playbook-newSkill
- j.playbookSkill
- j.proceedSkill
- j.publishSkill
- j.reconcile-originSkill
- j.reconcileSkill
- j.redoSkill
- j.skillifySkill
- j.smoke-testSkill
- j.spinoffSkill
- j.statusSkill
- j.testSkill
- j.todoSkill
- j.toolsSkill
- j.unchartedSkill
- j.wtfSkill
- skill-nameSkill
- j.brainstormSkill
- j.breakSkill
- j.btwSkill
- j.check-inSkill
- j.clearifySkill
- j.close-storySkill
- j.cloud-connectSkill
- j.commitSkill
- j.connectSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. About 0 are common, 18 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Before doing anything, check the user's message for arguments.
- Very specific: line 47
All paths are interpreted relative to the project root.
- Very specific: line 66
If update_targets is not empty, use those paths as the documentation files to update.
- Very specific: line 68
If update_targets is empty, resolve targets from assets/doc_targets.md:
- Distinctive: line 69
Read the file and parse the Documentation Targets list.
- Distinctive: line 71
If no entry matches an existing file, skip it and note it as missing.
- Distinctive: line 73
If neither source has targets (no arguments and no doc_targets), scan the project for documentation files:
- Very specific: line 74
Look for *.md, docs/ (the project's own documentation directory, if it has one — not a default target, and not Jenga's published site, …
- Distinctive: line 75
Ask the user: *"I found the following documentation files.
- Very specific: line 79
If source_paths is not empty, read those files and directories (recursively if directories).
- Very specific: line 81
If source_paths is empty, infer sources from each update target:
- Distinctive: line 82
Read the existing content of the documentation file.
- Distinctive: line 83
Look for mentions of paths, module names, function names, or API routes that hint at what code it describes.
- Distinctive: line 84
Use those hints to locate relevant source files in the project.
- Very specific: line 103
Every candidate identified above as "missing documentation for new things added in source" ships publicly by default unless this project …
- Distinctive: line 118
Before making any writes, present a concise drift summary per file:
- Distinctive: line 131
Ask: *"Should I apply all updates, or skip any of these?"*
- Distinctive: line 138
Add new sections or entries for undocumented items.
- Distinctive: line 139
Remove or mark deprecated items with a note if full removal seems too aggressive (ask when uncertain).
- Distinctive: line 140
Do not alter sections that appear unrelated to the analysed source files.
- Very specific: line 144
After sync edits are applied (or if only minification was requested), reduce each target file to approximately minify_pct% of its current …
- Distinctive: line 155
All unique technical facts (function signatures, config keys, env vars, routes, types).
- Distinctive: line 163
Remove content following the priority list above until the file is at or below the target size.
- Distinctive: line 164
If the target cannot be reached without removing essential content, stop at the smallest safe size and note the actual reduction achieved.
- Distinctive: line 165
Do not rewrite or paraphrase kept content — only remove.
- Distinctive: line 169
After all writes are done, print a summary:
- Very specific: line 185
If nothing needed updating, print: ✅ Documentation is already in sync with the source.
- Very specific: line 186
If minification could not reach the target, note: ⚠️ docs/API.md reduced to X% (target was Y% — essential content limit reached).
- Very specific: line 190
If this run updated project/.wiki/documentation.md, project/.wiki/intro-guide.md, or any project/.wiki/concepts/*.md file, also re-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
Doc-Sync — Keep Documentation in Sync with the Codebase
skills/j-doc-sync/ is the canonical, hand-edited directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the E50 reopening of 2026-09-09, which promoted skills/j-doc-sync/ from generated twin to sole canonical form). The j- prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see project/documentation/skill-authoring.md's "Invocation Convention").
⚠️
scripts/generate-j-alias.shwas retired byE50_S14and no longer exists — there is nothing to run. This file was previously generated from a bareskills/doc-sync/SKILL.mdsource;E50_S15deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.
What this skill does
Analyses project source files, compares them against existing documentation, and updates any documentation that is stale, incomplete, or missing. Can be scoped with arguments to focus on specific files or exclude noise.
Argument Parsing
Before doing anything, check the user's message for arguments. Arguments may appear in any order and may be combined in a single invocation.
| Argument | Format | Meaning |
--update: | update: <path(s)> | Documentation file(s) to check and update. Comma or space-separated. |
--source: | source: <path(s)> | Source file(s) or director(ies) to prioritize when analysing changes. Comma or space-separated. |
--exclude: | exclude: <path(s)> | File(s) or director(ies) to skip entirely — neither read as source nor updated. Comma or space-separated. |
--minify: | minify: <percent> | Reduce each target documentation file by approximately N% by removing redundant and non-essential content. Defaults to 70 (i.e. scale down to 70% of original size) if no value is given. |
Examples:
doc-sync update: docs/API.md source: src/api/doc-sync exclude: node_modules, dist update: README.mddoc-sync source: src/auth/ update: docs/auth.md, docs/security.mddoc-sync minify: 50 update: docs/API.mddoc-sync minify: update: README.md(uses default 70%)
All paths are interpreted relative to the project root. The docs/... paths above are examples of a
consumer's own documentation files named by the user; doc-sync does not treat docs/ as a default
location. When it must pick a home for a new maintainer-internal file, it uses the documentation path
from project/configs/workflow.json (paths.documentation, default project/documentation) and reserves
docs/ for published-site content (see CLAUDE.md's "Documentation Placement").
Instructions
1. Parse arguments
Extract any update:, source:, exclude:, and minify: values from the user's message.
- Store each as a list:
update_targets,source_paths,exclude_paths. - Store
minifyas a numberminify_pct. If theminify:key is present but has no value, default to70. Ifminify:is absent entirely, setminify_pcttonull(no minification). - Merge
exclude_pathswith the default excludes fromassets/default_excludes.txt.
2. Resolve update targets
If update_targets is not empty, use those paths as the documentation files to update.
If update_targets is empty, resolve targets from assets/doc_targets.md:
- Read the file and parse the Documentation Targets list.
- Each entry is a relative path to a documentation file to keep up to date.
- If no entry matches an existing file, skip it and note it as missing.
If neither source has targets (no arguments and no doc_targets), scan the project for documentation files:
- Look for
*.md,docs/(the project's own documentation directory, if it has one — not a default target, and not Jenga's published site, whose source issite/), thedocumentationpath fromproject/configs/workflow.json(defaultproject/documentation/),documentation/,README*,CHANGELOG*,CONTRIBUTING*. - Ask the user: "I found the following documentation files. Which should I update?" — present the list and let them select.
3. Resolve analysis sources
If source_paths is not empty, read those files and directories (recursively if directories).
If source_paths is empty, infer sources from each update target:
- Read the existing content of the documentation file.
- Look for mentions of paths, module names, function names, or API routes that hint at what code it describes.
- Use those hints to locate relevant source files in the project.
- Fall back to a broad scan of common source directories (
src/,lib/,app/, project root) if no hints are found.
Apply exclude_paths at this step — skip any file or directory matching an excluded path.
4. Analyse for drift
For each update target and its resolved sources:
- Read the documentation file — understand what it currently claims (structure, API, config, behaviour, examples).
- Read the source files — extract the current reality (exported functions, routes, config keys, CLI flags, env vars, class names, etc.).
- Compare — identify:
- Sections that reference removed or renamed things.
- Missing documentation for new things added in source.
- Outdated examples, wrong flag names, stale code snippets.
- Incorrect or missing configuration keys/values.
4a. Cross-reference .publicignore for "missing documentation" candidates
Every candidate identified above as "missing documentation for new things added in source" ships publicly by default unless this project has adopted /mirror-public. Before flagging any such candidate, check whether it's actually private-only:
- Check for
.publicignoreat the repo root. Most projects using this framework will not have one (they haven't adopted/mirror-public) — if it's absent, skip this entire sub-step. Fall through to flagging every "missing documentation" candidate exactly as3.above already would, with no further filtering. - If
.publicignoreexists, for each "missing documentation" candidate, determine its source path (relative to the repo root) and classify it by running:
This reusesbash "$([ -f scripts/check-publicignore-match.sh ] && echo scripts/check-publicignore-match.sh || echo node_modules/@jenga-ai/agent/scripts/check-publicignore-match.sh)" <path> [<path> ...]/mirror-public's ownmirror.shmatching logic (rsync --exclude-from=.publicignore) — a file this script reportsBLOCKEDis guaranteed to be a file/mirror-public --dry-runwould also report as "would be blocked", and vice versa forPUBLIC. It needs no network access and does not require/mirror-publicto be configured. BLOCKED→ do not flag this candidate as missing documentation. It's private-only and will never ship to the public mirror, so public docs coverage is not applicable.PUBLIC→ flag it as usual in step 5's report, and nameREADME.mdandproject/.wiki/documentation.md(the confirmed canonical full-reference doc — seeassets/doc_targets.md) as the target docs to check for coverage of this item.
This sub-step only changes what gets flagged as "missing documentation" in step 3's third bullet — it does not affect the other three drift categories (renamed/removed references, outdated examples, incorrect config keys), which are flagged regardless of .publicignore since they concern existing documentation content, not public-shipping coverage of new source additions.
5. Report findings before updating
Before making any writes, present a concise drift summary per file:
📄 docs/API.md
✏️ /api/users route renamed to /api/members in source
➕ New endpoint POST /api/invites not documented
🗑️ Reference to deprecated `--verbose` flag still present
📄 README.md
✏️ Setup instructions reference Node 16; project now requires Node 20
➕ New environment variable DATABASE_URL not listedAsk: "Should I apply all updates, or skip any of these?"
6. Apply updates
For each approved update:
- Edit the documentation file in-place — preserve existing structure, tone, and formatting.
- Replace stale references with accurate ones.
- Add new sections or entries for undocumented items.
- Remove or mark deprecated items with a note if full removal seems too aggressive (ask when uncertain).
- Do not alter sections that appear unrelated to the analysed source files.
6a. Minify (if minify_pct is set)
After sync edits are applied (or if only minification was requested), reduce each target file to approximately minify_pct% of its current size:
What to remove — in priority order:
- Duplicate explanations of the same concept said in multiple ways.
- Verbose prose that restates what a code example already shows clearly.
- Historical context, changelogs, or migration notes buried in reference docs.
- Filler phrases ("It is important to note that…", "As mentioned above…").
- Redundant examples where one concise example covers the same case as two or three longer ones — keep the most illustrative, remove the rest.
- Section headers with no meaningful content beneath them.
What to keep — never remove:
- All unique technical facts (function signatures, config keys, env vars, routes, types).
- Code examples that demonstrate something not expressed in prose.
- Warnings, caveats, and known limitations.
- Installation and setup steps.
Process:
- Calculate the current character count of the file.
- Target size =
current_size × (minify_pct / 100). - Remove content following the priority list above until the file is at or below the target size.
- If the target cannot be reached without removing essential content, stop at the smallest safe size and note the actual reduction achieved.
- Do not rewrite or paraphrase kept content — only remove.
7. Summarise changes
After all writes are done, print a summary:
✅ Updated 3 documentation files:
- docs/API.md (2 sections updated, 1 added)
- README.md (setup instructions refreshed)
- docs/config.md (3 new env vars added)
🗜️ Minified 2 documentation files:
- docs/API.md (4 200 → 2 940 chars, −30%)
- README.md (3 100 → 2 170 chars, −30%)
⚠️ Skipped 1 file (no matching sources found):
- docs/legacy.mdIf nothing needed updating, print: ✅ Documentation is already in sync with the source.
If minification could not reach the target, note: ⚠️ docs/API.md reduced to X% (target was Y% — essential content limit reached).
8. GitHub Pages site follow-up (E41_S13)
If this run updated project/.wiki/documentation.md, project/.wiki/intro-guide.md, or any
project/.wiki/concepts/*.md file, also re-run bash "$([ -f scripts/build-pages-site.sh ] && echo scripts/build-pages-site.sh || echo node_modules/@jenga-ai/agent/scripts/build-pages-site.sh)" afterward. That
script deterministically regenerates the GitHub Pages documentation site's wiki-derived pages
(site/guides/getting-started.md, site/guides/concepts.md, site/reference/skills.md,
site/reference/agents.md, site/reference/hooks.md, site/reference/mcp-tools.md,
site/reference/reference.md) from the wiki content this step just
updated — without re-running it, the Pages site silently drifts from the wiki the same way
README.md and the wiki itself have drifted from each other before. Mention this in the
summary output (e.g. 🔄 Re-ran build-pages-site.sh to refresh the Pages site).
Reference files
assets/doc_targets.md— Editable list of documentation files this skill checks by default.assets/default_excludes.txt— Paths always excluded from source analysis unless overridden.scripts/check-publicignore-match.sh(repo root) — Used in step 4a to classify "missing documentation" candidates asPUBLIC/BLOCKEDper.publicignore, reusing/mirror-public's exact matching semantics.
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.

