implementation-memory
Internal /build flow mechanism that maintains fixed-size procedural memory of durable implementation-quality lessons.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Internal /build flow mechanism that maintains fixed-size procedural memory of durable implementation-quality lessons.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Applying Amazon's raise-the-bar principle to every code review. What reviewers look for — clarity, correctness, design, reuse, operational readiness. "Ship It" means the change raises or maintains the quality bar.
Blameless post-incident analysis focused on timeline, 5 Whys, mechanisms over people, and concrete action items with owners.
Review a technical design before specs or implementation. Evaluate problem clarity, requirements, alternatives, trade-offs, architecture, dependency behavior, security, operations, cost, testability, and simplicity.
Bridge between an approved Design Document and code. Decompose the system-level blueprint into N vertical specs (requirements → design → tasks), each independently deliverable. Fail fast by ordering hardest-first. Execute wave-by-wave with approval gates.
Stage 4 of Working Backwards: Write the PR/FAQ — a press release announcing the product as if it already exists, plus a comprehensive FAQ addressing hard questions. This is the core Amazon mechanism that forces clarity, customer-centric thinking, and rigorous pre-mortems before any code is written.
Reverse-engineer an existing project to produce a Design Doc, API contracts, and a Threat Model anchored in the real code, IaC, and observability. Run once per project. Output anchors all subsequent /spec and /build invocations.
| name | Implementation Memory |
| description | Internal /build flow mechanism that maintains fixed-size procedural memory of durable implementation-quality lessons. |
| leadership_principles | ["Insist on the Highest Standards","Learn and Be Curious","Ownership"] |
Implementation memory is a compact, fixed-size set of rules that improves future /build executions. It captures durable lessons from completed builds, code review feedback, test failures, and user feedback, then applies only the relevant lessons to later implementation work.
This is procedural memory, not history. It stores rules for how to implement better next time. It does not store product context, design history, changelog entries, ADRs, raw retrospectives, PR transcripts, or conversation logs.
This mechanism is harness-agnostic by design. It uses a plain markdown file in the repo (docs/implementation-memory.md) intentionally. It is not tied to any agent's native memory system. Any AI agent that can read markdown and follow instructions can consume and update it.
This is an internal flow mechanism. Users do not invoke it as a slash command or choose it as a standalone workflow. Existing build commands and build-oriented assistant rules call it automatically at the defined points in the /build flow.
Implementation memory can be fed from multiple workflow stages — not only /build:
| Source | When | What to extract |
|---|---|---|
/build (post-implementation review) | After PASSED WITH FIXES NEEDED or user validation | Procedural lessons from fix tasks, debug cycles, review findings |
/review (code review) | After review feedback is resolved | Recurring review findings that apply beyond one PR |
/learn (COE) | After corrective actions are defined | Operational lessons that should influence future implementation |
All sources use the same Quality Memory Review process, admission checks, and rejection rules.
Use this mechanism in these places:
/build task execution: read the current spec/tasks first, then select only active memory rules whose Applies when field AND Tags/File patterns match the current work./review findings are resolved: if the review surfaced recurring patterns (same finding across 2+ PRs or explicitly flagged as "this keeps happening"), extract candidates and present for Accept / Reject / Edit./learn corrective actions: if a COE produces an implementation-level corrective action (not an org/process action), extract a candidate and present for Accept / Reject / Edit.Last build without update counter at the bottom of the memory file), include in the end-of-build summary: "You have had N builds without memory update. Would you like a quick Quality Memory Review?"Do not use this skill to replace requirements, design documents, ADRs, release notes, PR/FAQ, postmortems, or review artifacts.
The project-level memory artifact is:
docs/implementation-memory.md
If the file does not exist before a build, continue without memory guardrails. After the build, create it only when at least one candidate learning passes the admission bar. A repository may also keep an empty canonical file with the required structure so future builds have a stable location.
The memory is intentionally small:
Every active rule must use this shape:
### IM-XXX: [Short rule name]
Tags: [api, error-handling, testing, infra, ui, data-pipeline, security, observability, workflow, ...]
File patterns: [optional glob patterns, e.g. src/api/**, tests/integration/**]
Applies when: [Spec/component/risk conditions where this rule is relevant.]
Rule: [Actionable implementation behavior.]
Avoid: [Specific behavior to avoid.]
Evidence: [Review feedback | user feedback | test failure | build defect | repeated pattern.]
Impact: [Critical | High | Medium]
Confidence: [Proven (prevented issues) | Established (applied successfully) | New (just added)]
Hit count: [N — number of builds where this rule was selected and applied]
Prevented: [N — number of times this rule demonstrably prevented an issue]
Created: [YYYY-MM-DD]
Last used: [YYYY-MM-DD]
Builds on: [[IM-YYY]] (optional — reference to a related/prerequisite rule)
Use stable IDs. When removing a rule, do not renumber unrelated rules unless the file is being deliberately compacted for readability.
Before implementation starts:
specs/<slice-name>/requirements.md, design.md, tasks.md, and coherence-review.md if present.docs/implementation-memory.md if it exists.Hit count for each selected rule.Memory rules never override approved requirements, design, tasks, or coherence-review action items.
When the implementation review verdict is PASSED WITH FIXES NEEDED, the agent does not wait for the user to request memory update. Instead:
Memory candidates extracted from this build:
[1] IM-00X: [Short rule name]
Tags: [...]
Applies when: [...]
Rule: [...]
Avoid: [...]
[2] IM-00Y: [Short rule name]
Tags: [...]
Applies when: [...]
Rule: [...]
Avoid: [...]
Actions: [Accept all] [Accept 1 only] [Accept 2 only] [Edit before saving] [Reject all]
This ensures memory is populated even when users forget to ask for Quality Memory Review.
After implementation review is written (for PASSED verdicts without fix tasks), do not treat the model review as the final validation of product behavior. The final build response must explicitly hand the implementation to the user for real testing and invite a debug loop.
Use this shape:
Implementation is complete and implementation review has run. Please test the delivered behavior in the product. If anything is wrong, bring me the failure, error, or feedback and we will debug it together until it is OK. After you consider the implementation validated, ask me to run Quality Memory Review and I will capture only durable learnings worth keeping.
If no user validation/debug feedback is available yet, skip memory update and report: Implementation memory skipped: waiting for user validation/debug feedback and an explicit Quality Memory Review request.
Run this after the user asks for it, confirms the implementation is validated, or when the semi-automatic trigger fires. Use implementation verification, implementation-review findings, user test results, debug fixes, and final user feedback as evidence:
Builds without update counter to 0 when memory is updated.The Quality Memory Review response must state whether implementation memory was updated, unchanged, or skipped. When it changes:
When it is skipped, state why.
A candidate learning must pass at least 2 of these checks:
Reject candidates that are:
Rules decay over time. The following thresholds guide pruning:
Staleness alone does not trigger automatic removal. The agent flags stale rules during Quality Memory Review and asks the user: "Rule IM-XXX has not been used in N days. Keep or remove?"
When a candidate overlaps an existing rule, merge it into the existing rule and update Evidence, Impact, Confidence, Hit count, or Last used if warranted.
When rules conflict, keep the more specific and higher-impact rule. If the conflict is ambiguous, leave memory unchanged and report the conflict in the final response.
When pruning is required, remove in this order:
Rules may reference other rules using the Builds on: [[IM-YYY]] field. This indicates:
For projects with distinct domains (e.g., monorepos), the memory may be split:
docs/implementation-memory.md # global (max 12 rules)
docs/implementation-memory-<domain>.md # domain-scoped (max 6 rules each)
Pre-build selection loads the global file plus the domain file matching the current spec's primary domain. Domain files follow the same format and rules but with a reduced cap of 6 rules.
When to split: only when the global memory is consistently full (12 rules) AND rules from different domains are competing for slots. Do not split preemptively.
| Scenario | Expected behavior |
|---|---|
| No memory file exists | Build proceeds; Quality Memory Review may create memory if strong candidates exist. |
| Memory has 12 rules and 2 strong candidates | Merge or remove weaker rules; final memory still has at most 12 rules. |
| Candidate is a product requirement | Reject candidate. |
| Candidate duplicates an existing rule | Merge/refine existing rule instead of duplicating. |
| Current spec matches no active rules | Select no memory guardrails. |
| Review/user feedback is unavailable (PASSED verdict) | Skip memory update and ask the user to test/debug before requesting Quality Memory Review. |
| PASSED WITH FIXES NEEDED verdict | Semi-automatic trigger fires: extract candidates, present to user for Accept/Reject/Edit. |
| User validates after debug and asks for Quality Memory Review | Extract up to 2 durable learnings from the full implementation/review/test/debug cycle. |
| 3 builds without memory update | Nudge in end-of-build summary. |
| Rule IM-003 not used in 90+ days | Flag during next Quality Memory Review; ask user to keep or remove. |
/review finds recurring pattern | Extract candidate and present for Accept/Reject/Edit. |
/learn COE has implementation-level action | Extract candidate and present for Accept/Reject/Edit. |