From knowledge-distillery
Generates a structured session summary for git notes on refs/notes/commits. Extracts decisions, problems, constraints, and open questions from an AI coding session transcript for use as evidence in the Knowledge Distillery refinement pipeline. Use when generating a memento summary for a commit, or when the post-commit hook requests a session summary.
npx claudepluginhub ether-moon/knowledge-distillery --plugin knowledge-distilleryThis skill uses the workspace's default tool permissions.
Produce a structured summary of the current AI coding session. This summary is stored as a git note on `refs/notes/commits` (via memento-commit skill or directly) and later consumed by the Knowledge Distillery refinement pipeline as evidence.
Saves Claude Code session context to Obsidian vault as structured Markdown notes in categories like session-log, decision, troubleshooting. Extracts summary, decisions, file changes, next steps, links related docs via grep, and git commits.
Generates Markdown session summaries consolidating actions performed, decisions made, artifacts produced, pendings, and next steps for handoffs between developers or sessions. Saves to docs/context/session-YYYY-MM-DD.md and updates current-focus.md.
Generates markdown diary entries for coding sessions, capturing accomplishments, files changed, git commits, decisions, next steps, and handoffs. Triggers on 'save diary', 'log session', or 'wrapping up'.
Share bugs, ideas, or general feedback.
Produce a structured summary of the current AI coding session. This summary is stored as a git note on refs/notes/commits (via memento-commit skill or directly) and later consumed by the Knowledge Distillery refinement pipeline as evidence.
The summary MUST follow this exact 7-section markdown structure. All seven sections are required. Use "None" as the single item for any empty section.
## Decisions Made
- [Decision]: [Rationale]
## Problems Encountered
- [Problem]: [How it was resolved or current status]
## Constraints Identified
- [Constraint]: [Why it matters]
## Open Questions
- [Question]: [Context]
## Context
[Brief paragraph: what was being done and why, key files involved, outcome]
## Recorded Decisions
[If record-decision commits were made this session, list slug and SHA. Otherwise "None"]
- `slug` (sha1234): Brief description of the decision
## Vault Entries Referenced
[If vault entries were used this session, list each with a signal. Otherwise "None"]
- `entry-id` [signal]: How the entry related to this session's work
Scan for confirmed choices only:
For each decision, capture:
MUST-NOT decisions (things explicitly rejected) must always include the alternative that was chosen instead.
Do NOT include exploration steps, abandoned experiments, or intermediate reasoning that did not result in a confirmed decision.
Scan for issues that were actively worked on:
For each problem, capture:
Scan for limitations and boundaries discovered:
For each constraint, capture:
Scan for unresolved items:
Write a 2-4 sentence paragraph covering:
Reference decision commits made during this session via /knowledge-distillery:record-decision:
pr-template-out-of-scope (abc1234))decision: prefix messages on the current branchFor each vault entry meaningfully used in the session, record the entry ID and a signal:
followed — Entry guidance was applied successfullyoutdated — Entry doesn't reflect current situation or codebase stateconflicted — Session evidence directly contradicts the entry's claiminsufficient — Entry is correct but missing guidance for the situation encounteredOnly list entries that influenced your decisions, not every entry returned by a query. Source data comes from tmp/vault-refs.jsonl (recorded by the knowledge-gate skill during the session) combined with your assessment of how each entry was used. If no vault entries were referenced, use "None".
| Situation | Response |
|---|---|
| Transcript is empty or trivially short | Return minimal summary with Context noting "Minimal session -- no significant activity captured" |
| No decisions identifiable | "Decisions Made" section contains "None -- session focused on exploration/debugging" |
| Transcript appears corrupted | Return summary with Context noting the issue. Always produce output. |
| Session was purely conversational (no code changes) | Still summarize -- decisions and context from conversations are valuable evidence |
## Decisions Made
- Use exponential backoff for payment retries: Prevents thundering herd on payment provider
- Set max retry count to 3: Balances reliability with user experience (>3 retries = likely permanent failure)
- Store retry state in Redis, not DB: Avoids transaction overhead for transient state
## Problems Encountered
- Stripe webhook race condition with retry attempts: Resolved by adding idempotency key check before processing
- Test flakiness with time-dependent retry logic: Resolved by injecting clock dependency
## Constraints Identified
- Stripe API rate limit of 100 req/sec: Must implement client-side throttling for batch retry scenarios
- Payment service timeout set to 30s in production: Retry backoff intervals must fit within overall request timeout
## Open Questions
- Should failed retries trigger an alert?: Deferred to ops team discussion
- Retry behavior for partial refunds: Not covered in this session, needs specification
## Context
Implemented payment retry logic in PaymentService with exponential backoff. Key files: app/services/payment_service.rb, app/jobs/payment_retry_job.rb, spec/services/payment_service_spec.rb. Feature complete with tests passing.
## Recorded Decisions
- None
## Vault Entries Referenced
- None
## Decisions Made
- Use `includes(:line_items)` instead of `joins`: Avoids duplicate records in result set
- Add database index on orders.user_id: Query plan showed sequential scan
## Problems Encountered
- N+1 query in OrdersController#index causing 200+ queries per page load: Resolved with eager loading
- Initial fix with `joins` caused duplicate orders in pagination: Switched to `includes`
## Constraints Identified
- Cannot use `select` optimization due to downstream serializer requiring full association objects
## Open Questions
- None
## Context
Fixed N+1 query performance issue in orders listing endpoint. Key files: app/controllers/orders_controller.rb, db/migrate/add_user_id_index_to_orders.rb. Performance improved from ~200 queries to 3 queries per page load.
## Recorded Decisions
- None
## Vault Entries Referenced
- None
## Decisions Made
- None
## Problems Encountered
- None
## Constraints Identified
- None
## Open Questions
- None
## Context
Fixed typo in README.md documentation. Minimal session with no significant technical decisions.
## Recorded Decisions
- None
## Vault Entries Referenced
- None
## Decisions Made
- Use separate cleanup step in apply-changeset workflow: Ensures artifacts are cleaned even when vault.db is unchanged
- Keep decision commits on existing path: Preserves durability — decisions survive session crashes
## Problems Encountered
- Vault entry `pipeline-sequential-execution` conflicted with proposed parallel PR processing: Resolved by parallelizing across PRs while keeping intra-PR stages sequential
## Constraints Identified
- `.knowledge/` directory must not be read directly by agents: All access through knowledge-gate CLI
## Open Questions
- None
## Context
Implemented vault usage tracking and memento channel integration. Key files: memento-summary/SKILL.md, memento-commit/SKILL.md, knowledge-gate/SKILL.md, collect-evidence/SKILL.md. Feature complete across 11 files.
## Recorded Decisions
- `vault-refs-best-effort` (a1b2c3d): Vault reference tracking is best-effort — data loss on note failure is acceptable
## Vault Entries Referenced
- `pipeline-sequential-execution` [followed]: Maintained sequential per-PR processing as required
- `conservative-extraction-principle` [insufficient]: Entry covers extraction but lacks guidance on vault feedback signals