Finished a few more stories

This commit is contained in:
Dave
2026-02-19 14:53:44 +00:00
parent 959755cd6e
commit 9864e0a9e6
3 changed files with 47 additions and 0 deletions

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@ yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
node_modules
frontend/node_modules frontend/node_modules
frontend/dist frontend/dist
frontend/dist-ssr frontend/dist-ssr

View File

@@ -0,0 +1,46 @@
# Story 32: Worktree-Based Agent Orchestration
## User Story
As a user, I want to press a button in the frontend to spin up an agent that works on a story in its own git worktree, so that multiple stories can be worked on concurrently without branch conflicts.
## Acceptance Criteria
- [ ] The Rust binary can create a git worktree for a given story, on a new feature branch.
- [ ] The Rust binary can remove a git worktree and clean up the feature branch after story completion.
- [ ] Project-specific setup commands (e.g., dependency install) are configurable per-project, not hardcoded to any language or framework.
- [ ] The Rust binary can spawn an agent process (e.g., Claude Code CLI) pointed at the worktree directory.
- [ ] The backend exposes an API endpoint to start an agent for a given story (creates worktree, runs setup, spawns agent).
- [ ] The backend exposes an API endpoint to stop a running agent and optionally tear down its worktree.
- [ ] The backend tracks running agents and their status (idle/running/done/error).
- [ ] The frontend displays a "Run" button on stories that are ready to be worked on.
- [ ] The frontend shows agent status (running/done/error) for active stories.
- [ ] Agent stdout/stderr is streamed to the frontend in real time (via WebSocket or SSE).
## Configuration
Agent and worktree behavior is driven by a project-level config file (e.g., `.story_kit/config.toml`), keeping the Rust binary language-agnostic. Projects can define multiple components, each with their own working directory and setup/teardown commands:
```toml
[[component]]
name = "server"
path = "." # relative to worktree root
setup = ["cargo check"]
teardown = []
[[component]]
name = "frontend"
path = "frontend"
setup = ["pnpm install"]
teardown = []
[agent]
command = "claude"
args = ["--print", "--directory", "{{worktree_path}}"]
prompt = "Read .story_kit/README.md, then pick up story {{story_id}}"
```
Components are set up in order. Each `path` is relative to the worktree root.
## Out of Scope
- Coordinating merges to master when multiple agents finish simultaneously (see Story 31).
- Lock file implementation for multi-agent conflict prevention (see Story 31).
- Port management for dev servers within worktrees.
- Agent-to-agent communication.