Reflect
Capture hard-won knowledge back into project documentation at the end of an implementation effort. This skill activates after completing a task — when the agent has accumulated context through back-and-forth with the developer, false starts, clarifications, and discoveries that would otherwise vanish with the context window. Instead of letting that knowledgeevaporate, this skill distills it into the project's permanent knowledge base: CLAUDE.md directives, convention definitions, architecture notes, and maintenance backlog items. Trigger this skill at the end of any implementation phase, after a subagent completes execution, or whenever a significant body of work wraps up. Also trigger when the developer says things like "ok that's done", "ship it", "merge it", "wrap up", or asks to move on to the next task. The goal is compounding — every task should leave the project smarter than it found it.From its SKILL.md
npx -y skills add jeremygiberson/closing-the-loop-plugin --skill reflectAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
11.1 KB, as published. Nobody here has run it
Reflect: Closing the loop
You just finished a piece of work. You have context that no one else has — insights built up through back-and-forth with the developer, false starts, clarifications, and discoveries. That knowledge exists only in this context window, and when it closes, it's gone.
Your job is not to summarize what you did. Your job is to pay it forward — distill what you learned back into the project's permanent knowledge base so that every future task benefits from the effort that went into this one.
Why This Matters
Every implementation effort generates two kinds of value: the code changes themselves, and the understanding that informed those changes. The code gets committed. The understanding usually evaporates.
Over time, this loss compounds. Future agents (and developers) rediscover the same gotchas, repeat the same false starts, and make the same assumptions that were already tested and rejected. The project doesn't get smarter — it just gets bigger.
This skill breaks that cycle. Each task becomes a deposit into the project's institutional knowledge, making the next task faster, safer, and better informed.
When to Run
Execute this skill at the natural end of an implementation effort:
- After a subagent completes execution of a plan
- After you've finished implementing and are about to hand back to the developer
- When the developer signals completion ("that's done", "ship it", "looks good")
- Before a context window closes on a substantial piece of work
This is not a handoff note for continuing the same task. If work is ongoing and another agent needs to pick it up, that's a different concern. This is about distilling generalizable knowledge back into the project — insights that are useful beyond the immediate task.
The Core Question
Look at everything in your context window and ask:
What did I learn during this work that the project doesn't already know?
Not what you did. Not a summary. What you learned — about the codebase, the domain, the APIs, the developer's intent, the conventions, the gotchas. Things that were hard to figure out, easy to get wrong, or surprising.
What to Look For
Conventions Discovered or Confirmed
During implementation, you inevitably encounter (and either follow or establish) conventions — patterns for how things are done in this codebase. Some were explicit, some you inferred. Capture both:
- Patterns you followed because they appeared to be the codebase convention
- New patterns you introduced that the developer approved
- Existing conventions you found confusing or contradictory
- Decisions about "how we do things here" that came up in discussion
Output: New entries in docs/conventions/ with corresponding
rows in the conventions.md index. These compound — over time, the conventions
directory becomes the project's style guide.
Architectural Understanding
Implementation reveals things about a codebase that reading it cold does not:
- How components actually interact at runtime (vs. how they appear to interact)
- Implicit dependencies or ordering requirements
- Performance characteristics or bottlenecks you encountered
- Error propagation paths that aren't obvious from the code structure
- Subsystems that are more fragile or more robust than they appear
- Integration points with external services — quirks, rate limits, auth flows
Output: Notes in project documentation (architecture docs, READMEs, code comments) or CLAUDE.md directives that help future agents navigate correctly.
Domain Knowledge
The developer often shares domain context during planning and implementation — business rules, user expectations, historical decisions, product constraints. This knowledge is crucial for making good engineering decisions but rarely makes it into code:
- Business rules that explain why the code works the way it does
- User-facing behaviors that constrain implementation choices
- Historical context ("we did it this way because...")
- Product constraints that aren't obvious from the code
Output: Documentation additions — the kind of context a new team member would need. Can go into READMEs, architecture docs, or CLAUDE.md as appropriate.
Gotchas and Hard-Won Knowledge
The most valuable knowledge is often the most painful to acquire:
- Things that broke in non-obvious ways
- Assumptions that turned out to be wrong
- APIs or libraries that behave unexpectedly
- Edge cases that only surfaced during implementation
- Debugging dead ends — what looked like the problem but wasn't
- Configuration or environment issues that took time to resolve
Output: Warnings in CLAUDE.md, code comments at the relevant locations, or documentation updates. The test: "Would this save someone 30+ minutes if they encountered the same situation?"
Maintenance Observations
Implementation is when you see the codebase most clearly. You likely noticed things that need attention but were out of scope for the current task:
- Tech debt that made your work harder
- Code that's fragile or confusing
- Missing tests for critical paths you touched
- Documentation that's outdated or misleading
- Patterns that should be consolidated
Output: New entries in docs/backlog/ with corresponding rows
in the backlog.md index. These feed the active review cycle described in the
companion close-the-loop skill.
The Distillation Process
Step 1: Scan Your Context
Before writing anything, think through what you've accumulated. Ask yourself:
- What do I understand now that I didn't at the start of this task?
- What was hard to figure out? What took multiple attempts?
- What did the developer tell me that isn't written down anywhere?
- What assumptions did I make that future work might depend on?
- What surprised me about the codebase?
- What conventions did I follow, establish, or notice were inconsistent?
- What would I warn the next person working in this area about?
- What almost broke, and why?
- What pattern did I discover that could apply elsewhere?
- What did the developer emphasize, repeat, or correct me on?
Don't rush this step. The entire value of this skill is in the quality of reflection, not the speed.
Step 2: Categorize and Filter
Sort your findings into the categories above. Then filter aggressively:
Include knowledge that is:
- Generalizable beyond this specific task
- Hard to rediscover (would take >10 minutes to figure out again)
- Non-obvious (wouldn't be apparent from reading the code cold)
- Consequential (getting it wrong would cause real problems)
Exclude knowledge that is:
- Specific to this task and unlikely to recur
- Already documented somewhere in the project
- Obvious from the code itself
- Trivial or unlikely to save meaningful time
The goal is high signal. Five sharp insights beat twenty vague observations.
Step 3: Write to Permanent Locations
This is the critical difference from a braindump. You are not writing a single document that might or might not get read. You are placing knowledge where it will be found — in the locations where future agents and developers will naturally look when they need it.
CLAUDE.md — For directives that should influence all future code generation:
- Conventions ("always use X pattern for Y")
- Warnings ("never do X because Y")
- Architectural rules ("module A must not import from module B")
docs/conventions/{slug}.md — For conventions with enough nuance
to warrant examples, rationale, and edge case documentation. Add the index row
to docs/conventions.md with a short directive.
docs/backlog/{slug}.md — For maintenance observations. Add the
index row to docs/backlog.md.
Code comments — For gotchas that are specific to a location in the code. Place the warning where the next person will see it when they're working in that area.
Project docs (READMEs, architecture docs, API docs) — For domain knowledge, architectural understanding, and integration details that belong in the project's documentation.
Step 4: Present a Summary
After writing to permanent locations, give the developer a brief summary of what you captured and where:
Before we wrap up, I've captured some things from this session:
**Added to CLAUDE.md:**
- [directive summary]
**New conventions documented:**
- [convention] → docs/conventions/{slug}.md
**Backlog items captured:**
- [item] → docs/backlog/{slug}.md
**Updated docs:**
- [file] — [what was added]
Want to review any of these before we close out?
Keep it concise. The developer should be able to glance at this and either approve or ask to review specific items. This is the last step before context closes — respect their time.
What This Is NOT
Not a task summary. The commit log and PR describe what changed. You're capturing what was learned.
Not a handoff note. This isn't about enabling the next agent to continue this specific task. It's about making the project smarter for all future tasks.
Not a journal. Don't narrate your experience. Distill it. "I spent 2 hours debugging X" is a journal entry. "Module X silently swallows errors from Y — always check the return value" is project knowledge.
Not exhaustive. You don't need to capture everything. Capture what matters. The filter is: "Would a future agent or developer benefit from knowing this, and would they have trouble discovering it on their own?"
Behavioral Notes
Write in the project's voice. Match the tone, style, and level of detail of existing documentation. If the project's READMEs are terse, be terse. If they're detailed, be detailed.
Be concrete. File paths, function names, line numbers, API endpoints. Vague knowledge is nearly as useless as no knowledge.
Attribute uncertainty. If you're not sure about something, say so. Mark it: "UNVERIFIED:", "ASSUMPTION:", "NEEDS CONFIRMATION:". Future agents can then validate rather than blindly trust.
Respect existing structure. If the project has established documentation patterns, follow them. Don't create new documentation locations when existing ones would work. Extend what's there.
Don't duplicate. Before writing anything, check if it's already captured. Read CLAUDE.md, existing conventions, relevant READMEs. Add to or refine existing entries rather than creating redundant ones.