ln-160-docs-skill-extractor

Extracts procedural content from project docs into .claude/commands skills. Use when docs contain deploy, test, or troubleshoot procedures.

310 stars

Best use case

ln-160-docs-skill-extractor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Extracts procedural content from project docs into .claude/commands skills. Use when docs contain deploy, test, or troubleshoot procedures.

Teams using ln-160-docs-skill-extractor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ln-160-docs-skill-extractor/SKILL.md --create-dirs "https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/main/skills-catalog/ln-160-docs-skill-extractor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ln-160-docs-skill-extractor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ln-160-docs-skill-extractor Compares

Feature / Agentln-160-docs-skill-extractorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Extracts procedural content from project docs into .claude/commands skills. Use when docs contain deploy, test, or troubleshoot procedures.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If `shared/` is missing, fetch files via WebFetch from `https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}`.

# ln-160-docs-skill-extractor

**Type:** L2 Coordinator
**Category:** 1XX Documentation Pipeline
**Workers:** ln-161-skill-creator, ln-162-skill-reviewer

Scans project documentation, identifies procedural content, and extracts it into executable `.claude/commands/*.md` files. Declarative documentation stays in markdown; this skill only routes procedural sections into command form.

---

## Overview

| Aspect | Details |
|--------|---------|
| **Input** | Project docs, test docs, and optional doc registry |
| **Output** | `.claude/commands/*.md` files in target project |
| **Workers** | ln-161 creates commands, ln-162 reviews them |
| **Source policy** | Docs-first extraction; `AGENTS.md` and `CLAUDE.md` are routing-only |

---

## Workflow

```
Phase 1: Discovery (route docs, build inventory)
    |
Phase 2: Classification (procedural vs declarative scoring)
    |
Phase 3: Extraction Plan (user approval)
    |
Phase 4: Delegate -> ln-161 (create commands)
    |
Phase 5: Delegate -> ln-162 (review commands)
    |
Phase 6: Report (aggregate results)
```

---

## Phase 1: Discovery

**MANDATORY READ:** Load `shared/references/procedural_extraction_rules.md`, `shared/references/markdown_read_protocol.md`, and `shared/references/docs_quality_contract.md`

Build a docs-first inventory before extracting anything.

### Routing Sources

Use these files only to route discovery and prioritize reading:
- `AGENTS.md`
- `CLAUDE.md`
- `docs/project/.context/doc_registry.json` if present

Do **not** extract commands from routing sources.

### Extraction Sources

Scan only these sources for procedural content:
- `docs/**/*.md`
- `tests/README.md`
- `tests/manual/**/*`
- `README.md`
- `CONTRIBUTING.md`

Also scan:
- `.claude/commands/*.md` to avoid duplicate command creation

### Discovery Rules

1. If `docs/project/.context/doc_registry.json` exists, prioritize:
   - canonical docs first
   - `DOC_KIND=how-to` before `reference`
   - `reference` before `index` and `explanation`
2. Read markdown with the shared section-first protocol:
   - use outline first for large or unfamiliar files
   - read header markers and top sections first
   - expand only sections that might contain procedures
3. Ignore standard doc shell sections as extraction candidates:
   - `Quick Navigation`
   - `Agent Entry`
   - `Maintenance`
   - header markers such as `SCOPE`, `DOC_KIND`, `DOC_ROLE`, `READ_WHEN`, `SKIP_WHEN`, `PRIMARY_SOURCES`

### Build `contextStore`

```yaml
contextStore:
  project_root: {CWD}
  routing_sources:
    agents_md: true
    claude_md: true
    doc_registry: true
  existing_commands: [list of .claude/commands/*.md filenames]
  doc_inventory:
    - file: docs/project/runbook.md
      doc_kind: how-to
      doc_role: canonical
      sections:
        - header: "Deployment"
          line_range: [45, 92]
          signals: { code_blocks: 3, numbered_steps: 5, imperative_verbs: 8 }
```

---

## Phase 2: Classification

Score each candidate section with the shared procedural extraction rules.

| Classification | Condition | Action |
|---------------|-----------|--------|
| PROCEDURAL | `proc >= 4` and `proc > decl * 2` | Extract to command |
| DECLARATIVE | `decl >= 4` and `decl > proc * 2` | Keep as documentation |
| MIXED | Both >= 3 | Extract procedural subsection only |
| THIN | Both < 3 | Skip |

Filter:
- drop sections already covered by an existing `.claude/commands/*.md`
- drop standard doc shell sections
- prefer `DOC_KIND=how-to` when multiple sections overlap semantically

---

## Phase 3: Extraction Plan (User Approval Gate)

Present the classified result set to the user before creating files.

```
Found {N} procedural sections in {M} files:

| # | Source | DOC_KIND | Section | Score | Proposed Command |
|---|--------|----------|---------|-------|------------------|
| 1 | runbook.md | how-to | Deployment | P:8/D:1 | deploy.md |
| 2 | tests/README.md | index | Running Tests | P:7/D:2 | run-tests.md |

Existing .claude/commands/ (will skip): refresh_context.md, build-and-test.md

Include? (e.g., "1,2" or "all" or "all skip 2")
```

If the user approves nothing, stop with `No skills to create.`

---

## Phase 4: Delegate to ln-161 (Skill Creation)

Pass only approved sections to `ln-161-skill-creator`.

```text
Agent(
  description: "Create commands from procedural docs",
  prompt: "Execute skill creator.\nStep 1: Invoke:\n  Skill(skill: \"ln-161-skill-creator\")\nCONTEXT:\n{approved_sections}",
  subagent_type: "general-purpose"
)
```

Normalized payload:

