Skip to content

Wire '+ New Project' button: OS picker → create-research-project skill session (#673) #698

Description

@jeonghun-jj-lee

Important

Problem — The sidebar's "+ New Project" button fires amicode.newProject but the command is never registered. Users have no way to create a research project from the sidebar. The entire chain (webview click, bridge dispatch, handler) exists and routes to a dead command.

Approach — Wire the dead amicode.newProject command using the proven PR #362 pattern: register the command in extension.ts, show an OS folder picker (parent directory) then a VS Code input box (project name), create the directory, add it to the workspace, and launch a fresh chat session via ChatPanel.openNew + navigate bridge message with /create-research-project auto-sent. A new create-research-project skill interviews the user for research-project.toml fields (question, venue, collaborators, tags, domain pack) and delegates to amico project create.

Scope — in: command registration, OS picker + input box flow, create-research-project skill, session launch with auto-sent skill prompt. out: sidebar UI changes (the button already exists), amico project create CLI changes, project detection logic changes.

Assumptions — The navigate bridge kind and ChatPanel.openNew + navigateToPath API from PR #362 are merged and available. The amico project create CLI accepts --path, --question, --venue, --deadline, --author, --domain flags. The sidebar filesystem watcher re-detects project type when research-project.toml appears.

Acceptance Criteria

  • Clicking "+ New Project" in the sidebar opens a native OS folder picker titled "Choose a location for your new project"
  • After selecting a parent directory, a VS Code input box prompts for the project name
  • The directory <parent>/<slugified-name> is created and added to the workspace (visible in sidebar immediately)
  • A fresh chat session opens in a new tab with /create-research-project auto-invoked, carrying the project name and path
  • The create-research-project skill asks for: research question (required), venue (optional), deadline (conditional on venue), collaborators (optional), tags (optional), domain pack (optional)
  • The skill delegates to amico project create with the collected flags; the CLI scaffolds directories, writes research-project.toml, and runs git init
  • After the skill completes, the sidebar re-detects the project as "research" type (filesystem watcher picks up the new toml)
  • Cancelling the OS picker or escaping the input box is a silent no-op
  • If the opencode server is not ready, a warning message is shown instead of launching

Testing Decisions

Extend the existing sidebar_view.test.ts suite for the command registration and message handling. The skill itself is a SKILL.md (data, not code) and is tested by the repertoire lint gate.

Key Decisions

  1. Parent picker + input box over raw OS folder picker. The OS dialog's "New Folder" gesture is a two-step (create then select). Picking a parent then naming the project is one gesture each and gives us a clean slug from the name.
  2. Immediate workspace addition before the skill runs. The directory appears as "dev" type for ~30s until research-project.toml is written. This is acceptable because the sidebar filesystem watcher handles the re-detection automatically, and the user sees their project appear right away rather than waiting for the full interview.
  3. Skill delegates to amico project create CLI rather than handling scaffolding directly. Single source of truth for project structure. The CLI is idempotent on existing directories (mkdirSync({ recursive: true })).
  4. Session launch via PR feat: Fleet Panel & Profile UI (#350) #362's navigate bridge pattern: ChatPanel.openNew() + navigateToPath("/new-session?prompt=...&autoSend=1"). Proven, tested, handles the relay script and TabsProvider draft tab creation.

Constraints & Invariants

  • The SidebarUpMessage union already includes new-project kind and the bridge dispatches it to handlers.newProject() — this wiring must not be duplicated or changed.
  • The ProjectToml schema in packages/amico-run/src/project.ts is the source of truth for required/optional fields.
  • The skill must use the question tool for the interview (one question at a time), not prose prompts.

Prior Art

  • PR feat: Fleet Panel & Profile UI (#350) #362: fleet panel buttons launching sessions via ChatPanel.openNew + navigate bridge message + autoSend=1
  • addExistingProject() in sidebar_view.ts: the existing flow for adding folders to workspace via showOpenDialog + updateWorkspaceFolders
  • amico project create CLI in packages/amico-run/src/project_verb.ts: the scaffolding + toml + git init path
  • migrate-research-project skill: the existing skill for converting repos (different use case, but similar interview pattern)

Source

Sub-issue of #673 (Replace native TreeView sidebar with a webview sidebar)

Notes

The --author flag for amico project create should be populated from the user's profile (~/.amico/profile.json name field) when available, so the skill pre-fills the lead author without asking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions