.claude/skills/docs-drift-check/SKILL.md
Audit CLAUDE.md, README.md, CONTRIBUTING.md, AGENTS.md, Serena memories, and docs/ pages against the actual codebase for the documented drift points. Run before any release, after touching schema/routers/dependencies, or when starting a doc cleanup pass. User-only — explicit invocation, not a background task.
npx skillsauth add jrmatherly/1dev docs-drift-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This repo's documentation lives across multiple source-of-truth surfaces, all of which contain overlapping facts that drift independently. The canonical reference home is docs/ (enforced by openspec/specs/documentation-site/spec.md), but CLAUDE.md, README.md, CONTRIBUTING.md, AGENTS.md, and Serena memories all contain mirrors or summaries that must stay consistent.
This skill is the codified version of the doc-alignment audit performed throughout 2026-04.
src/main/lib/db/schema/index.ts (schema changes)src/main/lib/trpc/routers/package.json claude:download / codex:download script versions/docs-drift-check)The docs/ xyd-js site is the authoritative home for architectural facts, conventions, and runbooks:
docs/architecture/ — codebase layout, database, tech stack, tRPC routers, upstream boundarydocs/conventions/ — brand taxonomy, feature flags, pinned deps, quality gates, regression guards, tscheck baseline, no-scratchpad-referencesdocs/operations/ — cluster access, debugging first install, env gotchas, releasedocs/enterprise/ — auth strategy, auth fallback, cluster facts, envoy smoke test, fork posture, phase-0-gates, upstream featuresCLAUDE.md — identity, critical rules, architecture summary, quick commands, pointers to docs/README.md — user-facing pitchCONTRIBUTING.md — contributor setupAGENTS.md — AI quick-reference.claude/PROJECT_INDEX.md — repo navigation mapopenspec/config.yaml — OpenSpec project schema, context, and rules.serena/memories/project_overview.md.serena/memories/codebase_structure.md.serena/memories/environment_and_gotchas.md.serena/memories/style_and_conventions.md.serena/memories/suggested_commands.md.serena/memories/task_completion_checklist.md.claude/rules/*.md — behavioral rules loaded automatically by Claude CodeFor each drift point, the ground truth is the code or config file. All mirror surfaces must agree with ground truth. The canonical docs/ page (if present) takes precedence over CLAUDE.md and any mirror.
Ground truth: package.json
Grep: grep -n '"@anthropic-ai/claude-agent-sdk"' package.json
Mirrors: CLAUDE.md tech stack, AGENTS.md SDK version, docs/architecture/tech-stack.md
Ground truth: package.json
Canonical doc: docs/conventions/pinned-deps.md
Grep: grep -nE '"(vite|tailwindcss|shiki)":' package.json
Check: Both ground truth and canonical doc must agree. CLAUDE.md summary, environment_and_gotchas memory, and README must all match.
Ground truth: package.json + gh api repos/electron/electron/releases
Canonical doc: docs/conventions/pinned-deps.md (Electron section), docs/enterprise/phase-0-gates.md (Gate #14)
Check: Current Electron pin matches across surfaces. EOL date for the current major is still in the future.
Ground truth: package.json scripts → claude:download and codex:download
Canonical doc: docs/conventions/pinned-deps.md
Grep: grep -nE '"(claude|codex):download":' package.json
Check: CLAUDE.md summary, AGENTS.md, README.md, and environment_and_gotchas memory should all cite the same versions.
Ground truth: package.json scripts block
Canonical doc: docs/operations/release.md
Grep: grep -nE '"(release|dist:|icon:)' package.json
Check: The canonical doc must list every script that exists, and not list any that don't.
Ground truth: src/main/lib/db/schema/index.ts
Canonical doc: docs/architecture/database.md
Grep: grep -cE "^export const \w+ = sqliteTable" src/main/lib/db/schema/index.ts (table count)
Check: Canonical doc lists all tables. CLAUDE.md architecture summary cites the correct count. codebase_structure memory cites the correct count. Use the db-schema-auditor agent for a full drift report.
Ground truth: src/main/lib/trpc/routers/index.ts (createAppRouter composition)
Canonical doc: docs/architecture/trpc-routers.md
Grep: sed -n '/createAppRouter/,/^}/p' src/main/lib/trpc/routers/index.ts | grep -cE "^\s+\w+:"
Check: Canonical doc lists every router. CLAUDE.md architecture summary cites the correct total. Use the trpc-router-auditor agent for a full drift report.
Ground truth: ls src/renderer/features/agents/
Canonical doc: docs/architecture/codebase-layout.md
Check: Canonical doc must list all agents/ subdirs. CLAUDE.md summary tree matches.
Ground truth: .github/workflows/ci.yml
Canonical doc: docs/conventions/quality-gates.md
Grep: grep -nE "ts:check|quality gate" CLAUDE.md README.md CONTRIBUTING.md AGENTS.md openspec/config.yaml
Check: All five CI gates must be documented consistently: ts:check, build, test, audit, docs-build.
Ground truth: grep -rn "remoteTrpc\." src/renderer/ and grep -rn "fetch(\${apiUrl}" src/main/ src/renderer/**Canonical doc:**docs/architecture/upstream-boundary.md, docs/enterprise/upstream-features.md`
Check: README.md "Highlights" and "Removed in this fork" lists must accurately reflect which features depend on the upstream backend.
Ground truth: git log --diff-filter=D --name-only --pretty=format: | sort -u (every file ever deleted from the repo), cross-checked against the current git HEAD (git ls-tree -r HEAD --name-only) to confirm the file is still gone.
Check: Every file that was deleted in a recent commit MUST NOT be referenced by name in CLAUDE.md, README.md, CONTRIBUTING.md, AGENTS.md, .claude/PROJECT_INDEX.md, .claude/skills/*/SKILL.md, .claude/rules/*.md, or .serena/memories/*.md. Documentation references to deleted scripts/modules are the most common doc-drift failure mode in this repo.
Operational steps:
git log --since="30 days ago" --diff-filter=D --name-only --pretty=format: | sort -u
F, grep the doc corpus for the basename (not the full path, since docs may use relative references):
grep -rn "$(basename F)" CLAUDE.md README.md CONTRIBUTING.md AGENTS.md .claude/PROJECT_INDEX.md .claude/skills/ .claude/rules/ .serena/memories/ docs/ 2>/dev/null | grep -v "^Binary"
Ground truth: ls tests/regression/*.test.ts | wc -l
Canonical doc: docs/conventions/regression-guards.md
Check: Canonical doc lists every guard. CLAUDE.md critical-rules summary cites the correct count.
Ground truth: ls -d openspec/specs/*/ | wc -l
Check: CLAUDE.md pointers section and any docs that cite a count must match.
Context: Post-restructure (April 2026), CLAUDE.md was trimmed from 434 lines to <200 lines. Skills, agents, and docs that previously referenced "CLAUDE.md 'Working Directories' section" or hardcoded line numbers may be stale.
Grep: grep -rn "CLAUDE\.md line [0-9]\|CLAUDE\.md \"[^\"]" .claude/ .serena/memories/ docs/ 2>/dev/null
Check: Any hardcoded line numbers or section quotes must still match the current CLAUDE.md structure. If CLAUDE.md no longer has the cited section, the reference should point at the corresponding docs/ page or .claude/rules/ file.
Ground truth: Active OpenSpec changes (bunx @fission-ai/[email protected] list --json), upstream features status (docs/enterprise/upstream-features.md), ts:check baseline (.claude/.tscheck-baseline)
Canonical doc: docs/operations/roadmap.md
Check: Every active OpenSpec change should appear as "In Progress" on the roadmap. Every F-entry with a "Not Started" restore decision should have a corresponding roadmap entry. The ts:check error count in the roadmap should match the current baseline file.
Produce a structured report:
# Documentation Drift Audit — <date>
## Drift point 1: SDK package names
- Ground truth: `@anthropic-ai/claude-agent-sdk` at version X
- ✅ CLAUDE.md cites X
- ❌ AGENTS.md still says Y (outdated)
- ✅ docs/architecture/tech-stack.md cites X
## Drift point 2: Version pins
[...]
## Summary
- N drift points checked
- M issues found
- K recommended fixes (listed below with file:line citations)
## Recommended fixes
1. File: AGENTS.md:35 — change `0.2.43` to current version
[...]
docs/conventions/quality-gates.md — canonical quality gate listdocs/conventions/pinned-deps.md — canonical version pin listdocs/conventions/regression-guards.md — canonical regression guard list.claude/agents/db-schema-auditor.md — automated DB schema drift check.claude/agents/trpc-router-auditor.md — automated tRPC router drift checkopenspec/specs/documentation-site/spec.md — the rule that docs/ is canonical and mirrors must link.serena/memories/task_completion_checklist.md — references this skill under "If Touching Documentation Inventory"development
Background knowledge for AI agents before editing any file that handles authentication tokens or spawn environment variables in the 1Code enterprise fork. Triggers when touching src/main/lib/trpc/routers/claude.ts, claude-code.ts, claude/env.ts, feature-flags.ts, or claude-token.ts. Reminds the agent to consult the frozen Envoy Gateway strategy doc (auth-strategy-envoy-gateway.md v2.1) sections that impose hard rules on credential handling.
tools
Background knowledge for safely bumping the pinned versions of Claude CLI binary, Codex CLI binary, Electron, Vite, Tailwind, or Shiki in this repo. Each pin is load-bearing for a different reason — this skill encodes the per-pin rationale and the regression test that must pass before the bump can land. Use proactively whenever editing package.json, scripts/download-claude-binary.mjs, scripts/download-codex-binary.mjs, or any file that mentions these versions. Claude-only (background knowledge, not user-invocable).
development
Use when reading or writing any file under src/renderer/ that calls remoteTrpc.* or fetch(${apiUrl}/...). Verifies the call site is documented in docs/enterprise/upstream-features.md and warns if a new upstream-backend dependency is being introduced without a corresponding F-entry. This skill enforces the enterprise-fork posture documented in CLAUDE.md.
development
End-of-task sync — update CLAUDE.md, rebuild code graph, sync Serena memories, check roadmap drift, and commit. Run after completing any significant work to ensure all drift surfaces are current.