一键导入
pwrl-learnings-save
Persist deduplicated learnings to permanent storage with backups and version control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Persist deduplicated learnings to permanent storage with backups and version control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pwrl-learnings-save |
| description | Persist deduplicated learnings to permanent storage with backups and version control. |
| argument-hint | [dedup artifact from pwrl-learnings-dedup] |
Purpose: Final phase of learnings workflow. Persists deduplicated learnings to permanent storage with recovery backups, version control integration, and validation. Makes learnings discoverable and queryable.
Expects artifact from pwrl-learnings-dedup with:
dedup_id: YYYY-MM-DD-NNN-dedup
learnings: [array of deduplicated learnings]
archived_mapping: { old_id → new_id }
Emit save artifact (YAML + markdown):
---
format: pwrl-learnings-save-artifact
version: "1.0"
save_id: YYYY-MM-DD-NNN-save
created: ISO-8601-timestamp
---
# Learning Persistence Results
## Summary
- **Learnings Saved:** [count]
- **Files Written:** [count]
- **Indexes Updated:** [count]
- **Backup Created:** [path]
- **Storage Location:** docs/learnings/
- **Status:** success
## Files Written
- Learnings: [count] individual learning files
- Indexes: 7 index files (INDEX.md, BY_TYPE.md, etc.)
- Metadata: .index.json, .updated-at.txt
## Backup Information
- **Backup Path:** docs/learnings/.backups/2026-06-12-HHMMSS.tar.gz
- **Backup Size:** [X MB]
- **Timestamp:** [ISO-8601]
## Git Integration
- **Committed:** [yes/no]
- **Commit Hash:** [hash or N/A]
- **Commit Message:** "Add [N] learnings: [categories]"
## Validation Results
- **Files Verified:** [count] ✓
- **Index Links Valid:** ✓
- **Metadata Complete:** ✓
- **Duplicate Archive:** [count] archived learnings
## Recovery Information
- **Latest Backup:** [path]
- **Previous Backups:** [count]
- **Recovery Command:** `tar -xzf [backup-path] -C docs/`
## Ready for Access
- **Status:** ready
- **Access:** Open `docs/learnings/INDEX.md` to browse
- **Search:** Available via .index.json
For complete step-by-step instructions, see save-learnings-detailed-workflow.md.
This SKILL.md provides an overview. The detailed workflow document contains:
After completing this phase, run quality gate validation:
/pwrl-phase-checkpoint learnings 5 [artifact-path]
See pwrl-phase-checkpoint for validation rules.
Check input has valid dedup_id and learnings array with complete data.
Check storage environment:
Directory exists:
docs/learnings/ directory presentWrite permissions:
Disk space:
Backup directory:
.backups/ subdirectory if neededPreserve current state before writing:
Create tar.gz:
tar -czf docs/learnings/.backups/YYYY-MM-DD-HHMMSS.tar.gz docs/learnings/ --exclude='.backups'Verify backup:
Cleanup old backups:
ls -lh .backups/For each learning in dedup artifact:
Determine file path:
docs/learnings/gotcha/2026-06-12-race-condition-cache.mdFormat content:
Write file:
Handle errors:
Regenerate all navigation indexes:
INDEX.md (Master index)
BY_TYPE.md (Organized by type)
BY_DOMAIN.md (Organized by domain)
BY_PRIORITY.md (Organized by priority)
BY_APPLICABILITY.md (Organized by relevance)
RECENT.md (Recently added)
.index.json (Machine-readable)
Verify all written data:
File validation:
Index validation:
Metadata validation:
Error handling:
Optional: add learnings to version control:
Ask user:
If yes:
git add docs/learnings/git commit -m "Add/update learnings: [N] learnings, [types], [domains]"If no:
git_commit: noneError handling:
Emit final artifact with:
| Scenario | Recovery |
|---|---|
| Write fails | Restore backup: tar -xzf [backup-path] -C docs/ |
| Index fails | Regenerate indexes manually or run skill again |
| Disk full | Free space; restore backup if needed |
| Git integration fails | Learnings still saved; git can be added manually later |
Test file: tests/pwrl-learnings/save-learnings.test.ts
Happy Path Tests:
Edge Cases:
Output Validation Tests:
Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation
Create structured implementation plans with three tiers (Fast/Standard/Deep). Pure skill pipeline orchestrator—no agent routing.
Review code changes through 4-phase micro-skill pipeline (scope, prepare, analyze, report)
Execute implementation work efficiently through 4-phase micro-skill pipeline
Verify repository state and confirm session completion before committing.
Create a clear session commit with state and next steps. Orchestrates checkpoint and commit micro-skills, optionally chains to pwrl-learnings.