Agent skill
skills-perlahm0404-ai-orchestrator
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/skills-perlahm0404-ai-orchestrator
SKILL.md
Session Close
Command: /session-close
Description: End-of-session reflection, verification, and handoff generation
What This Does
Performs comprehensive end-of-session closure with:
- Work Reflection - Summarize all changes and accomplishments
- Code Verification - Run tests, lint, typecheck to ensure code works
- Security Audit - Scan for common security issues
- Improvement Proposals - Suggest workflow, skill, or agent improvements
- Session Handoff - Generate handoff document for next session
When to Use
Run this command when:
- Ending a coding session
- Before stepping away from work
- After completing a feature or fix
- When you want a checkpoint of current state
Usage
bash
# Full session close (all checks)
/session-close
# Quick close (skip lengthy verification)
/session-close --quick
# Include specific project context
/session-close --project karematch
Session Close Checklist
When invoked, perform these steps IN ORDER:
Step 1: Gather Session Context
bash
# Get git changes from session
git status
git diff --stat HEAD~10..HEAD # Last 10 commits (adjust as needed)
git log --oneline -10
# List modified files
git diff --name-only HEAD~5..HEAD
Step 2: Run Code Verification
bash
# Run the full verification suite (adjust for project)
# For Python projects:
python -m pytest --tb=short 2>&1 | tail -50
python -m ruff check . 2>&1 | tail -20
python -m mypy . 2>&1 | tail -20
# For TypeScript/Node projects:
npm run test 2>&1 | tail -50
npm run lint 2>&1 | tail -20
npm run typecheck 2>&1 | tail -20
Step 3: Security Audit
Scan for these common issues in modified files:
| Issue | Pattern | Severity |
|---|---|---|
| Hardcoded secrets | password =, api_key =, secret = |
CRITICAL |
| Debug code | console.log(, print(, debugger |
MEDIUM |
| SQL injection | Raw string concatenation in queries | HIGH |
| Command injection | os.system(, subprocess.run( with user input |
HIGH |
| Insecure randomness | Math.random() for security |
MEDIUM |
| Exposed credentials | .env in git, hardcoded tokens |
CRITICAL |
bash
# Quick security scan on recently changed files
git diff --name-only HEAD~5..HEAD | xargs grep -l -E "(password|api_key|secret|token)\s*=" 2>/dev/null || echo "No obvious secrets found"
# Check for debug statements
git diff HEAD~5..HEAD | grep -E "^\+.*console\.log|^\+.*print\(" | head -10
Step 4: Generate Improvement Proposals
Reflect on the session and propose improvements in these categories:
Workflow Improvements
- Were there repetitive tasks that could be automated?
- Did any tool or command fail repeatedly?
- Was context lost between steps?
New Skills Needed
- Would a new slash command have helped?
- Are there common patterns worth encapsulating?
New Agents/Advisors
- Did specialized knowledge come up repeatedly?
- Would a domain expert agent have helped?
Knowledge Objects
- Were there learnings worth capturing?
- Did patterns emerge that should be documented?
Tool/Integration Needs
- Were external tools needed but not available?
- Did any integration feel clunky?
Step 5: Generate Session Handoff
Create a session handoff document using this template:
markdown
# Session: {date} - {topic}
**Date**: {YYYY-MM-DD}
**Duration**: {approximate time}
**Focus Area**: {main topic}
## What Was Accomplished
- [List each completed item]
- [Include commit hashes for significant changes]
## What Was NOT Done
- [List incomplete items with reasons]
## Code Status
- **Tests**: {PASS/FAIL} ({X}/{Y} passing)
- **Lint**: {PASS/FAIL}
- **Typecheck**: {PASS/FAIL}
- **Security**: {OK/ISSUES FOUND}
## Files Modified
| File | Changes |
|------|---------|
| {file} | {description} |
## Key Decisions Made
- {Decision 1}: {rationale}
- {Decision 2}: {rationale}
## Open Questions / Blockers
1. {Question or blocker}
2. {Question or blocker}
## Improvement Proposals
### Workflow
- {Improvement idea}
### Skills/Agents
- {New skill or agent idea}
### Knowledge Objects
- {KO to create}
## Next Steps
1. {Immediate next action}
2. {Follow-up action}
## Handoff Notes
{2-3 paragraphs of context for the next session, including:
- Why certain approaches were taken
- Gotchas or edge cases discovered
- Context that isn't obvious from the code}
---
*Generated by /session-close*
Step 6: Save Handoff Document
bash
# Generate filename
DATE=$(date +%Y-%m-%d)
TOPIC="session-work" # Replace with actual topic
# Save to sessions directory
cat > sessions/${DATE}-${TOPIC}.md << 'EOF'
{handoff content}
EOF
# Update latest.md
cp sessions/${DATE}-${TOPIC}.md sessions/latest.md
# Optionally update STATE.md with session note
echo "\n---\n**Session ${DATE}**: {summary}" >> STATE.md
Output Format
When complete, provide a summary:
✅ SESSION CLOSE COMPLETE
========================
📊 Code Status:
- Tests: PASS (42/42)
- Lint: PASS
- Typecheck: PASS
- Security: OK
📁 Files Modified: 5
📝 Commits: 3
💡 Improvement Proposals: 2
1. Add /quick-test skill for rapid test runs
2. Create KO for TypeScript strict mode patterns
📋 Handoff: sessions/2026-01-14-feature-work.md
🔜 Next Steps:
1. Fix remaining edge case in auth flow
2. Add integration tests
Related
sessions/latest.md- Most recent handoffSTATE.md- Current project stateDECISIONS.md- Build-time decisions/autonomous-karematch- Autonomous mode (uses session state)
Implementation Notes
This skill is designed for interactive Claude Code sessions. It:
- Uses git to understand what changed
- Runs project-specific verification commands
- Applies security heuristics to catch common issues
- Generates structured handoff for session continuity
- Proposes improvements based on session observations
The improvement proposals are particularly valuable - they create a feedback loop where each session can suggest enhancements to the AI Orchestrator itself.
Didn't find tool you were looking for?