一键导入
sg-lessons
Use this when starting a new phase and you want to review prior lessons before planning — lists weighted lessons from .planning/lessons/ as context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this when starting a new phase and you want to review prior lessons before planning — lists weighted lessons from .planning/lessons/ as context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sg-lessons |
| description | Use this when starting a new phase and you want to review prior lessons before planning — lists weighted lessons from .planning/lessons/ as context. |
| argument-hint | [phase] - optional. If provided, show only lessons for that phase number. |
<execution_context> Self-contained. Reads .planning/lessons/ directory. Writes nothing. </execution_context>
0. **Milestone filter check.** If $ARGUMENTS matches the `--milestone=vX.Y` or `milestone=vX.Y` format, read the milestone archive file directly: ```bash MILESTONE_ARG=$(node -e " const args = process.argv[2] || ''; const m = args.match(/milestone=([^ ]+)/); process.stdout.write(m ? m[1] : ''); " -- "$ARGUMENTS" 2>/dev/null) if [ -n "$MILESTONE_ARG" ]; then if ! echo "$MILESTONE_ARG" | grep -qE '^[a-zA-Z0-9._-]+$'; then echo "Invalid milestone argument." exit 1 fi MILESTONE_FILE=".planning/milestones/${MILESTONE_ARG}-LESSONS.md" if [ ! -f "$MILESTONE_FILE" ]; then echo "No milestone archive found: $MILESTONE_FILE" echo "Run /super-gsd:sg-complete to create the archive when closing a milestone." exit 0 fi echo "--- $MILESTONE_FILE ---" cat "$MILESTONE_FILE" echo "" echo "Milestone lessons loaded: $MILESTONE_ARG" exit 0 fi ``` If no milestone filter, continue with the existing Step 1–4 flow.Collect file list via glob:
FILES=$(ls .planning/lessons/*.md 2>/dev/null | sort)
if [ -z "$FILES" ]; then
echo "No lessons recorded yet. Run /super-gsd:sg-learn after a review to capture lessons."
exit 0
fi
Apply phase filter from ARGUMENTS. If $ARGUMENTS is non-empty, keep only files starting with that phase number. Normalize various formats like phase-03, 03, 3 to a number:
if [ -n "$ARGUMENTS" ]; then
ARG_NUM=$(node -e "
const args = process.argv[2] || '';
const m = args.match(/([0-9]+)/);
process.stdout.write(m ? m[1] : '');
" -- "$ARGUMENTS" 2>/dev/null)
if [ -z "$ARG_NUM" ]; then
echo "Invalid phase argument: '$ARGUMENTS'. Use a number (e.g. 3 or 03 or phase-03)."
exit 1
fi
PADDED=$(printf "%02d" "$ARG_NUM")
FILES=$(echo "$FILES" | grep "/${PADDED}-")
if [ -z "$FILES" ]; then
echo "No lessons found for phase $ARGUMENTS."
exit 0
fi
fi
Print each file's content. Display filename as header then print content:
while IFS= read -r FILE; do
echo "--- $FILE ---"
cat "$FILE"
echo ""
done <<< "$FILES"
Print guidance message:
Lessons loaded. Run /super-gsd:sg-plan to start the next phase — prior lessons are auto-injected.
<success_criteria>
Detect the current workflow stage from HANDOFF.md and STATE.md and report the next sg-* skill to activate.
Detect existing session or start new project — super-gsd workflow entry point
Display current workflow stage, last handoff timestamp, and next recommended command
Toggle the sg-learn stage on or off in the super-gsd workflow by flipping super_gsd.skip_learn in .planning/config.json. Accepts on|off, or no argument to flip.
Toggle the sg-review stage on or off in the super-gsd workflow by flipping super_gsd.skip_review in .planning/config.json. Accepts on|off, or no argument to flip.
Toggle the sg-tdd stage on or off in the super-gsd workflow by flipping super_gsd.tdd_mode in .planning/config.json. Accepts on|off, or no argument to flip.