ohspec
Use when 需要生成 RFC 技术规范、进行需求分析、设计 API 契约,或需要 OHSpec 多代理编排输出。Triggers on "RFC", "需求分析", "API 契约", "设计规范", "OHSpec", "/ohspec".
npxskills add majiayu000/claude-skill-registry--skill ohspecLoading…
Use when 需要生成 RFC 技术规范、进行需求分析、设计 API 契约,或需要 OHSpec 多代理编排输出。Triggers on "RFC", "需求分析", "API 契约", "设计规范", "OHSpec", "/ohspec".
npxskills add majiayu000/claude-skill-registry--skill ohspecLoading…
AI辅助需求分析与设计规范生成,强调多代理编排、结构化产物和质量门禁。
架构概览与职责划分。
+-------------------------------------------------------------------+
| Orchestrator (你) |
| - 协调流程 / 复杂度路由 / 质量门禁 / 维护三文件 |
+-------------------------------+-----------------------------------+
| Subagents | Artifacts |
| Dispatcher / 需求分析师 / | rfc.md / findings.json / |
| 架构设计师 / 质量审查员 | progress.json |
+-------------------------------+-----------------------------------+
| Optional export: /ohspec:export -> rfc.digest.json + tasks.json |
+-------------------------------------------------------------------+
角色职责:
关键产物:rfc.md、findings.json、progress.json(三文件是 scan-of-record 与质量审计入口)。
用户需求
-> 初始化三文件(rfc.md/findings.json/progress.json)
-> PRECHECK:快速需求预检(30秒过滤不可行需求)
-> ASSESS:确定工具与 scan scope,写入 progress.json + audit_log
-> 快速意图澄清(≤2问题,确保扫描准确性)
-> Dispatcher 基线扫描(scan-of-record)
-> 深度技术澄清(基于扫描结果)
-> 复杂度路由 + 路由信号
-> analyze -> design -> precheck -> audit
-> RFC 输出
-> 可选 /ohspec:export 生成机读件
复杂度路由:
| 级别 | 特征 | 模式 |
|---|---|---|
| SIMPLE | 单文件,<50行 | 快速通道 |
| MEDIUM | 多文件,单子系统 | 标准流程 |
| COMPLEX | 跨子系统,架构级 | 完整流程 + spike |
路由信号:
| 信号 | 动作 |
|---|---|
SKIP_ANALYZE | 需求明确、单文件 → 跳过 analyze |
LOAD_DIPLOMAT | 跨子系统依赖 → 加载 Diplomat |
TRIGGER_SPIKE | 技术不确定 → 触发 Spike |
SIMPLIFY_CLARIFY | 详细需求 → 简化澄清 |
⛔ 禁止跳过:在执行任何操作之前,必须完整阅读以下文档。P1 表示触发该模式前必须读。
| Document | Purpose | Priority |
|---|---|---|
| workflows/main.md | 主工作流程 | P0 - 最高 |
| workflows/requirement-precheck.md | 快速需求预检 | P0 - 最高 |
| workflows/assess.md | ASSESS 阶段(代码库评估) | P0 - 最高 |
| workflows/precheck.md | RFC 预检规则 | P0 - 最高 |
| workflows/export.md | 手动导出机读件 | P0 - 最高 |
| workflows/spike.md | Spike 验证流程 | P1(触发 TRIGGER_SPIKE 时) |
| workflows/resume.md | Resume 模式 | P1(中断恢复时) |
| Document | Purpose | Priority |
|---|---|---|
| docs/phases.md | 阶段详细定义 | P0 - 最高 |
| docs/quality-gates.md | 质量门禁标准 | P0 - 最高 |
| docs/rfc-format.md | RFC 格式规范 | P0 - 最高 |
| docs/routing-signals.md | 路由信号机制 | P0 - 最高 |
| docs/subagent-contract.md | 子代理契约与摘要规范 | P1(启用子代理时) |
| docs/error-handling.md | 错误处理策略 | P1(发生异常时) |
| Document | Purpose | Priority |
|---|---|---|
| templates/rfc.md | RFC 模板 | P0 - 最高 |
| templates/findings.json | 扫描发现模板 | P0 - 最高 |
| templates/progress.json | 进度与门禁模板 | P0 - 最高 |
| templates/rfc-minimal.md | 快速通道 RFC | P1(快速通道) |
| templates/project-context.md | 项目上下文输入 | P1(需要补齐上下文时) |
| templates/context-pack.json | 上下文打包格式 | P1(需要打包上下文时) |
| templates/project-knowledge.json | 知识结构模板 | P1(需要结构化知识时) |
| templates/checkpoint.json | 断点续写状态 | P1(中断恢复时) |
| Document | Purpose | Priority |
|---|---|---|
.ohspec/scripts/precheck_rfc.py(优先;未初始化则用 scripts/precheck_rfc.py 或先 bootstrap) | RFC 结构预检 | P0 - 最高 |
| scripts/export_digest.py | 导出机读件 | P0 - 最高 |
| scripts/bootstrap_project.py | 初始化项目上下文 | P1(首次落盘项目时) |
强制:所有交付物必须使用简体中文(RFC、findings.json、progress.json、审查报告)。
例外:代码标识符遵循项目约定。
/ohspec "为音频服务增加 3D 音效开关"
rfc.md、findings.json、progress.json 必须先落盘再扫描/ohspec:export 手动生成 rfc.digest.json(可选 tasks.json)request_user_input;Claude Code CLI 用 AskUserQuestion;若工具不可用/被禁用,输出“选项式问题 + 影响 + 建议”的文本并暂停,不得进入 plan/design/audit当无法使用 Task 子代理时(例如 Codex 环境),允许编排器执行最小化 scan-of-record:
rg(其次 ag/grep)做关键词预过滤,快速定位候选关键文件rg --glob '!**/.ohspec/**' --glob '!**/.claude/ohspec/**' --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' ...)progress.json.tooling + phases.assess + audit_logfindings.confirmed.key_files(≥3 且覆盖入口/配置/依赖或测试/可观测)findings.confirmed.facts(SIMPLE ≥ 1;MEDIUM/COMPLEX ≥ 3,项目事实:配置/存储/权限/错误码/线程模型/可观测等,每条附证据锚点)progress.json.tooling 与 audit_log| 阶段 | 目标 | 专家 | 输出 |
|---|---|---|---|
| assess | 评估代码库规模,决策扫描策略 | 编排器 | 扫描策略 |
| analyze | 理解需求,澄清歧义 | 需求分析师 | RFC §1-§2 |
| design | 设计方案,定义接口 | 架构设计师 | RFC §3-§5 |
| precheck | 自动验证结构和覆盖 | 编排器 | 预检报告 |
| audit | 质量审查,评分决策 | 质量审查员 | 审查报告 |
| 阶段 | 目标 | 触发条件 | 输出 |
|---|---|---|---|
| requirement_precheck | 快速需求预检,过滤不可行/信息不足需求 | 所有任务 | 可行性判断 |
| assess | 评估代码库规模,决策扫描策略 | requirement_precheck 通过 | 扫描策略 |
| intent_clarify | 快速意图澄清,确保扫描准确 | assess 完成 | 意图理解 |
| dispatcher | 基线扫描(scan-of-record) | intent_clarify 完成 | key_files + facts |
| analyze | 深度技术澄清,输出 RFC §1-§2 | dispatcher 完成 | RFC §1-§2 |
核心专家:Dispatcher、需求分析师、架构设计师、质量审查员
扩展专家:Diplomat(跨子系统)、API设计师、Prototyper(spike验证)
必须满足:
ID格式:RFC-{YYYYMMDD}-{slug}-{hash4}
目录(推荐):.ohspec/rfcs/{RFC-ID}/
兼容(历史):.claude/ohspec/rfcs/{RFC-ID}/
工作流:
文档:
模板:
脚本:
.ohspec/scripts/precheck_rfc.py(优先;未初始化则用 scripts/precheck_rfc.py 或先 bootstrap)Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).