diff --git a/AGENTS.md b/AGENTS.md index 586fb818..7b680bc4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ Guidance for AI agents (Claude Code, Codex, etc.) working in this repository. `C ## Project Overview -dotbot is a structured AI-assisted development framework built entirely in **PowerShell 7+**. It wraps AI coding workflows in managed, auditable processes with two-phase execution (analysis → implementation), per-task git worktree isolation, and a web dashboard for monitoring. +dotbot is a structured AI-assisted development framework built entirely in **PowerShell 7+**. It wraps AI coding workflows in managed, auditable processes with single-session task execution, per-task git worktree isolation, and a web dashboard for monitoring. ## Commands @@ -61,10 +61,9 @@ The PowerShell framework (`src/runtime/`, `src/mcp/`, `src/ui/`, `src/cli/`, `sr `src/runtime/Modules/ContentResolver/` implements project-over-framework lookup. A project can override any content item (agents/skills/prompts/workflows/stacks/recipes) by placing it under `/content//`, or override hook scripts by placing them under `/hooks//`; the runtime falls back to `` otherwise. Merge is by filename — a project file replaces the framework file of the same name; framework-only files still run. APIs: `Resolve-DotbotContent`, `Get-DotbotContentItems`, `Get-DotbotHookChain`. -### Two-phase execution +### Single-session execution -1. **Analysis** (`98-analyse-task.md`): explores codebase, builds context package, may propose splits. Task: `todo → analysing → analysed`. -2. **Implementation** (`99-autonomous-task.md`): consumes context, writes code, tests, commits with `[task:XXXXXXXX]` tag. Task: `analysed → in-progress → done`. +Each task runs in one provider session driven by `100-single-session-task.md`. That session handles discovery, implementation, verification, and commit (with a `[task:XXXXXXXX]` tag), then marks the task done. If human input is needed it pauses on `needs-input` and resumes the same task. Task lifecycle: `todo -> analysing -> analysed -> in-progress -> done`; the task-runner auto-promotes through `analysing`/`analysed` (there is no separate analysis provider session). ### Git worktree isolation diff --git a/README.md b/README.md index 6fcdad19..98ad9ed3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ dotbot wraps AI-assisted coding in a managed, transparent workflow where every s - **Workflows and stacks** - **Workflows** (e.g. `start-from-jira`) define operational pipelines - what dotbot does. **Stacks** (e.g. `dotnet`, `dotnet-blazor`) add tech-specific skills, hooks, and MCP tools - what tech the project uses. Stacks compose additively with `extends` chains. Settings deep-merge across `default -> workflows -> stacks`. ### Execution engine -- **Two-phase execution** - Analysis resolves ambiguity, identifies files, and builds a context package. Implementation consumes that package and writes code. Tasks flow: `todo -> analysing -> analysed -> in-progress -> done`. +- **Single-session execution** - Each task runs in one provider session that does discovery, implementation, verification, and commit, pausing only when human input is needed. Tasks flow: `todo -> analysing -> analysed -> in-progress -> done`. - **Per-task git worktree isolation** - Each task runs in its own worktree on an isolated branch, squash-merged back to main on completion. - **Per-task model selection** - Tasks can specify a model (e.g. Sonnet for simple tasks, Opus for complex ones) that overrides the process-level default. Use cheaper models where they suffice to reduce token spend. - **Multi-slot concurrent execution** - The workflow engine runs multiple tasks from the same workflow in parallel with slot-aware locking, shortening wall-clock time for large task queues. diff --git a/content/prompts/00-interview.md b/content/prompts/00-interview.md new file mode 100644 index 00000000..62de6751 --- /dev/null +++ b/content/prompts/00-interview.md @@ -0,0 +1,84 @@ +# Clarification Interview + +You are conducting a clarification interview for a software project. The user's +short project description appears below. Each round, decide one thing: do you +have enough clarity to proceed, or must you ask the user targeted questions +first? + +Each round you write EXACTLY ONE file to `.bot/workspace/product/`: + +- `clarification-questions.json` -- you still need answers. The loop pauses, + collects the user's answers, then runs you again with those answers in + context. +- `interview-summary.md` -- you have enough clarity. The interview ends. + +NEVER write both in the same round. Do not write any other files (no +`mission.md`, no `tech-stack.md`). Do not use task-management tools. + +## When to ask vs finish + +Ask a question only when a genuine ambiguity would change the design, scope, or +technology AND you cannot resolve it from the description, the briefing files, +or previous rounds. Finish when the only unknowns left are ordinary +implementation details a developer can settle later. + +If a previous round already answered a question, do NOT re-ask it. Build on the +answer. + +## clarification-questions.json schema + +The loop validates this file strictly. A malformed file fails the task. Match +this shape exactly: + +{ + "questions": [ + { + "id": "q1", + "question": "One clear, specific question. Do not inline the choices here.", + "context": "Why this matters -- what is ambiguous and what the answer changes.", + "options": [ + { "key": "A", "label": "First option, short noun phrase", "rationale": "Why you might pick this" }, + { "key": "B", "label": "Second option", "rationale": "Why you might pick this" } + ], + "recommendation": "A" + } + ] +} + +Hard rules (the validator rejects the file otherwise): + +- `questions` is a non-empty array. +- Each question has a non-empty `question` string. +- `options` is REQUIRED and is an array of OBJECTS. Never plain strings. Never + inline the choices as text in the `question` field. +- Each option is an object with `key` and `label`. `key` is a single uppercase + letter: A, B, C, D, or E, unique within the question. `label` is a non-empty + short phrase. `rationale` is optional but recommended. +- Each question has 2 to 5 options. +- `recommendation`, if present, must equal one of the option keys. Put the + recommended choice as option `A`. +- `context` is optional but recommended. + +Ask only as many questions as genuinely needed. Fewer, sharper questions beat +many shallow ones. + +## interview-summary.md format + +When you have enough clarity, write a short markdown summary: + +# Interview Summary + +## Project +One paragraph restating what is being built. + +## Key Decisions +- Bullet the choices that are now settled (from the description, the briefing, + or answered questions). + +## Clarification Log +One row per answered question across all rounds. Omit this whole section if no +questions were ever asked. + +| # | Question | Answer | Interpretation | +|---|----------|--------|----------------| +| q1 | ... | ... | ... | diff --git a/content/prompts/100-single-session-task.md b/content/prompts/100-single-session-task.md index 8e6ecc72..8378d6d4 100644 --- a/content/prompts/100-single-session-task.md +++ b/content/prompts/100-single-session-task.md @@ -12,12 +12,12 @@ You are an autonomous AI coding agent. Complete this task in the current provide Built-in tools (`Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep`, `WebSearch`, `WebFetch`) are always available. Do not use ToolSearch for them. -The Bash tool runs Bash, not PowerShell. If you need PowerShell semantics, run `pwsh -Command "