원클릭으로
speckit-memory-md-capture-from-diff
Capture durable knowledge and architecture decisions from current or provided diffs.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Capture durable knowledge and architecture decisions from current or provided diffs.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Prioritize official @wordpress packages over external dependencies. Detect React conflicts, use aliasing, and validate package usage.
Apply approved architecture refactors by updating plan and task artifacts directly.
Perform a framework-agnostic architecture review validating implementation against spec.md, plan.md, tasks.md, and the governance and architecture constitutions.
Perform an architecture-aware verification gate validating implementation against spec.md, plan.md, tasks.md, and the Architecture Constitution.
Run a single architecture workflow that prefers memory-first context and can incorporate security review when available.
Run implementation with memory context, then review the produced implementation against security and architecture constraints.
| name | speckit-memory-md-capture-from-diff |
| description | Capture durable knowledge and architecture decisions from current or provided diffs. |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"memory-md:commands/speckit.memory-md.capture-from-diff.md"} |
You are capturing durable knowledge for memory-hub by analyzing code changes.
Resolve configuration first. Use .specify/extensions/memory-md/config.yml when present; otherwise default to memory_root: docs/memory and specs_root: specs.
Capture is manual and human-approved. Do not write durable memory unless the user explicitly ran this command and approves the proposed updates.
.specify/scripts/bash/detect-changed-files.sh with --json to detect changed files since the merge-base or in the working directory.changed_files list as the primary set for knowledge extraction.Before proposing new entries, check the existing memory to avoid duplicates.
When .specify/extensions/memory-md/config.yml has optimizer.enabled: true:
cd .specify/extensions/memory-md && npx speckit-memory refresh-memory (or npx . refresh-memory if in the extension repo).cd .specify/extensions/memory-md && npx speckit-memory search-memory "architecture constraints boundaries decisions <topic>" for candidate topics identified from the diff.DECISIONS.md, ARCHITECTURE.md, BUGS.md, WORKLOG.md). When the optimizer is enabled, the search-memory results are the authoritative dedup source.When the optimizer is disabled, you MUST read {memory_root}/INDEX.md and relevant source sections.
tasks.md.DECISIONS.md: Durable architectural or technical choices.ARCHITECTURE.md: Durable boundaries or constraints.BUGS.md: Lessons from fixed bugs and prevention rules.WORKLOG.md: High-value project milestones.INDEX.md: Compact routing rows for every durable entry added or changed.WORKLOG.md for concise, high-value project milestones and durable lessons that do not belong in decisions, architecture, or bugs.DECISIONS.md, ARCHITECTURE.md, BUGS.md, or WORKLOG.md, you MUST register the update in INDEX.md.--content flag delegates the file write entirely to Node.js:
cd .specify/extensions/memory-md && npx speckit-memory register-memory \
--id <ID> --title "<Short title>" --tags "<tag1,tag2>" \
--file "<SourceFile.md>" --status "active" \
--content "### YYYY-MM-DD - <Title>
Status Active
Why this is durable
Decision / Finding
Tradeoffs / Prevention
For `WORKLOG.md` only, add `--prepend` to insert at the top (newest-first order).
This single command: (1) writes the entry to `<SourceFile.md>` behind a `---` separator, (2) updates `INDEX.md`, and (3) syncs the SQLite cache. No further file edits are needed.
- **Markdown-Only Registration (Fallback)**: When the optimizer is disabled, write the entry to the target file manually following the `### YYYY-MM-DD - Title` format, then update `INDEX.md` with the compact row.
- Keep `INDEX.md` short (20-50 rows target). It points to source entries; it does not duplicate full lessons.
- Refuse routine implementation detail, feature narrative, or speculative lessons.
#### ID Convention
The `--id` value uses a letter prefix + sequential number:
| Prefix | File | INDEX.md section |
|--------|------|------------------|
| `A` | `ARCHITECTURE.md` | `## Architecture` |
| `B` | `BUGS.md` | `## Bugs` |
| `D` | `DECISIONS.md` | `## Decisions` |
| `W` | `WORKLOG.md` | `## Workflow` |
To pick the next number: count existing entries with that prefix in `INDEX.md` and add 1.
Approval flow:
1. Show proposed durable memory entries and the matching `register-memory --content` command first.
2. Ask for approval before writing.
3. If approval is not explicit, stop after the proposal.
4. After approved writes, execute the `register-memory --content` command — it handles all file writes, index synchronization, and cache refresh in one step.