Get the FREE Ultimate OpenClaw Setup Guide →

michat-docs-drift-guard

npx machina-cli add skill filmicgaze/MiChat-desktop/michat-docs-drift-guard --openclaw
Files (1)
SKILL.md
3.3 KB

MiChat Docs Drift Guard

Canonical Rules

  • Code is ground truth when ambiguous: michat/ and toolset configs.
  • Canonical documentation lives in docs/.
  • profiles/assistant/library/michat-specs/ must be an exact mirror of docs/ (same filenames, same contents).
  • docs/MICHAT_REFERENCE.md is human-facing and can be higher-level, but must not contradict docs/ or code.
  • profiles/_global/library/operating_guide_for_assistants.md and profiles/_global/library/troubleshooting_for_assistants.md are derived assistant guides and must not contradict their named sources or code.

Update Workflow (Use This Order)

  1. Verify truth if needed
    • If changing paths, defaults, gates, UI labels, or dev/frozen behavior: confirm by reading the relevant code.
  2. Update canonical docs
    • Edit the owning file(s) under docs/.
  3. Update the human-facing guide
    • If the change affects a user-visible behavior or concept, update docs/MICHAT_REFERENCE.md.
    • Keep it readable; remove minutiae, not facts.
  4. Update derived assistant guides
    • If assistants rely on the claim for operations/troubleshooting, update the derived guides.
    • Keep “Derived from:” lines consistent with the current source versions/dates.
  5. Bump version/date headers
    • If a doc has a — vX.Y.Z — YYYY-MM-DD header, update date whenever the change is user-meaningful.
    • Bump version for non-trivial changes, following the repo’s existing pattern (do not invent a new scheme).
  6. Resync the mirror
    • Copy docs/*.md to profiles/assistant/library/michat-specs/*.md.
    • Verify the mirror matches exactly (hash or diff).

Drift Checks (Fast, Deterministic)

1) Mirror equality (hash check)

$docsDir = 'docs'
$mirrorDir = 'profiles/assistant/library/michat-specs'
$docNames = (Get-ChildItem -LiteralPath $docsDir -File | Sort-Object Name).Name
foreach ($name in $docNames) {
  $h1 = (Get-FileHash -Algorithm SHA256 -LiteralPath (Join-Path $docsDir $name)).Hash
  $h2 = (Get-FileHash -Algorithm SHA256 -LiteralPath (Join-Path $mirrorDir $name)).Hash
  if ($h1 -ne $h2) { Write-Output ("DRIFT " + $name) }
}

2) Spot-check a single file (diff)

git --no-pager diff --no-index -- docs/MICHAT_REFERENCE.md profiles/assistant/library/michat-specs/MICHAT_REFERENCE.md

High-Risk Claim Types (Always Verify In Code)

  • Paths: data root, profiles root, credentials root, frozen vs dev locations
  • Gates: what enables a toolset vs what toggles a permission
  • UI exact text: Settings labels, buttons, tooltips
  • Allow-lists: file extensions, blocked actions, safety restrictions

When editing these, prefer citing/aligning to the exact module (e.g., michat/runtime_paths.py, michat/toolsets/*/__init__.py, michat/qt_shell.py).

Source

git clone https://github.com/filmicgaze/MiChat-desktop/blob/main/.codex/skills/michat-docs-drift-guard/SKILL.mdView on GitHub

Overview

Protect MiChat docs from drift by enforcing canonical sources across the repo. It ensures docs/ is the ground truth, mirrors exactly to profiles/assistant/library/michat-specs/, keeps docs/MICHAT_REFERENCE.md human-facing and aligned, and maintains derived guides with consistent version headers.

How This Skill Works

The skill codifies canonical rules: docs/ is the ground truth, profiles/assistant/library/michat-specs/ must be an exact mirror, docs/MICHAT_REFERENCE.md is human-facing and non-contradictory, and derived guides under profiles/_global/library/*_for_assistants.md align with their sources. Drift checks compare mirrors and diffs, then follow a 6-step Update Workflow to edit, reference, mirror, and bump headers as needed.

When to Use It

  • Editing any docs to fix errors or update content
  • Preparing a release or clean-history pass
  • When docs disagree with code or config
  • Updating derived assistant guides to match sources
  • Bumping version/date headers after user-visible changes

Quick Start

  1. Step 1: Verify truth in code and docs (read relevant modules and canonical docs)
  2. Step 2: Edit docs/ to reflect the truth; update user-facing guidance in MICHAT_REFERENCE.md if needed
  3. Step 3: Resync: copy docs/*.md to profiles/assistant/library/michat-specs/*.md, run drift checks, and bump headers if applicable

Best Practices

  • Verify the canonical docs under docs/ reflect truth, and cross-check with code
  • Edit canonical docs first, then mirror and update the human-facing reference
  • Run drift checks after edits (mirror equality and diff) and resolve any drift
  • Keep derived assistant guides aligned and avoid contradictions with sources or code
  • Follow the Update Workflow and bump version/date headers for meaningful changes

Example Use Cases

  • Edit docs/ to fix a wording issue, mirror to profiles/assistant/library/michat-specs/, update MICHAT_REFERENCE.md if user-facing, and bump header dates as needed
  • Fix a mismatch between docs/ and michat/runtime_paths.py, then run the mirror sync to ensure exact content
  • Prepare a release: update docs/, refresh MICHAT_REFERENCE.md, resync mirror, and bump the version/date header
  • Update profiles/_global/library/operating_guide_for_assistants.md to reflect a sourced change without contradicting the original docs
  • Spot-check a single file drift with a git diff and adjust docs until mirror hashes align

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers