
Reflect
Close out a merged branch or finished task by capturing learnings in memory, verifying GitHub issues, and passing the COMMIT phase gate.
Overview
reflect is a journey-wide agent skill that consolidates session learnings into memory layers, verifies issue closure, and enforces a COMMIT phase gate—usable whenever a solo builder needs to close a task properly before
Install
npx skills add https://github.com/camacho/ai-skills --skill reflectWhat is this skill?
- COMMIT checkpoint phase gate—task not complete until Step 8 passes
- Ordered workflow from timestamp marker through session review and learning classification
- GitHub issue closure verification via commit message keywords and gh issue view
- Routes learnings to MEMORY.md, Basic Memory vault, or both by signal type
- Integrates with completed plans in ai-workspace/plans/ when Outcomes & Learnings exist
- COMMIT checkpoint with Step 8 completion gate
- Reviews last 10 commits via git log --oneline -10
Adoption & trust: 598 installs on skills.sh; 1 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You finish coding and merge but session fixes, issue links, and reusable patterns never get captured, so the next task repeats the same mistakes.
Who is it for?
Solo builders using git, optional gh CLI, and ai-workspace plans who want a repeatable end-of-task ritual after merges.
Skip if: Greenfield brainstorming before any implementation, or workflows with no git history and no desire to maintain agent memory files.
When should I use this skill?
After merging a branch or completing a task to consolidate learnings into memory layers, close out issues, and verify the phase gate.
What do I get? / Deliverables
Learnings are classified into the right memory stores, referenced GitHub issues are checked for closure, and the COMMIT gate passes so the task can be declared complete.
- Updated MEMORY.md or Basic Memory vault entries
- Issue closure verification report
- Passed COMMIT phase gate (Step 8)
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
After implementing a feature from an ai-workspace plan, harvest Outcomes & Learnings into MEMORY.md before starting the next story.
Post-merge, confirm commits that say 'fixes #12' actually closed the issue on GitHub.
When wrapping an incident fix branch, record tooling quirks in Basic Memory for other repos.
After a spike branch merges, capture scope decisions so validate assumptions do not get lost.
After shipping a support fix, document recurrence patterns in project memory for faster future tickets.
How it compares
Structured post-task workflow—not a one-off 'summarize this chat' prompt or a code review skill.
Common Questions / FAQ
Who is reflect for?
Indie developers and agentic coders who use Camacho-style ai-workspace layouts and want systematic learning capture after merges or task completion.
When should I use reflect?
After Ship merges, at the end of Build features, when closing Operate incidents, or any time you complete a planned task—whenever you need the COMMIT checkpoint instead of stopping mid-flow.
Is reflect safe to install?
It runs git and optional GitHub CLI commands against your repo; review the Security Audits panel on this Prism page and your gh auth scope before installing.
SKILL.md
READMESKILL.md - Reflect
Phase gate: COMMIT checkpoint. Do not declare task complete until Step 8 passes. Execute all steps in order. Escalate to the user only at explicit escalation points. ## Step 0 — Mark reflect timestamp ```bash date +%s > "${CLAUDE_PROJECT_DIR}/ai-workspace/.last-reflect-ts" ``` ## Step 1 — Review session work ```bash git log --oneline -10 ``` Review recent edits and corrections made during this session. If a completed plan exists in `ai-workspace/plans/` (Outcomes & Learnings filled in), use it as the primary source. Otherwise derive learnings directly from git history and session events. Build an explicit inventory of candidate learnings before moving on. ## Step 1b — Verify issue closure Scan commit messages for closing keywords (case-insensitive): `closes`, `close`, `closed`, `fixes`, `fix`, `fixed`, `resolves`, `resolve`, `resolved` followed by `#N`. For each issue number found: ```bash gh issue view N --json state --jq '.state' ``` Warn if any referenced issue is still open. Do not block — warn and continue. ## Step 2 — Classify learnings | Signal | Destination | |---|---| | References this repo's files, paths, configs, or project conventions | MEMORY.md only | | General pattern, tool behavior, or preference applicable across projects | Basic Memory vault only | | Both (project-specific instance of a cross-project pattern) | Both — cross-reference each entry to the other | ## Step 2b — Comment learnings on related issues **Plan has `Issue: #N` in frontmatter**: post learnings directly as a comment on that issue. No confirmation needed — the link is explicit. **No plan or no Issue field**: run `gh issue list --state open --json number,title,labels --limit 50`, fuzzy-match keywords against open issue titles. Confirm with user before posting to any fuzzy match. A bad auto-comment is worse than a missed one. ## Step 3 — Write to MEMORY.md (concurrent write protocol) MEMORY.md lives on main and may receive concurrent writes. Never write from the current worktree. ```bash REFLECT_DIR="${CLAUDE_SESSION_DIR:-$TMPDIR}/memory-reflect" [ -d "$REFLECT_DIR" ] && rm -rf "$REFLECT_DIR" git clone --depth 50 "$(git remote get-url origin)" "$REFLECT_DIR" ``` Retry loop (max 3 attempts): 1. Read `$REFLECT_DIR/ai-workspace/MEMORY.md` as it exists now. 2. Re-derive entries from the current file state — skip anything already present, avoid duplicates. Do not auto-merge. Do not replay old diffs. 3. Add new entries. Prune entries older than 30 days. Keep under 200 lines — if over, summarize the oldest section (never silently delete). 4. Commit and push: ```bash git -C "$REFLECT_DIR" add ai-workspace/MEMORY.md git -C "$REFLECT_DIR" commit -m "reflect: update MEMORY.md [$(date +%Y-%m-%d)] Co-Authored-By: Claude <model>" git -C "$REFLECT_DIR" push ``` 5. On non-fast-forward rejection: `git -C "$REFLECT_DIR" pull --rebase`, return to step 1. 6. After 3 failures, stop and escalate — do not proceed: > MEMORY.md write failed after 3 retries. Manual merge required at `$REFLECT_DIR/ai-workspace/MEMORY.md`. ### Propagate to primary worktree After successful push, bring the primary worktree's main up to date so other agents see the new MEMORY.md immediately: ```bash PRIMARY="$(git worktree list --porcelain | grep -m1 '^worktree ' | sed 's/^worktree //')" CURRENT=$(git -C "$PRIMARY" branch --show-current) if [ "$CURRENT" = "main" ]; then # WIP commit if dirty if [ -n "$(git -C "$PRIMARY" status --porcelain)" ]; then git -C "$PRIMARY" add -u git -C "$PRIMARY" commit -m "wip: preserve local state before reflect sync" WIP=1 fi git -C "$PRIMARY" fetch origin main git -C "$PRIMARY" merge --ff-only origin/main || echo "Primary diverged — manual pull needed" # Restore WIP [ "${WIP:-}" = "1" ] && git -C "$PRIMARY" reset --soft HEAD~1 fi ```