Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
Run a high-thoroughness end-to-end implementation loop using clean worker worktrees, per-slice planning, implementation, explicit review/fix iteration, orchestrator integration, and final commit/PR drafting. Use when the user explicitly wants a Ralph/Wiggum-style loop, autonomous multi-agent execution, a delegated feature/bugfix carried from confirmed scope through review-ready completion, or RFC-driven implementation that should be reviewed, bumped to In Progress, decomposed into phases, and executed through nested sub-loops. Supports Codex subagents by default and external CLI workers such as OpenCode when explicitly requested and available.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Use this skill when the user wants more than basic delegation. The goal is not "parallelize some work"; the goal is to carry a scoped task through planning, implementation, review, integration, and ship-ready artifacts with explicit backpressure.
Keep orchestrate-parallel-work generic. Use this skill as the opinionated wrapper around it.
.incn facade over a custom Rust backend. Direct from rust:: imports of existing crates and primitives are acceptable when the .incn module still owns the behavior; bespoke incan_std_<component>::feature Rust modules that hide the feature logic are not acceptable unless the maintainer explicitly asks for that backend boundary..incn precedents, parser/typechecker/codegen tests, or run a small probe and record the specific capability evidence.WORKTREE_ROOT so VS Code picks it up. WORKTREE_ROOT must resolve to the primary repository's shared sibling tmp/ directory; do not implement in the system /tmp, /private/tmp, or in the main repo checkout.done output has been integrated and verified unless the orchestrator records a concrete reason to keep one..agents/state/review-report.md inside each worktree so findings survive across loops..incn source to pass review-incan-source-quality; Incan implementation work is not done when it merely compiles if the authored source reads like Rust-shaped scaffolding instead of well-written Python.ralph-loop is a plan -> do -> check -> act loop, not a linear pipeline.
Use these meanings consistently:
Important:
Every Ralph loop must have a persisted loop identity before workers are spawned or resumed. Record it in the orchestrator overview and use it to filter durable state:
loop_id: stable slug for this run, usually <repo>-<issue-or-rfc-or-milestone>-<short-purpose>Use STATE_ROOT to mean the active loop's state directory. For new loops, prefer a namespaced root:
.agents/state/ralph-loop/<loop-id>/
Legacy top-level state such as .agents/state/ralph-loop/slices.json may be read for migration or handoff, but must not silently drive a new loop unless its recorded loop identity matches the current request.
On every resume, stop-hook continuation, compaction, or long-running restart:
STATE_ROOT/overview.md, STATE_ROOT/slices.json, and .agents/state/review-report.md.in_scope: same loop identity and allowed implementation repoverification_lane: downstream/consumer repo explicitly named as validation onlyout_of_scope: different repo, issue, milestone, branch, or objectivein_scope implementation slices.Out-of-scope or historical slices may be cited as background evidence, but they must not be advanced, committed, pushed, or turned into PRs from the current loop. If the user wants to pick them up, start or resume a separate Ralph loop with its own loop identity.
Consumer repositories such as IncQL may be used to reproduce, verify, or acceptance-test an Incan compiler/runtime change only when listed as a verification lane. Adding product features, docs CI, repo automation, or cleanup in that consumer repo is a separate implementation loop unless the user explicitly asks for it.
Do not use this for:
If the user feeds the loop an RFC, enter RFC intake mode before ordinary execution.
In RFC intake mode:
review-rfc on the RFC and apply direct fixes.Status: and the design tail honestly.Draft and design is settled, use bump-rfc to move it to Planned.bump-rfc to move it to In Progress. For this skill, the parent Ralph loop itself counts as "a contributor has picked up the work"; a child loop does not need its own PR or branch-level ceremony.Implementation Plan and Progress Checklist as the source of truth for implementation phases. If they are missing or weak, strengthen them before spawning workers.Do not quietly force an RFC past open design questions. Stop and ask the user.
Restate the requested end-state before starting execution. Confirm:
If scope is ambiguous, stop and ask a short numbered list of missing decisions.
After confirming scope, write the loop identity into STATE_ROOT/overview.md before creating or resuming slices. If existing durable state lacks a matching loop identity, do not continue it as part of this loop.
Default to Codex subagents plus git worktrees under WORKTREE_ROOT.
Resolve WORKTREE_ROOT once at the start of the loop and record its absolute path in STATE_ROOT/overview.md. It is the primary repository's shared sibling tmp/ directory. RALPH_WORKTREE_ROOT is only an assertion of that location: if it resolves elsewhere, stop rather than silently accepting another root. In particular, never use the system temporary directory as a worktree or durable build-output root.
COMMON_GIT_DIR="$(git rev-parse --path-format=absolute --git-common-dir)"
WORKSPACE_ROOT="$(dirname "$(dirname "$COMMON_GIT_DIR")")"
EXPECTED_WORKTREE_ROOT="$WORKSPACE_ROOT/tmp"
mkdir -p "$EXPECTED_WORKTREE_ROOT"
EXPECTED_WORKTREE_ROOT="$(cd "$EXPECTED_WORKTREE_ROOT" && pwd -P)"
if [ -n "${RALPH_WORKTREE_ROOT:-}" ]; then
[ -d "$RALPH_WORKTREE_ROOT" ] || {
echo "RALPH_WORKTREE_ROOT must already be $EXPECTED_WORKTREE_ROOT" >&2
exit 2
}
[ "$(cd "$RALPH_WORKTREE_ROOT" && pwd -P)" = "$EXPECTED_WORKTREE_ROOT" ] || {
echo "RALPH_WORKTREE_ROOT must be $EXPECTED_WORKTREE_ROOT" >&2
exit 2
}
fi
WORKTREE_ROOT="$EXPECTED_WORKTREE_ROOT"
git-common-dir keeps the default stable when the loop runs from a linked worktree.
Before creating a worktree, and before every command that can perform a substantial build, enforce the storage boundary:
du -sk "$WORKTREE_ROOT", df -k "$WORKSPACE_ROOT", and the primary repository's git worktree list --porcelain inventory in STATE_ROOT/storage-ledger.md.CARGO_TARGET_DIR, generated SDK/provider caches, package/distribution output, and test fixtures that copy repositories or build trees.WORKTREE_ROOT, normally under a loop-specific .ralph-cache/<loop-id>/ directory. Do not rely on a tool's default temporary path.WORKTREE_ROOT. If the ledger or measured root is at the ceiling, do not start another build; first retire an already-integrated Ralph worktree/cache, or report a concrete blocker. Never solve this by moving output to /tmp or /private/tmp.For every build/test command, set CARGO_TARGET_DIR and TMPDIR to that slice's owned locations. Set any project-specific output variables too (for example, TOOLCHAIN_DIST for Incan's release-toolchain smoke commands). The ledger must distinguish retained worktrees from reclaimable targets/caches and must name the owner slice. Any primary-repository worktree outside WORKTREE_ROOT is legacy or foreign and must be explicitly recorded; a Ralph-owned one is a cleanup blocker, not a reason to create another outside-root worktree. git worktree remove alone is not cleanup when a worker placed output in a separate cache directory.
If the user explicitly wants OpenCode:
opencode is installed and callableopencode run ... or a preconfigured OpenCode agent profileIf OpenCode is requested but unavailable, say so plainly and either stop or fall back to Codex only with the user's approval.
Use start-work once at the orchestration boundary to resolve issue/RFC context, branch naming, and relevant learnings.
Do not mechanically run start-work inside every worker unless each worker owns a distinct issue or RFC. The important requirement is a clean worktree plus resolved context, not duplicated branch ceremony.
Create WORKTREE_ROOT first if it does not exist.
Create:
Create durable slice state under each worktree. The paths below are relative to STATE_ROOT; for new loops STATE_ROOT should normally be .agents/state/ralph-loop/<loop-id>:
overview.md for orchestrator-wide state, including loop identity and scope boundariesSTEERING.md for operator overrides, urgency changes, and mid-run guidanceslices.json for the orchestrator-owned slice registry<slice-id>/scope.md<slice-id>/plan.md<slice-id>/tasks.json<slice-id>/tasks.md<slice-id>/status.md<slice-id>/handoff.mdTreat the slice folder as the source of truth for that slice. Do not rely on memory or only on conversational context.
Use these files deliberately:
STEERING.md: human or orchestrator overrides that should preempt normal task orderingslices.json: orchestrator registry of all active slices, their owners, and their current statetasks.json: machine-readable task list for the slicetasks.md: human-readable task narrative and notesstatus.md: current PDCA state, blockers, and next actionBase all worker worktrees from the same resolved starting point unless there is a deliberate dependency chain.
For non-decomposed work, the single-agent implementation still belongs in a fresh worktree under WORKTREE_ROOT; "keep the work local" does not mean "edit the primary checkout directly."
Before spawning workers, identify:
-dev.N line and therefore needs a version bumpFor milestone, RFC-wide, or compiler-boundary work, also write an ## Acceptance Contract section into STATE_ROOT/overview.md before implementation starts. Include:
Do not defer this acceptance contract to release-branch closeout. The release branch should verify the contract, not discover it.
Do not treat RFC edits or release notes alone as sufficient user documentation.
Before spawning workers, decide whether the task actually decomposes cleanly. If it does not, keep the work local and continue as a single-agent Ralph loop.
When it does decompose, hand off to orchestrate-parallel-work for slice definition, ownership, and worktree isolation under WORKTREE_ROOT. Pass the resolved WORKTREE_ROOT, loop-specific .ralph-cache/<loop-id>/ root, and 20 GiB ceiling as mandatory inputs; the delegated orchestrator and workers must not recompute or override their own temporary root.
If the task came from an RFC:
orchestrate-parallel-work for leaf workers inside their owned scope, but they must not spawn further ralph-loop childrenFor each slice, create tasks.md with explicit task items. Keep them concrete and finishable, not vague “phase done” markers.
Also create tasks.json for the same slice. tasks.json is the authoritative status surface; tasks.md is the human-readable companion.
Suggested shape:
{
"slice_id": "lifecycle-env",
"status": "planned",
"tasks": [
{
"id": "T1",
"title": "Establish manifest/env schema ownership boundary",
"status": "todo",
"notes": ""
},
{
"id": "T2",
"title": "Remove CLI-local env schema parsing",
"status": "todo",
"notes": ""
}
]
}
Example shape:
# Slice Tasks — lifecycle-env
- [ ] Establish manifest/env schema ownership boundary
- [ ] Remove CLI-local env schema parsing
- [ ] Add internal manifest override discovery
- [ ] Make env overlays affect nested `incan lock`
- [ ] Add focused tests
- [ ] Run slice verification
- [ ] Run slice review/fix loop
Subagents should work tasks to completion against these files and update them as state changes.
The orchestrator should maintain slices.json with entries like:
[
{
"loop_id": "incan-557-std-environ",
"slice_id": "lifecycle-env",
"repo": "encero-systems/incan",
"scope_role": "implementation",
"owner": "<worker name or id>",
"worktree": "<WORKTREE_ROOT>/...",
"status": "doing",
"next_action": "Implement T2"
}
]
Use scope_role: "verification" for downstream acceptance lanes. Verification slices may run checks and collect evidence, but they must not mutate consumer product code unless the loop identity explicitly allows cross-repo implementation.
Each worker must own a non-overlapping slice with:
implementation or verification)WORKTREE_ROOTWORKTREE_ROOT/.ralph-cache/<loop-id>/<slice-id>/, with the owner recorded in STATE_ROOT/storage-ledger.mdSTATE_ROOT/<slice-id>/For RFC-driven work, prefer one child loop per implementation phase or tightly related checklist group.
Each worker must perform this loop inside its slice:
create-plan..incn, stdlib, or language-surface work, perform capability intake before ruling out an Incan-native design. Record the local precedent, test, or probe result in plan.md.scope.md, plan.md, tasks.json, and tasks.md.tasks.json and keep tasks.md as the readable companion.status.md as planned.tasks.json, tasks.md, and status.md as task ownership and progress change.doing as the active execution state.review-incan-source-quality when the slice touches .incn source.review on the slice in report-only mode, or review-orchestrate if the slice itself is broad enough to justify specialization.scope.md, not only against test output.checking as the active verification/review state.fix on every actionable in-scope blocker or warning.flag-compiler-bug before reporting the blocker or choosing a workaround.replan_required and go back to Plan. Update scope.md, plan.md, tasks.json, and tasks.md before doing more code.blocked with a concrete blocker.done and write handoff.md.scope.md is honestly satisfied,
or report a concrete blocker with its classification.The slice's .agents/state/review-report.md must be kept current throughout this loop.
The slice folder under STATE_ROOT/<slice-id>/ must also stay current throughout this loop.
Allowed slice states:
planneddoingcheckingreplan_requiredblockeddoneDo not invent vague alternatives like “mostly done” or “almost ready”.
Workers must be told:
ralph-loop children; if they need extra decomposition, they may use orchestrate-parallel-work only for leaf-level workers within their owned scopeRequire every worker to return the shape in reference.md.
The orchestrator owns integration. Workers do not integrate each other.
The orchestrator must:
slices.json and ensure every in-scope slice has an honest terminal or active stateloop_id, repo, branch, issue, milestone, or scope role does not match the current loop identity-dev.N by one at minimum for implementation work on the active dev lineSTATE_ROOT/overview.mdreview-incan-source-quality for touched .incn source, plus review or review-orchestrate on the integrated resultfix on actionable in-scope findings, or go back to planning if integration review shows that the original requested scope is still not satisfiedflag-compiler-bug for real out-of-scope compiler defects found during integrationThe orchestrator worktree's .agents/state/review-report.md is the integration source of truth.
The orchestrator's STATE_ROOT/overview.md is the integration state source of truth.
Worker cleanup is part of integration, not optional closeout. For every slice marked done:
handoff.md, the worker changed-file list, and the accepted patch are reflected in the orchestrator worktree.slices.json, such as integrated_at, integrated_by, and worktree_removed.git worktree remove <worker-path>.overview.md or slices.json, then remove that Ralph-owned worker worktree with git worktree remove --force <worker-path>.WORKTREE_ROOT/.ralph-cache/<loop-id>/<slice-id>/, then update STATE_ROOT/storage-ledger.md with the reclaimed size. Do not remove an unowned path or a path with unknown contents.Do not force-remove a worker worktree with unknown or unintegrated changes. Do not push while accepted slice work exists only in a worker worktree or worker branch.
STEERING.md must be checked at the start of every major iteration. If it changes the priority, scope, or urgency of the work, the orchestrator must update slices.json, affected scope.md / tasks.json, and continue from the new direction rather than pretending the original ordering still applies.
If STEERING.md or a resume hook mentions slices from another loop identity, treat them as out of scope until the user explicitly says to resume that separate loop.
Do not stop at "worker green." Cross-slice regressions and consistency problems belong to the orchestrator.
When code is ready:
write-commit-messagecreate-pr-description.agents/state/findings-ledger.md (a symlink into a private, non-git location — see AGENTS.md) if this loop's integration review (step 6) surfaced a real defect, regression, or scope gap that got fixed before shipping: - YYYY-MM-DD | ralph-loop | <loop_id>: <what was found> | <what changed>. Skip this for a loop that shipped clean with nothing notable to record, and skip silently if the ledger file doesn't exist in this workspace.For RFC-driven work, only the parent loop drafts or owns the final PR description. Child loops must not produce PRs of their own.
If the user says "greenlight for PR", "green light for PR", or otherwise approves PR publication for RFC-driven work, treat RFC finalization as part of the pre-PR gate. Before reporting the branch ready for review or opening/marking a PR ready:
bump-rfc to move the RFC from In Progress to ImplementedProgress Checklist item is checked before the bump; unchecked items are scope failures, not residual PR risksreplan_required, update the relevant slice/task state, and continue the Plan -> Do -> Check -> Act loop instead of publishingCloses #NNNclosed/implemented/Do not leave a fully implemented RFC in In Progress while presenting the PR as review-ready. Do not use Refs #NNN as an escape hatch for RFC-driven Ralph-loop work unless the user explicitly changed the scope to a partial implementation. If the branch implements only part of the RFC, say that directly, leave the RFC active, and do not present the PR as a full-RFC closeout.
The orchestrator runs the commit, push, and PR flow itself once the integrated gate passes. Do not leave finished, verified work uncommitted.
Treat these as default expectations, not optional polish:
-dev.N -> -dev.(N+1)) at minimum for implementation work on the active dev lineIf the task teaches a durable lesson about orchestration, testing, or worktree hygiene, consider add-learning before finishing.
start-work: use once to resolve context and branch strategy before decompositionreview-rfc: use first in RFC intake modebump-rfc: use to move a settled RFC into Planned and then In Progress before phase execution, and to move fully implemented RFC-driven work to Implemented before PR review/publication; stop and ask the user if open questions or blockers remaincreate-plan: each worker uses it for its own slice; the orchestrator may also use it if the whole task still needs a settled planorchestrate-parallel-work: use it for decomposition, worker ownership, and isolationreview: report-only detector for smaller worker slices and local integration checksreview-orchestrate: preferred detector for broad integrated outputs or slices that are themselves wide enough to justify specialized reviewersreview-incan-source-quality: required detector for touched .incn source; use it to enforce the well-written-Python readability bar and dogfooding integrity before declaring a slice or integration cleanfix: mandatory repair pass after review findingsreview-and-fix: allowed as a convenience wrapper when a worker or the orchestrator wants the combined loop explicitlywrite-commit-message: use for the final commit textcreate-pr-description: use for the final PR bodyUse this shape:
ralph-loopralph-loops for major RFC phases when justifiedorchestrate-parallel-work leaf workers inside a child phase when neededDo not recurse ralph-loop indefinitely. A child loop is a phase owner, not another top-level orchestrator.
review-rfc ran firstbump-rfc moved it to In Progress only after design was settled and work was actually being picked upralph-loop childrenWORKTREE_ROOTRALPH_WORKTREE_ROOT, if set, resolved exactly to the primary repository's shared sibling tmp/ directoryWORKTREE_ROOTSTATE_ROOT/storage-ledger.md recorded ownership and measured usage before substantial buildsSTATE_ROOT/<slice-id>/STATE_ROOT/slices.jsonslices.json entry has loop_id, repo, and scope_roleSTATE_ROOT/STEERING.md at each major iterationscope.md, plan.md, tasks.json, tasks.md, status.md, and handoff.mdplanned, doing, checking, replan_required, blocked, done.agents/state/review-report.md in its worktree.incn source ran review-incan-source-quality.agents/state/review-report.md in the integration worktreeSTATE_ROOT/overview.mdProgress Checklist item was checked or the orchestrator stayed in replan_requiredbump-rfc moved it to Implemented before the PR was presented as review-readyCloses #NNN; partial-scope PRs explain the remaining RFC scope insteadまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
Transition an Incan RFC from one status to the next. Use when the user asks to promote, advance, or finalize an RFC, or says /bump-rfc. Handles Draft → Planned, Planned → In Progress, and In Progress → Implemented transitions.
日本語の概要は準備中です。原文の説明を表示しています。
Safely close out completed Incan work after a PR is merged by verifying merge status, syncing the base branch, removing task-owned local worktrees/assets, deleting merged local/remote branches, pruning refs, and reporting dirty or ambiguous leftovers. Use when the user says /closeout, asks to clean up after a merged PR, or wants local RFC/issue branch/worktree cleanup.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts a GitHub issue title and body using the target repository's issue templates under .github/ISSUE_TEMPLATE. Use when the user asks to create, draft, or file a GitHub issue, bug report, feature request, chore, documentation issue, or RFC proposal, or wants issue text that matches the repo's template.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts implementation plans with TDD, documentation updates, and repository verification commands before coding. Use when the user asks for an implementation plan, /create-plan, or structured pre-implementation design for work in encero workspaces (e.g. Incan, IncQL).
日本語の概要は準備中です。原文の説明を表示しています。
Generate a PR description following the repository's pull request template. Use when the user asks to create, draft, or generate a PR description for a pull request. The skill automatically locates the PR template in the target repository and fills it in based on the git diff.
日本語の概要は準備中です。原文の説明を表示しています。