agentsclimarketplace

Doc hygiene

Skill fabioc-aloha/Alex_Skill_Mall/plugins/documentation/doc-hygiene

Documentation hygiene — anti-drift rules, count elimination, and living document maintenanceFrom its SKILL.md

Install
npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill doc-hygiene

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

5.6 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

Documentation 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""the AI assistant has 109 skills"
Counts in tables OKTables with `Count
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
Muscle count.github/muscles/ 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

Keep looking

Skills are one crate of 326,736. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.