Start with one job and grow from there.
Free to start · No credit card required
# Read the durable ledger first — the last commit SHA processed, any open
# docs PR from a prior run, and pages known to intentionally lag the code.
cat .singulacomp/memory/docs-sync-log.md 2>/dev/null || echo "(no ledger yet — first run)"
# Check for an open docs PR from a prior run before opening a new one.
gh pr list --repo {{target_repo}} --state open \
--search 'in:title "docs:" OR label:documentation' \
--json number,title,headRefName,statusCheckRollup,url
DEFAULT_BRANCH=$(gh repo view {{target_repo}} --json defaultBranchRef -q .defaultBranchRef.name)
if [ -d /workspace/repo/.git ]; then
cd /workspace/repo && git fetch origin && git checkout "$DEFAULT_BRANCH" && git reset --hard "origin/$DEFAULT_BRANCH"
else
git clone --filter=blob:none https://github.com/{{target_repo}}.git /workspace/repo
cd /workspace/repo
git checkout "$DEFAULT_BRANCH"
fi
cd /workspace/repo
LAST_SHA=$(grep -m1 '^checkpoint:' .singulacomp/memory/docs-sync-log.md | awk '{print \$2}')
if [ -z "$LAST_SHA" ]; then
# First run: seed from HEAD, do a light backward scan instead of the whole history.
LAST_SHA=$(git rev-parse HEAD~20)
fi
git log --oneline "$LAST_SHA"..HEAD
git diff "$LAST_SHA"..HEAD --stat
$LAST_SHA, skip straight to Step 7 — advance the
checkpoint to current HEAD and stop. Never open an empty PR.git show "$LAST_SHA"..HEAD --name-only | sort -u # touched files across the range
git log -p "$LAST_SHA"..HEAD -- <touched-file> # full history of one file's changes
# Search the docs tree and READMEs for anything referencing the old behavior.
grep -rn "<old-symbol-or-var-name>" {{docs_path}} README.md **/README.md 2>/dev/null
{{docs_path}} itself — the
structure, terminology, and page ownership already in use — and write to match it
rather than inventing a new style. For each mapped page:cd /workspace/repo
BRANCH="docs-sync/$(date +%Y-%m-%d)"
git checkout -b "$BRANCH"
git add {{docs_path}} README.md **/README.md
git commit -m "docs: sync with $(git rev-parse --short "$LAST_SHA")..$(git rev-parse --short HEAD)"
git push origin "$BRANCH"
gh pr create --repo {{target_repo}} --base "$DEFAULT_BRANCH" --head "$BRANCH" \
--title "docs: sync with recent changes ($(date +%Y-%m-%d))" \
--label documentation \
--body "Generated by the docs sync agent. Covers commits $LAST_SHA..HEAD. Each
section below links the commit that prompted the change and states why the old
text no longer matched the code. A human owns the merge."
.singulacomp/memory/docs-sync-log.md (see <ledger-format>)
with the new checkpoint SHA, then advance it whether or not a PR was opened — the
checkpoint always moves to the HEAD this run inspected.