mcpField

hackathon-code-implementer

github.com/bernieweb3开发57 次安装
代码仓库

关于 hackathon-code-implementer

为开发者提供黑客松任务原型实现指导的技能。它根据任务背景和时间预算,生成步骤计划、代码脚手架、集成点、捷径、风险及可验证的完成标准。

主要功能

  1. 01制定有序实现计划
  2. 02提供精简代码脚手架
  3. 03标出集成位置
  4. 04建议原型开发捷径
  5. 05标记时间预算风险
  6. 06定义可验证的完成标准

适用场景

  1. 01开始实现已规划的黑客松任务
  2. 02为缺少具体起点的开发者提供指引
  3. 03评估任务超出可用时间的风险

安装

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

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

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

详细介绍

hackathon-code-implementer

目标

为黑客马拉松项目任务提供结构化的实现指导,包括适合快速制作原型的代码模式、集成策略和捷径。


触发条件

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

  • 即将实现 hackathon-task-planner 中的特定任务
  • 需要实现指导、代码框架或捷径模式
  • 开发者受阻,需要一个具体的起点
  • 需要评估任务预算是否有超出预算的 [HIGH-RISK] 风险
  • 每个任务调用一次;遍历 hackathon-task-planner 中的完整任务列表

输入

输入类型必填描述
task_title字符串是正在实现的任务(来自 hackathon-task-planner)
task_description字符串是任务必须实现的详细说明
tech_stack字符串[]是使用的技术
mvp_demo_flow对象[]是来自 hackathon-scope-cutter 的演示流程步骤
time_budget_hours数字是分配给此任务的小时数
existing_code_context字符串否相关的现有代码片段或文件结构
fake_ok布尔值否是否接受硬编码或模拟数据(默认值:false)

输出

输出描述
implementation_plan完成任务的有序子步骤列表
code_scaffolds可作为起点的关键代码片段、模式或桩代码
integration_points此任务与其他组件的连接位置
shortcuts适合黑客马拉松的捷径(模拟、硬编码、库)
gotchas常见的失败情况及规避方法
done_criteria表明任务已完成的条件

规则

  1. 优先考虑可运行的代码,而非整洁的代码;明确指出技术债务。
  2. 尽可能推荐现有库,而非自定义实现。
  3. 如果 fake_ok 为 true,同时提供模拟或桩代码模式和实际实现。
  4. code_scaffolds 应保持精简——仅提供入口点,而非完整实现。
  5. done_criteria 必须能在 time_budget_hours 内观察和验证。
  6. 对于任何可能耗时超过 time_budget_hours 50% 的子步骤,标记为 [HIGH-RISK]。
  7. 不要生成生产级架构;优先确保演示完整。

输出格式

implementation_plan:
  - step: <number>
    action: "<what to do>"
    risk: "<[HIGH-RISK]|normal>"

code_scaffolds:
  - label: "<purpose>"
    language: "<language>"
    snippet: |
      <code>

integration_points:
  - component: "<name>"
    connection: "<how this task connects>"

shortcuts:
  - shortcut: "<description>"
    trade_off: "<what is sacrificed>"

gotchas:
  - "<pitfall>"

done_criteria:
  - "<verifiable condition>"

示例

输入:

task_title: "Implement session memory read/write (T-03)"
task_description: "Store and retrieve a rolling summary of the user's emotional state across chat sessions using Redis."
tech_stack: ["Python", "FastAPI", "Redis", "OpenAI API"]
mvp_demo_flow:
  - step: 2
    action: "User describes recurring work stress"
    outcome: "AI references last week's similar conversation from memory"
time_budget_hours: 3
fake_ok: false

输出:

implementation_plan:
  - step: 1
    action: "Install redis-py; add Redis client singleton to app startup"
    risk: "normal"
  - step: 2
    action: "After each GPT-4 response, call GPT-4 to generate a 2-sentence session summary and write to Redis key user:{id}:summary"
    risk: "normal"
  - step: 3
    action: "On each new conversation, prepend the stored summary to the system prompt"
    risk: "[HIGH-RISK] — summary injection may push context window near limit; keep summary ≤100 tokens"
  - step: 4
    action: "Test by running two sessions and verifying AI references prior context"
    risk: "normal"

code_scaffolds:
  - label: "Redis memory read/write"
    language: "python"
    snippet: |
      import redis
      r = redis.Redis(host="localhost", port=6379, decode_responses=True)

      def get_memory(user_id: str) -> str:
          return r.get(f"user:{user_id}:summary") or ""

      def save_memory(user_id: str, summary: str):
          r.set(f"user:{user_id}:summary", summary, ex=86400)

integration_points:
  - component: "OpenAI chat endpoint (T-02)"
    connection: "Prepend get_memory() result to system prompt on every request"

shortcuts:
  - shortcut: "Use a single hardcoded user_id='demo' for the hackathon"
    trade_off: "No real multi-user support; acceptable for single-demo session"

gotchas:
  - "Redis not running on demo machine → add a startup health check with a clear error message"
  - "Summary growing too long → hard-cap at 150 tokens before injection"

done_criteria:
  - "Starting a new chat session shows AI referencing content from the previous session"
  - "Redis key exists and contains non-empty summary after first session ends"

上下文文件

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

评论

支持 Markdown