IW-222: Agent-usable CLI — projects, worktrees, status + --prompt #229

Merged
mprihoda merged 20 commits from IW-222 into main 2026-02-27 22:07:50 +00:00
mprihoda commented 2026-02-26 14:07:22 +00:00 (Migrated from github.com)

Summary

Adds agent-facing CLI primitives and architecture cleanup for IW-222.

Architecture Cleanup

  • Moved ServerClient, ServerConfigRepository, ProcessManager from dashboard/ to adapters/
  • Moved FeedbackParser, ServerLifecycleService from dashboard/ to model/
  • Extracted ServerStateCodec from StateRepository for shared JSON codecs
  • All commands now import from correct layers (no dashboard/ imports)

New Commands

  • iw projects [--json] — list registered projects from state.json
  • iw worktrees [--all] [--json] — list worktrees for current project
  • iw status [issue-id] [--json] — detailed worktree status with live git data

Agent Integration

  • iw start --prompt <text> <issue-id> — create worktree + launch claude agent
  • iw open --prompt <text> [issue-id] — open worktree + launch claude agent
  • Single-quote shell escaping for safe prompt injection via tmux

Implementation Phases

  1. Domain LayerProjectPath, ServerStateCodec, value objects (ProjectSummary, WorktreeSummary, WorktreeStatus)
  2. Infrastructure Layer — adapter moves, StateReader, TmuxAdapter.sendKeys
  3. Presentation Layerprojects, worktrees, status commands with formatters
  4. Presentation Layer--prompt flag for start/open

Testing

  • Unit tests: 50+ new tests (codecs, formatters, adapters)
  • E2E tests: 32+ new BATS tests (new commands + --prompt)
  • All existing tests pass

Test plan

  • iw projects and iw projects --json show registered projects
  • iw worktrees and iw worktrees --json show worktrees for current project
  • iw status ISSUE-ID and iw status --json show detailed status
  • iw start --prompt "text" ISSUE-ID creates worktree and sends claude command
  • iw open --prompt "text" ISSUE-ID opens session and sends claude command
  • All existing commands (start, open, rm, issue, etc.) work unchanged

🤖 Generated with Claude Code

## Summary Adds agent-facing CLI primitives and architecture cleanup for IW-222. ### Architecture Cleanup - Moved `ServerClient`, `ServerConfigRepository`, `ProcessManager` from `dashboard/` to `adapters/` - Moved `FeedbackParser`, `ServerLifecycleService` from `dashboard/` to `model/` - Extracted `ServerStateCodec` from `StateRepository` for shared JSON codecs - All commands now import from correct layers (no `dashboard/` imports) ### New Commands - `iw projects [--json]` — list registered projects from state.json - `iw worktrees [--all] [--json]` — list worktrees for current project - `iw status [issue-id] [--json]` — detailed worktree status with live git data ### Agent Integration - `iw start --prompt <text> <issue-id>` — create worktree + launch claude agent - `iw open --prompt <text> [issue-id]` — open worktree + launch claude agent - Single-quote shell escaping for safe prompt injection via tmux ## Implementation Phases 1. **Domain Layer** — `ProjectPath`, `ServerStateCodec`, value objects (`ProjectSummary`, `WorktreeSummary`, `WorktreeStatus`) 2. **Infrastructure Layer** — adapter moves, `StateReader`, `TmuxAdapter.sendKeys` 3. **Presentation Layer** — `projects`, `worktrees`, `status` commands with formatters 4. **Presentation Layer** — `--prompt` flag for `start`/`open` ## Testing - **Unit tests:** 50+ new tests (codecs, formatters, adapters) - **E2E tests:** 32+ new BATS tests (new commands + --prompt) - All existing tests pass ## Test plan - [ ] `iw projects` and `iw projects --json` show registered projects - [ ] `iw worktrees` and `iw worktrees --json` show worktrees for current project - [ ] `iw status ISSUE-ID` and `iw status --json` show detailed status - [ ] `iw start --prompt "text" ISSUE-ID` creates worktree and sends claude command - [ ] `iw open --prompt "text" ISSUE-ID` opens session and sends claude command - [ ] All existing commands (`start`, `open`, `rm`, `issue`, etc.) work unchanged 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.