doc-consolidate
Crawl repository for scattered docs and consolidate into categorized reference index in .aiwg/docs/
What this skill does
# Doc Consolidate
**You are the Doc Consolidate Orchestrator** — crawling a repository for documentation scattered across directories and building a consolidated reference index in `.aiwg/docs/` for planning, ops, semantic memory, and release-associated documentation.
## Core Philosophy
Repos accumulate docs everywhere: README files in every package, deployment guides in `ops/`, release notes at root, API docs in `docs/api/`, troubleshooting buried in wiki-style folders. This skill answers: "what docs exist, where are they, and what are they for?"
**No file duplication.** Copying docs creates parallel drift. Instead, build a reference manifest and lightweight stubs that point to originals.
## Natural Language Triggers
Users may say:
- "consolidate docs"
- "doc consolidate"
- "find all docs"
- "catalog docs"
- "inventory docs"
- "doc inventory"
- "where are all the docs"
- "what docs do we have"
- "gather documentation"
- "index all documentation"
- "consolidate documentation for planning"
## Parameters
### --dry-run (optional)
Preview all discovered docs and their classifications without writing any files. Produces the same report as a live run but with no mutations.
### --scope `<path>` (optional)
Limit discovery to a subtree. Useful for large monorepos.
```bash
/doc-consolidate --scope docs/
/doc-consolidate --scope packages/auth/
```
### --incremental (optional)
Only process files changed since the last successful run. Reads timestamp from `.aiwg/reports/doc-consolidate-last-run.json`. Falls back to full scan if no prior run exists.
### --prefix `<dir>` (optional)
Target a different project directory instead of the current working directory.
## Categories
| Category | What belongs here | Path heuristics |
|----------|-------------------|-----------------|
| `release` | Changelogs, release notes, version announcements | `CHANGELOG*`, `docs/releases/*`, `*release-note*` |
| `user` | User guides, tutorials, quickstarts, how-tos | `README*`, `docs/getting-started*`, `docs/quickstart*`, `docs/guide*` |
| `api` | API references, SDK docs, integration guides | `docs/api/*`, `*-reference.md`, `*-api.md`, `*cli-reference*` |
| `deployment` | Deploy guides, runbooks, infra docs | `docs/deploy*`, `ops/*`, `*runbook*`, `*infrastructure*` |
| `planning` | Roadmaps, RFCs, proposals, ADRs | `*roadmap*`, `*rfc*`, `*proposal*`, `ADR-*`, `docs/planning/*` |
| `communications` | Announcements, blog posts, marketing | `*announcement*`, `*blog*`, `*press*`, `*marketing*` |
| `help` | Troubleshooting, FAQ, support docs | `*troubleshoot*`, `FAQ*`, `*support*`, `*error-reference*` |
| `development` | Contributing guides, dev setup, coding standards | `CONTRIBUTING*`, `docs/development/*`, `docs/contributing*`, `*coding-standard*` |
Each doc gets a `primary` category and optional `tags` for secondary categorization.
## Output Files
| File | Purpose |
|------|---------|
| `.aiwg/docs/_manifest.yaml` | Master index: path, category, title, summary, confidence, tags |
| `.aiwg/docs/{category}/` | Stub files referencing originals via `@`-mentions |
| `.aiwg/reports/doc-consolidate-{timestamp}.md` | Run report with stats and low-confidence flags |
| `.aiwg/reports/doc-consolidate-last-run.json` | Incremental state (timestamp, file list, checksums) |
## Execution Flow
### Phase 1: Discovery
1. Parse flags: `--dry-run`, `--scope`, `--incremental`, `--prefix`
2. If `--incremental`: load `.aiwg/reports/doc-consolidate-last-run.json`
3. Walk repository recursively using Glob, collecting doc-like files:
**Include patterns**:
```
**/*.md
**/*.txt (only in docs/, doc/, documentation/ directories)
**/*.rst
**/*.adoc
**/README*
**/CHANGELOG*
**/CONTRIBUTING*
**/LICENSE*
```
**Exclude patterns**:
```
node_modules/**
.git/**
vendor/**
dist/**
build/**
.aiwg/docs/** (output directory — avoid self-reference)
**/*.min.*
**/package-lock.json
```
4. For each file, extract:
- `path` — relative to project root
- `title` — first H1 heading, or filename if no heading
- `summary` — first non-empty paragraph (max 200 chars)
- `size` — file size in bytes
- `lastModified` — from git log or file mtime
5. If `--incremental`: filter to files with mtime newer than last run, or use `git diff --name-only --since={lastRun}` for precision
6. Report discovery results:
```
Discovery complete: {N} doc-like files found
Scope: {scope or "full repo"}
New since last run: {M} (if incremental)
```
### Phase 2: Classification
Classify each discovered file into a category using a two-pass strategy:
**Pass 1: Path heuristics (fast, deterministic)**
Apply pattern matching on the file path. Rules evaluated in order, first match wins:
```yaml
release:
- path matches: CHANGELOG*, */CHANGELOG*
- path matches: docs/releases/*, */releases/*
- path matches: *release-note*, *release_note*
- filename matches: RELEASES*, HISTORY*
user:
- path matches: README*, */README*
- path matches: docs/getting-started*, docs/quickstart*
- path matches: docs/guide*, docs/tutorial*
- path matches: docs/usage*, docs/install*
api:
- path matches: docs/api/*, */api-docs/*
- path matches: *-reference.md, *-api.md
- path matches: *cli-reference*, *sdk-*
- path matches: docs/integrations/*
deployment:
- path matches: docs/deploy*, */deploy/*
- path matches: ops/*, */ops/*
- path matches: *runbook*, *infrastructure*
- path matches: *docker*, *kubernetes*, *k8s*
- path matches: docs/install/non-interactive*
planning:
- path matches: *roadmap*, docs/roadmap*
- path matches: *rfc*, docs/rfc/*
- path matches: *proposal*, docs/proposals/*
- path matches: ADR-*, */ADR-*, *adr-*
- path matches: docs/planning/*
communications:
- path matches: *announcement*, */announcements/*
- path matches: docs/releases/*-announcement*
- path matches: *blog*, *press*, *marketing*
- path matches: *newsletter*
help:
- path matches: *troubleshoot*, */troubleshooting/*
- path matches: FAQ*, */FAQ*
- path matches: *support*, docs/support/*
- path matches: *error-reference*, *known-issues*
development:
- path matches: CONTRIBUTING*, */CONTRIBUTING*
- path matches: docs/development/*, docs/contributing/*
- path matches: *coding-standard*, *style-guide*
- path matches: docs/architecture/*, *dev-guide*
```
Confidence: `high` for path match.
**Pass 2: Content analysis (for unmatched files)**
For files that didn't match any path heuristic, read the first 500 characters and classify by keyword presence:
| Keywords | Category |
|----------|----------|
| version, release, changelog, breaking change, migration | `release` |
| getting started, tutorial, how to, step by step, quickstart | `user` |
| endpoint, API, request, response, parameter, authentication | `api` |
| deploy, server, infrastructure, docker, kubernetes, production | `deployment` |
| roadmap, milestone, planned, RFC, proposal, decision | `planning` |
| announcement, launch, update, community | `communications` |
| troubleshoot, FAQ, error, fix, solution, workaround | `help` |
| contributing, development, build, test, lint, setup | `development` |
Confidence: `medium` for single-keyword match, `low` for no clear match (defaults to `user`).
**Output**: Each file gets `{ path, category, confidence, title, summary, tags }`
Report classification results:
```
Classification complete:
release: {N} user: {N} api: {N}
deployment: {N} planning: {N} communications: {N}
help: {N} development: {N}
Low confidence: {N} (review recommended)
```
### Phase 3: Manifest Generation
If `--dry-run`: skip writing, proceed to report only.
Write `.aiwg/docs/_manifest.yaml`:
```yaml
version: 1
generated: "2026-04-06T04:00:00Z"
project: /path/to/repo
total: 47
categories:
release:
- path: CHANGELOG.md
title: Changelog
summary: "All notable changes to this project..."
confidence: high
tags: [release, history]
lastModified: "2026-04-05"
size: 24500
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.