cyberarian
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.
What this skill does
# Cyberarian - Document Lifecycle Management
This skill enforces a structured approach to documentation in Claude Code projects, ensuring consistency, discoverability, and automatic maintenance.
## Core Principles
1. **Structured Organization**: All persistent documentation goes in `docs/` with semantic categorization
2. **No Temporary Docs in docs/**: Ephemeral/scratch documents belong in `/tmp` or system temp, never in `docs/`
3. **Metadata-Driven**: YAML frontmatter enables automation and lifecycle management
4. **Automatic Maintenance**: Indexing and archiving happen automatically, not manually
5. **Context Efficiency**: Bulk operations delegate to subagents to preserve main context
## Context-Efficient Operations
### The Problem
Document management operations can produce verbose output that pollutes the main agent's context:
- Validation scripts listing many errors across files
- Index generation scanning dozens of documents
- Archive operations listing all files being moved
- Search results returning many matches
### The Solution: Subagent Delegation
**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).
### Delegation Rules
**Execute directly** (simple, low-output):
- Creating a single document from template
- Reading a specific document's metadata
- Checking if `docs/` directory exists
**Delegate to Task subagent** (complex, verbose):
- Running validation across all documents
- Regenerating the index
- Archiving operations (especially dry-run)
- Searching documents by tag/status/category
- Summarizing INDEX.md contents
- Any operation touching multiple files
### Delegation Pattern
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.
```
### Response Formats
**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]`
## Directory Structure
```
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/
```
## Workflows
### First-Time Setup
When a project doesn't have a `docs/` directory:
1. **Initialize the structure**:
```bash
python scripts/init_docs_structure.py
```
This creates all directories, README.md, and initial INDEX.md
2. **Inform the user** about the structure and conventions
### Creating a New Document
When asked to create documentation (specs, analysis, plans, etc.):
1. **Determine the category**:
- **ai_docs**: SDKs, API references, repo architecture, coding conventions
- **specs**: Feature specifications, migration plans, technical designs
- **analysis**: Bug investigations, performance analysis, code audits
- **plans**: Implementation plans, rollout strategies, task breakdowns
- **templates**: Reusable document templates
2. **Use the template**:
```bash
cp assets/doc_template.md docs/<category>/<descriptive-name>.md
```
3. **Fill in metadata**:
- Set `title`, `category`, `status`, `created`, `last_updated`
- Add relevant `tags`
- Start with `status: draft`
4. **Write the content** following the document structure
5. **Update the index**:
```bash
python scripts/index_docs.py
```
**File naming convention**: Use lowercase with hyphens, descriptive names:
- โ
`oauth2-migration-spec.md`
- โ
`auth-performance-analysis.md`
- โ `spec1.md`
- โ `MyDocument.md`
### Working with Existing Documents
When modifying existing documentation:
1. **Update metadata**:
- Set `last_updated` to current date
- Update `status` if lifecycle changes (draft โ active โ complete)
2. **Regenerate index** if significant changes:
```bash
python scripts/index_docs.py
```
### Creating Temporary/Scratch Documents
When creating ephemeral documents (scratchpads, temporary notes, single-use docs):
**NEVER create in docs/** - Use system temp instead:
```bash
# 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.
### Regular Maintenance
**When to run**:
- After creating/modifying documents: Update index
- Weekly/monthly: Run archiving to clean up completed work
- Before commits: Validate metadata
**Maintenance workflow** (delegate to Task subagent for context efficiency):
1. **Validate metadata** โ Delegate to subagent:
```
Task: Run python scripts/validate_doc_metadata.py
Return: โ [N] valid | [N] issues: [list top 3] | Next: [action]
```
2. **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
```
3. **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 Documents
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 days
- `analysis/`: Auto-archive when `status: complete` AND >60 days
- `plans/`: Auto-archive when `status: complete` AND >30 days
- `ai_docs/`: Manual archiving only
- `templates/`: Never auto-archive
**To prevent auto-archiving**, set in frontmatter:
```yaml
archivable_after: 2025-12-31
```
## Metadata Requirements
Every document must have YAML frontmatter. See `references/metadata-schema.md` for complete schema.
**Minimal required frontmatter**:
```yaml
---
title: Document Title
category: specs
status: draft
created: 2024-11-16
last_updated: 2024-11-16
tags: []
---
```
**Lifecycle statuses**:
- `draft` โ Document being created
- `active` โ Current and relevant
- `complete` โ Work done, kept for reference
- `archived` โ Moved to archive
## Reference Files
Load these when needed for detailed guidance:
- **references/metadata-schema.md**: Complete YAML frontmatter specification
- **references/archiving-criteria.md**: Detailed archiving rules and philosophy
- **agents/doc-librarian-subagent.md**: Subagent template for context-efficient operations
## Scripts Reference
All scripts accept optional path argument (defaults to current directory):
- `scripts/init_docs_structure.py [path]` - Initialize docs structure
- `scripts/index_docs.py [path]` - Regenerate INDEX.md
- `scripts/archive_docs.py [path] [--dry-run]` - Archive olRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.