mcpField
I
interactive-requirements-gathering

interactive-requirements-gathering

github.com/oimiragieoAgent 工作流44103 次安装17 周前更新
代码仓库

关于 interactive-requirements-gathering

interactive-requirements-gathering 是通过交互式问卷收集需求的结构化技能。它指导 Agent 分类问题、逐项提问、仅依据用户选择生成内容,并要求用户确认结果。

主要功能

  1. 01区分多选与单选问题
  2. 02提供结构化选项
  3. 03一次只提一个问题
  4. 04仅依据已选答案生成内容
  5. 05设置审阅与确认环节
  6. 06保存多步问卷状态

适用场景

  1. 01定义产品需求
  2. 02梳理功能规格
  3. 03收集项目设置偏好
  4. 04引导用户熟悉工作流

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/oimiragieo/agent-studio --skill interactive-requirements-gathering

安装后在 Claude Code 中输入/interactive-requirements-gathering确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

commands/
interactive-requirements-gathering.md
hooks/
post-execute.cjs
pre-execute.cjs
references/
research-requirements.md
rules/
interactive-requirements-gathering.md
schemas/
input.schema.json
output.schema.json
scripts/
main.cjs
templates/
implementation-template.md

详细介绍

交互式需求收集

通过交互式问卷收集需求的结构化框架。基于 Conductor 方法经过验证的人机协作模式。

适用场景

  • 搭建新项目
  • 定义产品需求
  • 收集功能规格
  • 引导用户熟悉新工作流
  • 任何需要结构化用户输入的任务

核心原则

1. 问题分类

提出任何问题之前,先对问题类型进行分类:

类型用途表述方式示例
多选头脑风暴,可有多个有效答案“选择所有适用项”“你需要哪些功能?”
单选必须选择一个答案不使用多选提示语“我们应该使用哪个框架?”
2. 问题结构

所有问题都必须遵循以下结构:

[Question text]

A) [Option A - often recommended, marked with "(Recommended)"]
B) [Option B]
C) [Option C]
D) Type your own answer
E) Auto-generate and continue
3. 按顺序提问

重要:一次只问一个问题。等待用户回答后再提出下一个问题。

CORRECT:
1. Ask Question 1
2. Wait for response
3. Confirm understanding
4. Ask Question 2

INCORRECT:
1. Ask Questions 1, 2, and 3 together

问卷工作流

步骤 1:介绍

说明当前正在处理的部分:

"I'll now help you define [section name]. I'll ask a few questions to understand your needs."
步骤 2:按顺序提问

对于每个问题:

  1. 分类:这是多选题还是单选题?
  2. 拟定:创建清晰的问题和选项
  3. 呈现:以 A/B/C/D/E 格式显示选项
  4. 等待:收到回答前不要继续
  5. 确认:继续之前总结并确认理解
步骤 3:处理特殊选项

选项 D(输入自定义内容):

  • 接受用户的自定义输入
  • 确认自定义回答
  • 继续下一个问题

选项 E(自动生成):

  • 停止询问本部分的问题
  • 根据先前的回答做出最佳判断
  • 生成内容并提交审核
步骤 4:生成内容

重要:仅将用户选中的答案作为事实依据。

CORRECT:
- User selected "OAuth 2.0" -> Generate OAuth implementation details

INCORRECT:
- Include Option A, B, C text that wasn't selected
- Include question text in generated content
步骤 5:用户确认循环

生成内容后:

"I've drafted [document name]. Please review:"

[Content preview]

What would you like to do?
A) Approve - proceed to next step
B) Suggest Changes - tell me what to modify

Please respond with A or B.

循环进行,直到用户批准或提供其他方向。

问题模式

产品愿景问题(多选)
What are the primary goals of this product? (Select all that apply)

A) Improve user productivity
B) Reduce operational costs
C) Enhance customer experience
D) Type your own answer
E) Auto-generate and continue
技术选择问题(单选)
Which database should we use?

A) PostgreSQL (Recommended) - Best for relational data with complex queries
B) MongoDB - Document store for flexible schemas
C) SQLite - Lightweight for small applications
D) Type your own answer
E) Auto-generate and continue
功能范围界定问题(多选)
Which authentication methods should be supported? (Select all that apply)

