From 184bb64e27b16ecda1d1bb9def6da1e5789c52e2 Mon Sep 17 00:00:00 2001 From: Nathan Baschez Date: Thu, 12 Mar 2026 08:34:40 -0700 Subject: [PATCH] feat: add no-worktree workspace mode --- README.md | 4 +- SKILL.md | 36 ++++++++++++----- maintenance/import-skills.sh | 24 ++++++++---- .../skill-instructions/trycycle-finishing.txt | 8 ++-- .../skill-instructions/trycycle-planning.txt | 4 +- .../skill-instructions/trycycle-worktrees.txt | 4 +- subagents/prompt-executing.md | 2 +- subagents/prompt-planning-edit.md | 4 +- subagents/prompt-planning-initial.md | 4 +- subagents/prompt-post-impl-review.md | 2 +- subagents/prompt-test-plan.md | 4 +- subagents/prompt-test-strategy.md | 2 +- subskills/trycycle-finishing/SKILL.md | 26 +++++++------ subskills/trycycle-planning/SKILL.md | 2 +- trycycle_explorer/explorer.toml | 23 ++++++----- .../samples/no-worktree-conductor.json | 39 +++++++++++++++++++ 16 files changed, 131 insertions(+), 57 deletions(-) create mode 100644 trycycle_explorer/samples/no-worktree-conductor.json diff --git a/README.md b/README.md index e49b0a3..0b974dd 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,9 @@ Once installed, you can use Trycycle from any Claude Code or Codex CLI session. Use trycycle to add a dark mode toggle to the settings page. ``` -Trycycle will ask you any questions it needs answered before starting, then handle the rest. It creates a git worktree, writes a plan, strengthens that plan until a fresh editor approves it unchanged, builds a test plan, builds the code, and reviews the code -- all without further input from you unless something comes up that needs your judgment. +Trycycle will ask you any questions it needs answered before starting, then handle the rest. By default it creates a git worktree, writes a plan, strengthens that plan until a fresh editor approves it unchanged, builds a test plan, builds the code, and reviews the code -- all without further input from you unless something comes up that needs your judgment. + +If you want Trycycle to reuse the current checkout instead, include the literal flag `--no-worktree` in your request. This is useful in tools like Conductor that already create an isolated workspace and branch for you. You can use Trycycle for anything from small features to large refactors. It works best when you have a clear goal in mind and a codebase that Trycycle can read and test. diff --git a/SKILL.md b/SKILL.md index 121817d..01c9557 100644 --- a/SKILL.md +++ b/SKILL.md @@ -28,6 +28,14 @@ When a step below tells you to render a prompt template: The prompt builder supports conditional blocks inside templates. A block guarded by `{{#if NAME}} ... {{/if}}` is included only when `NAME` is bound to a non-empty value. +## Workspace path convention + +Throughout this skill, `{WORKTREE_PATH}` means the directory where implementation happens: +- In the default mode, it is the path to the dedicated git worktree created in Step 4. +- If the user's request includes the literal flag `--no-worktree`, it is the path to the current checkout/workspace instead. + +In `--no-worktree` mode, do not create a nested git worktree. Reuse the current checkout as the implementation workspace. This is intended for tools such as Conductor that already provide an isolated workspace and branch. + ## Transcript placeholder helper When a step below references `{USER_REQUEST_TRANSCRIPT}`, `{INITIAL_REQUEST_AND_SUBSEQUENT_CONVERSATION}`, or `{FULL_CONVERSATION_VERBATIM}`: @@ -97,17 +105,25 @@ When the subagent returns a proposed strategy, present it to the user verbatim a The agreed testing strategy is used in step 7. -## 4) Create worktree +## 4) Prepare implementation workspace + +Default behavior: read and follow `/subskills/trycycle-worktrees/SKILL.md` to create an isolated worktree for the implementation with an appropriately named branch, for example `add-connection-status-icon`. -Read and follow `/subskills/trycycle-worktrees/SKILL.md` to create an isolated worktree for the implementation with an appropriately named branch, for example `add-connection-status-icon`. +If the user's request includes the literal flag `--no-worktree`, skip the worktree-creation subskill and prepare the current checkout as the implementation workspace instead: +- Set `{WORKTREE_PATH}` to the current repository root. +- Run `git -C {WORKTREE_PATH} status --short` and stop unless it is clean. +- Detect the default branch. Prefer `CONDUCTOR_DEFAULT_BRANCH` when it is set and non-empty. Otherwise use the repo's configured remote default branch if available; if not, fall back to `main`, then `master`. +- If `CONDUCTOR_WORKSPACE_PATH` is set and resolves to the current workspace, treat that as confirmation that the existing checkout is already an isolated workspace and do not create any nested worktree. +- If `git -C {WORKTREE_PATH} branch --show-current` already shows a non-default branch, reuse it. +- Otherwise create and switch to a new appropriately named branch in place. -Immediately after creating the worktree, run: +Immediately after preparing the implementation workspace, run: - `git -C {WORKTREE_PATH} branch --show-current` - `git -C {WORKTREE_PATH} status --short` Do not continue until the branch is correct and the status is clean. -## 5) Worktree hygiene gate (mandatory) +## 5) Workspace hygiene gate (mandatory) Before and after each major phase (`plan-editing`, `execution`, `post-implementation review`), run: - `git -C {WORKTREE_PATH} branch --show-current` @@ -137,7 +153,7 @@ Wait for the planning subagent to return either: If the planning subagent returns `USER DECISION REQUIRED:`, present that question to the user, send the user's answer back to that active planning subagent, and wait again for either a planning report or another `USER DECISION REQUIRED:` report. -If a planning report was returned, update `{IMPLEMENTATION_PLAN_PATH}` from `## Plan path`, then run the Worktree hygiene gate checks, verify the latest commit hash plus changed-file list match the planning subagent's report, and confirm the plan file exists at `{IMPLEMENTATION_PLAN_PATH}`. +If a planning report was returned, update `{IMPLEMENTATION_PLAN_PATH}` from `## Plan path`, then run the workspace hygiene gate checks, verify the latest commit hash plus changed-file list match the planning subagent's report, and confirm the plan file exists at `{IMPLEMENTATION_PLAN_PATH}`. ## 7) Plan-editor loop (up to 5 rounds) @@ -151,7 +167,7 @@ After each edit round: 1. Wait for the planning subagent to return either an updated planning report containing `## Plan verdict`, `## Plan path`, `## Commit`, and `## Changed files`, or a report beginning with `USER DECISION REQUIRED:`. 2. If the planning subagent returns `USER DECISION REQUIRED:`, present that question to the user, send the user's answer back to that active planning subagent, and wait again for either an updated planning report or another `USER DECISION REQUIRED:` report. 3. Update `{IMPLEMENTATION_PLAN_PATH}` from `## Plan path` in the latest planning report. -4. Run the Worktree hygiene gate checks and verify the latest commit hash plus changed-file list match the planning subagent's report. +4. Run the workspace hygiene gate checks and verify the latest commit hash plus changed-file list match the planning subagent's report. 5. If `## Plan verdict` is `ALREADY-EXCELLENT`, continue to step 8 with the current `{IMPLEMENTATION_PLAN_PATH}`. 6. If `## Plan verdict` is `MADE-EXCELLENT`, repeat with a fresh planning subagent. 7. Repeat up to 5 rounds. @@ -173,7 +189,7 @@ When the subagent returns: 2. If the test-plan report includes `## Strategy changes requiring user approval`, present that section to the user verbatim. 3. If the user requests changes or redirects the approach, rebuild `{FULL_CONVERSATION_VERBATIM}` immediately before the next render, save it to a temp file again, re-render `/subagents/prompt-test-plan.md` with `--set IMPLEMENTATION_PLAN_PATH={IMPLEMENTATION_PLAN_PATH}`, `--set WORKTREE_PATH={WORKTREE_PATH}`, `--set-file FULL_CONVERSATION_VERBATIM=`, and `--require-nonempty-tag conversation`, save the rendered prompt to a temp file, re-dispatch the test-plan subagent with the exact rendered prompt file contents verbatim, update `{TEST_PLAN_PATH}` from the latest test-plan report, and repeat until the user explicitly approves or the report no longer includes that section. 4. Do not proceed until the current test-plan report either has no `## Strategy changes requiring user approval` section or the user has explicitly approved it. -5. Run the Worktree hygiene gate checks, verify the latest commit hash plus changed-file list match the test-plan subagent's report, and verify the test plan file exists at `{TEST_PLAN_PATH}`. +5. Run the workspace hygiene gate checks, verify the latest commit hash plus changed-file list match the test-plan subagent's report, and verify the test plan file exists at `{TEST_PLAN_PATH}`. ## 9) Execute with trycycle-executing (subagent-owned) @@ -185,7 +201,7 @@ Render `/subagents/prompt-executing.md` with the prompt builder Do not proceed to post-implementation review until the implementation subagent has returned an implementation report. -After implementation completes, run the Worktree hygiene gate checks and verify the latest commit hash plus changed-file list match the implementation subagent's report before launching post-implementation review. +After implementation completes, run the workspace hygiene gate checks and verify the latest commit hash plus changed-file list match the implementation subagent's report before launching post-implementation review. ## 10) Post-implementation review loop (up to 8 rounds) @@ -199,7 +215,7 @@ Use the review subagent's output as the fix-loop input. When another fix round i 3. Render `/subagents/prompt-executing.md` with the prompt builder using `--set IMPLEMENTATION_PLAN_PATH={IMPLEMENTATION_PLAN_PATH}`, `--set TEST_PLAN_PATH={TEST_PLAN_PATH}`, `--set WORKTREE_PATH={WORKTREE_PATH}`, and `--set-file POST_IMPLEMENTATION_REVIEW_FINDINGS_VERBATIM=`, then save the rendered prompt to a temp file. 4. Resume the same implementation subagent and send the exact rendered prompt file contents verbatim. -After each implementation-subagent fix round, run the Worktree hygiene gate checks and verify the latest commit hash plus changed-file list match the implementation subagent's report before starting the next fresh review round. +After each implementation-subagent fix round, run the workspace hygiene gate checks and verify the latest commit hash plus changed-file list match the implementation subagent's report before starting the next fresh review round. Stop when either condition is met: 1. No **critical** or **major** issues remain. @@ -221,4 +237,4 @@ Clean up temporary artifacts created during the loop (for example plan scratch f Report the process to the user using concrete facts and returned artifacts: how many plan-editor rounds, how many code-review rounds, the current `HEAD`, the changed-file list, the implementation subagent's latest summary and verification results, and any reviewer-reported residual issues. -Then read and follow `/subskills/trycycle-finishing/SKILL.md` to present the user with options for integrating the worktree (merge, PR, etc.). +Then read and follow `/subskills/trycycle-finishing/SKILL.md` to present the user with options for integrating the implementation workspace (merge, PR, etc.). diff --git a/maintenance/import-skills.sh b/maintenance/import-skills.sh index 41aee3f..5ad4c2a 100755 --- a/maintenance/import-skills.sh +++ b/maintenance/import-skills.sh @@ -18,13 +18,20 @@ cleanup() { } trap cleanup EXIT -# Map trycycle skill names to superpowers source skill directory names -declare -A SKILL_MAP=( - [trycycle-worktrees]="using-git-worktrees" - [trycycle-planning]="writing-plans" - [trycycle-executing]="executing-plans" - [trycycle-finishing]="finishing-a-development-branch" -) +# Map trycycle skill names to superpowers source skill directory names. +# Use a case statement so the script still works on macOS's default Bash 3.2. +source_skill_name_for() { + case "$1" in + trycycle-worktrees) echo "using-git-worktrees" ;; + trycycle-planning) echo "writing-plans" ;; + trycycle-executing) echo "executing-plans" ;; + trycycle-finishing) echo "finishing-a-development-branch" ;; + *) + echo "ERROR: unknown trycycle skill name: $1" >&2 + return 1 + ;; + esac +} # Extract base-commit from an existing adapted skill's header. # Returns empty string if no header found (first import). @@ -303,7 +310,8 @@ main() { local any_aborted=false for trycycle_name in trycycle-worktrees trycycle-planning trycycle-executing trycycle-finishing; do - local source_name="${SKILL_MAP[$trycycle_name]}" + local source_name + source_name="$(source_skill_name_for "$trycycle_name")" echo "" echo "--- Importing $source_name -> $trycycle_name ---" diff --git a/maintenance/skill-instructions/trycycle-finishing.txt b/maintenance/skill-instructions/trycycle-finishing.txt index f248a3a..b319fc9 100644 --- a/maintenance/skill-instructions/trycycle-finishing.txt +++ b/maintenance/skill-instructions/trycycle-finishing.txt @@ -3,7 +3,7 @@ This skill is invoked in trycycle Step 11 ("Finish"). After the post-implementat **What the orchestrator already handles:** - The orchestrator has already verified correctness through up to 8 rounds of code review (Step 10). - The orchestrator runs its own cleanup of temporary artifacts before invoking this skill. -- The orchestrator runs final worktree hygiene checks (status, HEAD, changed files) before this step. +- The orchestrator runs final workspace hygiene checks (status, HEAD, changed files) before this step. **What to strip:** @@ -14,11 +14,13 @@ This skill is invoked in trycycle Step 11 ("Finish"). After the post-implementat - Step 2 (Determine Base Branch) — keep. - Step 3 (Present Options) — keep the 4 options and their mechanics, but replace any placeholder summary-writing or verification-writing with reuse of artifacts already produced earlier in trycycle. For the PR option, replace `` with ``, replace `` with ``, and carry through any reviewer-reported residual issues if present. - Step 4 (Execute Choice) — keep all 4 option implementations, and keep using those same latest implementation-summary / verification-result / residual-issue artifacts whenever an option needs PR text or user-facing reporting. - - Step 5 (Cleanup Worktree) — keep. + - Step 5 (Cleanup Worktree) — keep, but make it mode-aware. In default mode, clean up the dedicated worktree as before. In `--no-worktree` mode, do not attempt to remove a worktree; instead preserve the current checkout and only perform the branch actions relevant to the chosen option. - Quick Reference table — keep. - Common Mistakes — keep the ones about skipping test verification, no confirmation for discard. Remove ones about integration with skills we don't ship. - Red Flags — keep. -3. **This is the lightest adaptation** of the four skills. The finishing workflow is self-contained and the orchestrator doesn't override any of its behavior — it just invokes it. +3. **Adjust language to "workspace" where it helps.** The skill still manages branches, but it should not imply that every run has a removable git worktree. It must work for either a dedicated worktree or an existing isolated workspace such as a Conductor workspace. + +4. **This is the lightest adaptation** of the four skills. The finishing workflow is self-contained and the orchestrator doesn't override any of its behavior — it just invokes it. **Resulting structure should be roughly the same as the original, minus stale cross-references.** diff --git a/maintenance/skill-instructions/trycycle-planning.txt b/maintenance/skill-instructions/trycycle-planning.txt index aee9f32..69b5d26 100644 --- a/maintenance/skill-instructions/trycycle-planning.txt +++ b/maintenance/skill-instructions/trycycle-planning.txt @@ -8,7 +8,7 @@ This skill is invoked in trycycle Step 6 ("Plan with trycycle-planning"). A dedi **What to strip:** -1. **Remove brainstorming preconditions.** The line "This should be run in a dedicated worktree (created by brainstorming skill)" should change to something like "This should be run in a dedicated worktree" (drop the brainstorming reference). The orchestrator creates the worktree in Step 4. +1. **Remove brainstorming preconditions.** The line "This should be run in a dedicated worktree (created by brainstorming skill)" should change to something like "This should be run in an isolated implementation workspace" (drop the brainstorming reference). The orchestrator prepares that workspace in Step 4, either as a dedicated worktree or as an existing isolated checkout when `--no-worktree` is used. 2. **Remove the plan header line about executing-plans.** The template header says `> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.` — change this to reference `trycycle-executing`. @@ -16,7 +16,7 @@ This skill is invoked in trycycle Step 6 ("Plan with trycycle-planning"). A dedi **Resulting structure should be roughly:** - Overview (plan writing guidance) -- Context note (run in dedicated worktree) +- Context note (run in isolated implementation workspace) - Save plans to `docs/plans/YYYY-MM-DD-.md` - Bite-sized task granularity rules - Plan document header template diff --git a/maintenance/skill-instructions/trycycle-worktrees.txt b/maintenance/skill-instructions/trycycle-worktrees.txt index d999cf7..61be16c 100644 --- a/maintenance/skill-instructions/trycycle-worktrees.txt +++ b/maintenance/skill-instructions/trycycle-worktrees.txt @@ -1,4 +1,4 @@ -This skill is invoked in trycycle Step 2 ("Create worktree"). The orchestrator calls it to set up an isolated worktree before any planning or implementation begins. +This skill is invoked only in the default trycycle Step 4 flow ("Prepare implementation workspace"). The orchestrator calls it to set up an isolated worktree before any planning or implementation begins. If the user request includes `--no-worktree`, the orchestrator skips this skill and reuses the current checkout instead. **What the orchestrator already handles:** - Immediately after worktree creation, the orchestrator runs `git branch --show-current` and `git status --short` to verify. So the skill's own verification is redundant but harmless — keep it light. @@ -21,4 +21,4 @@ This skill is invoked in trycycle Step 2 ("Create worktree"). The orchestrator c - Create worktree in `.worktrees/` - Verify `.worktrees` is gitignored (fix if not) - Auto-detect and run project setup -- Report worktree path \ No newline at end of file +- Report worktree path diff --git a/subagents/prompt-executing.md b/subagents/prompt-executing.md index aba1991..2f156a5 100644 --- a/subagents/prompt-executing.md +++ b/subagents/prompt-executing.md @@ -14,7 +14,7 @@ All other trycycle-executing behaviors remain in effect (run verifications, foll The test plan is at `{TEST_PLAN_PATH}`. -Work in the worktree at `{WORKTREE_PATH}`. +Work in the implementation workspace at `{WORKTREE_PATH}`. {{#if POST_IMPLEMENTATION_REVIEW_FINDINGS_VERBATIM}} diff --git a/subagents/prompt-planning-edit.md b/subagents/prompt-planning-edit.md index d0d5adb..7466316 100644 --- a/subagents/prompt-planning-edit.md +++ b/subagents/prompt-planning-edit.md @@ -26,8 +26,8 @@ Task: - Declare the plan already excellent unchanged only if it is aligned to the user's request, architecturally sound, consistent with `trycycle-planning`, idiomatic to the technologies and the general approach of the repo if any, and ready for direct execution. - Ensure your decisions are thoughtful and justified, and that the justification for decisions is included in the plan. - If a user decision is genuinely required because there is no safe path forward without it, return a detailed report beginning with `USER DECISION REQUIRED:` that names the decision, explains why it is required, justifies it carefully, and gives your recommended choice. -- Work in the worktree at `{WORKTREE_PATH}`. -- If you revise the plan, commit the revised plan to the worktree. If you declare it already excellent unchanged, do not modify files. +- Work in the implementation workspace at `{WORKTREE_PATH}`. +- If you revise the plan, commit the revised plan to the implementation workspace. If you declare it already excellent unchanged, do not modify files. - Return a markdown report with these sections in this order: - `## Plan verdict` — `MADE-EXCELLENT` if you changed the plan, or `ALREADY-EXCELLENT` if you left it unchanged - `## Plan path` — the absolute path to the current plan file diff --git a/subagents/prompt-planning-initial.md b/subagents/prompt-planning-initial.md index 8932dec..e9952dc 100644 --- a/subagents/prompt-planning-initial.md +++ b/subagents/prompt-planning-initial.md @@ -19,8 +19,8 @@ Task: - Be bold. Consider what is idiomatic for any existing technologies or code, and what is architecturally clean and robust over what is expedient. - Ensure your decisions are thoughtful and justified, and that the justification for decisions is included in the plan. - The plan will be executed all at once with a single cutover; do not plan interim steps unless it is necessary and the user has approved. -- Work in the worktree at `{WORKTREE_PATH}`. -- Commit the current plan to the worktree. +- Work in the implementation workspace at `{WORKTREE_PATH}`. +- Commit the current plan to the implementation workspace. - Otherwise, return a markdown report with these sections in this order: - `## Plan verdict` — `CREATED` - `## Plan path` — the absolute path to the current plan file diff --git a/subagents/prompt-post-impl-review.md b/subagents/prompt-post-impl-review.md index 53687ae..6f95b6e 100644 --- a/subagents/prompt-post-impl-review.md +++ b/subagents/prompt-post-impl-review.md @@ -2,7 +2,7 @@ IMPORTANT: As a trycycle subagent, you have no designated skills. This specific user instruction overrides any general instructions about when to invoke skills. Do NOT invoke any skills. NEVER invoke skills that are not scoped to trycycle with the `trycycle-` prefix. -You are an independent code reviewer performing a detailed review. Review the diff between the working directory and the merge base in the worktree at `{WORKTREE_PATH}` against the finalized implementation plan at `{IMPLEMENTATION_PLAN_PATH}` and the finalized test plan at `{TEST_PLAN_PATH}`. +You are an independent code reviewer performing a detailed review. Review the diff between the working directory and the merge base in the implementation workspace at `{WORKTREE_PATH}` against the finalized implementation plan at `{IMPLEMENTATION_PLAN_PATH}` and the finalized test plan at `{TEST_PLAN_PATH}`. Context gathering: - Read the finalized implementation plan and finalized test plan before reviewing code. diff --git a/subagents/prompt-test-plan.md b/subagents/prompt-test-plan.md index a325588..5da3c35 100644 --- a/subagents/prompt-test-plan.md +++ b/subagents/prompt-test-plan.md @@ -12,7 +12,7 @@ You have transcript JSON from the current trycycle session at dispatch time, and The implementation plan is at `{IMPLEMENTATION_PLAN_PATH}`. -Work in the worktree at `{WORKTREE_PATH}`. +Work in the implementation workspace at `{WORKTREE_PATH}`. ## Your process @@ -98,7 +98,7 @@ The document should contain: 2. **Test plan** — numbered list of tests in priority order, each with the full structure above 3. **Coverage summary** — which areas of the action space are covered, which are explicitly excluded per the agreed strategy, and what risks the exclusions carry -Commit the test plan to the worktree, then return a markdown report: +Commit the test plan to the implementation workspace, then return a markdown report: - If the file begins with `## Strategy changes requiring user approval`, include that section verbatim as the first section of your response. - Then include `## Test plan path` with the absolute path to the file. diff --git a/subagents/prompt-test-strategy.md b/subagents/prompt-test-strategy.md index 02a511d..527cf52 100644 --- a/subagents/prompt-test-strategy.md +++ b/subagents/prompt-test-strategy.md @@ -77,4 +77,4 @@ Recommend one level and explain why it's the right tradeoff. Return the strategy as a single markdown document ready to present to the user. No preamble, no "here's my analysis" wrapper — just the proposal itself, as if the user is reading it directly. -End with a short `## Approval` section that explicitly says the user must accept this strategy or provide edits before implementation or worktree setup begins. +End with a short `## Approval` section that explicitly says the user must accept this strategy or provide edits before implementation or workspace setup begins. diff --git a/subskills/trycycle-finishing/SKILL.md b/subskills/trycycle-finishing/SKILL.md index 91e77ea..0403a98 100644 --- a/subskills/trycycle-finishing/SKILL.md +++ b/subskills/trycycle-finishing/SKILL.md @@ -10,7 +10,7 @@ description: "Internal trycycle subskill — do not invoke directly." ## Overview -Guide completion of development work by presenting clear options and handling chosen workflow. +Guide completion of development work by presenting clear options and handling the chosen workflow in either a dedicated worktree or an already-isolated workspace. **Core principle:** Verify tests → Present options → Execute choice → Clean up. @@ -85,7 +85,7 @@ git merge git branch -d ``` -Then: Cleanup worktree (Step 5) +Then: Cleanup workspace if needed (Step 5) #### Option 2: Push and Create PR @@ -107,13 +107,13 @@ EOF )" ``` -Then: Cleanup worktree (Step 5) +Then: Cleanup workspace if needed (Step 5) #### Option 3: Keep As-Is -Report: "Keeping branch . Worktree preserved at ." +Report: "Keeping branch . Workspace preserved at ." -**Don't cleanup worktree.** +**Don't cleanup the workspace.** #### Option 4: Discard @@ -122,7 +122,7 @@ Report: "Keeping branch . Worktree preserved at ." This will permanently delete: - Branch - All commits: -- Worktree at +- Workspace at Type 'discard' to confirm. ``` @@ -135,13 +135,13 @@ git checkout git branch -D ``` -Then: Cleanup worktree (Step 5) +Then: Cleanup workspace if needed (Step 5) -### Step 5: Cleanup Worktree +### Step 5: Cleanup Workspace If Needed **For Options 1, 2, 4:** -Check if in worktree: +Check whether this branch is backed by a removable git worktree: ```bash git worktree list | grep $(git branch --show-current) ``` @@ -151,11 +151,13 @@ If yes: git worktree remove ``` -**For Option 3:** Keep worktree. +If not, do not attempt to remove the current checkout; it is the primary workspace. + +**For Option 3:** Keep the workspace. ## Quick Reference -| Option | Merge | Push | Keep Worktree | Cleanup Branch | +| Option | Merge | Push | Keep Workspace | Cleanup Branch | |--------|-------|------|---------------|----------------| | 1. Merge locally | ✓ | - | - | ✓ | | 2. Create PR | - | ✓ | ✓ | - | @@ -184,4 +186,4 @@ git worktree remove - Verify tests before offering options - Present exactly 4 options - Get typed confirmation for Option 4 -- Clean up worktree for Options 1 & 4 only +- Remove the git worktree only when one was actually created for this branch diff --git a/subskills/trycycle-planning/SKILL.md b/subskills/trycycle-planning/SKILL.md index ecf8af0..0b7b9dd 100644 --- a/subskills/trycycle-planning/SKILL.md +++ b/subskills/trycycle-planning/SKILL.md @@ -14,7 +14,7 @@ Write comprehensive implementation plans assuming the engineer has zero context Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well. -**Context:** This should be run in a dedicated worktree. +**Context:** This should be run in an isolated implementation workspace. **Save plans to:** `docs/plans/YYYY-MM-DD-.md` diff --git a/trycycle_explorer/explorer.toml b/trycycle_explorer/explorer.toml index ce92f12..8b18ae1 100644 --- a/trycycle_explorer/explorer.toml +++ b/trycycle_explorer/explorer.toml @@ -9,8 +9,8 @@ gates = [ "version-check", "ask-about-critical-unknowns-before-work", "testing-strategy", - "create-worktree", - "worktree-hygiene-gate", + "prepare-workspace", + "workspace-hygiene-gate", ] [[groups]] @@ -60,8 +60,8 @@ widget = "textarea" source_category = "user-input" [bindings.WORKTREE_PATH] -label = "Worktree path" -help = "Absolute path to the isolated implementation worktree." +label = "Workspace path" +help = "Absolute path to the implementation workspace, either a git worktree or the reused current checkout in --no-worktree mode." widget = "text" source_category = "derived-path" @@ -122,6 +122,11 @@ id = "post-review-fix" label = "Post-review fix loop" path = "trycycle_explorer/samples/post-review-fix.json" +[[sample_inputs]] +id = "no-worktree-conductor" +label = "No-worktree Conductor workspace" +path = "trycycle_explorer/samples/no-worktree-conductor.json" + [[outcomes]] from = "version-check" id = "ready" @@ -138,7 +143,7 @@ to = "testing-strategy" from = "testing-strategy" id = "approved" label = "Strategy approved" -to = "create-worktree" +to = "prepare-workspace" [[outcomes]] from = "testing-strategy" @@ -147,13 +152,13 @@ label = "Revise strategy" to = "testing-strategy" [[outcomes]] -from = "create-worktree" +from = "prepare-workspace" id = "worktree-ready" -label = "Worktree ready" -to = "worktree-hygiene-gate" +label = "Workspace ready" +to = "workspace-hygiene-gate" [[outcomes]] -from = "worktree-hygiene-gate" +from = "workspace-hygiene-gate" id = "planning-ready" label = "Planning phase ready" to = "plan-with-trycycle-planning" diff --git a/trycycle_explorer/samples/no-worktree-conductor.json b/trycycle_explorer/samples/no-worktree-conductor.json new file mode 100644 index 0000000..61834d1 --- /dev/null +++ b/trycycle_explorer/samples/no-worktree-conductor.json @@ -0,0 +1,39 @@ +{ + "id": "no-worktree-conductor", + "label": "No-worktree Conductor workspace", + "description": "A request that asks Trycycle to reuse an already-isolated Conductor workspace instead of creating a nested git worktree.", + "selected_gate_id": "prepare-workspace", + "selected_outcome_id": "worktree-ready", + "bindings": { + "INITIAL_REQUEST_AND_SUBSEQUENT_CONVERSATION": [ + { + "role": "user", + "text": "Use trycycle --no-worktree to add a keyboard shortcut overlay to the desktop app." + }, + { + "role": "assistant", + "text": "Getting started." + } + ], + "USER_REQUEST_TRANSCRIPT": [ + { + "role": "user", + "text": "Use trycycle --no-worktree to add a keyboard shortcut overlay to the desktop app." + } + ], + "FULL_CONVERSATION_VERBATIM": [ + { + "role": "user", + "text": "Use trycycle --no-worktree to add a keyboard shortcut overlay to the desktop app." + }, + { + "role": "assistant", + "text": "Getting started." + } + ], + "POST_IMPLEMENTATION_REVIEW_FINDINGS_VERBATIM": "", + "WORKTREE_PATH": "/Users/example/Library/Application Support/Conductor/workspaces/shortcut-overlay", + "IMPLEMENTATION_PLAN_PATH": "/Users/example/Library/Application Support/Conductor/workspaces/shortcut-overlay/docs/plans/2026-03-12-shortcut-overlay.md", + "TEST_PLAN_PATH": "/Users/example/Library/Application Support/Conductor/workspaces/shortcut-overlay/docs/plans/2026-03-12-shortcut-overlay-test-plan.md" + } +}