add-learnings
[ADD v0.11.0] Manage learnings — generate active views, archive old entries, show stats
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
[ADD v0.11.0] Manage learnings — generate active views, archive old entries, show stats
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
[ADD v0.11.0] Generate or sync a portable AGENTS.md from ADD project state — writes, checks drift, or merges with hand-curated content
[ADD v0.11.0] Declare absence — get autonomous work plan for the duration
[ADD v0.11.0] Return from absence — get briefing on autonomous work
[ADD v0.11.0] View project branding — accent color, palette, drift detection, image gen status
[ADD v0.11.0] Update project branding — new colors, fonts, tone, audit artifacts
[ADD v0.11.0] Generate or refresh CHANGELOG.md from conventional commits
| name | add-learnings |
| description | [ADD v0.11.0] Manage learnings — generate active views, archive old entries, show stats |
| argument-hint | [migrate|archive|stats] [--dry-run] |
Manage the learnings knowledge base: generate optimized active views, archive stale entries, and report statistics.
Learnings accumulate over time in .add/learnings.json and ~/.claude/add/library.json. The full JSON files are expensive to load into agent context. This skill manages the lifecycle:
-active.md views from existing JSON (or migrate legacy .md to JSON first)Default subcommand (no argument): migrate.
.add/config.json to get project name.add/learnings.json (Tier 3 project learnings).add/learnings.md (legacy or generated view).add/learnings-active.md (optimized active view)~/.claude/add/library.json (Tier 2 cross-project)~/.claude/add/library-active.md (Tier 2 active view)Generate -active.md files from existing JSON. Handles three scenarios:
This is the most common case — existing projects upgrading to the active view approach.
~/.codex/hooks/filter-learnings.sh on .add/learnings.json~/.codex/hooks/filter-learnings.sh on ~/.claude/add/library.json (if it exists).md exists (no JSON)Pre-v0.4.0 projects that never migrated to structured JSON.
.add/learnings.md to .add/learnings.md.pre-migration.bak- **[{severity}] {title}** line is an entry## section + bullet as an entryL-001, L-002, etc.category from section heading (Anti-Patterns → anti-pattern, Technical → technical, etc.)severity from [critical], [high], [medium], [low] markers. Default: mediumscope: projectstack: [] (stack-agnostic, can be refined during retro)source: project name from configdate: extract from entry if present, otherwise use file modification dateclassified_by: agentcheckpoint_type: retro (migrated entries treated as retro-sourced).add/learnings.json with the standard wrapper~/.codex/hooks/filter-learnings.sh on the new JSONNo learnings yet. Report: "No learnings files found. Learnings will be captured automatically during skill execution."
Apply the same logic to ~/.claude/add/library.json / ~/.claude/add/library.md. Use WL- prefix for IDs.
ADD LEARNINGS MIGRATION
=======================
Tier 3 (Project): .add/learnings.json
Status: JSON exists (34 entries)
Active view: Generated .add/learnings-active.md (15 of 34 entries)
Context savings: 19,280 bytes → 5,494 bytes (72% reduction)
Tier 2 (Library): ~/.claude/add/library.json
Status: JSON exists (4 entries)
Active view: Generated ~/.claude/add/library-active.md (4 of 4 entries)
Context savings: 1,820 bytes → 680 bytes (63% reduction)
Migration complete. Agents will now read -active.md files instead of full JSON.
If --dry-run is passed:
Review and archive stale learnings to keep the active set focused.
.add/learnings.json.add/config.json: learnings.archival_days (default: 90) and learnings.archival_max_severity (default: "medium")archival_days with severity at or below archival_max_severityARCHIVE CANDIDATES (5 of 34 entries)
L-011 [low] Hill chart concept maps perfectly to ADD (2026-02-07)
→ Reason: 66 days old, low severity
L-012 [low] Now/Next/Later framing for milestones (2026-02-07)
→ Reason: 66 days old, low severity
L-020 [low] v0.1.0 built in single session (2026-02-07)
→ Reason: 66 days old, low severity, historical note
Archive these entries? They remain in the JSON but are excluded from the active view.
[a] Archive all candidates
[s] Select individually
[n] Skip archival
"archived": true on selected entriesList candidates without modifying anything.
archival_max_severity — always require explicit human selectionShow learning statistics without modifying anything.
ADD LEARNINGS STATISTICS
========================
Tier 3 (Project): .add/learnings.json
Total entries: 34
Active (non-archived): 34
By severity: 1 critical, 9 high, 18 medium, 6 low
By category: 8 technical, 7 architecture, 5 anti-pattern, 1 performance, 9 process, 4 collaboration
Oldest: L-001 (2026-02-08)
Newest: L-034 (2026-02-19)
JSON size: 19,280 bytes
Active view: 5,494 bytes (72% smaller)
Active view exists: yes (generated 2026-04-14)
Tier 2 (Library): ~/.claude/add/library.json
Total entries: 4
Active view exists: no
Recommendation: Run /add-learnings migrate to generate active view
Archive candidates (>archival_days, severity ≤ medium): 12 entries
Recommendation: Run /add-learnings archive to review
| Error | Action |
|---|---|
jq not installed | Report: "jq is required for active view generation. Install: brew install jq (macOS) or apt install jq (Linux)" |
| JSON parse error | Report the error, suggest checking file manually. Do not modify. |
| Filter script missing | Report: "filter-learnings.sh not found at expected path. Plugin may need reinstallation." |
| Backup already exists | Append timestamp: .pre-migration-{YYYYMMDD-HHMMSS}.bak |
| Empty entries array | Generate empty active view, report "No entries to process" |