From cortex-overnight
Guide the user through the morning report after an overnight session. Displays the Executive Summary, walks each report section in order, collects answers to deferred questions, advances completed-feature lifecycles to Complete, and auto-closes backlog tickets at the end. Use when the user says "/morning-review", "morning review", "review overnight", "morning report walkthrough", or "what happened overnight".
How this skill is triggered — by the user, by Claude, or both
Slash command
/cortex-overnight:morning-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Interactive walkthrough of the morning report produced by an overnight session. Guides the user through the Executive Summary, completed features (batched with overnight metadata), deferred questions, and failed features in order. Advances completed-feature lifecycles to Complete and auto-closes backlog tickets at the end. See `${CLAUDE_SKILL_DIR}/references/walkthrough.md` for the section-by-s...
Interactive walkthrough of the morning report produced by an overnight session. Guides the user through the Executive Summary, completed features (batched with overnight metadata), deferred questions, and failed features in order. Advances completed-feature lifecycles to Complete and auto-closes backlog tickets at the end. See ${CLAUDE_SKILL_DIR}/references/walkthrough.md for the section-by-section protocol.
/morning-review — start the morning report walkthroughBefore locating the report, mark the current overnight session as complete if it is still in the executing phase.
Locate the session to update:
~/.local/share/overnight-sessions/active-session.json. If it exists and contains "phase": "executing", use its state_path value as the path to overnight-state.json.phase is not "executing", fall back to resolving lifecycle/sessions/latest-overnight/overnight-state.json (via the latest-overnight symlink).If <resolved_state_path> resolves to a readable file, mark the session complete by invoking the C11 helper. The helper owns the phase == "executing" precondition (silent-skip on any other phase per spec R5), the canonical state-machine transition, the atomic write, and the optional pointer-file cleanup.
If you used the active-session pointer (the path-resolution branch above selected line 1's pointer because its phase == "executing"), invoke the helper WITH --pointer so the pointer file is unlinked on success:
cortex-morning-review-complete-session <resolved_state_path> --pointer <pointer_path>
If you used the lifecycle/sessions/latest-overnight fallback (line 2 above), invoke the helper WITHOUT --pointer — there is no pointer file to clean up:
cortex-morning-review-complete-session <resolved_state_path>
Read the current session ID from the resolved state file (its session_id field is invariant under the C11 helper — only phase mutates — so the read is safe to perform after the helper runs):
session_id="$(jq -r '.session_id' <resolved_state_path>)"
After marking the session complete, sweep stale demo worktrees left behind by prior overnight sessions. The sweep is intentionally narrow — it only touches worktrees under $TMPDIR whose path matches the canonical demo-worktree pattern created by Section 2a of the walkthrough, so it cannot collide with unrelated user worktrees. The C12 helper handles the $TMPDIR resolution, prefix matching, active-session exclusion, uncommitted-state precondition, per-worktree git worktree remove, and the trailing single git worktree prune ordering invariant internally.
The C12 sweep runs AFTER the C11 helper invocation. Pass the resolved active session ID as the script's positional argument:
cortex-morning-review-gc-demo-worktrees "$session_id"
Skip Step 0 entirely if neither path-resolution branch resolved to a readable state file (line 31). Otherwise invoke the C11 helper unconditionally — the helper itself silent-skips when phase is anything other than "executing" (per spec R5), and is safe to call repeatedly.
Check for the morning report in order:
$CORTEX_COMMAND_ROOT/lifecycle/sessions/latest-overnight/morning-report.md — the MC session directory (new-style worktree sessions).lifecycle/sessions/latest-overnight/morning-report.md — reachable via a project-local latest-overnight symlink (if one exists)lifecycle/morning-report.md — regular file overwritten by each overnight session's writer.Use whichever path resolves first. If none exist, report that no morning report was found. Tell the user that no overnight session has been run yet, or the report was not generated. Suggest running python3 -m cortex_command.overnight.report to generate one. Stop.
Staleness check: After locating the report, read the session ID from the report heading (e.g., overnight-2026-03-27-0121). Compare it against the session ID in the state file resolved during Step 0. If they differ, warn the user that the report may be stale and ask whether to proceed or regenerate.
If a report is found, proceed to Step 2.
Read the morning report located in Step 1. Extract and display the Executive Summary section to the user: the session verdict, feature counts (completed / failed / deferred), and session duration. This is the first thing the user sees before any interaction.
Work through the report sections in sequence. Delegate the per-section interaction protocol to ${CLAUDE_SKILL_DIR}/references/walkthrough.md:
demo-commands: (list) or demo-command: (single string) is configured and the session is local, offer to spin up a demo worktree from the overnight branch; for demo-commands:, the agent reasons from Section 2 context to select the most relevant entry (or skips if none is relevant).lifecycle/{feature}/events.logdeferred/ fileSkip any section that has no entries — do not display a placeholder or empty heading.
After all sections are walked, close each completed feature's backlog ticket. No per-feature confirmation is needed.
Slug resolution: The overnight state stores lifecycle slugs (e.g., enemy-chase-ai-upgrade-simpleenemy-to-characterbody2d-with-direct-steering) which are longer than backlog file slugs (e.g., 036-enemy-chase-ai). The cortex-update-item script accepts backlog file slugs or numeric IDs — not lifecycle slugs.
To resolve: read each feature's backlog_id field from overnight-state.json (the state file located in Step 0). Pass the zero-padded numeric ID to cortex-update-item:
cortex-update-item 078 status=complete
Important: IDs must be zero-padded to 3 digits (e.g., 078 not 78). Unpadded IDs return "Item not found".
If backlog_id is not set for a feature, fall back to passing the lifecycle slug — cortex-update-item does substring matching and may still find a match.
For each feature report one of:
closed #ID — ticket was found and updatedno ticket found — update_item.py exited 1 (item not found or already terminal)Report the results as a summary list before proceeding to Step 5.
Before committing, run a preflight git sync:
main, skip steps 2–4 and proceed directly to step 5.git fetch origin. If the fetch fails (network error, no remote), surface the error and ask the user whether to continue without syncing or abort. Do not proceed silently.git rev-list HEAD..origin/main --count. If the output is 0, no pull is needed — proceed to step 5.0, run git pull --rebase origin main. If the rebase succeeds, proceed to step 5. If it fails (conflict or other error), surface git's output, pause, and ask the user to resolve the issue and confirm before continuing. Do not invoke /commit until the user confirms the branch is clean./commit skill to commit all changes produced during the review:lifecycle/{feature}/events.log — newly created completion event logsbacklog/ — closed/archived ticket files and updated indexNo additional user input is needed before committing — the review is authoritative. Let the /commit skill compose the message from the staged diff.
After the commit, locate the PR that the runner created for this session's integration branch, display it to the user, and offer to merge it to main. See ${CLAUDE_SKILL_DIR}/references/walkthrough.md Section 6 for the full protocol.
After a successful merge, Section 6a of the walkthrough handles post-merge sync: rebasing local main onto the remote and pushing to origin so that the local and remote branches are fully aligned.
/overnight resume)python3 -m cortex_command.overnight.report)overnight-state.json for metadata from the session directory (resolved via lifecycle/sessions/latest-overnight/ symlink for new-style worktree sessions, or directly from lifecycle/overnight-state.json for old-style sessions); Step 0 may write phase: "complete" to it — all other steps are read-onlyCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub charleshall888/cortex-command --plugin cortex-overnight