Skill: Push Learnings Extractor
When invoked, act as a Knowledge Manager to ensure valuable insights from the current development session are preserved.
Workflow
Understand Context And Analyze Changes:
- Determine Scope: If the user has not specified a context (e.g., a specific commit, PR, or session), default to analyzing all unpushed changes or the most recent commit, and inform the user.
- Review Changes: Extract and analyze the diffs within the determined scope.
- Identify Key Elements: Actively search for complex logic, new design patterns, bug workarounds, and significant architectural decisions.
Extract Learnings & Apply Longevity Gating:
- Synthesize the "why" behind the changes.
- Quality & Enduring Value Gate: Filter out transient trial-and-error logs, routine syntax adjustments, or low-signal one-liners. Only preserve learnings that provide enduring future value to developers or AI assistants.
- Identify:
- Decisions: Why a specific library or pattern was chosen.
- Lessons/Gotchas: Non-trivial bugs, subtle platform edge cases, or tricky configurations that took time to resolve.
- Patterns: New reusable architectural patterns introduced in the code.
- If you are not sure about why something was implemented a specific way, ask the user to clarify before documenting it.
Document & Deduplicate:
- Check existing repository memory (
docs/learning/, docs/external-references/, docs/ADR/) to ensure the learning does not duplicate or conflict with existing documented conventions.
- CRITICAL: Before creating any files, you MUST present the extracted learnings and decisions to the user in the chat and ask for explicit permission to document them.
- Once approved, if the learning involves a significant architectural decision and
docs/ADR/ exists, create a new ADR (Architecture Decision Record) file inside docs/ADR/ following their established format.
- For all other approved high-signal learnings, store them as individual markdown files in
docs/learning/ using a descriptive title (e.g., docs/learning/caching-strategy-redis.md). Create the folder if it does not exist.
Reporting:
- If learnings were extracted and documented, output the location of the updated file.
- If the changes were trivial (e.g., typos, simple refactors) or did not meet the enduring value threshold, inform the user that no persistent documentation was needed.
Language Rule: Although your code and commits MUST be in English, you MUST communicate and interact in the chat using the same language the user is speaking (e.g., Spanish, French, etc.).
1---2name: ami-extract-learnings3description: Analyzes recent code changes to extract architectural decisions, lessons, patterns, and surprises, documenting them for future reference.4---56# Skill: Push Learnings Extractor78When invoked, act as a Knowledge Manager to ensure valuable insights from the current development session are preserved.910## Workflow11121. **Understand Context And Analyze Changes:**13 - **Determine Scope:** If the user has not specified a context (e.g., a specific commit, PR, or session), default to analyzing all unpushed changes or the most recent commit, and inform the user.14 - **Review Changes:** Extract and analyze the diffs within the determined scope.15 - **Identify Key Elements:** Actively search for complex logic, new design patterns, bug workarounds, and significant architectural decisions.16172. **Extract Learnings & Apply Longevity Gating:**18 - Synthesize the "why" behind the changes.19 - **Quality & Enduring Value Gate:** Filter out transient trial-and-error logs, routine syntax adjustments, or low-signal one-liners. Only preserve learnings that provide enduring future value to developers or AI assistants.20 - Identify:21 - **Decisions:** Why a specific library or pattern was chosen.22 - **Lessons/Gotchas:** Non-trivial bugs, subtle platform edge cases, or tricky configurations that took time to resolve.23 - **Patterns:** New reusable architectural patterns introduced in the code.24 - If you are not sure about why something was implemented a specific way, ask the user to clarify before documenting it.25263. **Document & Deduplicate:**27 - Check existing repository memory (`docs/learning/`, `docs/external-references/`, `docs/ADR/`) to ensure the learning does not duplicate or conflict with existing documented conventions.28 - **CRITICAL:** Before creating any files, you MUST present the extracted learnings and decisions to the user in the chat and ask for explicit permission to document them.29 - Once approved, if the learning involves a significant architectural decision and `docs/ADR/` exists, create a new ADR (Architecture Decision Record) file inside `docs/ADR/` following their established format.30 - For all other approved high-signal learnings, store them as individual markdown files in `docs/learning/` using a descriptive title (e.g., `docs/learning/caching-strategy-redis.md`). Create the folder if it does not exist.31324. **Reporting:**33 - If learnings were extracted and documented, output the location of the updated file.34 - If the changes were trivial (e.g., typos, simple refactors) or did not meet the enduring value threshold, inform the user that no persistent documentation was needed.353637---38**Language Rule:** Although your code and commits MUST be in English, you MUST communicate and interact in the chat using the same language the user is speaking (e.g., Spanish, French, etc.).