一键导入
pwrl-learnings
Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.
Extract actionable learnings from code, commits, tasks, documentation, errors, and reviews.
| name | pwrl-learnings |
| description | Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation |
| argument-hint | [Optional: source material to extract from] |
Complete learning lifecycle management through 5-phase micro-skill pipeline.
ask_user_question, ask_user, ask_user_input, vscode/askQuestions or any available extension/tool for user interaction for all decisionsInput (code/commit/task/documentation)
↓
Phase 1: pwrl-learnings-extract
├ Extract learnings from source
├ Identify candidates (gotcha, pattern, decision, technical_fix, workflow)
├ Output: extraction artifact
↓
Phase 2: pwrl-learnings-classify
├ Refine classification and priority
├ Assign domains and tags
├ Detect duplicates
├ Output: classification artifact
↓
Phase 3: pwrl-learnings-structure
├ Normalize format
├ Generate metadata and storage paths
├ Create indexes
├ Output: structured artifact
↓
Phase 4: pwrl-learnings-dedup
├ Identify and merge duplicates
├ Manage archived learnings
├ Preserve lineage
├ Output: deduplicated artifact
↓
Phase 5: pwrl-learnings-save
├ Create backups
├ Write to persistent storage
├ Generate indexes
├ Git commit changes
├ Output: saved artifact (ready for access)
↓
COMPLETE
Extracts learnings from various sources (code, commits, tasks, documentation, errors, reviews).
/pwrl-phase-checkpoint learnings 1 [artifact-path] to validate phase completion. See pwrl-phase-checkpoint for validation rules.Classifies and prioritizes learnings by type, domain, severity, and applicability.
/pwrl-phase-checkpoint learnings 2 [artifact-path] to validate phase completion. See pwrl-phase-checkpoint for validation rules.Structures learnings for persistent storage with metadata and indexes.
/pwrl-phase-checkpoint learnings 3 [artifact-path] to validate phase completion. See pwrl-phase-checkpoint for validation rules.Deduplicates and merges identical or very similar learnings.
/pwrl-phase-checkpoint learnings 4 [artifact-path] to validate phase completion. See pwrl-phase-checkpoint for validation rules.Saves learnings to permanent storage with backups and git versioning.
/pwrl-phase-checkpoint learnings 5 [artifact-path] to validate phase completion. See pwrl-phase-checkpoint for validation rules./pwrl-learnings # Extract from current context
/pwrl-learnings code # Extract from code
/pwrl-learnings commit # Extract from git commit
/pwrl-learnings task # Extract from task description
/pwrl-learnings documentation # Extract from docs
/pwrl-learnings error # Extract from error trace
| Type | Definition | Example |
|---|---|---|
| gotcha | Unexpected behavior, trap, surprise | JavaScript type coercion, closure scope |
| pattern | Reusable solution, best practice, idiom | Error handling pattern, caching strategy |
| decision | Why something was chosen over alternatives | Technology choice, architectural decision |
| technical_fix | Solution to specific problem | Debugging steps, workaround, bug fix |
| workflow | Process improvement, efficiency gain | Git workflow, code review technique |
EXTRACTED:
CLASSIFIED:
STRUCTURED:
DEDUPLICATED:
SAVED:
Each phase is executed sequentially by the orchestrator. The orchestrator invokes the micro-skill, validates output with quality gates, and passes the artifact to the next phase.
Extract learning candidates from source material (code, commits, tasks, documentation, errors, reviews). Identify signal patterns, create candidates, set interaction mode.
See detailed workflow: extract-learnings-detailed-workflow.md
Refine type classifications, assign priority and domain, score applicability, detect potential duplicates. Flag early duplicate warnings for improved coverage.
See detailed workflow: classify-learnings-detailed-workflow.md
Normalize format, generate metadata (slugs, fingerprints, indexes), determine storage paths, create full-text search indexes.
See detailed workflow: structure-learnings-detailed-workflow.md
Calculate fingerprints, find exact/semantic/high-similarity matches, merge with lineage preservation, link complementary learnings.
See detailed workflow: dedup-learnings-detailed-workflow.md
Validate environment, create backup, write files with metadata, update indexes, commit to git, validate data integrity.
See detailed workflow: save-learnings-detailed-workflow.md
Interaction mode (detailed | smart | yolo) is set in Phase 1 (via pwrl-learnings-extract Step 1.5) and propagated through all five phases. The mode is stored in the extraction artifact's interactionMode field.
detailed — Step-by-step interaction at each phase. Pause for every ambiguous classification in Phase 2 (classify) and every dedup decision in Phase 4 (dedup); inspect candidate learnings before they are committed. Maximum control. Best for curating a high-quality personal learnings library.smart — Phases run automatically; pause only for HIGH-confidence-low-applicability entries and for dedup decisions where the existing entry is itself low-confidence. v1 simplification: behaves like Yolo with a single confirmation prompt at workflow start.yolo — Full automation from Phase 1 through Phase 5. Only final confirmation before persisting. Auto-decisions use conservative thresholds (high confidence). Fastest. Best for routine session-end batch extraction or trusted source materials.Note: The scanning itself (FIXME/HACK/TODO detection, commit-message analysis, etc.) is identical in all three modes — only the confirmations and dedup resolutions differ.
Exception: Error recovery steps always pause the pipeline for user action, regardless of mode. See docs/learnings/pattern/interaction-mode-three-mode-propagation-2026-06-29.md for the full contract.
Early detection (Phase 2): Classify phase checks extracted learnings against existing knowledge base. Flags candidates that appear to update existing learnings (suggest update instead of create).
Late resolution (Phase 4): Dedup phase runs full fingerprinting and merge algorithm. Handles exact, semantic, and high-similarity matches with archive mapping.
Result: Significantly reduced duplicates through multi-stage coverage.
docs/learnings/ directory (persistent knowledge base)After successful save, learnings available in:
docs/learnings/
├── INDEX.md (all learnings)
├── BY_TYPE.md (organized by type)
├── BY_DOMAIN.md (organized by domain)
├── BY_SEVERITY.md (organized by severity)
├── RECENT.md (latest 20)
├── .index.json (machine-readable)
├── .backups/ (recovery backups)
│ └── 2026-06-12-14-58-00.tar.gz
├── gotcha/ (type-based folders)
│ ├── async-race-condition.md
│ └── closure-scope-trap.md
├── pattern/
├── decision/
├── technical_fix/
├── workflow/
└── archived/ (merged/deprecated)
Phase 5: Consolidation utilities (4 micro-skills)
Provide:
docs/learnings/INDEX.mdAfter documenting the new learning, evaluate whether related learnings might need updates.
Suggest /pwrl-refresh-learnings [scope] when:
Skip refresh when: No related learnings found, or existing docs are still current and consistent.
How to suggest: Provide specific scope based on findings (e.g., file:specific-doc.md, topic-name, or category). Let user decide whether to run refresh now.
Creates categorized learning document in docs/learnings/[category]/[slug]-[date].md with:
Also updates docs/learnings/INDEX.md so every learning has a short description entry.
Directory structure example:
docs/learnings/technical-fix/ — Bug fixes and error resolutionsdocs/learnings/pattern/ — Reusable patterns and architecturedocs/learnings/workflow/ — Process improvements and toolingdocs/learnings/gotcha/ — Non-obvious behaviors and edge casesdocs/learnings/concept/ — Technology and framework understandingdocs/learnings/decision/ — Why specific approaches were chosen