Skip to content

Noirewinter/hplan / skills/hplan-zh

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

scripts/recover-context.sh

View on GitHub
#!/bin/sh
# recover-context.sh — UserPromptSubmit hook
# 用户发送消息时检查是否有进行中的计划,如有则注入恢复上下文
#
# 触发逻辑:
#   - .plan/overview.md 不存在 → 静默退出
#   - 所有阶段为 pending(DONE=0)→ 静默退出(等待用户确认计划)
#   - 所有阶段为 complete → 静默退出
#   - 存在 in_progress 阶段(DONE>0 且未全部完成)→ 注入恢复上下文

PLAN_DIR="$(pwd)/.plan"

if [ ! -f "$PLAN_DIR/overview.md" ]; then
  exit 0
fi

# 统计完成状态
TOTAL=$(grep -cE '^\- \[.\]' "$PLAN_DIR/overview.md" 2>/dev/null || echo "0")
DONE=$(grep -cE '^\- \[x\]' "$PLAN_DIR/overview.md" 2>/dev/null || echo "0")

# 无阶段 或 全部 pending(等确认)或 全部完成 → 不注入
if [ "$TOTAL" -eq 0 ] || [ "$DONE" -eq 0 ] || [ "$DONE" -eq "$TOTAL" ]; then
  exit 0
fi

# 有进行中的工作 → 注入计划上下文
CURRENT=$(grep -m1 '^current_phase:' "$PLAN_DIR/overview.md" 2>/dev/null | sed 's/current_phase: *//')

# 安全校验:拒绝包含路径遍历字符的阶段 ID
case "$CURRENT" in
  *..* | */* | *\\*) exit 0 ;;
esac

echo "=== ACTIVE PLAN DETECTED ==="
cat "$PLAN_DIR/overview.md"

if [ -n "$CURRENT" ] && [ -f "$PLAN_DIR/phases/$CURRENT/spec.md" ]; then
  echo ""
  echo "=== CURRENT PHASE: $CURRENT ==="
  cat "$PLAN_DIR/phases/$CURRENT/spec.md"
fi

if [ -n "$CURRENT" ] && [ -f "$PLAN_DIR/phases/$CURRENT/checklist.md" ]; then
  echo ""
  echo "=== CURRENT CHECKLIST ==="
  cat "$PLAN_DIR/phases/$CURRENT/checklist.md"
fi

echo "=== END PLAN CONTEXT ==="
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