From a9902693db85e789ece8926db2e2a1c49be02915 Mon Sep 17 00:00:00 2001 From: JJ Lee Date: Tue, 8 Sep 2026 15:52:41 -0400 Subject: [PATCH] fix(skills): inline environment creation instead of session spawn (#895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both create-research-project (Stage 8) and migrate-research-project (Phase 6) now run the environment creation interview inline in the same chat instead of spawning a child session via amicode_session. The session-to-session chaining mechanism is not reliable yet — running inline is simpler and works now. The 'Create new' option now walks through the create-research-environment skill's 6 stages directly, calls amico env create, and binds the project in the same conversation. --- .../skills/create-research-project/SKILL.md | 30 +++++++--------- .../skills/migrate-research-project/SKILL.md | 34 +++++++++---------- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/packages/extension/skills/create-research-project/SKILL.md b/packages/extension/skills/create-research-project/SKILL.md index d49c1b52..cfe6d36a 100644 --- a/packages/extension/skills/create-research-project/SKILL.md +++ b/packages/extension/skills/create-research-project/SKILL.md @@ -94,30 +94,26 @@ skip this stage silently and move to Execution. Choice question with options (in this order): - One option per registered environment (label = environment name, description = slug and path) -- "Create new" — spawn a `create-research-environment` session +- "Create new" — create a new environment inline (see below) - "Skip" — no environment binding **If the user selects a registered environment:** record the slug to pass to `amico env bind` after project creation. -**If the user selects "Create new":** after the project is created, use the -`amicode_session` tool to spawn a new session tab with the `command` parameter -set to invoke the skill directly: +**If the user selects "Create new":** run the environment creation interview +**inline in this chat** — do NOT spawn a new session. Walk through the +`create-research-environment` skill's 6 stages right here: -``` -amicode_session( - command: "create-research-environment", - prompt: "--bind-project \"\"" -) -``` - -The `command` parameter uses the engine's command API to invoke the -`create-research-environment` skill reliably — it does not depend on the child -LLM parsing a `/skill-name` prefix from the prompt text. The `prompt` becomes -the skill's arguments (the child session will parse `--bind-project` from it). +1. Ask for the environment name (default: infer from the project's domain) +2. System/domain (optional) +3. Research field (optional) +4. Description (optional) +5. Tags (optional) +6. GitHub remote (optional) -Tell the user: "I've opened a new tab to create the environment — head over -there and I'll bind it to this project when it's done." +Then run `amico env create "" --path "" [flags]` where `` is a +sibling directory to the project (default: `../` next to the project +dir). After creation, record the slug for binding in the post-execution step. **If the user selects "Skip":** proceed to Execution with no binding. diff --git a/packages/extension/skills/migrate-research-project/SKILL.md b/packages/extension/skills/migrate-research-project/SKILL.md index abd2dc46..7d1ffb68 100644 --- a/packages/extension/skills/migrate-research-project/SKILL.md +++ b/packages/extension/skills/migrate-research-project/SKILL.md @@ -274,7 +274,7 @@ Read the registry and present a choice via the `question` tool: - One option per registered environment (label = environment name, description = slug and path) -- "Create new" — spawn a `create-research-environment` session +- "Create new" — create a new environment inline (see below) - "Skip" — no environment binding **If the user selects a registered environment:** write the `[environment]` @@ -292,23 +292,21 @@ Append this to the end of the file. This preserves all existing content Then commit: `git add research-project.toml && git commit -m "bind to environment "` -**If the user selects "Create new":** use the `amicode_session` tool to spawn -a new session tab with the `command` parameter set to invoke the skill directly: - -``` -amicode_session( - command: "create-research-environment", - prompt: "--bind-project \"\"" -) -``` - -The `command` parameter uses the engine's command API to invoke the -`create-research-environment` skill reliably — it does not depend on the child -LLM parsing a `/skill-name` prefix from the prompt text. The `prompt` becomes -the skill's arguments (the child session will parse `--bind-project` from it). - -Tell the user: "I've opened a new tab to create the environment — head over -there and I'll bind it to this project when it's done." +**If the user selects "Create new":** run the environment creation interview +**inline in this chat** — do NOT spawn a new session. Walk through the +`create-research-environment` skill's 6 stages right here: + +1. Ask for the environment name (default: infer from the project's domain) +2. System/domain (optional) +3. Research field (optional) +4. Description (optional) +5. Tags (optional) +6. GitHub remote (optional) + +Then run `amico env create "" --path "" [flags]` where `` is a +sibling directory to the project (default: `../` next to the project +dir). After creation, bind the project by appending the `[environment]` section +to `research-project.toml` (same as above) and commit. **If the user selects "Skip":** no action needed. The project can be bound later via Command Palette ("Amicode: Bind to Environment") or `amico env bind`.