Skip to content
Back to skills

Docs Sync

ASecurity

Maps current-branch code changes to covered prose docs and updates only stale prose in isolated Claude sessions. Use before opening a PR, after changing documented behavior, or when the user invokes `/docs-sync`.

  • 43 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 3, 2026
developmentbashnodegit

Works with

  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add opslane/opslane --skill docs-sync --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs Sync?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs Sync
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/opslane-docs-sync/badge)](https://www.skillsdirectory.com/skills/opslane-docs-sync)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docs-sync
description: Maps current-branch code changes to covered prose docs and updates only stale prose in isolated Claude sessions. Use before opening a PR, after changing documented behavior, or when the user invokes `/docs-sync`.
---

# docs-sync

Run from anywhere in the repository:

```bash
node "$(git rev-parse --show-toplevel)/.claude/skills/docs-sync/scripts/run.mjs"
```

Use `--dry-run` to resolve the base and print mapper results without starting Claude or editing files.

The runner performs this deterministic workflow:

1. Resolve the `@{upstream}` merge-base candidate, then validate it against the upstream default branch. Prefer `refs/remotes/origin/HEAD`, then `origin/main`; use the upstream candidate only when neither default-branch ref is available. This prevents a pushed feature branch from making `BASE=HEAD` and hiding committed PR changes.
2. Build a rename-aware, deduplicated path set from all local work:
   - `git diff --name-status -z --find-renames "$BASE" -- .` for committed and tracked working-tree changes.
   - `git diff --name-status -z --find-renames --cached "$BASE" -- .` for staged changes.
   - `git ls-files -z --others --exclude-standard` for untracked files.
3. Pipe those paths into `node scripts/docs-map.mjs` and use its `matched` and `uncovered` output. Do not infer additional docs.
4. Process each matched doc sequentially, passing only that document and its relevant code diff through standard input. Include matched untracked-file contents as added-file context because Git diff omits them.
5. Start a fresh headless Claude session for each doc with **all built-in tools disabled**, MCP disabled, and settings/customizations disabled. Require a schema-validated response containing the complete resulting Markdown. This prevents the model from reading the repository, environment, or version control.
6. Deterministically write only the matched target doc when the returned content changed. The runner never stages, commits, or pushes.
7. Report changed docs, unchanged docs, and mapper-reported uncovered code paths. Do not edit docs for uncovered paths.

Review the resulting working-tree diff and commit the docs with the code change.

Files in this skill

  • SKILL.md2.2 KB
  • scripts/run.mjs8.6 KB
  • scripts/run.test.mjs3.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.