mcpField
P
planning-documentation

planning-documentation

github.com/qodex-aiAgent 工作流47147 次安装42 周前更新
代码仓库

关于 planning-documentation

用于编写实施计划的技能,面向不熟悉代码库的开发者,将工作拆成小型可测试任务,并列明文件路径、命令和代码。强调 TDD、频繁提交,并提供后续执行交接方式。

主要功能

  1. 01将计划拆为 2–5 分钟的操作
  2. 02列明文件、代码和测试命令
  3. 03写出预期测试结果
  4. 04采用 TDD 并频繁提交
  5. 05提供执行交接选项

适用场景

  1. 01为陌生代码库规划功能
  2. 02将实施工作拆成可测试步骤
  3. 03为另一个执行会话准备计划

安装

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

$npx skills add https://github.com/qodex-ai/ai-agent-skills --skill planning-documentation

安装后在 Claude Code 中输入/planning-documentation确认已加载。

详细介绍

编写计划

概述

编写完整的实现计划,假设工程师对我们的代码库毫无背景知识,且品味存疑。记录他们需要知道的一切:每个任务要改哪些文件、代码、测试、他们可能需要查阅的文档、如何测试。把整个计划拆解成小任务。DRY。YAGNI。TDD。频繁提交。

假设他们是熟练的开发者,但对我们的工具链或问题领域几乎一无所知。假设他们不太懂好的测试设计。

开始时宣布:“我正在使用 writing-plans 技能来创建实现计划。”

上下文: 应在专用 worktree 中运行(由 brainstorming 技能创建)。

将计划保存到:docs/plans/YYYY-MM-DD-<feature-name>.md

小任务粒度

每一步是一个操作(2-5 分钟):

  • “编写失败的测试” - 步骤
  • “运行它以确保失败” - 步骤
  • “实现最小代码使测试通过” - 步骤
  • “运行测试并确保通过” - 步骤
  • “提交” - 步骤

计划文档头部

每个计划必须以这个头部开头:

# [Feature Name] Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** [One sentence describing what this builds]

**Architecture:** [2-3 sentences about approach]

**Tech Stack:** [Key technologies/libraries]

---

任务结构

### Task N: [Component Name]

**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`

**Step 1: Write the failing test**

```python
def test_specific_behavior():
    result = function(input)
    assert result == expected

第 2 步:运行测试以验证它失败

运行:pytest tests/path/test.py::test_name -v 预期:失败,报错 “function not defined”

第 3 步:编写最小实现

def function(input):
    return expected

第 4 步:运行测试以验证它通过

运行:pytest tests/path/test.py::test_name -v 预期:通过

第 5 步:提交

git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"

## Remember
- Exact file paths always
- Complete code in plan (not "add validation")
- Exact commands with expected output
- Reference relevant skills with @ syntax
- DRY, YAGNI, TDD, frequent commits

## Execution Handoff

After saving the plan, offer execution choice:

**"Plan complete and saved to `docs/plans/<filename>.md`. Two execution options:**

**1. Subagent-Driven (this session)** - I dispatch fresh subagent per task, review between tasks, fast iteration

**2. Parallel Session (separate)** - Open new session with executing-plans, batch execution with checkpoints

**Which approach?"**

**If Subagent-Driven chosen:**
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
- Stay in this session
- Fresh subagent per task + code review

**If Parallel Session chosen:**
- Guide them to open new session in worktree
- **REQUIRED SUB-SKILL:** New session uses superpowers:executing-plans

评论

支持 Markdown