一键导入
compound-learnings
Extract patterns from git history and session files, recommend artifacts (skill/rule/hook/agent) based on frequency thresholds
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract patterns from git history and session files, recommend artifacts (skill/rule/hook/agent) based on frequency thresholds
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create distinctive, production-grade frontend interfaces with high design quality. Use when building web components, pages, or applications. Includes framework-specific guidance for Tailwind, React, Vue, and Rails/Hotwire ecosystems.
Skill file structure, naming conventions, directory layout, frontmatter requirements, and invocation control. Use when creating skill files or slash commands to ensure correct format and validation.
Forces adversarial reasoning before committing to decisions. Triggers on architectural choices, approach selection, and planning phases to prevent premature commitment bias.
Verify LLM reasoning using Reverse Chain-of-Thought (RCoT) to detect overlooked conditions.
Autonomous task implementation - research, plan, build, review, fix, ship
Generate a complete favicon set (ICO, PNG variants, apple-touch-icon, web manifest) from a source image and integrate into the project's HTML layout. Use when user asks to generate favicons, set up PWA icons, or add an apple-touch-icon.
| name | compound-learnings |
| description | Extract patterns from git history and session files, recommend artifacts (skill/rule/hook/agent) based on frequency thresholds |
| allowed-tools | Bash Read Glob Grep |
Transform recurring patterns into durable artifacts. Use frequency-based thresholds to distinguish noise from signal.
Scan these locations for patterns:
| Source | Command/Path | What to Extract |
|---|---|---|
| Git commits | git log --oneline -100 | Repeated fix types, refactor patterns |
| Git commit bodies | git log -50 --format="%B---" | Lessons in commit descriptions |
| PR descriptions | gh pr list --state merged -L 20 | Decisions, learnings |
| Handoffs | $MAIN_WORKTREE/.agents/handoffs/*.md | Patterns, What Worked/Failed |
| Key Learnings | CLAUDE.md (Key Learnings section) | Existing encoded patterns |
Note: Session ledger (.agents/session_ledger.md) is for Skill("reflect") only - ephemeral per-session state.
# Git patterns (look for repeated prefixes/types)
git log --oneline -100 | cut -d' ' -f2- | sort | uniq -c | sort -rn
# Handoff patterns
grep -h "^- " .agents/handoffs/*.md 2>/dev/null | sort | uniq -c | sort -rn
Before counting, normalize patterns:
Group by semantic meaning, not exact wording.
| Occurrences | Action | Rationale |
|---|---|---|
| 1 | Skip | Could be noise, one-off incident |
| 2 | Note | Emerging pattern, watch for recurrence |
| 3+ | Recommend | Clear pattern, suggest artifact |
| 4+ | Strong recommend | Encode immediately |
Use this decision tree to determine artifact type:
Is it a sequential workflow with distinct phases?
YES → Consider COMMAND (user-invoked) or AGENT (autonomous)
Does it need user interaction during execution?
YES → COMMAND
NO → AGENT
NO ↓
Should it trigger automatically on file/context patterns?
YES → SKILL (probabilistic, Claude MAY follow)
Is enforcement critical (must happen every time)?
YES → Consider HOOK instead (deterministic)
NO ↓
Is it a simple rule or convention?
YES → RULE (add to CLAUDE.md or .agents/lessons/)
Project-specific? → .agents/lessons/ (with workflow_phase: review)
Universal? → CLAUDE.md
NO ↓
Does it enhance an existing agent's behavior?
YES → AGENT UPDATE (modify existing agent)
NO → Likely doesn't need encoding
| Artifact | When to Use | Example |
|---|---|---|
| Rule | Simple convention, always applies | "Use kebab-case for file names" |
| Skill | Knowledge/context for specific work | "Stimulus controller patterns" |
| Hook | Must enforce behavior deterministically | "Run linter before commit" |
| Command | User-invoked workflow with arguments | "/deploy --env staging" |
| Agent | Autonomous task, returns report | "security-review agent" |
Present findings as:
## Compound Learnings Analysis
### Strong Signal (4+ occurrences)
| Pattern | Count | Recommended Artifact | Rationale |
|---------|-------|---------------------|-----------|
| ... | ... | ... | ... |
### Emerging Patterns (2-3 occurrences)
| Pattern | Count | Potential Artifact | Notes |
|---------|-------|-------------------|-------|
| ... | ... | ... | ... |
### Recommended Actions
1. **[Artifact Type]**: `name` - description
- Draft: [brief template or content]
Before recommending an artifact, verify:
learnWhen invoked from Skill("learn"):
Note: Skill("reflect") is for single-session analysis. Skill("learn") is for cross-session compound learning.