diataxis-categorizer by arisng/github-copilot-fc
npx skills add https://github.com/arisng/github-copilot-fc --skill diataxis-categorizer此技能为 Diátaxis 框架增加了子类别分类功能。diataxis 技能确定文件属于_哪个顶级类别_(教程、操作指南、参考、解释),而此技能则确定文件在该类别中_属于哪个域子文件夹_。
diataxis 技能的关系| 关注点 | diataxis 技能 | diataxis-categorizer 技能 |
|---|---|---|
| 顶级分类 | ✅ 负责 | ❌ 遵从 |
| 子类别放置 | ❌ 不涉及 | ✅ 负责 |
| 模板和语言模式 | ✅ 负责 | ❌ 遵从 |
| 域分类法 | ❌ 不涉及 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| ✅ 负责 |
| 批量重组 | ❌ 不涉及 | ✅ 负责 |
子类别是每个 Diátaxis 顶级类别内的基于域的文件夹:
.docs/
├── tutorials/
│ └── ralph/ # ≥3 个与 ralph 相关的教程
├── how-to/
│ ├── ralph/ # ≥3 个与 ralph 相关的操作指南
│ └── copilot/ # ≥3 个与 copilot 相关的操作指南
├── reference/
│ ├── ralph/ # ≥3 个与 ralph 相关的参考文档
│ └── copilot/ # ≥3 个与 copilot 相关的参考文档
├── explanation/
│ ├── ralph/ # ≥3 个与 ralph 相关的解释文档
│ └── copilot/ # ≥3 个与 copilot 相关的解释文档
└── index.md
命名约定:<category>/<domain>/filename.md
ralph、copilot、blazor-agui)reference/ralph/ 可以存在,而 tutorials/ralph/ 可以不存在此工作空间的主要域:
| 域 | 关键词模式 | 描述 |
|---|---|---|
ralph | ralph, session, orchestrator, executor, reviewer, librarian, subagent | Ralph v2 编排系统 |
copilot | copilot, copilot-fc, vscode, extension, agent, custom instruction | GitHub Copilot 自定义 |
sdk | sdk, copilot-sdk, acp, client | Copilot SDK / 代理通信协议 |
blazor | blazor, ag-ui, blueprint, razor | Blazor UI 框架 |
域是可扩展的 — 当文件自然地围绕某个关键词聚集时,新的域就会出现。
给定文件路径及其内容,确定目标子类别:
使用以下优先级链从文件中提取主要域关键词:
ralph-subagent-contracts.md → ralphcategory 字段:category: copilot → copilot# Ralph v2 State Machine → ralph如果没有单个域占主导地位,则该文件是跨域的 → 保留在类别根目录。
如果存在与提取的域关键词匹配的现有子类别文件夹:
reference/ralph/ 存在且文件域是 ralph → 目标是 reference/ralph/filename.md如果没有匹配的子类别文件夹存在:
≥3 的阈值可以防止为一次性文件过早创建子文件夹。
文件保留在类别根目录的情况:
Input: file path + metadata
│
┌────▼────┐
│ Rule 1: │
│ Extract │
│ keyword │
└────┬────┘
│
keyword found?
├── NO ──────────────────────────────► FALLBACK: category root
│
YES
│
┌────▼────┐
│ Rule 2: │
│ Reuse │
│ check │
└────┬────┘
│
sub-folder exists?
├── YES ─────────────────────────────► TARGET: <category>/<domain>/file.md
│
NO
│
┌────▼────┐
│ Rule 3: │
│ Create │
│ check │
└────┬────┘
│
≥3 peers share domain?
├── YES ─────────────────────────────► CREATE sub-folder + move all peers
│
NO ──────────────────────────────────► FALLBACK: category root
research/ 文件夹是一个暂存区,而不是一个永久的第 5 个 Diátaxis 类别。
research/ 中research/ 中的文件视为重新分类的候选文件diataxis 技能)和子类别(使用此技能)研究文件准备好重新分类时:
此技能设计为在 Librarian 的 PROMOTE 工作流的 步骤 6.75 — 子类别解析 处内联调用,在顶级 Diátaxis 分类(步骤 6)和内容转换(步骤 6.5)之后。
输入:
file_path: string # 例如:"reference/ralph-subagent-contracts.md"
metadata:
title: string # H1 或 frontmatter 标题
category: string # 已由 diataxis 技能确定(步骤 6)
frontmatter: object # 完整的 frontmatter(如果可用)
body_preview: string # 正文的前 500 个字符(用于关键词扫描)
输出:
target_path: string # 例如:"reference/ralph/ralph-subagent-contracts.md"
action: "place" | "create_and_place" | "stay"
domain: string | null # 提取的域关键词,跨域时为 null
reason: string # 人类可读的解释
peers: string[] # 共享该域的其他文件(用于 create_and_place)
action 是 create_and_place,调用者还应移动列出的 peers用于对现有 .docs/ wiki 进行追溯性重组:
reference/)中的所有 .md 文件{
"category": "reference",
"scan_date": "2026-03-01",
"proposed_moves": [
{
"source": "reference/ralph-subagent-contracts.md",
"target": "reference/ralph/ralph-subagent-contracts.md",
"domain": "ralph",
"action": "create_and_place",
"reason": "5 files share domain 'ralph' — creating sub-folder"
},
{
"source": "reference/copilot-cli-help.md",
"target": "reference/copilot/copilot-cli-help.md",
"domain": "copilot",
"action": "create_and_place",
"reason": "4 files share domain 'copilot' — creating sub-folder"
}
],
"staying": [
{
"file": "reference/urls.md",
"domain": null,
"reason": "Cross-domain — no single domain dominates"
}
]
}
4. 审查:人工审查清单并批准/拒绝个别移动
5. 执行:脚本执行批准的移动(创建文件夹,mv 文件)
6. 重新生成:运行 python skills/diataxis/scripts/generate_index.py 以更新 index.md
For each category in [tutorials, how-to, reference, explanation]:
files = list .md files at category root (not in sub-folders)
domain_counts = {}
For each file in files:
domain = extract_domain(file) # Rule 1
domain_counts[domain] += 1
For each file in files:
domain = extract_domain(file)
if sub-folder exists for domain: # Rule 2
propose move → <category>/<domain>/file
elif domain_counts[domain] >= 3: # Rule 3
propose create + move → <category>/<domain>/file
else:
mark as staying # Fallback
Output manifest JSON
每周安装数
1
仓库
GitHub 星标数
2
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
This skill adds sub-category classification to the Diátaxis framework. While the diataxis skill determines which top-level category a file belongs in (tutorials, how-to, reference, explanation), this skill determines which domain sub-folder within that category.
diataxis Skill| Concern | diataxis skill | diataxis-categorizer skill |
|---|---|---|
| Top-level classification | ✅ Owns | ❌ Defers |
| Sub-category placement | ❌ Not covered | ✅ Owns |
| Templates & language patterns | ✅ Owns | ❌ Defers |
| Domain taxonomy | ❌ Not covered | ✅ Owns |
| Batch reorganization | ❌ Not covered | ✅ Owns |
Sub-categories are domain-based folders inside each Diátaxis top-level category:
.docs/
├── tutorials/
│ └── ralph/ # ≥3 ralph-related tutorials
├── how-to/
│ ├── ralph/ # ≥3 ralph-related how-to guides
│ └── copilot/ # ≥3 copilot-related how-to guides
├── reference/
│ ├── ralph/ # ≥3 ralph-related reference docs
│ └── copilot/ # ≥3 copilot-related reference docs
├── explanation/
│ ├── ralph/ # ≥3 ralph-related explanations
│ └── copilot/ # ≥3 copilot-related explanations
└── index.md
Naming convention : <category>/<domain>/filename.md
ralph, copilot, blazor-agui)reference/ralph/ can exist without tutorials/ralph/Primary domains for this workspace:
| Domain | Keyword patterns | Description |
|---|---|---|
ralph | ralph, session, orchestrator, executor, reviewer, librarian, subagent | Ralph v2 orchestration system |
copilot | copilot, copilot-fc, vscode, extension, agent, custom instruction | GitHub Copilot customization |
sdk | sdk, copilot-sdk, acp, client | Copilot SDK / Agent Communication Protocol |
blazor | blazor, ag-ui, blueprint, razor | Blazor UI framework |
Domains are extensible — new domains emerge when files naturally cluster around a keyword.
Given a file path and its content, determine the target sub-category:
Extract the primary domain keyword from the file using this priority chain:
ralph-subagent-contracts.md → ralphcategory field: category: copilot → copilot# Ralph v2 State Machine → ralphIf no single domain dominates, the file is cross-domain → stays at category root.
If an existing sub-category folder matches the extracted domain keyword:
reference/ralph/ exists and file domain is ralph → target is reference/ralph/filename.mdIf no matching sub-category folder exists:
The ≥3 threshold prevents premature sub-folder creation for one-off files.
File stays at the category root when:
Input: file path + metadata
│
┌────▼────┐
│ Rule 1: │
│ Extract │
│ keyword │
└────┬────┘
│
keyword found?
├── NO ──────────────────────────────► FALLBACK: category root
│
YES
│
┌────▼────┐
│ Rule 2: │
│ Reuse │
│ check │
└────┬────┘
│
sub-folder exists?
├── YES ─────────────────────────────► TARGET: <category>/<domain>/file.md
│
NO
│
┌────▼────┐
│ Rule 3: │
│ Create │
│ check │
└────┬────┘
│
≥3 peers share domain?
├── YES ─────────────────────────────► CREATE sub-folder + move all peers
│
NO ──────────────────────────────────► FALLBACK: category root
The research/ folder is a staging area , not a permanent 5th Diátaxis category.
research/ during active investigationresearch/ files as candidates for reclassificationdiataxis skill) and the sub-category (using this skill)A research file is ready for reclassification when:
This skill is designed to be invoked inline by the Librarian's PROMOTE workflow at Step 6.75 — Sub-Category Resolution , after top-level Diátaxis classification (Step 6) and content transformation (Step 6.5).
Input :
file_path: string # e.g., "reference/ralph-subagent-contracts.md"
metadata:
title: string # H1 or frontmatter title
category: string # Already determined by diataxis skill (Step 6)
frontmatter: object # Full frontmatter if available
body_preview: string # First 500 chars of body (for keyword scan)
Output :
target_path: string # e.g., "reference/ralph/ralph-subagent-contracts.md"
action: "place" | "create_and_place" | "stay"
domain: string | null # Extracted domain keyword, null if cross-domain
reason: string # Human-readable explanation
peers: string[] # Other files that share the domain (for create_and_place)
action is create_and_place, the caller should also move the listed peersFor retroactive reorganization of an existing .docs/ wiki:
.md files in a target category (e.g., reference/){
"category": "reference",
"scan_date": "2026-03-01",
"proposed_moves": [
{
"source": "reference/ralph-subagent-contracts.md",
"target": "reference/ralph/ralph-subagent-contracts.md",
"domain": "ralph",
"action": "create_and_place",
"reason": "5 files share domain 'ralph' — creating sub-folder"
},
{
"source": "reference/copilot-cli-help.md",
"target": "reference/copilot/copilot-cli-help.md",
"domain": "copilot",
"action": "create_and_place",
"reason": "4 files share domain 'copilot' — creating sub-folder"
}
],
"staying": [
{
"file": "reference/urls.md",
"domain": null,
"reason": "Cross-domain — no single domain dominates"
}
]
}
4. Review : Human reviews the manifest and approves/rejects individual moves
5. Execute : Script executes approved moves (create folders, mv files)
6. Regenerate : Run python skills/diataxis/scripts/generate_index.py to update index.md
For each category in [tutorials, how-to, reference, explanation]:
files = list .md files at category root (not in sub-folders)
domain_counts = {}
For each file in files:
domain = extract_domain(file) # Rule 1
domain_counts[domain] += 1
For each file in files:
domain = extract_domain(file)
if sub-folder exists for domain: # Rule 2
propose move → <category>/<domain>/file
elif domain_counts[domain] >= 3: # Rule 3
propose create + move → <category>/<domain>/file
else:
mark as staying # Fallback
Output manifest JSON
Weekly Installs
1
Repository
GitHub Stars
2
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
开源项目教练指南 - 诊断问题、制定行动计划、优化开源项目运营
31,600 周安装