mcpField

hackathon-test-generator

github.com/bernieweb3测试与质量39 次安装
代码仓库

关于 hackathon-test-generator

hackathon-test-generator 是为黑客松演示创建重点测试和轻量覆盖计划的技能,优先保障端到端演示流程,并根据时间预算生成测试框架、手动检查项和演示阻断因素。

主要功能

  1. 01优先覆盖演示流程
  2. 02依据完成标准生成测试用例
  3. 03包含负向和边界测试
  4. 04创建轻量测试框架
  5. 05列出手动检查项和演示阻断因素

适用场景

  1. 01评估评审前的 MVP 演示
  2. 02在有限时间内规划测试
  3. 03修复缺陷后重新检查演示

安装

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

$npx skills add https://github.com/bernieweb3/hackathon-ai-devkit --skill hackathon-test-generator

安装后在 Claude Code 中输入/hackathon-test-generator确认已加载。

详细介绍

hackathon-test-generator

目标

生成一组精简的测试用例和轻量级测试覆盖计划,验证演示流程,同时无需确保完整测试套件的覆盖率。


触发条件

在以下情况下使用此技能:

  • 核心 MVP 功能已实现,演示流程已端到端连通
  • 已获得 hackathon-code-implementer 的完成标准
  • 团队需要确认演示在评审前不会崩溃
  • 需要手动验证步骤,以便在演示前快速进行健全性检查
  • 在实现阶段稳定后调用一次;修复任何演示路径上的错误后再次调用

输入

输入类型必需描述
mvp_featuresstring[]是来自 hackathon-scope-cutter 的 MVP 功能
mvp_demo_flowobject[]是来自 hackathon-scope-cutter 的演示流程步骤
tech_stackstring[]是使用中的技术
done_criteriastring[]是来自 hackathon-code-implementer 的完成标准
time_budget_hoursnumber是可用于测试的小时数

输出

输出描述
test_cases覆盖演示流程的优先级测试用例
coverage_plan已测试与有意不测试的内容
test_scaffolds可作为起点的最简测试桩
manual_checks用于确认演示就绪的快速手动验证步骤
demo_blockers会导致演示中断的失败条件

规则

  1. 优先编写保护 mvp_demo_flow 的测试,高于其他所有覆盖需求。
  2. 每个 done_criterion 至少生成一个测试。
  3. 将任何对演示不重要的测试标记为 [NICE-TO-HAVE]。
  4. 每个 MVP 功能至少包含一个负面或边界情况测试。
  5. test_scaffolds 必须使用主要 tech_stack 语言对应的标准测试框架。
  6. manual_checks 必须能在总计 5 分钟内完成。
  7. 任何可能导致现场演示失败的场景都必须列入 demo_blockers。

输出格式

test_cases:
  - id: "TC-<number>"
    feature: "<feature name>"
    description: "<what is tested>"
    type: "<unit|integration|e2e|manual>"
    priority: "<critical|high|[NICE-TO-HAVE]>"
    input: "<test input>"
    expected_output: "<expected result>"

coverage_plan:
  covered:
    - "<area>"
  intentionally_skipped:
    - area: "<area>"
      reason: "<why skipped>"

test_scaffolds:
  - label: "<test name>"
    language: "<language>"
    snippet: |
      <code>

manual_checks:
  - step: <number>
    action: "<what to do>"
    pass_condition: "<what success looks like>"

demo_blockers:
  - scenario: "<failure scenario>"
    mitigation: "<how to prevent or recover>"

示例

输入:

mvp_features: ["GPT-4 check-in conversation", "Session memory", "Crisis escalation (mocked)"]
mvp_demo_flow:
  - step: 2
    action: "User describes recurring work stress"
    outcome: "AI references last week's similar conversation from memory"
  - step: 3
    action: "User expresses hopelessness"
    outcome: "AI surfaces crisis resource card"
tech_stack: ["Python", "FastAPI", "React", "Redis"]
done_criteria:
  - "New chat session shows AI referencing previous session content"
  - "Redis key contains non-empty summary after session ends"
time_budget_hours: 2

输出:

test_cases:
  - id: "TC-01"
    feature: "Session memory"
    description: "AI references prior session context in a new session"
    type: "e2e"
    priority: "critical"
    input: "Start session 1, say 'I'm anxious about exams'. End session. Start session 2."
    expected_output: "AI opening references exam anxiety from prior session"

  - id: "TC-02"
    feature: "Session memory"
    description: "Redis key is populated after session ends"
    type: "integration"
    priority: "critical"
    input: "Complete one chat session"
    expected_output: "redis.get('user:demo:summary') returns non-empty string"

  - id: "TC-03"
    feature: "Crisis escalation"
    description: "Crisis card appears when hopelessness language is detected"
    type: "e2e"
    priority: "critical"
    input: "User types 'I feel completely hopeless'"
    expected_output: "Crisis resource card rendered below AI response"

  - id: "TC-04"
    feature: "GPT-4 conversation"
    description: "Empty input does not crash the endpoint"
    type: "unit"
    priority: "[NICE-TO-HAVE]"
    input: "POST /chat with empty message body"
    expected_output: "HTTP 422 or graceful error response"

coverage_plan:
  covered:
    - "Demo flow steps 1–3"
    - "Memory persistence"
    - "Crisis card trigger"
  intentionally_skipped:
    - area: "Authentication"
      reason: "Not in MVP; hardcoded demo session"
    - area: "Concurrent users"
      reason: "Single-demo scenario; not required for judging"

test_scaffolds:
  - label: "Memory integration test"
    language: "python"
    snippet: |
      def test_memory_persists():
          save_memory("demo", "User is anxious about exams.")
          assert get_memory("demo") == "User is anxious about exams."

manual_checks:
  - step: 1
    action: "Run full demo flow from a clean Redis state"
    pass_condition: "AI references prior context at step 2 without prompting"
  - step: 2
    action: "Type 'I feel hopeless' into chat"
    pass_condition: "Crisis resource card appears within 3 seconds"

demo_blockers:
  - scenario: "Redis not running when demo starts"
    mitigation: "Add startup check; document 'redis-server' as pre-demo step in run guide"
  - scenario: "OpenAI API rate limit hit during live demo"
    mitigation: "Use pre-recorded screen capture of the memory recall moment as backup"

上下文文件

知识库
  • ../hackathon-shared-resources/knowledge/hackathon-demo-patterns.md
  • ../hackathon-shared-resources/knowledge/hackathon-common-failures.md
  • ../hackathon-shared-resources/knowledge/hackathon-mvp-strategy.md
操作手册
  • ../hackathon-shared-resources/playbooks/hackathon-workflow.md

评论

支持 Markdown