Noirewinter/hplan / skills/hplan-zh
hplan
Verified分层持久化计划管理,适用于复杂的多阶段开发任务。当用户要求进行涉及多文件修改、 架构重构、系统设计等需要详细规划的任务时使用(超过5次工具调用的任务)。 创建分层的计划目录结构:overview.md(全局摘要)+ 每个阶段独立目录(详细规格、 调用链、检查清单)。触发词包括:开始规划、制定计划、任务分解。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.1 KB |
| scripts/advance-phase.sh | script | 2.0 KB |
| scripts/check-complete.sh | script | 2.4 KB |
| scripts/init-plan.sh | script | 2.4 KB |
| scripts/inject-overview.sh | script | 279 B |
| scripts/post-edit-remind.sh | script | 321 B |
| scripts/recover-context.sh | script | 1.5 KB |
| scripts/validate-plan.sh | script | 2.1 KB |
| templates/call_chain.md | markdown | 1.2 KB |
| templates/checklist.md | markdown | 509 B |
| templates/decisions.md | markdown | 112 B |
| templates/errors.md | markdown | 130 B |
| templates/overview.md | markdown | 305 B |
| templates/spec.md | markdown | 1.4 KB |
scripts/check-complete.sh
View on GitHub#!/bin/sh
# check-complete.sh — 检查所有阶段的完成状态
#
# 返回码:
# 0 = 允许结束(全部完成,或尚未开始执行)
# 2 = 阻止结束(已开始但未全部完成)
#
# 判断逻辑:
# DONE=0, TOTAL>0 → 计划已创建但未开始执行(可能在等用户确认)→ 允许结束
# DONE>0, DONE<TOTAL → 已开始但未完成 → 阻止结束
# DONE=TOTAL → 全部完成 → 允许结束
PLAN_DIR="$(pwd)/.plan"
if [ ! -f "$PLAN_DIR/overview.md" ]; then
exit 0
fi
# 统计阶段状态,写入临时文件(兼容 POSIX sh 的管道子 shell 限制)
TMP_DONE="/tmp/.hplan_done_$$"
TMP_INCOMPLETE="/tmp/.hplan_incomplete_$$"
TMP_TOTAL="/tmp/.hplan_total_$$"
rm -f "$TMP_DONE" "$TMP_INCOMPLETE" "$TMP_TOTAL"
grep -E '^\- \[.\]' "$PLAN_DIR/overview.md" 2>/dev/null | while IFS= read -r line; do
phase_id=$(echo "$line" | sed -n 's/^- \[.\] \([^ :]*\).*/\1/p')
# 安全校验:跳过包含路径遍历字符的阶段 ID
case "$phase_id" in
*..* | */* | *\\* | "") continue ;;
esac
if echo "$line" | grep -q '\[x\]'; then
echo "done" >> "$TMP_DONE"
else
echo "$phase_id" >> "$TMP_INCOMPLETE"
fi
echo "1" >> "$TMP_TOTAL"
done
TOTAL=0
DONE=0
if [ -f "$TMP_TOTAL" ]; then
TOTAL=$(wc -l < "$TMP_TOTAL")
fi
if [ -f "$TMP_DONE" ]; then
DONE=$(wc -l < "$TMP_DONE")
fi
rm -f "$TMP_TOTAL" "$TMP_DONE"
# 无阶段定义
if [ "$TOTAL" -eq 0 ]; then
echo "[hplan] overview.md 中未找到阶段定义。"
rm -f "$TMP_INCOMPLETE"
exit 0
fi
# 尚未开始执行(全部 pending)→ 允许结束(等待用户确认计划)
if [ "$DONE" -eq 0 ]; then
rm -f "$TMP_INCOMPLETE"
echo "[hplan] 计划已创建,等待用户确认后开始执行。"
exit 0
fi
# 全部完成
if [ ! -f "$TMP_INCOMPLETE" ]; then
echo "[hplan] 所有阶段已完成 ($DONE/$TOTAL)。"
echo "如需追加工作,请在 overview.md 中添加新阶段。"
exit 0
fi
# 已开始但未全部完成 → 阻止结束
INCOMPLETE=$(cat "$TMP_INCOMPLETE" | sed 's/^/ - /')
rm -f "$TMP_INCOMPLETE"
echo "[hplan] 进度: $DONE/$TOTAL 阶段完成。"
echo "未完成阶段:"
echo "$INCOMPLETE"
echo ""
echo "仍有未完成的阶段,请检查剩余任务后再结束。"
echo "如果遇到无法解决的阻塞,请在 errors.md 中记录原因并向用户请求帮助。"
echo "用户可随时通过删除 .plan/ 目录退出计划。"
exit 2
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |