ce-compound
Capture a solved problem's lesson in its cheapest durable form, a test or lint rule, a coding standard, or a repo learning, or refresh existing learnings against the codebase. Use when verified work corrected a wrong belief about how something behaves, such as a failed approach, a real defect a review caught, or a wrong assumption or document, or when auditing stale, overlapping, or drifted learnings. Do not auto-invoke it for work that went as first planned.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- ce-compound
- description
- Capture a solved problem's lesson in its cheapest durable form, a test or lint rule, a coding standard, or a repo learning, or refresh existing learnings against the codebase. Use when verified work corrected a wrong belief about how something behaves, such as a failed approach, a real defect a review caught, or a wrong assumption or document, or when auditing stale, overlapping, or drifted learnings. Do not auto-invoke it for work that went as first planned.
- argument-hint
- [optional: brief context, or refresh and a scope] [mode:refresh] [mode:non-interactive] [depth:lightweight|full]
02 资源文件 38
- 资产文件assets/resolution-template.md2.8 KB
- 参考文档references/agents/best-practices-researcher.md7.1 KB
- 参考文档references/agents/data-integrity-guardian.md3.1 KB
- 参考文档references/agents/framework-docs-researcher.md5.4 KB
- 参考文档references/agents/pattern-recognition-specialist.md3.6 KB
- 参考文档references/agents/performance-oracle.md4.5 KB
- 参考文档references/agents/security-sentinel.md4.1 KB
- 参考文档references/agents/session-historian.md7.1 KB
- 参考文档references/assembly.md16.4 KB
- 参考文档references/concepts-vocabulary.md11.4 KB
- 参考文档references/enhancement.md2.7 KB
- 参考文档references/form.md4.8 KB
- 参考文档references/grounding-validation.md7.4 KB
- 参考文档references/lightweight.md7.5 KB
- 参考文档references/modes.md3.1 KB
- 参考文档references/refresh-and-discoverability.md9.6 KB
- 参考文档references/refresh/classify.md9.0 KB
- 参考文档references/refresh/commit.md3.4 KB
- 参考文档references/refresh/discoverability.md1.8 KB
- 参考文档references/refresh/investigate.md4.8 KB
- 参考文档references/refresh/modes.md3.5 KB
- 参考文档references/refresh/overview.md5.8 KB
- 参考文档references/refresh/per-action-flows.md14.6 KB
- 参考文档references/refresh/report.md2.0 KB
- 参考文档references/refresh/scope.md1.9 KB
- 参考文档references/refresh/worth-audit.md4.6 KB
- 参考文档references/report.md8.3 KB
- 参考文档references/research.md14.1 KB
- 参考文档references/schema.yaml9.5 KB
- 参考文档references/session-history.md10.1 KB
- 参考文档references/yaml-schema.md9.0 KB
- 脚本scripts/packs-resolve.py30.8 KB
- 脚本scripts/session-history/discover-sessions.sh12.8 KB
- 脚本scripts/session-history/extract-errors.py10.1 KB
- 脚本scripts/session-history/extract-metadata.py23.6 KB
- 脚本scripts/session-history/extract-skeleton.py23.4 KB
- 脚本scripts/validate-doc-claims.py21.6 KB
- 脚本scripts/validate-frontmatter.py5.0 KB
03 SKILL.md 正文
/ce-compound
Choosing the job
This skill does one of two jobs. Capture holds the lesson of one solved problem. Refresh audits the existing learnings against the current codebase and can delete docs and open a PR.
Run refresh when the arguments contain mode:refresh, or when an interactive run was invoked to do one, as in /ce-compound refresh payments, "clean up the learnings", or a standalone request to create CONCEPTS.md. An earlier remark in the session does not count. Read references/refresh/overview.md and follow it instead of the rest of this file. The refresh references name the parts of this file they reuse.
When an interactive run is asked to create or update the project's coding standards or review docs as a whole, invoke the ce-setup skill with standards and stop.
Otherwise run capture. A non-interactive run without mode:refresh is always capture, whatever its context says. Capture takes free-text context, so refresh token rotation after fixing that bug is a capture. If an interactive run's words could mean either job, ask once with the host's blocking question tool, and capture if there is no answer.
Capture
Outcome: the lesson of one qualifying solved problem is held in the cheapest form that stops the repeat, grounded against the current tree, discoverable by the next agent.
Done: the chosen form is written or updated and validated, vocabulary capture recorded, and the mode's completion report emitted; when no lesson qualifies, nothing is written and the report says why.
One learning per run. A session that produced several gets several sequential runs, never one batched run. Read references/research.md; it explains what batching breaks.
Preconditions
Document only a problem that is solved and verified.
<!-- ce-durable-bar:start --> A lesson earns a durable form only when it holds durable project reasoning that is not readily recoverable from the current code, tests, checks, coding standards, comments, or documentation, and losing it would plausibly cause recurrence, material risk, or substantial rediscovery. Apply this counterfactual: without a record of this lesson, would a future engineer working from the current tree still be likely to repeat the mistake or redo substantial investigation? Completion, effort, and diff size do not establish eligibility. <!-- ce-durable-bar:end -->
If the counterfactual fails, write nothing and report why. Judge this from the session rather than asking. An explicit invocation requests the judgment now but does not lower the bar.
An existing learning that became materially inaccurate or incomplete qualifies because leaving it would mislead. Update that learning instead of creating a duplicate.
Mode Detection
Enter non-interactive mode when either holds: the arguments you were invoked with contain the mode:non-interactive token or its deprecated alias mode:headless, or the invocation makes non-interactive intent unmistakable, such as a caller or standing instruction asking to run ce-compound "headless", "non-interactively", "unattended", or "without prompts/questions". Both tokens together is not a conflict. Bare "automatically" or "auto-run" is not on its own a non-interactive signal: it speaks to invoking the skill, not to suppressing its prompts. An ambiguous or absent signal defaults to interactive. Tokens starting with mode: or depth: are flags, not context: strip them before treating the remainder as the brief context hint. Once detected, non-interactive mode applies for the entire run.
references/modes.md decides depth, including what a depth: token does, as in mode:non-interactive depth:lightweight or mode:non-interactive depth:full. Read it before step 1.
Non-interactive mode asks nothing. It asks no blocking question of any kind, in any phase, because a caller reaching this path has no human to answer one. Every non-interactive exit, including one taken before any phase runs, ends on a terminal signal a caller parses: Documentation complete, or Documentation skipped with the reason when the run wrote nothing. Interactive mode asks only where a step's own reference says to.
Artifact Root
Resolve <root> when you first compose a <root>/solutions/ path, and pass a subagent the resolved path rather than the config.
<!-- ce-docs-root:start -->
Resolve the artifact root <root> before composing any artifact path.
- Read
docs_rootfrom<repo-root>/.rocketclaw/config.yamlonly (<repo-root>=jj workspace root). Do not read it fromconfig.local.yaml. Unset -><root>isdocs, exactly as before. - Validate a set value: a repo-relative directory whose real, symlink-resolved path stays inside the repo and is neither the repo root nor under
.git/. Otherwise stop with an error namingdocs_rootand the value -- never fall back todocs. - Use
<root>as the sole artifact location: create it if absent, compose each path as<root>/<subdir>with this skill's own subdirectory, and never also readdocs. <!-- ce-docs-root:end -->
Write boundary
Only the orchestrator writes product files. Phase 1 subagents write to per-run scratch only, and never touch <root>/, project instruction files, or any other tracked path.
The orchestrator writes what references/form.md chooses, in every mode and without asking: at most one added test, added or tightened lint rule with any baseline entries it needs, or condition in an existing CODING_STANDARDS.md, and at most one learning under <root>/solutions/. It never changes product code. It also writes two maintenance side effects that their own step describes: CONCEPTS.md during vocabulary capture, and — only in interactive Full mode after consent — a small discoverability line in a project instruction file. Two further writes exist only in interactive Full mode when the user selects them at the assembly destination step: a rule file inside a writable declared Compound Pack, and the packs: entry appended to .rocketclaw/config.yaml. An instruction file is only ever edited, never created. Nothing else in the tree is written. Edits to other docs belong to a refresh, which a capture recommends or runs with a narrow scope.
Full Mode
Context-pressure handoff
When an interactive run would otherwise choose Lightweight for context pressure, dispatch one fresh native OpenCode subagent loading ce-compound with mode:non-interactive depth:full. Read the source session ID with shell from $OPENCODE_SESSION_ID, never guess or recall it. Obtain the absolute workspace root with jj workspace root. Pass that ID, title when known, absolute root, any learning-doc path already written this run, and a one-sentence problem topic. Do not pre-digest the conversation. The delegated run is the orchestrator for the write boundary and reuses an already-written doc.
This skill explicitly requests delegation under a host rule allowing user- or skill-requested subagents; do not ask again under that rule. Respect unconditional prohibitions and actual denials. Use native opencode.models for configured model discovery when needed; model permission is separate from delegation permission, so omit an unauthorized model override and use a suitable inherited model. Classify actual errors separately as unavailable tool, permission denial, model-argument rejection, or exhausted nesting depth. Never evade restrictions through shell or another harness. Fall back to Lightweight only for actual unavailable/denied/depth delegation, naming which; advise re-running ce-compound from this same session once delegation is available, not in a fresh session. Explicit non-interactive depth: tokens remain authoritative.
The parent relays the delegated report and doc path, then offers with usual consent reported-but-unapplied interactive-only discoverability instruction-file edits and a Compound Pack destination. Do not run a second Full pass or re-edit the doc in the parent.
Run these in order. Each reference is a required read at the step that names it.
- Research — read
references/research.md. - Session history — read
references/session-history.md, and start it after dispatching the Related Docs Finder so it overlaps your drafting rather than serializing. - Form, assembly, and write — wait for every Phase 1 input, read
references/form.mdand write what it chooses, then readreferences/assembly.md. - Refresh check and discoverability — read
references/refresh-and-discoverability.md. - Optional enhancement — read
references/enhancement.md. Interactive only. - Report — read
references/report.mdfor the report shape your mode must emit and how the skill ends.
Lightweight Mode replaces steps 1-6 with a single pass; read references/lightweight.md, which defines its own completion output for both modes.
04 同仓库更多 Skills
ce-retro
Look back over an agent session in this repo, the current one by default or any scope the user names across harnesses, and find what in the repo's environment keeps costing agents effort or leading them into mistakes, keeping only fixes the evidence shows are worth it. Lands the approved environment fixes and hands the rest to their owners. Use for a retro, postmortem, or papercut sweep of how agents worked in this repo. Use ce-compound to keep the lesson of one solved problem, and ce-debug for a bug in product code.
release-notes
Draft release notes from merged pull requests since the last tag. Use when preparing a release.
skill-one
Sample skill
disabled-skill
A skill with model invocation disabled
claude-only-skill
A skill restricted to Claude Code only
agent-only-skill
An agent-only skill not intended for direct user invocation