Skip to content

Noirewinter/hplan / skills/hplan-zh

分层持久化计划管理,适用于复杂的多阶段开发任务。当用户要求进行涉及多文件修改、 架构重构、系统设计等需要详细规划的任务时使用(超过5次工具调用的任务)。 创建分层的计划目录结构:overview.md(全局摘要)+ 每个阶段独立目录(详细规格、 调用链、检查清单)。触发词包括:开始规划、制定计划、任务分解。

scripts/init-plan.sh

View on GitHub
#!/bin/sh
# init-plan.sh — 初始化 .plan/ 目录结构
# 用法: sh init-plan.sh [phase_count]
# 默认创建 3 个阶段目录

set -e

PLAN_DIR="$(pwd)/.plan"
PHASE_COUNT="${1:-3}"

# 获取脚本所在目录(模板目录的父目录)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
TEMPLATE_DIR="$SCRIPT_DIR/../templates"

if [ -d "$PLAN_DIR" ]; then
  echo "[hplan] .plan/ 目录已存在,跳过初始化。"
  echo "如需重新初始化,请先删除 .plan/ 目录。"
  exit 0
fi

echo "[hplan] 正在初始化 .plan/ 目录..."

# 创建目录结构
mkdir -p "$PLAN_DIR/phases"

# 复制顶层模板
if [ -d "$TEMPLATE_DIR" ]; then
  cp "$TEMPLATE_DIR/overview.md" "$PLAN_DIR/overview.md"
  cp "$TEMPLATE_DIR/decisions.md" "$PLAN_DIR/decisions.md"
  cp "$TEMPLATE_DIR/errors.md" "$PLAN_DIR/errors.md"
else
  # 模板不可用时创建最小文件
  cat > "$PLAN_DIR/overview.md" << 'OVERVIEW'
# [项目名称]
current_phase: phase1_xxx

## Goal
[一句话描述最终目标]

## Phases
- [ ] phase1_xxx: [描述] → pending

## Blockers
None

## Last Decision
(尚无决策)

## Last Error
None
OVERVIEW

  cat > "$PLAN_DIR/decisions.md" << 'DECISIONS'
# 决策记录

| 时间 | 阶段 | 决策 | 理由 | 影响 |
|------|------|------|------|------|
DECISIONS

  cat > "$PLAN_DIR/errors.md" << 'ERRORS'
# 错误记录

| 时间 | 阶段 | 错误 | 尝试次数 | 解决方案 |
|------|------|------|---------|---------|
ERRORS
fi

# 创建阶段目录
for i in $(seq 1 "$PHASE_COUNT"); do
  PHASE_DIR="$PLAN_DIR/phases/phase${i}_todo"
  mkdir -p "$PHASE_DIR"

  if [ -d "$TEMPLATE_DIR" ]; then
    cp "$TEMPLATE_DIR/spec.md" "$PHASE_DIR/spec.md"
    cp "$TEMPLATE_DIR/checklist.md" "$PHASE_DIR/checklist.md"
    # call_chain.md 按需创建,不默认复制
  else
    cat > "$PHASE_DIR/spec.md" << SPEC
# Phase $i: [阶段名称]

## 目标
[该阶段要达成的具体目标]

## 修改文件清单

| 文件 | 操作 | 变更内容 |
|------|------|---------|

## 验收标准
- [ ] [标准]
SPEC

    cat > "$PHASE_DIR/checklist.md" << CHECK
# Phase $i: [阶段名称] — 检查清单

## 子任务
- [ ] [子任务]

## 完成标志
更新 overview.md 状态后进入下一阶段。
CHECK
  fi
done

echo "[hplan] 初始化完成。结构如下:"
find "$PLAN_DIR" -type f | sort | sed "s|$PLAN_DIR|.plan|"
echo ""
echo "下一步:编辑 .plan/overview.md 填入项目目标和阶段信息。"
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall