product-compound

Installation
SKILL.md

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 mapping
  • assets/learning-template.md — learning file section structure
  • ../../scripts/cmd/compound — all learning CRUD operations
Related skills

More from jihunkim0/jk-skills

Installs
2
First Seen
Mar 27, 2026