From dtk
Use after completing a code review session to extract actionable lessons and persist them as individual files in docs/lessons/.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dtk:learn-from-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze the current code review session, extract actionable lessons, and persist each one as an individual file in `docs/lessons/{category}/`.
Analyze the current code review session, extract actionable lessons, and persist each one as an individual file in docs/lessons/{category}/.
SCRIPTS="bin/skill-scripts"; [ -d "$SCRIPTS" ] || SCRIPTS="${CLAUDE_PLUGIN_ROOT:-}/bin/skill-scripts"; [ -d "$SCRIPTS" ] || SCRIPTS=$(find ~/.claude/plugins -path "*/dtk/bin/skill-scripts" -maxdepth 5 2>/dev/null | head -1); echo "$SCRIPTS"
Use the output path as $SCRIPTS for all script commands below.
Examine the current conversation and identify lessons across these categories:
For each lesson found, prepare it in this format:
### [Short descriptive title]
**Category:** Security | Code Patterns | QA | Performance | Framework | Testing | Frontend
**Severity:** Critical | High | Medium | Low
**Rule:** [One clear, actionable sentence — what to always do or never do]
**Bad:**
```[lang]
// brief example of the wrong approach
Good:
// brief example of the correct approach
Why: [1-2 sentences explaining the risk or benefit]
## Step 3: Check for Duplicates
Before creating each lesson, check if a similar one already exists:
```bash
bash $SCRIPTS/lessons/create-lesson.sh \
--category <category> --title "<title>" --severity <severity> --check-dup
DUPLICATE: — read the existing file and decide:
NO_DUPLICATE → proceed to createFor each new lesson (that passed the duplicate check), create a file:
echo '<lesson content in Step 2 format>' | bash $SCRIPTS/lessons/create-lesson.sh \
--category <category> --title "<title>" --severity <severity>
The script will:
docs/lessons/{category}/NNN-slug.md with the contentdocs/lessons/index.md with a new row in the correct category tableCategory directory mapping:
| Category | Directory |
|---|---|
| Security | security |
| Code Patterns | code-patterns |
| QA | qa |
| Performance | performance |
| Framework | framework |
| Testing | testing |
| Frontend | frontend |
After creating all lessons, output:
Created: docs/lessons/security/003-sql-injection-db-raw.md
Created: docs/lessons/performance/001-eager-load-in-loops.md
Skipped: "Mass Assignment Protection" (duplicate of security/002-mass-assignment-protection.md)
docs/lessons/ as individual filesnpx claudepluginhub junielton/claude-base-dtk --plugin dtkRecords reusable lessons from resolved bug fixes, architectural changes, interface updates, or recurring pitfalls into project memory docs, anchored to git commits.
Captures learnings from completed development sessions into reusable knowledge files organized by pattern, pitfall, decision, tool insight, and process improvement.
Extracts reusable rules from developer corrections during a coding session and persists them to CLAUDE.md or memory for future sessions.