skills/backup/ai-ref-creator/SKILL.md
Converts lengthy official product documentation into concise, high-density AI references. Use when users request: (1) Documentation compression or condensing, (2) Creating AI-friendly reference materials, (3) Reducing token usage for large documentation, (4) Extracting technical specifications from official docs
npx skillsauth add sampx/agent-tools ai-ref-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
将冗长的官方产品文档压缩、提炼为简洁、高密度的 AI 友好参考文档。
采用"提炼与重构"方法,而非摘要总结。
关键原则:源文件可追溯性
<!-- Source: path/to/file.md --> 引用压缩(提炼)规则: 参见 references/compression_rules.md 获取完整规则,包括:
何时阅读 compression_rules.md:
docs/link_references/opencode/)index.md 或第一个可用文件以找到实际产品标题(如"OpenCode"而非"opencode_docs")docs/ai-references/<ProductName>/始终运行脚本对原始文档进行分块:
python scripts/bundle_docs.py \
-i <input_docs_dir> \
-o <output_dir> \
--max-size 40
脚本功能:
.bundles_temp/,包含:
*_partNN.md)manifest.json 元数据(源路径、文件计数、大小)阅读 manifest.json 以了解结构:
{
"bundle_file": "_root_part01.md",
"name": "_root_part01",
"file_count": 3,
"total_size_kb": 25.5,
"source_files": [
"docs/link_references/opencode/cli.md",
"docs/link_references/opencode/config.md",
"docs/link_references/opencode/api.md"
]
}
处理策略:
小文档(<3 个分块文件):
大文档(≥3 个打包文件):
Sub Agent 指令(使用并行处理时):
你是一个参考文档压缩器,擅长将官方文档或者教程压缩、提炼成 AI agent 友好的精简的快速参考文档。
任务:读取 <bundle_path> 处的文档并压缩提炼它。
关键约束:
- 将压缩提炼后的 markdown 写入磁盘:<output_path>
- 不要在响应中返回压缩后的内容
- 仅返回简短的状态消息:"Compressed to: <output_path>"
压缩提炼规则:
1. 处理所有 <!-- Source: ... --> 标记的部分
2. **关键:保留所有 Source markers!**
- 每个 `<!-- Source: path/to/file.md -->` 标记必须保留
- 即使内容被压缩,Source markers 也必须留在对应内容之前
- 删除 Source markers 会破坏到原始文档的可追溯性
3. 提取并保留:API 签名、参数、配置、约束、重要参考信息链接
4. 删除:营销文案、教程、重复示例
5. 格式:参数使用表格、TypeScript 风格接口、嵌套列表
6. 保持提炼后的内容高度精简,极具技术参考价值
如遇到复杂文档,需详细规则、示例和边界情况,阅读 references/compression_rules.md。
自动化工作流程:
合并打包脚本:
python scripts/merge_refs.py \
-d <compressed_dir> \
-o <output_file> \
--max-size 40
何时使用自动化合并:
--keep-temp 标志此技能包含以下捆绑资源:
详细的压缩规则、黄金原则和前后对比示例。在处理文档时阅读此文件以确保一致、高质量的输出。
智能文档分块脚本。按标题分割大文件并合并小文件以进行高效处理。
用法:
python scripts/bundle_docs.py -i ./docs -o ./bundles --max-size 40
参数:
-i, --input:包含 Markdown 文件的输入目录-o, --output:打包文件的输出目录--max-size:最大打包文件大小(单位 KB,默认 40)输出结构:
<output_dir>/
├── .bundles_temp/ # 临时目录(自动创建)
│ ├── *_partNN.md # 打包文件
│ └── manifest.json # 打包元数据
└── (压缩后在此处写入最终输出文件)
压缩打包文件的自动化合并脚本。处理验证、token 估算和输出生成。
何时使用: 在 Sub Agent 将所有打包文件压缩到磁盘后(在 .bundles_temp/compressed/ 中)。
用法:
python scripts/merge_refs.py \
-d <compressed_dir> \
-o docs/ai-references/Product/reference.md \
--max-size 40
参数:
-d, --bundles-dir:包含 .bundles_temp 文件夹的目录-o, --output:最终参考文档的输出文件路径--max-size:每个输出文件的最大大小(单位:k,即 tokens/1000,默认 40)--keep-temp:保留临时目录用于调试功能:
输出:
reference.md 或 reference_01.md, reference_02.md 等reference_verification_report.txt任务:将 OpenCode 官方文档压缩为 AI 参考文档
步骤:
docs/link_references/opencode/官方文档/ 和产品名称 "OpenCode"python scripts/bundle_docs.py -i docs/link_references/opencode/官方文档 -o docs/ai-references/OpenCode --max-size 40.bundles_temp/compressed/python scripts/merge_refs.py -d docs/ai-references/OpenCode -o docs/ai-references/OpenCode/reference.md --max-size 40.bundles_temp/。结果:docs/ai-references/OpenCode/reference.md(61KB),保留 33 个 Source markers
tools
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
testing
Master specification for WopalSpace. [MUST LOAD FIRST] — Load this skill when Wopal is uncertain how to proceed, task intent is ambiguous, or performing ontology/space maintenance. Triggers: Ambiguous task intent, "what workflow to use", "what skill to load", skill management (install/remove/search), space maintenance (worktrees, sync, PR contribution, promote), multi-space management. [CRITICAL] MUST LOAD whenever interacting with ontology repo operations (update/sync/contribute/promote/PR), even if the user does not explicitly say "upstream sync".
development
Workspace-level Git worktree management — create, list, remove, and prune isolated development environments. Use this skill whenever the user needs to create a worktree, set up an isolated workspace, work on multiple features in parallel, list existing worktrees, check what worktrees exist, remove or delete a worktree, clean up stale worktrees, or manage git working trees in any way. Triggers include "create worktree", "new worktree", "list worktrees", "show worktrees", "remove worktree", "delete worktree", "clean up worktree", "prune worktree", "isolated environment", "parallel development", "worktree for <project>", or any request involving git worktree operations.
development
Issue/Plan-driven development workflow. Tasks must be backed by a GitHub Issue or Plan. Trigger: issue references like #14, creating issues, creating plans, implementing plans, executing plans, checking plans, verifying plans, Plan lifecycle transitions (approve/complete/verify/archive), decomposing PRDs into Issues. Skip: spec-driven workflows, research/discussion/explanation only, small ad-hoc changes that don't need an Issue or Plan.