```json
{
  "approved_sections": [
    {
      "source_file": "docs/project/runbook.md",
      "section_header": "Deployment",
      "line_range": [45, 92],
      "command_name": "deploy.md",
      "doc_kind": "how-to",
      "doc_role": "canonical"
    }
  ]
}
```

Collect:
- created file paths
- source-to-command mapping
- per-command summary

---

## Phase 5: Delegate to ln-162 (Skill Review)

Pass created command paths to `ln-162-skill-reviewer` in COMMAND mode.

```text
Agent(
  description: "Review created commands",
  prompt: "Execute skill reviewer in COMMAND mode.\nStep 1: Invoke:\n  Skill(skill: \"ln-162-skill-reviewer\", args: \"commands\")\nFILES: {list of created paths}",
  subagent_type: "general-purpose"
)
```

Collect:
- verdict per file
- aggregate pass/fix/warn counts

---

## Phase 6: Report

Aggregate the create and review results.

```text
## Docs Skill Extractor -- Complete

| Metric | Count |
|--------|-------|
| Documents scanned | {N} |
| Sections analyzed | {N} |
| Procedural found | {N} |
| Commands created | {N} |
| Commands skipped (existing) | {N} |
| Review PASS | {N} |
| Review FIXED | {N} |
| Review WARN | {N} |

Created commands:
- .claude/commands/deploy.md (from runbook.md#Deployment)
- .claude/commands/run-tests.md (from tests/README.md#Running Tests)
```

---

## Critical Rules

- **Docs-first extraction:** Extract only from docs sources. `AGENTS.md` and `CLAUDE.md` route discovery but never become command sources.
- **Section-first reading:** Use the shared markdown read protocol before full-file reads.
- **Detect before extract:** Only extract sections classified as procedural.
- **No duplicates:** Skip sections already covered by existing `.claude/commands/*.md`.
- **User approval required:** Never create commands without Phase 3 confirmation.
- **Delegate creation:** All command file writing goes through ln-161.
- **Delegate review:** All command validation goes through ln-162.
- **Preserve docs:** Source documentation stays intact.

---

**TodoWrite format (mandatory):**
```text
- Build docs inventory (in_progress)
- Invoke ln-161-skill-creator (pending)
- Invoke ln-162-skill-reviewer (pending)
- Aggregate report (pending)
```

## Worker Invocation (MANDATORY)

| Phase | Worker | Context |
|-------|--------|---------|
| 4 | ln-161-skill-creator | Approved procedural sections with source metadata |
| 5 | ln-162-skill-reviewer | Created command file paths in COMMAND mode |

**All workers:** Invoke via Skill tool. Workers consume only the context they need.

## Definition of Done

- [ ] Routing sources checked (`AGENTS.md`, `CLAUDE.md`, doc registry if present)
- [ ] Extraction inventory built from docs-first sources
- [ ] Every candidate section classified
- [ ] User approved extraction plan
- [ ] ln-161 created all approved commands
- [ ] ln-162 reviewed all created commands
- [ ] Final report aggregated with scan, create, and review metrics

---

## Meta-Analysis

**MANDATORY READ:** Load `shared/references/meta_analysis_protocol.md`

Skill type: `planning-coordinator`. Run after Phase 6 completes. Output to chat using the `planning-coordinator` format.

---

**Version:** 1.0.0
**Last Updated:** 2026-03-26

Related Skills

ln-775-api-docs-generator

310
from levnikolaevich/claude-code-skills

Configures Swagger/OpenAPI documentation for backend APIs. Use when adding interactive API docs to a project.

ln-614-docs-fact-checker

310
from levnikolaevich/claude-code-skills

Verifies claims in .md files (paths, versions, counts, configs, endpoints) against codebase, cross-checks contradictions. Use when auditing docs accuracy.

ln-611-docs-structure-auditor

310
from levnikolaevich/claude-code-skills

Checks hierarchy, links, SSOT, compression, requirements compliance, freshness, legacy cleanup. Use when auditing documentation structure.

ln-610-docs-auditor

310
from levnikolaevich/claude-code-skills

Coordinates audit of project knowledge surfaces: markdown documentation plus inline code documentation (comments/docstrings). Use when auditing project documentation.

ln-140-test-docs-creator

310
from levnikolaevich/claude-code-skills

Creates test documentation (testing-strategy.md, tests/README.md) with Risk-Based Testing philosophy. Use when setting up test strategy for a project.

ln-130-tasks-docs-creator

310
from levnikolaevich/claude-code-skills

Creates task management docs (kanban board, workflow rules) with Linear integration. Use when setting up task tracking for a project.

ln-120-reference-docs-creator

310
from levnikolaevich/claude-code-skills

Creates reference docs (ADRs, guides, manuals) for nontrivial tech stack choices. Use when project needs justified architecture decision records.

ln-115-devops-docs-creator

310
from levnikolaevich/claude-code-skills

Creates infrastructure.md and runbook.md (Docker-conditional). Use for DevOps documentation in any project.

ln-114-frontend-docs-creator

310
from levnikolaevich/claude-code-skills

Creates design_guidelines.md with WCAG 2.1 compliance and design system docs. Use when project has a frontend.

ln-113-backend-docs-creator

310
from levnikolaevich/claude-code-skills

Creates backend docs (api_spec.md, database_schema.md). Use when project has backend API or database.

ln-111-root-docs-creator

310
from levnikolaevich/claude-code-skills

Creates root documentation files (AGENTS.md, CLAUDE.md, docs/README.md, standards, principles, tools config). Use for initial project doc setup.

ln-110-project-docs-coordinator

310
from levnikolaevich/claude-code-skills

Coordinates project documentation creation with single context gathering and project type detection. Use when generating project docs subset.