product-compound
Product Compound: Learning System
Orchestrate the learning lifecycle — capture, retrieve, refresh, sync to AGENTS.md. All logic lives in Go. This skill is the map.
Scripts live at ../../scripts/cmd/<name>/ — run via go run ../../scripts/cmd/<name>.
Determine Trigger
Identify what invoked this skill:
| Trigger | Action |
|---|---|
Manual /product-compound <slug> |
Phase 1: Capture |
| Feature-complete ceremony | Phase 1: Capture |
/product-compound retrieve |
Phase 2: Retrieve |
/product-compound refresh |
Phase 3: Refresh |
/product-compound sync |
Phase 4: Sync AGENTS.md |
/product-compound rebuild |
Phase 5: Rebuild index |
/product-compound staleness |
Phase 6: Staleness check |
| Warm start surfaces stale learnings | Phase 3 → Phase 4 |
Phase 0: Warm Start
Run go run ../../scripts/cmd/assess state --slug=<slug> for structured state.
Read .agents/products/.journal/<slug>.jsonl (last 5 entries) for context.
Phase 1: Capture
go run ../../scripts/cmd/compound capture --slug=<slug> --title="..." --domain=<domain> --body="..."
Optional flags: --impact=3 (1-5), --tags="tag1,tag2", --context="when this applies".
Creates a new learning file in docs/product-learnings/<domain>/, assigns a unique ID (<slug>-YYYYMMDD-NNN), and appends to index.jsonl.
Output: CREATED <id> at <path>. After capture, auto-run Phase 4.
Commit learning files atomically: git add -A && git commit -m "learning: <id> <short description>"
If session ends, optionally write a handoff: go run ../../scripts/cmd/handoff write --slug=$SLUG --skill=compound
Phase 2: Retrieve
go run ../../scripts/cmd/compound retrieve --slug=<slug> --domain=<domain>
Optional flags: --tags="tag1,tag2", --limit=5.
Returns JSON array of {id, title, domain, score, confidence, tags, body, path} — top 5 by relevance (configurable with --limit). Scores by text match, domain, tags, recency, impact, and confidence.
Phase 3: Refresh
go run ../../scripts/cmd/compound refresh --id=<learning-id>
Bumps the frequency counter and recalculates score for a single learning. Updates updated_at timestamp. Returns {id, frequency, score, updated_at}.
Phase 4: Sync AGENTS.md
go run ../../scripts/cmd/compound sync-agents [--dry-run]
Recalculates critical scores (impact × frequency × recency × breadth), updates managed section: critical learnings (top 5-7), domain index, recent (last 3-5), superseded warnings. Section stays ~30-50 lines regardless of total count.
Phase 5: Rebuild Index
go run ../../scripts/cmd/compound rebuild-index
Full rebuild of index.jsonl from all docs/product-learnings/**/*.md. Recovery operation — safe to run anytime. Run sync-agents afterward to update AGENTS.md.
Phase 6: Staleness Report
go run ../../scripts/cmd/compound staleness
Optional flag: --days=90 (threshold for staleness).
Returns stale learnings with reasons: {total_checked, threshold_days, stale: [{id, title, domain, status, confidence, updated_at, reason, path}]}.
Three-Tier Architecture
| Tier | What | Loaded When |
|---|---|---|
| 1 | AGENTS.md managed section (~30-50 lines) | Every session, every agent |
| 2 | Per-domain INDEX.md files |
On-demand when working in that domain |
| 3 | Individual learning files | By ID when specifically needed |
AGENTS.md scales: ~30 lines at 10 learnings AND at 10,000 learnings.
References
references/yaml-schema.md— frontmatter fields, enums, category→directory mappingassets/learning-template.md— learning file section structure../../scripts/cmd/compound— all learning CRUD operations
More from jihunkim0/jk-skills
pr-merge-cleanup
Execute a PR workflow: commit changes, push to a branch, create a GitHub PR, wait for CI checks to pass (no bypassing), merge the PR, and clean up all git status, branches, and scratch files. Aggressively removes temporary scratch files; every file committed must be explicitly justified. Use when a user asks to commit, PR, and clean up.
10document-update
Pre-PUSH, PR documentation update. Reads all project docs, cross-references the diff, updates README, ARCHITECTURE, AGENTS, and other markdown files to match what changed. Polishes CHANGELOG voice and cleans up TODOS. Use when asked to "update the docs", "sync documentation", or "pre-PR docs". Proactively suggest using this skill before creating a PR.
8optimize-code
Deep architectural analysis, aggressive cleanup, modularization, and test enforcement — ruminate on the codebase to identify dead code, redundancies, duplicated logic, over-abstractions, test gaps, and files exceeding 300 lines that need splitting. Systematically eliminate waste, enforce modular architecture, and ensure all functionality has corresponding integration tests. Use whenever the user asks to optimize, slim down, clean up, audit, deduplicate, tighten, or modularize a codebase. Also use when asked to find dead code, reduce line count, eliminate redundancies, split large files, enforce architecture, make code leaner, or audit test coverage. Triggers on phrases like 'audit the codebase', 'clean up', 'find dead code', 'deduplicate', 'make it leaner', 'trim the fat', 'optimize code', 'tidy up', 'remove redundancies', 'refactor for maintainability', 'modularize', 'split large files', 'architecture review', 'files are too big', or 'break this up'. Proactively suggest using this skill before creating a PR.
8product-implement
Product Implement phase. Use this skill when a user wants to execute a planned feature by fetching unblocked tickets from Linear/GitHub, dispatching isolated subagents via git worktrees, and executing a strict TDD loop.
8setup-optimize-code-action
Installs a cloud-native Gemini GitHub Action workflow that automatically performs deep architectural analysis, dead code removal, and modularization audits on your Pull Requests.
8product-pipeline
Product Factory — the single entry point for all product development. Detects where you are, shows a dashboard, and routes to the right phase. Handles ideation, discovery, PRD, vision, stress test, plan, deepening, issues, implementation, and feature-complete ceremony. Invoke at any stage — it picks up where you left off.
7