Agent skill
recap
Loads session context and pending work status for fresh session starts.
Install this agent skill to your Project
npx add-skill https://github.com/goffity/claude-km-skill/tree/main/skills/recap
SKILL.md
Session Recap
เริ่ม session ใหม่โดยโหลด context ที่จำเป็น
Usage
/recap
Instructions
Step 1: Load Current Focus
export TZ='Asia/Bangkok'
echo "=== Current Focus ==="
cat docs/current.md
Step 2: Show Context
export TZ='Asia/Bangkok'
echo "=== Recent Activity (last 5) ==="
tail -5 docs/logs/activity.log
echo ""
echo "=== Git Status ==="
echo "Date: $(date '+%Y-%m-%d %H:%M')"
echo "Branch: $(git branch --show-current)"
git status --short
echo ""
echo "=== Recent Commits ==="
git log --oneline -5
Step 3: Check for Pending Work
ถ้า STATE = working หรือ pending:
ใช้ AskUserQuestion เพื่อถามผู้ใช้:
งานค้างอยู่: [TASK from current.md]
ตั้งแต่: [SINCE from current.md]
ต้องการทำอะไร?
Options:
- ทำต่องานเดิม - Continue working on current task
- เริ่มงานใหม่ - Start new task (old task moves to WIP.md)
Step 4: Handle User Choice
ถ้าเลือก "ทำต่องานเดิม":
export TZ='Asia/Bangkok'
EXPECTED_BRANCH=$(grep "^BRANCH:" docs/current.md | cut -d: -f2- | xargs)
CURRENT_BRANCH=$(git branch --show-current)
if [ -n "$EXPECTED_BRANCH" ] && [ "$EXPECTED_BRANCH" != "-" ] && [ "$CURRENT_BRANCH" != "$EXPECTED_BRANCH" ]; then
echo "Switching to branch: $EXPECTED_BRANCH"
git checkout "$EXPECTED_BRANCH"
fi
sed -i '' 's/STATE: pending/STATE: working/' docs/current.md
echo "$(date '+%Y-%m-%d %H:%M') | working | [TASK] (resumed)" >> docs/logs/activity.log
แสดง:
พร้อมทำต่อ: [TASK]
Branch: [BRANCH]
ถ้าเลือก "เริ่มงานใหม่":
- ย้ายงานเก่าไป WIP.md:
export TZ='Asia/Bangkok'
if [ ! -f docs/WIP.md ]; then
echo "# Work In Progress" > docs/WIP.md
echo "" >> docs/WIP.md
echo "งานที่ยังไม่เสร็จ พักไว้ก่อน" >> docs/WIP.md
echo "" >> docs/WIP.md
fi
TASK=$(grep "^TASK:" docs/current.md | cut -d: -f2- | xargs)
SINCE=$(grep "^SINCE:" docs/current.md | cut -d: -f2- | xargs)
BRANCH=$(grep "^BRANCH:" docs/current.md | cut -d: -f2- | xargs)
ISSUE=$(grep "^ISSUE:" docs/current.md | cut -d: -f2- | xargs)
echo "## $TASK" >> docs/WIP.md
echo "" >> docs/WIP.md
echo "- **Started:** $SINCE" >> docs/WIP.md
echo "- **Paused:** $(date '+%Y-%m-%d %H:%M')" >> docs/WIP.md
echo "- **Branch:** $BRANCH" >> docs/WIP.md
echo "- **Issue:** $ISSUE" >> docs/WIP.md
echo "- **Status:** Incomplete" >> docs/WIP.md
echo "" >> docs/WIP.md
- Log activity:
export TZ='Asia/Bangkok'
echo "$(date '+%Y-%m-%d %H:%M') | pending | [TASK] (moved to WIP.md)" >> docs/logs/activity.log
- Reset current.md:
export TZ='Asia/Bangkok'
cat > docs/current.md << 'EOF'
STATE: ready
TASK: -
SINCE: -
ISSUE: -
BRANCH: -
EOF
- แสดง:
งานเก่าถูกย้ายไป docs/WIP.md แล้ว
ใช้ /focus เพื่อตั้งงานใหม่
ถ้า STATE = ready หรือ completed:
ไม่มีงานค้าง
ใช้ /focus เพื่อตั้งงานใหม่
Step 5: Check WIP.md (Optional)
ถ้ามี WIP.md และมีงานค้างอยู่ แสดง:
if [ -f docs/WIP.md ]; then
echo "=== งานที่พักไว้ ==="
grep "^## " docs/WIP.md | head -5
fi
Output Format
## Session Recap
### Current Focus
STATE: [state]
TASK: [task]
SINCE: [since]
ISSUE: [issue]
BRANCH: [branch]
### Recent Activity
[last 5 entries]
### Git Status
Branch: [branch]
Changes: [count]
### Action Required
[ถาม continue/new หรือ แนะนำ /focus]
State Reference
| STATE | Action |
|---|---|
ready |
ไม่มี focus → แนะนำ /focus |
working |
มีงานค้าง → ถาม continue/new |
pending |
งานถูกพักไว้ → ถาม continue/new |
blocked |
ติดปัญหา → ถามสถานะ |
completed |
งานเสร็จแล้ว → แนะนำ /focus |
Related Commands
| Command | Purpose |
|---|---|
/focus |
ตั้ง focus ใหม่ |
/recap |
ดู context (คุณอยู่ที่นี่) |
/td |
จบ session + retrospective |
/mem |
บันทึก knowledge |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
Creates atomic commits by invoking TDG and commenting on related GitHub issues.
distill
Synthesizes related learnings into reusable knowledge base patterns.
security-auditor
Audits code for security vulnerabilities including OWASP Top 10 and authentication issues.
code-reviewer
Reviews code changes for bugs, security vulnerabilities, and performance issues.
example
Saves reusable code examples to the examples library with metadata and tags.
flow
Documents workflow diagrams and process flows with Mermaid diagram support.
Didn't find tool you were looking for?