--- description: Extract learnings, domain knowledge, and decisions from the session and propose updates to context files --- Review the current conversation and summarize everything learned about Sam's preferences, workflows, decisions, domain knowledge, and way of working that is NOT already captured in the existing context files. ## Instructions 1. Read the relevant context files to understand what is already documented: - ~/.config/opencode/AGENTS.md (global preferences) - The current project's AGENTS.md (if one exists) - ~/LLM Context/AGENTS.md (context system and file organization) - Any initiative-specific AGENTS.md files that were referenced in this session - Any other context files that were loaded during this session - ~/.config/opencode/skills/*/SKILL.md (existing skill definitions) - ~/.config/opencode/commands/*.md (existing command definitions) - ~/LLM Context/.opencode/commands/*.md (project-local command definitions) - Knowledge/ directories at relevant scopes (initiative, company/personal, global) - Decisions/ directories at relevant scopes (initiative, company/personal, global) - ~/LLM Context/Shared/Templates/decision-template.md (for decision format) 2. Compare what was learned during this conversation against what is already documented. Identify NEW learnings only -- skip anything already captured. Before proposing any change, read the current content of the target file to verify a previous session has not already applied the same learning. Determine which scopes are relevant to this session (e.g., Business/Monizze/, a specific initiative). If ambiguous, ask Sam to confirm the scope before proceeding. 3. Categorize each learning: - **Preference** -- how Sam likes to work (communication, review style, tooling choices) - **Decision** -- a concrete choice made during this session (tech stack, architecture, process) - **Workflow** -- how Sam interacts with agents, reviews work, iterates - **Correction** -- something the agent got wrong that Sam corrected - **Domain Knowledge** -- a fact, pattern, or observation about a specific domain (pricing, onboarding, competitors, etc.) - **Domain Rule** -- a confirmed pattern that should be applied by default (promoted from hypothesis after 3+ confirmations, or stated directly by Sam) - **Domain Hypothesis** -- a pattern that needs more data before becoming a rule - **Scoped Decision** -- a decision that affects more than today's task and should be logged for future reference 4. Determine the correct target file for each learning: - Global preferences (apply everywhere) -> `~/.config/opencode/AGENTS.md` - Project-specific rules -> current project's `AGENTS.md` - Context system changes -> `~/LLM Context/AGENTS.md` - Domain context -> appropriate file in `~/LLM Context/` - Domain Knowledge / Rules / Hypotheses -> `Knowledge/[domain].md` at the appropriate scope - If the file exists, add to the correct section (## Rules, ## Hypotheses, or ## Knowledge) - If the file does not exist, create it using the format from LLM Context/AGENTS.md - Check if any existing hypothesis has now been confirmed 3+ times -- propose promotion to Rule - Check if any existing rule was contradicted in this session -- propose demotion to Hypothesis - Scoped Decisions -> `Decisions/YYYY-MM-DD-{topic}.md` at the appropriate scope - Use the template at `Shared/Templates/decision-template.md` - Search existing Decisions/ for prior decisions on the same topic - If replacing a prior decision, populate the ## Supersedes field 5. Present learnings for review: # Learnings - [Date] ## Summary [1-2 sentence overview of what was learned] ## Proposed Updates ### [n]. [Short description] - **Type:** [Preference / Decision / Workflow / Correction / Domain Knowledge / Domain Rule / Domain Hypothesis / Scoped Decision] - **Scope:** [Global / Business/[Company] / Business/[Company]/Initiatives/[Name] / Personal / Personal/Initiatives/[Name]] - **Domain:** [domain name, if applicable -- e.g., pricing, onboarding] - **Learning:** [What was learned] - **Target file:** [Path to the file that should be updated] - **Proposed change:** ``` [The specific text to add or modify in the target file] ``` - **Status:** Pending review [Repeat for each learning] ## No Update Needed [List any learnings that are already captured in existing files -- confirm they match] 6. After presenting the full summary, walk through each proposed change ONE AT A TIME. For each: - Show the change (target file, what will be added/modified) - Ask: "Accept, reject, or modify?" - Wait for Sam's response before moving to the next - Only apply the change after explicit acceptance 7. For each accepted change, update the target file immediately, then present the next one. 8. After all changes are reviewed, add a "Last Updated" entry to each modified file with the date and a brief description. IMPORTANT: - Never apply changes without Sam's explicit approval - Always go one at a time -- never batch approvals - Be specific -- show exact text to add/modify, not vague suggestions - If a learning contradicts an existing rule, flag the conflict and ask which is correct - Include the source of each learning (what Sam said or did that revealed it) - Skills and commands are valid target files -- if a session revealed a gap or correction in a skill or command, propose an update to that file directly - For knowledge items, always specify which section (Rules / Hypotheses / Knowledge) the entry belongs in - When promoting a hypothesis to a rule, remove it from ## Hypotheses and add it to ## Rules with a note like "Promoted from hypothesis -- confirmed in [sessions/dates]" - When demoting a rule to a hypothesis, remove it from ## Rules and add it to ## Hypotheses with a note like "Demoted -- contradicted by [what happened]" - For scoped decisions, always use the decision template format - When scope is ambiguous, ask Sam before proceeding -- one topic at a time