archive/cyberarian/SKILL.md
The digital librarian for Claude Code projects. Enforces structured document lifecycle management - organizing, indexing, and archiving project documentation automatically. Use when creating, organizing, or managing project documentation. Ensures documents are created in the proper `docs/` directory structure with required metadata, handles temporary documents in system temp directories, maintains an auto-generated index, and performs automatic archiving of old/complete documents. Use for any task involving document creation, organization, or maintenance.
npx skillsauth add slamb2k/mad-skills cyberarianInstall 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 skill enforces a structured approach to documentation in Claude Code projects, ensuring consistency, discoverability, and automatic maintenance.
docs/ with semantic categorization/tmp or system temp, never in docs/Document management operations can produce verbose output that pollutes the main agent's context:
Delegate to Task subagent for operations that return verbose output. The subagent absorbs the verbose output in its isolated context and returns a concise summary (<50 tokens).
Execute directly (simple, low-output):
docs/ directory existsDelegate to Task subagent (complex, verbose):
When verbose output is expected:
1. Recognize the operation will be verbose
2. Delegate to Task subagent with explicit instructions
3. Subagent executes scripts, absorbs output
4. Subagent parses and returns summary <50 tokens
5. Main agent receives only essential summary
Task subagent prompt format:
Execute document operation and return concise summary:
- Run: [command]
- Parse: Extract [specific data needed]
- Return: [emoji] [state] | [metric] | [next action]
- Limit: <50 tokens
Use agents/doc-librarian-subagent.md patterns for response formatting.
Success: ✓ [result] | [metric] | Next: [action]
List: 📋 [N] items: [item1], [item2], ... (+[remainder] more)
Error: ❌ [operation] failed | Reason: [brief] | Fix: [action]
Warning: ⚠️ [concern] | Impact: [brief] | Consider: [action]
docs/
├── README.md # Human-written guide to the structure
├── INDEX.md # Auto-generated index of all documents
├── ai_docs/ # Reference materials for Claude Code (SDKs, APIs, repo context)
├── specs/ # Feature and migration specifications
├── analysis/ # Investigation outputs (bugs, optimization, cleanup)
├── plans/ # Implementation plans
├── templates/ # Reusable templates
└── archive/ # Historical and completed documents
├── specs/
├── analysis/
└── plans/
When a project doesn't have a docs/ directory:
Initialize the structure:
python scripts/init_docs_structure.py
This creates all directories, README.md, and initial INDEX.md
Inform the user about the structure and conventions
When asked to create documentation (specs, analysis, plans, etc.):
Determine the category:
Use the template:
cp assets/doc_template.md docs/<category>/<descriptive-name>.md
Fill in metadata:
title, category, status, created, last_updatedtagsstatus: draftWrite the content following the document structure
Update the index:
python scripts/index_docs.py
File naming convention: Use lowercase with hyphens, descriptive names:
oauth2-migration-spec.mdauth-performance-analysis.mdspec1.mdMyDocument.mdWhen modifying existing documentation:
Update metadata:
last_updated to current datestatus if lifecycle changes (draft → active → complete)Regenerate index if significant changes:
python scripts/index_docs.py
When creating ephemeral documents (scratchpads, temporary notes, single-use docs):
NEVER create in docs/ - Use system temp instead:
# Create in /tmp for Linux/macOS
/tmp/scratch-notes.md
/tmp/debug-output.txt
# Let the system clean up temporary files
Why: The docs/ directory is for persistent, managed documentation. Temporary files clutter the structure and interfere with indexing and archiving.
When to run:
Maintenance workflow (delegate to Task subagent for context efficiency):
Validate metadata → Delegate to subagent:
Task: Run python scripts/validate_doc_metadata.py
Return: ✓ [N] valid | [N] issues: [list top 3] | Next: [action]
Archive old documents → Delegate to subagent:
Task: Run python scripts/archive_docs.py --dry-run
Return: 📦 [N] ready for archive: [list top 3] | Next: Run archive
Task: Run python scripts/archive_docs.py
Return: ✓ Archived [N] docs | Categories: [list] | Index updated
Update index → Delegate to subagent:
Task: Run python scripts/index_docs.py
Return: ✓ Index updated | [N] documents | Categories: [summary]
Why delegate? These operations can scan dozens of files and produce verbose output. Subagent isolation keeps the main context clean for reasoning.
Archiving happens automatically based on category-specific rules. See references/archiving-criteria.md for full details.
Quick reference:
specs/: Auto-archive when status: complete AND >90 daysanalysis/: Auto-archive when status: complete AND >60 daysplans/: Auto-archive when status: complete AND >30 daysai_docs/: Manual archiving onlytemplates/: Never auto-archiveTo prevent auto-archiving, set in frontmatter:
archivable_after: 2025-12-31
Every document must have YAML frontmatter. See references/metadata-schema.md for complete schema.
Minimal required frontmatter:
---
title: Document Title
category: specs
status: draft
created: 2024-11-16
last_updated: 2024-11-16
tags: []
---
Lifecycle statuses:
draft → Document being createdactive → Current and relevantcomplete → Work done, kept for referencearchived → Moved to archiveLoad these when needed for detailed guidance:
All scripts accept optional path argument (defaults to current directory):
scripts/init_docs_structure.py [path] - Initialize docs structurescripts/index_docs.py [path] - Regenerate INDEX.mdscripts/archive_docs.py [path] [--dry-run] - Archive old documentsscripts/validate_doc_metadata.py [path] - Validate all metadata# Copy template
cp assets/doc_template.md docs/specs/new-feature-spec.md
# Edit with proper metadata
# category: specs
# status: draft
# tags: [feature-name, relevant-tags]
# Update index
python scripts/index_docs.py
# Update document metadata
# status: draft → active → complete
# last_updated: <current-date>
# After a while, archiving script will auto-archive
python scripts/archive_docs.py
Delegate searches to subagent for context efficiency:
Task: Summarize docs/INDEX.md
Return: 📊 [N] total docs | Categories: [breakdown] | Recent: [latest doc]
Task: Search docs for tag "performance"
Run: grep -r "tags:.*performance" docs/ --include="*.md" | head -10
Return: 📋 [N] docs match: [path1], [path2], ... | Next: Read [most relevant]
Task: Find all draft documents
Run: grep -r "status: draft" docs/ --include="*.md"
Return: 📋 [N] drafts: [list top 5] | Next: [action]
Direct execution (only for quick checks):
# Check if docs/ exists
ls docs/ 2>/dev/null
last_updated when making significant changesvalidate_doc_metadata.py to catch issuesDocument has no frontmatter:
assets/doc_template.md as referencevalidate_doc_metadata.py to confirmDocument in wrong category:
category field in frontmatter to matchArchived document still needed:
archive/<category>/ back to <category>/status from archived to activearchived_date and archive_reason fieldstesting
Run the full OMC idea-to-merged-PR pipeline — cancel + deep-interview + ralplan + autopilot + mad-skills:ship — in a single invocation. Explicit-only; this skill never auto-activates. Only run when the user literally types /launch. Do not invoke on phrases like "launch this", "ship it", "full pipeline", or similar — none of those should trigger this skill.
testing
Ship changes through the full PR lifecycle. Use after completing feature work to commit, push, create PR, wait for checks, and merge. Handles the entire workflow: syncs with main, creates feature branch if needed, groups commits logically with semantic messages, creates detailed PR, monitors CI, fixes issues, squash merges, and cleans up. Invoke when work is ready to ship.
development
Generate container-based release pipelines that build once and promote immutable artifacts through environments (dev → staging → prod). Detects your stack, interviews for infrastructure choices, then outputs deterministic CI/CD files (Dockerfile, workflows, deployment manifests) that run without an LLM. Use when setting up deployment pipelines, containerizing an app, creating release workflows, or connecting CI to container-friendly infrastructure (Azure Container Apps, AWS Fargate, Google Cloud Run, Kubernetes, Dokku, Coolify, CapRover, etc.).
development
Initialize any project directory with a standard scaffold for AI-assisted development. Creates specs/ and context/ directories, a project CLAUDE.md with development workflow and guardrails, .gitignore, and branch protection. Recommends claude-mem for persistent memory. Idempotent — safe to run on existing projects. Triggers: "init project", "setup brace", "brace", "initialize", "bootstrap", "scaffold".