Start-of-day setup and readiness routine. Calculates Ready to Code Score (0-100) based on session restoration, service health, dependency updates, branch sync, PR reviews, and issue triage. Automatically captures session state to STATUS.json. Use at start of work day after opening Claude Code.
Runs an automated start-of-day routine that calculates a "Ready to Code Score" (0-100) by checking session restoration, service health, dependencies, branch sync, PR reviews, and issue triage. Use this immediately after opening Claude Code to quickly assess your environment and get a prioritized setup checklist.
/plugin marketplace add jrc1883/popkit-claude/plugin install popkit-dev@popkit-claudeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdscripts/STATUS.jsonscripts/morning_report_generator.pyscripts/morning_workflow.pyscripts/ready_to_code_score.pytests/test_ready_to_code_score.pyAutomated start-of-day setup that ensures optimal development environment before starting work.
Core principle: Validate readiness to code and restore previous session context with zero manual overhead.
Trigger: Start of work day, after opening Claude Code
Duration: ~15-20 seconds (vs. ~90 seconds manual)
Comprehensive readiness check across 6 dimensions:
| Check | Points | Criteria |
|---|---|---|
| Session Restored | 20 | Previous session context restored from STATUS.json |
| Services Healthy | 20 | All required dev services running |
| Dependencies Updated | 15 | Package dependencies up to date |
| Branches Synced | 15 | Local branch synced with remote |
| PRs Reviewed | 15 | No PRs waiting for review |
| Issues Triaged | 15 | All issues assigned/prioritized |
Score Interpretation:
Load context from STATUS.json:
from pathlib import Path
import json
status_file = Path('STATUS.json')
if status_file.exists():
status = json.loads(status_file.read_text())
# Extract session context
last_nightly = status.get('last_nightly_routine', {})
git_status = status.get('git_status', {})
session_data = {
'restored': True,
'last_nightly_score': last_nightly.get('sleep_score'),
'last_work_summary': git_status.get('action_required'),
'previous_branch': git_status.get('current_branch'),
'stashed_count': git_status.get('stashes', 0)
}
Restored Context Includes:
Using capture_state.py utility with morning-specific checks:
from popkit_shared.utils.capture_state import capture_project_state
state = capture_project_state()
# Returns: {
# 'git': {...},
# 'github': {...},
# 'services': {...}
# }
Git Analysis:
GitHub Analysis:
Service Analysis:
Dependency Analysis:
Using ready_to_code_score.py module:
from pop_morning.scripts.ready_to_code_score import calculate_ready_to_code_score
score, breakdown = calculate_ready_to_code_score(state)
# score: 0-100
# breakdown: {
# 'session_restored': {'points': 20, 'max': 20, 'reason': '...'},
# 'services_healthy': {'points': 10, 'max': 20, 'reason': '...'},
# ...
# }
Using morning_report_generator.py module:
from pop_morning.scripts.morning_report_generator import generate_morning_report
report = generate_morning_report(score, breakdown, state)
# Returns formatted markdown report with:
# - Ready to Code Score headline
# - Score breakdown table
# - Service status (if not all running)
# - Setup recommendations
# - Today's focus items
Update STATUS.json with morning routine data:
# This happens automatically via direct STATUS.json update
# Updates STATUS.json with:
# - Morning routine execution timestamp
# - Ready to Code score
# - Session restoration status
# - Dev environment state
# - Recommendations
Display morning report with:
Single command to gather all git data:
{
git fetch --quiet
echo "=== BRANCH ==="
git rev-parse --abbrev-ref HEAD
echo "=== BEHIND ==="
git rev-list --count HEAD..origin/$(git rev-parse --abbrev-ref HEAD)
echo "=== STATUS ==="
git status --porcelain
echo "=== STASHES ==="
git stash list | wc -l
}
{
gh pr list --state open --json number,title,reviewDecision
echo "---SEPARATOR---"
gh issue list --state open --json number,title,assignees,labels
} > /tmp/gh_morning_data.json
{
ps aux | grep -E "(node|npm|pnpm|redis|postgres|supabase)" | grep -v grep
echo "---SEPARATOR---"
pnpm outdated --json 2>/dev/null || echo "{}"
} > /tmp/service_morning_data.txt
Located: packages/shared-py/popkit_shared/utils/capture_state.py
def capture_project_state() -> dict:
"""Capture complete project state for morning routine."""
return {
'git': capture_git_state(),
'github': capture_github_state(),
'services': capture_service_state(),
'timestamp': datetime.now().isoformat()
}
Located: packages/shared-py/popkit_shared/utils/routine_measurement.py
When invoked with --measure flag:
.claude/popkit/measurements/morning-<timestamp>.jsonLocated: packages/shared-py/popkit_shared/utils/routine_cache.py
Caching strategy:
# ☀️ Morning Routine Report
**Date**: 2025-12-28 09:30
**Ready to Code Score**: 75/100 👍
**Grade**: B - Good - Ready with minor issues
## Score Breakdown
| Check | Points | Status |
|-------|--------|--------|
| Session Restored | 20/20 | ✅ Previous session context restored |
| Services Healthy | 10/20 | ⚠️ Missing: redis |
| Dependencies Updated | 15/15 | ✅ All dependencies up to date |
| Branches Synced | 10/15 | ⚠️ 3 commits behind remote |
| PRs Reviewed | 15/15 | ✅ No PRs pending review |
| Issues Triaged | 10/15 | ⚠️ 2 issues need triage |
## 🔧 Dev Services Status
**Required**: 2 services
**Running**: 1 services
**Not Running:**
- redis
## 🔄 Branch Sync Status
**Current Branch**: fix/critical-build-blockers
**Commits Behind Remote**: 3
Run `git pull` to sync with remote.
## 📋 Recommendations
**Before Starting Work:**
- Start dev services: redis
- Sync with remote: git pull (behind by 3 commits)
**Today's Focus:**
- Triage 2 open issues
- Review overnight commits and CI results
- Continue: Fix critical build blockers
---
STATUS.json updated ✅
Morning session initialized. Ready to code!
try:
git_state = capture_git_state()
except GitNotFoundError:
print("[WARN] Git not available - skipping git checks")
# Continue with partial score
try:
github_state = capture_github_state()
except GhNotFoundError:
print("[WARN] GitHub CLI not available - skipping GitHub checks")
# Continue with partial score
# Service checks are best-effort
# If they fail, provide recommendations but don't block
try:
session_data = restore_session()
except Exception:
print("[WARN] Could not restore session - starting fresh")
session_data = {'restored': False}
With --optimized flag:
routine_cache.py for GitHub/service data/popkit:routine morning
# → Runs default morning routine
# → Calculates Ready to Code Score
# → Updates STATUS.json
# → Shows report
/popkit:routine morning --measure
# → Runs morning routine
# → Tracks performance metrics
# → Saves to .claude/popkit/measurements/
/popkit:routine morning quick
# → Shows one-line summary
# → Ready to Code Score: 75/100 👍 - redis down, 3 commits behind
/popkit:routine morning --optimized
# → Uses caching for GitHub/service data
# → Reduces token usage by 40-96%
STATUS.json - Session state updated with:
.claude/popkit/measurements/ (if --measure used)
✅ Ready to Code Score accurately reflects environment state ✅ STATUS.json always updated correctly ✅ Completes in <25 seconds ✅ Provides actionable recommendations ✅ Session context successfully restored ✅ Reduces manual workflow by 67%
Skill Type: Automated Routine Category: Workflow Automation Tier: Core (Always Available) Version: 1.0.0
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.