ワンクリックで
compound
Use at the end of a work session, or when accumulated findings need to be embedded into conventions, skills, or patterns
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use at the end of a work session, or when accumulated findings need to be embedded into conventions, skills, or patterns
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when a file or module is too large, responsibilities are tangled, or a cross-cutting redesign is needed
Use when literature notes exist and need citation verification, or before publishing any artifact that cites literature
Use at the end of a work session to embed learnings into conventions. Simplified for models with lower reasoning capacity.
Use when the Slack bot needs to handle an operational action like launching an experiment, querying status, or processing approvals
Use when a plan, finding, or design needs adversarial review before committing to it
Use when designing a new experiment or research protocol and need to ensure methodological rigor
| name | compound |
| description | Use at the end of a work session, or when accumulated findings need to be embedded into conventions, skills, or patterns |
| complexity | medium |
| model-minimum | glm-5 |
| disable-model-invocation | false |
| allowed-tools | ["Read","Grep","Glob","Bash(git diff *)","Bash(git log *)"] |
| argument-hint | [optional: 'fast', 'deep', or no argument for auto-detect] |
Compound engineering phase — turns session work into accumulated system advantage by embedding learnings into conventions, skills, and patterns. Invoked as Step 5 of autonomous work cycle SOP.
/compound fast — 1-2 turns, skip cross-session scanning/compound deep — 10-15 min, full procedure with deep-mode scope/compound (no argument) — auto-detect: scheduler injects directive to use fast if full ran <3h ago; otherwise run fullRationale: 83% of sessions produce zero compound actions. Fast saves ~$5.40/day by skipping redundant cross-session scans. See projects/akari/analysis/compound-step-overhead-analysis.md.
Run !git diff --stat HEAD~N..HEAD. Identify what changed.
Ask the 4 questions from Step 2: non-obvious facts, failure modes, useful techniques, convention friction.
If completed experiment/analysis, check EXPERIMENT.md Findings for: unresolved questions, failed criteria, "N too small", multi-phase gaps. Create task with provenance if found.
Read last 5 fleet sessions from .scheduler/metrics/sessions.jsonl (entries with "triggerSource":"fleet"). Check: verification pass rate, any 0-commit or 0-turn sessions. Report: "Fleet: N/M passed" or "Fleet: no recent sessions."
Apply small updates directly. Larger changes → task. See Step 10 for growth accounting and 400-line gate.
Compound (fast): N actions — <summary>. or Compound (fast): no actions.
Skip cross-session scanning — covered by full compound.
Pre-compound commit: Check git status. Commit uncommitted session work first.
The standard compound procedure. Runs when auto-detection determines a full scan is needed (~2-5 minutes), or when explicitly requested without the fast argument.
Compound engineering turns individual session work into accumulated system advantage. The compound phase embeds learnings from each task into conventions, skills, and patterns — transforming linear progress into exponential improvement. See projects/akari/analysis/ralph-loop-architecture-analysis.md for the underlying pattern.
Run !git diff --stat HEAD~N..HEAD (where N is the number of commits in this session) to see what changed. If this is an end-of-session invocation, the diff is against the pre-session HEAD.
Identify:
Ask these questions about the session's work:
Did I discover a non-obvious fact? (e.g., an API behaves differently than documented, a file format has an undocumented constraint, a convention is ambiguous in edge cases) → If yes: should this fact live in CLAUDE.md, a skill, or a project file?
Did I encounter a failure mode that future sessions should avoid? (e.g., a command that silently fails, a configuration that looks correct but isn't, a common mistake in a workflow) → If yes: add a gotcha/warning to the relevant skill or convention.
Did I develop a technique or approach that worked well? (e.g., a debugging strategy, an analysis pattern, a verification method) → If yes and it generalizes beyond this one task: note it as a gravity candidate or add to a skill.
Did I work around a convention that didn't fit? (e.g., a CLAUDE.md rule that was unhelpful, a schema that was too rigid, a skill instruction that was misleading) → If yes: update the convention/skill to handle the edge case, or note the friction for future evaluation.
This step has two parts: (A) explicit recommendation sections, and (B) implied tasks from findings.
Search recent files for "Recommendations", "Prevention", "Proposal", "Migration", or "Next steps" sections:
projects/*/diagnosis/diagnosis-*.md, projects/*/postmortem/postmortem-*.md
projects/*/experiments/*/EXPERIMENT.md (status: completed in last N days)
projects/akari/feedback/*.md, projects/akari/analysis/*.md, projects/akari/architecture/*.md
decisions/*.md (with Migration or Consequences action items)
For each file: check if recommendations are relevant to this session's area, trivially actionable, or (for ADRs) whether migration steps are implemented.
Automated extraction — use logic from infra/scheduler/src/recommendations.ts:
RECOMMENDATION_HEADER_RE pattern- [ ] <imperative> [zero-resource] Why: From <exp-id> — <summary> Done when: <condition><!-- Recommendations surfaced: YYYY-MM-DD -->Anti-loop check: For recommendations about analyzing running experiments, split into preliminary + final analysis tasks per decisions/0023-incremental-analysis-throttling.md.
Fleet routing (ADR 0045): When creating new tasks (from recommendations, implied tasks, or any other source), untagged tasks default to fleet-eligible. Only apply [requires-opus] when a task fails the fleet-eligibility checklist from CLAUDE.md. When a recommended action can be decomposed into subtasks, prefer creating multiple fleet-eligible subtasks over a single complex task.
Note: verify.ts now runs an L0 check (ADR 0060) that detects actionable language in Findings/Implications without a corresponding TASKS.md modification. This compound step provides the deeper semantic scan for cases the regex misses.
Completed experiments often have implied follow-up work in Findings sections that lacks a formal "Recommendations" header. Scan for:
| Pattern | Signal phrases | Implied task |
|---|---|---|
| Failed criterion | "FAIL", "below threshold" | Refined experiment |
| Insufficient sample | "N too small", "cannot draw conclusions" | Larger replication |
| Confound | "confound", "cannot separate" | Controlled follow-up |
| Partial confirmation | "partially confirmed", "effect exists but" | Targeted investigation |
| Unexplained result | "unexpected", "mechanism unclear" | Diagnosis |
| Multi-phase plan | "Phase N" in body | Check phase-tasks exist |
For each pattern: check TASKS.md for existing follow-up; create task candidate with experiment provenance if missing. Multi-phase: grep for "Phase [0-9]" and verify corresponding tasks exist.
Extract implicit research questions from three sources. In full mode: current session/project only. In deep mode: all active projects.
Scan EXPERIMENT.md Findings sections for implicit questions:
| Pattern | Signal phrases | Question form |
|---|---|---|
| Unexplained result | "unexpected", "mechanism unclear" | "Why does X despite Y?" |
| Untestable hypothesis | "cannot be tested", "future work" | "Under what conditions does H hold?" |
| Aggregate-stratum reversal | "aggregate masks", "breakdown reveals opposite" | "What drives reversal between aggregate and per-X?" |
| Methodology confound | "protocol asymmetry", "cannot separate" | "How to disentangle X from Y?" |
For each pattern: state question clearly, reference source experiment/finding, identify CI layers, note what data/methodology would resolve it.
Read detectPatterns() output from infra/scheduler/src/patterns.ts (or run on .scheduler/metrics/sessions.jsonl). For each high/medium severity pattern without documented root cause: "Why does [pattern] recur despite [existing mitigation]?"
Check projects/*/literature/synthesis.md and recent /lit-review outputs for gap analysis sections. Formulate questions for gaps not already in "Open questions".
Before proposing: read target project's "Open questions", check for semantic overlap, skip questions already covered. Present candidates:
Candidate research question for <project>:
Q: <question>
Source: <exp-id, Finding N> or <pattern-id> or <literature gap>
CI layers: <layers>
To resolve: <data/methodology needed>
Status: NEW | OVERLAPS WITH "<existing question>"
Agent decides whether to append. Do not auto-append.
Check whether the current session's work reveals a pattern that has recurred 3+ times:
In full mode: only note candidates for future /gravity evaluation.
In deep mode: evaluate each candidate using the /gravity procedure (recurrence, stability, cost-benefit).
Read docs/conventions/registry.yaml and identify conventions needing attention.
For each L0 convention, check whether the enforcer has triggered in the last 90 days:
| Source | How to check |
|---|---|
| verify.ts warnings | grep -c '"warning".*"convention_id"' .scheduler/metrics/sessions.jsonl |
| health-watchdog alerts | Check .scheduler/health/ for recent alerts |
| warning-escalation entries | Check escalation log files |
| anomaly-detection triggers | grep -c 'anomaly' .scheduler/metrics/sessions.jsonl |
A convention is potentially stale if:
Output for stale conventions:
Convention <id> (<name>): No triggers in 90+ days.
Consider: (a) verify problem still exists, (b) update description, (c) deprecate if obsolete.
For each L2 convention, check promotion_criteria field:
| Status | Condition | Output |
|---|---|---|
| Ready | verifiable_by_code: true AND trivial check | Flag for L0 promotion task |
| Blocked | Requires NLP/complex analysis | Note what's blocking |
| Partial | Already partially L0 | Document remaining gap |
Output for promotion candidates:
Convention <id>: Ready for L0 promotion.
Criteria: <promotion_criteria>
Task: Add <check> to <enforcer>.
Also check for:
id, name, level, description)In deep mode, check whether any active project has accumulated enough experiment records to warrant domain knowledge synthesis. Skip this step in full mode.
Procedure:
For each active project, count completed experiments:
grep -rl "^status: completed" projects/<project>/experiments/*/EXPERIMENT.md | wc -l
Check whether the project has a knowledge.md:
ls projects/<project>/knowledge.md
If a project has 10+ completed experiments AND no knowledge.md (or knowledge.md is older than 30 days while 5+ new experiments have completed since its last update):
TASKS.md:
- [ ] Run domain knowledge synthesis [zero-resource]
Why: Project has N completed experiments without a consolidated knowledge reference. Per feedback/feedback-domain-knowledge-consolidation.md.
Done when: projects/<project>/knowledge.md exists compiling key domain findings from all completed experiments, with provenance links to source EXPERIMENT.md files.
Priority: medium
If a project already has knowledge.md and <5 new experiments since last update, skip it.
Rationale: Domain knowledge accumulates across experiments but doesn't naturally consolidate. After 10+ experiments, searching individual records becomes impractical. Periodic synthesis into knowledge.md files provides the same benefit as review papers — making accumulated knowledge accessible without reading every source. See projects/akari/feedback/feedback-domain-knowledge-consolidation.md.
Measure line counts for high-read-frequency artifacts:
| Artifact | Threshold | Rationale |
|---|---|---|
CLAUDE.md | >400 | Read every session |
projects/*/README.md | >200 | Read during orient |
projects/*/TASKS.md | >150 | Read during task selection |
.claude/skills/*/SKILL.md | See tiers below | Loaded on invocation |
infra/*/src/*.ts | >500 | Maintainability |
Tiered triggers for skills (per feedback/feedback-skill-growth-governance.md):
| Tier | Threshold | Action |
|---|---|---|
| Flag | >200 | Note in output; no task |
| Task | >300 | Create simplification task |
| Gate | >400 | Must simplify before adding content |
The gate prevents indefinite deferral — a 300-line task can be deprioritized, but a 400-line gate forces action at point of need.
For each artifact exceeding threshold: check TASKS.md for existing simplification task; create one if missing. Report in output.
Audit recent fleet worker sessions against projects/akari/plans/fleet-quality-audit-checklist.md.
.scheduler/metrics/sessions.jsonl for triggerSource: "fleet" entries — last 24h (full) or 48h (deep).verification object. Flag sessions with: hasCommit: false (D3), hasLogEntry: false (D2), ledgerConsistent: false (D7), l2ViolationCount > 0 (D4). Fire-and-forget (D8) is already L0-enforced.[x] tasks — does "Done when" match artifacts on disk?[escalate:] tags — is the escalation reason legitimate?For each compound opportunity, classify and act:
| Category | Criterion | Action |
|---|---|---|
| Direct update | Small, verifiable | Apply now |
| New task | Larger, needs design | Add to TASKS.md |
| Gravity candidate | Recurring pattern | Add task: "Run /gravity on: " |
| Approval needed | Governance change | Write to APPROVAL_QUEUE.md |
| Evolution | Infra code change | Create .pending-evolution.json |
Direct update rules:
/simplify first).### Compound phase
**Learnings embedded:** <count>
<bulleted list or "none">
**Recommendations actioned:** <count>
<bulleted list or "none">
**Research questions surfaced:** <count>
<bulleted list or "none">
**Gravity candidates noted:** <count>
<bulleted list or "none">
**Convention lifecycle:** <count>
<bulleted list or "none">
**Fleet audit:** <N sessions, M/N passed> or "no fleet sessions"
<dimension failures if any>
**Tasks created:** <count>
<bulleted list or "none">
If no compound actions: ### Compound phase\nNo compound actions warranted this session.
/compound identifies candidates; /gravity evaluates them./compound checks if postmortem recommendations were actioned./compound operates on single-session learnings./compound session-end embedding — orient reads what compound wrote./compound may generate .pending-evolution.json.If standalone (not SOP Step 5): commit changes with git add <files> && git commit -m "compound: <summary>". Do not push. When invoked as SOP Step 5, the session's Step 6 handles the commit.
/gravity.