一键导入
corgispec-memory-migrate
Migrate existing project knowledge into the memory/wiki structure from docs, archived changes, agent configs, and vault files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Migrate existing project knowledge into the memory/wiki structure from docs, archived changes, agent configs, and vault files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create or complete a CorgiSpec planning package and synchronize one GitHub parent issue plus Task Group child issues. Use when proposing a change whose normalized tracking provider is GitHub.
Create or complete a CorgiSpec planning package and optionally synchronize GitLab issues. Use when proposing a new change or finishing an existing change whose normalized tracking provider is GitLab or none.
Execute or resume a CorgiSpec Run Contract v2 one Task Group at a time through the canonical corgispec loop CLI. Use when starting, continuing, fixing, committing, recovering, or finalizing an implementation run; never write loop state or evidence artifacts directly.
Implement exactly one pending Task Group from a CorgiSpec change and optionally synchronize GitLab progress. Use when applying a change whose normalized tracking provider is GitLab or none.
Validate and archive a completed CorgiSpec change, extract durable knowledge, and optionally close GitLab tracking. Use when archiving a change whose normalized tracking provider is GitLab or none.
Compare fresh CorgiSpec planning, implementation, Git, and run evidence and close only implementation gaps through the canonical converge CLI. Use after implementation or review when deciding whether a change is converged, planning needs update, or a new append-only Task Group is required.
| name | corgispec-memory-migrate |
| description | Migrate existing project knowledge into the memory/wiki structure from docs, archived changes, agent configs, and vault files. |
| license | MIT |
| compatibility | Requires memory/ and wiki/ directories (run corgispec-memory-init first). |
| metadata | {"author":"corgispec","version":"1.0","generatedBy":"1.0.0"} |
Migrate existing project knowledge into the memory/wiki structure.
When applying memory to an existing project, the memory-init skill creates empty templates. This skill fills them with knowledge already present in the project — extracting from agent config files, archived Corgi changes, docs/ directory, and any existing Obsidian vault pages.
The migration is hybrid: obvious items are auto-populated, ambiguous items prompt the user for categorization. Source files are never moved or deleted — migration creates wiki entries that reference originals.
corgispec-memory-init on an existing project with accumulated knowledgedocs/, archived changes, or existing .md files that should feed the memory system/corgi-migrate slash commandDo not use this skill to initialize empty memory (use corgispec-memory-init), run lint checks, or extract from active/in-progress changes.
memory/ directory exists with MEMORY.md, session-bridge.md, pitfalls.mdwiki/ directory exists with hot.md, index.md, and subdirectoriesContext Gate: If session context already contains ALL of: isolation.mode, active changes with worktree paths, current branch
→ Gate passed — SKIP config reading below and proceed to the next step.
Otherwise: read openspec/config.yaml and proceed with discovery.
Scan the project root to determine which sources exist:
CLAUDE.md, AGENTS.md, GEMINI.mdopenspec/changes/archive/ with subdirectoriesdocs/ directory with .md filesmemory/, wiki/, docs/, openspec/, node_modules/, .git/Report the survey to the user:
## Knowledge Sources Found
- Agent configs: CLAUDE.md, AGENTS.md (2 files)
- Archived changes: 5 archived changes in openspec/changes/archive/
- Documentation: 12 files in docs/
- Vault pages: 3 .md files in project root
Phases to run: 1 (auto), 2 (auto), 3 (hybrid), 4 (hybrid)
If NO sources are found, report "No knowledge sources detected — nothing to migrate." and stop.
Source: CLAUDE.md, AGENTS.md, GEMINI.md
This phase auto-populates without asking — agent config constraints are never ambiguous.
For each file that exists, extract:
Read the current memory/MEMORY.md. For each section:
{{...}} or "Not specified" or "Unknown")Rules:
Read wiki/hot.md. Update the Architecture Pulse section:
If Architecture Pulse already has real content (not {{...}} or "TBD"), merge rather than replace.
### Phase 1: Agent Config Deepening (auto)
- memory/MEMORY.md: +N constraints, +M preferences
- wiki/hot.md: Architecture Pulse updated (Stable: ..., Evolving: ..., Legacy: ...)
Source: openspec/changes/archive/*/
This phase auto-populates without asking — archived change structure is predictable.
List all directories in openspec/changes/archive/. For each:
proposal.md — extract change name and purposetasks.md — count total tasks, verify all completedesign.md (if exists) — extract key decisionsFor each archived change, check if wiki/sessions/<change-name>.md already exists.
If it does NOT exist, create it:
---
type: wiki
created: <archive date>
source_change: <change-name>
status: archived
tags: [session, migrated]
---
# Session Summary: <change-name>
## Overview
<1-2 sentence summary from proposal.md>
## Timeline
- **Proposed**: <earliest date available>
- **Completed**: <archive date>
- **Task Groups**: <N groups, M total tasks>
## Key Decisions
<Bullet list from design.md decisions, or "Not recorded" if no design.md>
## Pitfalls Encountered
<If any pitfall in memory/pitfalls.md references this change, list them. Otherwise: "Not recorded">
## Outcome
<Brief from proposal.md "What Changes" section>
## References
- Proposal: [[openspec/changes/archive/<dir-name>/proposal]]
- Design: [[openspec/changes/archive/<dir-name>/design]] (if exists)
- Tasks: [[openspec/changes/archive/<dir-name>/tasks]]
If it already exists, skip it.
For each archived change with a design.md:
wiki/patterns/<pattern-name>.md existscorgispec-memory-extract skillBe conservative — only extract patterns that clearly solve a recurring problem. When uncertain, skip. Migration errs on the side of less noise.
Add the 5 most recent archived changes to the Recently Shipped section:
- **<change-name>** (<archive date>) — <one-line summary>
Trim to 5 entries if more exist.
Add links for all newly created pages:
## Session History## PatternsCheck the 80-line cap — if exceeded, keep only the 10 most recent session links.
For each newly created wiki page, update the corresponding _index.md:
wiki/sessions/_index.mdwiki/patterns/_index.mdwiki/decisions/_index.mdFollow the format convention: - [[filename|Title]] — date — brief description
Reference wiki/schema.md for format rules.
For each archived change that was processed in this phase, append a log entry to wiki/log.md:
<archive-date> | archive <change-name> | +wiki/sessions/<name>.md +wiki/patterns/<pattern-names>.md
If wiki/log.md does not exist, create it with the format header from wiki/schema.md Section D.
### Phase 2: Archived Changes (auto)
- Session summaries created: N (skipped M already existing)
- Patterns extracted: P
- wiki/hot.md Recently Shipped: updated with 5 most recent
- wiki/index.md: +Q links added
Source: docs/ directory tree
This phase is hybrid — auto-categorize obvious docs, ask about ambiguous ones.
List all .md files in docs/ (recursively). For each file:
| Signal | Category | Target |
|---|---|---|
| Filename contains "adr", "decision", "rfc" | decisions | wiki/decisions/ |
| Filename contains "architecture", "design", "system" | architecture | wiki/architecture/ |
| Filename contains "research", "investigation", "spike" | research | wiki/research/ |
| Filename contains "pattern", "recipe", "howto" | patterns | wiki/patterns/ |
| Content has "## Decision" or "## Status: Accepted" | decisions | wiki/decisions/ |
| Content describes system components/boundaries | architecture | wiki/architecture/ |
Show the auto-categorized files and ask for confirmation:
### docs/ Categorization
**Auto-categorized** (confidence: high):
- docs/adr/001-use-postgres.md → wiki/decisions/ (ADR)
- docs/architecture/service-map.md → wiki/architecture/
- docs/research/auth-providers.md → wiki/research/
**Needs your input** (ambiguous):
- docs/api-guide.md — architecture or skip?
- docs/deployment-notes.md — architecture or skip?
- docs/changelog.md — skip? (probably not wiki material)
For ambiguous files, choose: architecture / decisions / research / patterns / skip
Wait for user response before proceeding.
For each categorized doc (not "skip"), create a wiki reference page:
---
type: wiki
created: <today's date>
source: docs/<relative-path>
tags: [<category>, migrated]
---
# <Title from doc>
## Summary
<2-4 sentence summary of the document's content>
## Key Points
- <Most important point 1>
- <Most important point 2>
- <Most important point 3>
## Source
Full document: [[docs/<relative-path>]]
Important: Do NOT copy the entire doc content. Create a summary that helps the AI decide whether to read the full doc. The original stays in docs/.
Add new entries to the relevant wiki/<category>/_index.md page:
- [[wiki/<category>/<page-name>|<Title>]]
Update wiki/index.md if new categories gained their first entries.
### Phase 3: docs/ Directory (hybrid)
- Auto-categorized: N files
- User-categorized: M files
- Skipped: P files
- Wiki pages created: Q
Source: .md files outside standard directories
This phase is hybrid — present all found files for user decision.
Find .md files in the project that are NOT in:
memory/, wiki/, docs/, openspec/node_modules/, .git/, .opencode/, .claude/, .codex/dist/, build/, out/, target/)Common locations: project root, notes/, journal/, custom directories.
If files are found, present them grouped by location:
### Vault Pages Found
**Project root**:
- README.md — skip (already used for identity)
- CONTRIBUTING.md — architecture or skip?
- TROUBLESHOOTING.md — patterns or pitfalls?
**notes/**:
- notes/performance-tuning.md — research or patterns?
- notes/known-issues.md — pitfalls or skip?
Choose for each: architecture / decisions / research / patterns / pitfalls / skip
If no files found outside standard directories: "No additional vault pages found." and skip to Step 6.
For files categorized as pitfalls: extract individual entries and append to memory/pitfalls.md Active section (with (source: [[<original-path>]]) links).
For all other categories: create wiki reference pages following the same format as Phase 3 (summary + link to source, never copy full content).
For skip: do nothing.
For all created wiki pages, update the corresponding _index.md with a wikilink entry following the format in wiki/schema.md.
### Phase 4: Vault Pages (hybrid)
- Files found: N
- Imported: M (to architecture: A, decisions: D, research: R, patterns: P, pitfalls: X)
- Skipped: S
After all phases complete:
Verify all memory files respect their caps:
wiki/hot.md: count words — if > 600, compact (trim oldest Recently Shipped)wiki/index.md: count lines — if > 80, trim oldest session linksmemory/pitfalls.md: count active entries — if > 20, rotate oldest to ArchiveFor all newly created wiki pages, verify that:
_index.mdReport any broken links.
## Migration Complete
| Phase | Source | Auto | User-Directed | Skipped | Pages Created |
|-------|--------|------|---------------|---------|---------------|
| 1. Agent Config | CLAUDE.md, AGENTS.md | all | — | — | 0 (enriched existing) |
| 2. Archived Changes | openspec/changes/archive/ | all | — | M | N |
| 3. docs/ | docs/ | P | Q | R | S |
| 4. Vault Pages | .md files | — | T | U | V |
**Total wiki pages created**: <sum>
**memory/MEMORY.md**: enriched with N constraints, M preferences
**Size caps**: hot.md <X>/600 words, index.md <Y>/80 lines, pitfalls <Z>/20 active
**Broken links**: <count or "none">
### Next Steps
1. Review created wiki pages for accuracy
2. Run `/corgi-lint` to validate memory health
3. Consider running `/corgi-propose` for your next change — memory will now provide context
Users can run migration partially:
--auto-only or answer "skip" when prompted for Phases 3/4--phase N to run only one phase (requires prior phases already done or skipped)