A) Email/Password
B) OAuth (Google, GitHub)
C) Magic Links
D) Type your own answer
E) Auto-generate and continue

与 AskUserQuestion 工具集成

使用 AskUserQuestion 工具时,将其映射到此框架:

AskUserQuestion({
  questions: [
    {
      header: 'Database',
      question: 'Which database should we use?',
      multiSelect: false, // Exclusive question
      options: [
        { label: 'PostgreSQL (Recommended)', description: 'Best for relational data' },
        { label: 'MongoDB', description: 'Document store for flexible schemas' },
        { label: 'SQLite', description: 'Lightweight for small apps' },
      ],
    },
  ],
});

状态持久化

对于多步骤问卷,保存进度:

{
  "last_successful_step": "2.1_product_guide",
  "answers": {
    "product_type": "SaaS",
    "target_users": ["developers", "teams"]
  }
}

这样即可恢复被中断的工作流。

示例会话

AGENT: "I'll help you define the product vision. First question:"

"Who are the primary users of this product?"

A) Developers
B) Business users
C) End consumers
D) Type your own answer
E) Auto-generate and continue

USER: A, B

AGENT: "Got it - targeting developers and business users. Next question:"

"What problem does this product solve?"

A) Streamlines workflows
B) Reduces manual work
C) Improves collaboration
D) Type your own answer
E) Auto-generate and continue

USER: D - "Automates code review feedback"

AGENT: "Understood - the product automates code review feedback for developers and business users. Let me generate the product vision..."

反模式

请勿
  • 一次提出多个问题
  • 在生成的内容中包含未选中的选项
  • 跳过确认步骤
  • 不经询问就擅自假设答案
  • 在选项中使用未加解释的技术术语
请
  • 一次只问一个问题
  • 清晰、简洁地描述选项
  • 经常总结理解内容
  • 提供退出选项(D、E 选项)
  • 尊重用户的自定义输入

铁律

  1. 始终一次只问一个问题,并在提出下一个问题前等待答复——同时提出多个问题会让用户不知所措,导致回答含糊不清,并破坏顺序状态机。
  2. 绝不在生成的内容中使用未选中的选项文本——生成的输出必须基于用户实际选择的答案,而不是呈现的完整选项列表。
  3. 始终在提问前将每个问题分类为累加型(多选)或排他型(单选)——分类错误会导致答案相互矛盾(例如,用户在只能单选时选择了“B 和 D”)。
  4. 绝不在生成内容后跳过确认步骤——未经批准就呈现内容,会忽略用户需要的修改;必须持续循环,直到用户明确批准。
  5. 始终在每个问题中提供“自定义输入”选项——如果用户的情况不适用于任何给定选项,受限的选项集就会失效;自定义输入可以避免工作流停滞。

反模式

反模式失败原因正确做法
一次提出多个问题回答含糊不清;破坏顺序状态;用户只能回答部分问题一次问一个问题;等待答复;然后再问下一个
在生成的文档中逐字使用选项文本文档包含用户未选择的选项;需求不准确仅使用选中的答案值,而不是完整的选项列表
跳过问题分类(累加型还是排他型)将多选问题当作单选问题处理,反之亦然;导致需求相互矛盾先分类;累加型问题使用 multiSelect: true
未经确认就继续生成的内容与用户意图不符;需要返工始终提供输出供用户审阅;设置“批准 / 提出修改建议”的循环
没有自定义输入选项用户的情况不适用于任何选项;会话停滞或被迫作出错误选择始终在每个问题中加入“D) 自定义输入”

相关技能

  • project-onboarding - 在项目设置期间使用此框架
  • context-driven-development - 根据回答生成上下文材料
  • brainstorming - 开放式探索的替代方案

记忆协议(必须遵守)

开始前: 阅读 .claude/context/memory/learnings.md

完成后:

  • 发现新模式 -> .claude/context/memory/learnings.md
  • 遇到问题 -> .claude/context/memory/issues.md
  • 作出决策 -> .claude/context/memory/decisions.md

假定任务可能中断:如果没有记录在记忆中,就等于没有发生。

评论

支持 Markdown