agentleFS
fabioc-alohafabioc-aloha/Alex_ACT_Edition/.github/skills/doc-hygiene/SKILL.md

doc-hygiene

Skill0 starsChanged 4 months agoMITView on GitHub

Documentation hygiene — anti-drift rules, count elimination, and living document maintenance

2 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All other files should use descriptive references instead of counts.

    line 47
  2. Distinctive:

    Principle: If a doc change would break another doc's accuracy, it's a breaking change.

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Doc Hygiene

Prevent documentation drift through structural rules — not manual vigilance.

The Count Problem

Hardcoded counts (e.g., "109 skills", "28 instructions", "6 agents") in prose become stale within days during active development. Every count is a future bug.

Rules

RuleDoDon't
No counts in prose"See the skills catalog for the current list""Alex has 109 skills"
Counts in tables OKTables with `CountValue` format are scannable and updatableCounts buried in paragraphs
Single source of truthOne canonical location per metricSame count in 5 files
Link, don't copy"See brain-health-grid for current list"Duplicate the list inline
Timestamp proximityCounts near a "Last Updated" date are acceptableUndated counts

Canonical Sources

The filesystem is always the source of truth. Derive counts from directories, not from prose.

MetricCanonical SourceWhy
Skill count.github/skills/ directory count (or generated catalog if present)Filesystem is truth
Instruction count.github/instructions/ directory listingFilesystem is truth
Prompt count.github/prompts/ directory listingFilesystem is truth
Agent count.github/agents/ directory listingFilesystem is truth
Command countpackage.json contributes.commands (if applicable)Code is truth
Connection countBrain QA validation outputValidated at runtime

Acceptable Count Locations

Counts are tolerated (not encouraged) in these specific locations because they serve as dashboards:

FilePurposeUpdate Cadence
copilot-instructions.md Memory Stores tableAI working contextPer release
README.md architecture treeUser-facing overviewPer release

All other files should use descriptive references instead of counts.

Document Freshness

Staleness Indicators

SignalAction
Count doesn't match filesystemFix count or replace with reference
"Last Updated" older than 30 days on living docReview for accuracy
Version number doesn't match current releaseUpdate or archive
References to removed/renamed filesFix or remove reference

Living vs Historical Documents

TypeExamplesCount Policy
LivingREADME, copilot-instructions, ROADMAP, USER-MANUALMinimize counts; keep current
HistoricalResearch papers, competitive analyses, archived docsCounts are snapshots — leave as-is
Generatedbrain-health-grid outputCounts are output of audit — OK

Docs-as-Architecture

Documentation in a cognitive architecture IS architecture. Apply the same engineering rigor to docs that you would to code:

Code ConceptDocs Equivalent
Broken importBroken cross-reference link
Stale dependencyStale count or version number
Orphan moduleFile not linked from any index
Circular dependencyTwo files claiming to be source of truth
Dead codeArchived content still linked from living docs

Principle: If a doc change would break another doc's accuracy, it's a breaking change. Treat it as such.

Link Integrity

Rules

RuleEnforcement
Every markdown link in living docs must resolveGrep + verify during audit
Every important file in a folder should be linked from its README.mdOrphan check
Moving a file requires updating ALL references in the same commitGrep for filename in all .md files before moving
Archived docs removed from active indexesDon't link to archive/ from living docs
Use relative paths within doc trees./architecture/FILE.md not absolute paths

Link Integrity Checker

# Find all markdown links and verify they resolve
find . -name "*.md" -exec grep -oP '\[.*?\]\((?!http)[^)]+\)' {} + | while read match; do
  file=$(echo "$match" | sed -E 's/.*\(([^)]+)\).*/\1/')
  dir=$(dirname "$match" | cut -d: -f1)
  target="$dir/$file"
  if [ ! -f "$target" ] && [ ! -d "$target" ]; then
    echo "BROKEN: $match"
  fi
done
// Programmatic link integrity check
import { glob } from 'glob';
import { readFile } from 'fs/promises';
import { dirname, resolve, existsSync } from 'path';

async function checkLinkIntegrity(docsRoot: string): Promise<string[]> {
  const broken: string[] = [];
  const mdFiles = await glob(`${docsRoot}/**/*.md`);
  
  for (const file of mdFiles) {
    const content = await readFile(file, 'utf-8');
    const linkRegex = /\[.*?\]\((?!http)([^)]+)\)/g;
    let match;
    
    while ((match = linkRegex.exec(content)) !== null) {
      const linkPath = match[1].split('#')[0]; // Remove anchors
      const absolutePath = resolve(dirname(file), linkPath);
      
      if (!existsSync(absolutePath)) {
        broken.push(`${file}: ${match[0]} -> ${absolutePath}`);
      }
    }
  }
  
  return broken;
}

Orphan Detection

A file is orphaned if it exists in a doc folder but is not referenced by any index or parent document. Orphans are either:

  • Forgotten knowledge → add to appropriate index
  • Stale artifacts → archive or delete

Would Revise If

Revise if the anti-drift rules let stale counts ship to released artifacts twice in a quarter, or if the 'living vs historical' classification produces disputes the rules cannot resolve.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.