/claude-harness:harness-syncfrom claude-harness
Detects and fixes drift between a repository's harness documentation and the reality of its code, settings and lots. Use after editing CLAUDE.md or a skill, when the stack, conventions or lot scope evolved, after a lot, or when the user asks to refresh, check or improve the harness.
Ships in claude-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Detects drift between the harness documentation and the reality of the repository, fixes it, and proposes improvements. Never touches application code.
| File | Rule |
|---|---|
CLAUDE.md | Source of truth for project conventions, gate parameters and the census |
AGENTS.md | Byte-identical mirror of CLAUDE.md |
CONVENTIONS.md | Byte-identical to the harness master at main — never written by this skill: only the harness sync-projects workflow writes it, through a pull request |
Lots file | Modified only with user approval (status column excepted) |
README.md | Aligned with the real stack |
.claude/settings.json | Marketplace and plugin declaration |
.claude/skills/*/SKILL.md | Project-specific skills only; the generic ones come from the plugin |
Task Progress:
- [ ] Step 1 — Fact collection
- [ ] Step 2 — Invariant checks
- [ ] Step 3 — Drift report (before any write)
- [ ] Step 4 — Application after approval
- [ ] Step 5 — Verification
Read the repository's reality, assuming nothing: the build file (versions,
dependencies), the real package or directory layout, the configuration and its
env vars, the CI workflows, the branch and rtk proxy git log --first-parent,
and the reports in docs/audits/.
Run each of these. Each failure is a drift row in the Step 3 report.
| # | Invariant | How |
|---|---|---|
| 1 | Mirror | cmp CLAUDE.md AGENTS.md silent |
| 2 | Conventions copy | git -C ~/ENV/projets/claude-harness fetch -q origin main, then git -C ~/ENV/projets/claude-harness show origin/main:CONVENTIONS.md | cmp - CONVENTIONS.md silent. The main of the clone, never its working tree, which may sit on a branch that was never promoted. Not applicable in claude-harness itself, which holds the master |
| 3 | Plugin declared with the ref | .claude/settings.json declares the claude-harness marketplace with "ref": "main". No ref is a drift: the harness default branch is develop, so a refless declaration makes every unpromoted merge active here |
| 4 | Gate parameters complete | ## Gate parameters present, every parameter of the harness README.md contract has a row, n/a where it does not apply — a missing row is a drift, n/a is not |
| 5 | Census ⇔ skills | Every .claude/skills/*/SKILL.md, every docs/audits/*.md and every managed file appears in ## Project documents |
| 6 | No legacy skill/ | The directory skill/ does not exist |
| 7 | No sprint chaining | No "Sprint chaining", no "chain the next lot", no sprint skill anywhere. One lot, one PR, then stop (LOT-6) |
| 8 | Gate order documented | The Skills table states lot-test → lot-review → lot-audit → lot-ship. An audit step documented without a review step before it is a drift |
| 9 | Lots file status table | The Lots file starts with a | Lot | Branche | Statut | table whose every status is one of ⬜ 🔄 ✅ ⏸️ ❄️ |
| 10 | Statuses match history | Cross-check each ✅ row against rtk proxy git log --first-parent. A lot marked ✅ whose section still says "PR to open", or whose branch was never merged, is a drift. Always rtk proxy: the rtk filter hides merge commits |
| 11 | Branch naming | Branches follow feat/lot-N-slug, fix/…, chore/…, docs/…; no lot-XX-slug, no branch from main |
| 12 | Lot lock ignored | .gitignore carries .claude/current-lot, the local lock lot-confirm.sh writes. Missing line: add it |
Present this before any write:
## Harness Sync — Report
**Drifts detected:** N
| # | Invariant | File(s) | Drift | Proposed fix |
|---|-----------|---------|-------|--------------|
**Improvements (optional):** [list or none]
Distinguish clearly:
CLAUDE.md replicated byte for byte in AGENTS.md.CONVENTIONS.md is never written here, not even re-copied: the harness
sync-projects workflow is its only writer (DOC-7). Report the
drift with its resolution: if
gh pr list --head chore/sync-harness-files --state open shows a sync pull
request, the user merges it; otherwise the user re-runs
gh workflow run sync-projects.yml --repo SelimLBOURAYA/claude-harness -f projects=<project>.Lots file is never modified without explicit approval (status excepted).grep the fixed occurrences: a version can appear in CLAUDE.md, AGENTS.md,
README.md and a SKILL.md. Fix all of them.docs: or chore: commit. Do not commit
or push unrequested — that is lot-ship's job.SKILL.md description too vague to fire at the right time.CLAUDE.md and AGENTS.md.Lots file without explicit approval.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub selimlbouraya/claude-harness --plugin claude-harness12 skills in this plugin
/bootstrap-projectGenerates a harnessed repository from templates/project: documents, gate parameters, plugin declaration, CI caller and dependabot, then verifies the result against harness-invariants. Use when starting a new project, or when bringing an existing repository under the harness for the first time./dep-updateChecks and updates a project's dependencies, applying patch and minor bumps and proposing majors, then validating the build before commit. Use when the user asks for a dependency update, wants to know what is outdated, or before writing a lot PR./i-have-adhdShape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress tangents, give specific time estimates, make wins visible. Invoke with /i-have-adhd; stays on until "stop adhd mode".