Skip to content

Noirewinter/hplan / skills/hplan-zh

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

scripts/validate-plan.sh

View on GitHub
#!/bin/sh
# validate-plan.sh — 校验 overview.md 与 phases/ 目录的一致性
#
# 检查项:
#   1. overview.md 中列出的每个 phase 在 phases/ 下是否有对应目录
#   2. phases/ 下的每个目录是否在 overview.md 中被引用
#   3. 每个活跃阶段目录中是否包含 spec.md 和 checklist.md
#
# 返回码:
#   0 = 一致
#   1 = 发现不一致(输出详情)

PLAN_DIR="$(pwd)/.plan"
HAS_ERROR=0

if [ ! -f "$PLAN_DIR/overview.md" ]; then
  echo "[hplan] 未找到 .plan/overview.md"
  exit 1
fi

if [ ! -d "$PLAN_DIR/phases" ]; then
  echo "[hplan] 未找到 .plan/phases/ 目录"
  exit 1
fi

# 1. overview.md 中的 phase → 目录是否存在
grep -E '^\- \[.\]' "$PLAN_DIR/overview.md" | while IFS= read -r line; do
  phase_id=$(echo "$line" | sed -n 's/^- \[.\] \([^ :]*\).*/\1/p')
  if [ -z "$phase_id" ]; then
    continue
  fi

  if [ ! -d "$PLAN_DIR/phases/$phase_id" ]; then
    echo "[hplan] 缺失目录: phases/$phase_id/ (overview.md 中有定义但目录不存在)"
    echo "1" >> "/tmp/.hplan_validate_err_$$"
  else
    # 检查必要文件
    if [ ! -f "$PLAN_DIR/phases/$phase_id/spec.md" ]; then
      echo "[hplan] 缺失文件: phases/$phase_id/spec.md"
      echo "1" >> "/tmp/.hplan_validate_err_$$"
    fi
    if [ ! -f "$PLAN_DIR/phases/$phase_id/checklist.md" ]; then
      echo "[hplan] 缺失文件: phases/$phase_id/checklist.md"
      echo "1" >> "/tmp/.hplan_validate_err_$$"
    fi
  fi
done

# 2. 目录是否有 overview.md 中未引用的残留
for dir in "$PLAN_DIR/phases"/*/; do
  [ -d "$dir" ] || continue
  dir_name=$(basename "$dir")
  if ! grep -q "$dir_name" "$PLAN_DIR/overview.md" 2>/dev/null; then
    echo "[hplan] 残留目录: phases/$dir_name/ (overview.md 中无引用)"
    echo "1" >> "/tmp/.hplan_validate_err_$$"
  fi
done

# 汇总
if [ -f "/tmp/.hplan_validate_err_$$" ]; then
  ERR_COUNT=$(wc -l < "/tmp/.hplan_validate_err_$$")
  rm -f "/tmp/.hplan_validate_err_$$"
  echo ""
  echo "[hplan] 发现 $ERR_COUNT 处不一致。请修复后再继续。"
  exit 1
else
  echo "[hplan] 计划结构校验通过。overview.md 与 phases/ 目录一致。"
  exit 0
fi
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