ln-160-docs-skill-extractor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
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.
路径说明: 文件路径(
shared/
references/
../ln-*
)相对于技能仓库根目录。如果在当前工作目录(CWD)未找到,请定位到本SKILL.md所在目录,然后向上一级即为仓库根目录。

ln-160-docs-skill-extractor

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 (deploy, test, SSH, troubleshoot), and extracts it into executable
.claude/commands/*.md
skills. Declarative content (architecture, requirements, API specs) remains as documentation.

类型: L2 Coordinator 分类: 1XX 文档流水线 协作Worker: ln-161-skill-creator、ln-162-skill-reviewer
扫描项目文档,识别流程类内容(部署、测试、SSH、故障排查),并将其提取为可执行的
.claude/commands/*.md
技能。声明类内容(架构、需求、API规范)则保留为文档。

Overview

概述

AspectDetails
InputProject docs (
docs/
,
tests/
,
README.md
)
Output
.claude/commands/*.md
files in target project
Workersln-161 (create commands), ln-162 (review commands)

维度详情
输入项目文档(
docs/
tests/
README.md
输出目标项目中的
.claude/commands/*.md
文件
协作Workerln-161(创建命令)、ln-162(审核命令)

Workflow

工作流程

Phase 1: Discovery (scan 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 (scan 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

阶段1:发现(Discovery)

Scan target project documentation to build content inventory.
Scan targets:
  • docs/
    (all .md recursively)
  • tests/README.md
    ,
    tests/manual/
  • .claude/commands/
    (existing -- to avoid duplicates)
  • README.md
    ,
    CONTRIBUTING.md
Per file: Extract H2/H3 sections with metadata.
Build contextStore:
yaml
contextStore:
  project_root: {CWD}
  existing_commands: [list of .claude/commands/*.md filenames]
  doc_inventory:
    - file: docs/project/runbook.md
      sections:
        - header: "Deployment"
          line_range: [45, 92]
          signals: { code_blocks: 3, numbered_steps: 5, imperative_verbs: 8 }

扫描目标项目文档,构建内容清单。
扫描目标:
  • docs/
    (所有.md文件,递归扫描)
  • tests/README.md
    tests/manual/
  • .claude/commands/
    (已存在的文件——避免重复)
  • README.md
    CONTRIBUTING.md
每个文件处理: 提取带有元数据的H2/H3章节。
构建contextStore:
yaml
contextStore:
  project_root: {CWD}
  existing_commands: [list of .claude/commands/*.md filenames]
  doc_inventory:
    - file: docs/project/runbook.md
      sections:
        - header: "Deployment"
          line_range: [45, 92]
          signals: { code_blocks: 3, numbered_steps: 5, imperative_verbs: 8 }

Phase 2: Classification

阶段2:分类(Classification)

MANDATORY READ: Load
references/classification_rules.md
Score each section as PROCEDURAL vs DECLARATIVE via weighted signals. Apply thresholds to classify:
ClassificationConditionAction
PROCEDURALproc >= 4 AND proc > decl * 2Extract to command
DECLARATIVEdecl >= 4 AND decl > proc * 2Skip (keep as doc)
MIXEDBoth >= 3Partial extraction
THINBoth < 3Skip
Filter: remove sections already covered by existing
.claude/commands/
.

必读要求: 加载
references/classification_rules.md
通过加权信号对每个章节进行流程类(PROCEDURAL)与声明类(DECLARATIVE)评分。应用阈值进行分类:
分类结果条件操作
PROCEDURALproc >=4 且 proc > decl *2提取为命令
DECLARATIVEdecl >=4 且 decl > proc *2跳过(保留为文档)
MIXED两者均 >=3部分提取
THIN两者均 <3跳过
过滤:跳过已被现有
.claude/commands/
文件覆盖的章节。

Phase 3: Extraction Plan (User Approval Gate)

阶段3:提取计划(用户确认环节)

Present classified results via AskUserQuestion:
Found {N} procedural sections in {M} files:

| # | Source | Section | Score | Proposed Command |
|---|--------|---------|-------|------------------|
| 1 | runbook.md | Deployment | P:8/D:1 | deploy.md |
| 2 | runbook.md | Troubleshooting | P:6/D:0 | troubleshoot.md |
| 3 | tests/README.md | 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,3" or "all" or "all skip 3")
If user approves none, end with "No skills to create."

通过AskUserQuestion展示分类结果:
Found {N} procedural sections in {M} files:

| # | Source | Section | Score | Proposed Command |
|---|--------|---------|-------|------------------|
| 1 | runbook.md | Deployment | P:8/D:1 | deploy.md |
| 2 | runbook.md | Troubleshooting | P:6/D:0 | troubleshoot.md |
| 3 | tests/README.md | 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,3" or "all" or "all skip 3")
如果用户全部不批准,则结束并提示“无技能需要创建。”

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

阶段4:委托给ln-161(技能创建)

Pass approved sections from contextStore to ln-161-skill-creator:
Agent(
  description: "Create commands from docs",
  prompt: "Execute skill creator.\nStep 1: Invoke:\n  Skill(skill: \"ln-161-skill-creator\")\nCONTEXT:\n{contextStore with approved sections}",
  subagent_type: "general-purpose"
)
Collect: list of created file paths + per-file summary.

将contextStore中已批准的章节传递给ln-161-skill-creator:
Agent(
  description: "Create commands from docs",
  prompt: "Execute skill creator.\nStep 1: Invoke:\n  Skill(skill: \"ln-161-skill-creator\")\nCONTEXT:\n{contextStore with approved sections}",
  subagent_type: "general-purpose"
)
收集结果:已创建文件的路径列表 + 每个文件的摘要。

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

阶段5:委托给ln-162(技能审核)

Pass created command file paths to ln-162-skill-reviewer:
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: review verdicts per file + aggregate pass rate.

将已创建的命令文件路径传递给ln-162-skill-reviewer:
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"
)
收集结果:每个文件的审核结论 + 整体通过率。

Phase 6: Report

阶段6:报告

Aggregate results from ln-161 (created files) + ln-162 (review verdicts):
undefined
汇总ln-161(已创建文件)和ln-162(审核结论)的结果:
undefined

Docs Skill Extractor -- Complete

Docs Skill Extractor -- Complete

MetricCount
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)
Next steps:
  • Test each command by invoking /{command-name}
  • Customize generated commands for project-specific needs

---
MetricCount
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)
Next steps:
  • Test each command by invoking /{command-name}
  • Customize generated commands for project-specific needs

---

Critical Rules

核心规则

  • Detect before extract: Only extract sections scoring PROCEDURAL -- never force extraction on declarative content
  • No duplicates: Skip sections already covered by existing
    .claude/commands/
    files
  • User approval required: Never create commands without Phase 3 confirmation
  • Delegate creation: All command file writing goes through ln-161 (SRP)
  • Delegate review: All command validation goes through ln-162 (SRP)
  • Preserve docs: Source documentation stays intact -- commands are extracted, not moved

  • 先检测再提取: 仅提取评分为PROCEDURAL的章节——绝不对声明类内容强制提取
  • 避免重复: 跳过已被现有
    .claude/commands/
    文件覆盖的章节
  • 需用户批准: 未通过阶段3确认,不得创建命令
  • 委托创建: 所有命令文件的编写必须通过ln-161(单一职责原则)
  • 委托审核: 所有命令的验证必须通过ln-162(单一职责原则)
  • 保留原文档: 源文档保持完整——仅提取命令,不移动内容

Definition of Done

完成标准

  • Doc inventory built (all scan targets discovered)
  • Classification scored for every section (PROCEDURAL/DECLARATIVE/MIXED/THIN)
  • User approved extraction plan (Phase 3 gate passed)
  • ln-161 created all approved commands
  • ln-162 reviewed all created commands
  • Report aggregated with scan/create/review metrics

  • 已构建文档清单(已发现所有扫描目标)
  • 已对所有章节完成分类评分(PROCEDURAL/DECLARATIVE/MIXED/THIN)
  • 用户已批准提取计划(通过阶段3环节)
  • ln-161已创建所有批准的命令
  • ln-162已审核所有创建的命令
  • 已汇总包含扫描/创建/审核指标的报告

Phase 7: Meta-Analysis

阶段7:元分析

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-13
必读要求: 加载
shared/references/meta_analysis_protocol.md
技能类型:
planning-coordinator
。在阶段6完成后运行。使用
planning-coordinator
格式输出到聊天窗口。

版本: 1.0.0 最后更新时间: 2026-03-13