agent-planner-mcp 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,335 +0,0 @@
1
- # Autonomous Plan Execution Guide
2
-
3
- This directory is configured for autonomous plan execution using Claude Code with the MCP planning system.
4
-
5
- ## System Architecture
6
-
7
- ```
8
- ┌─────────────────────────────────────────────────────────────┐
9
- │ Claude Code │
10
- │ ┌────────────────┐ ┌────────────────┐ ┌───────────────┐ │
11
- │ │ Slash Commands │→│ Task Tool │→│ MCP Planning │ │
12
- │ │ (Orchestrator) │ │ (Executors) │ │ System (Data) │ │
13
- │ └────────────────┘ └────────────────┘ └───────────────┘ │
14
- └─────────────────────────────────────────────────────────────┘
15
- ↓ ↓ ↓
16
- /execute-plan general-purpose Persistent Storage
17
- /create-plan agents (plans, tasks, logs)
18
- /plan-status
19
- ```
20
-
21
- ## Quick Start
22
-
23
- ### 1. Create a Plan
24
-
25
- ```bash
26
- # In Claude Code CLI, run:
27
- /create-plan
28
- ```
29
-
30
- This interactive command will guide you through:
31
- - Defining your plan title and description
32
- - Breaking it into phases
33
- - Creating specific tasks with acceptance criteria
34
- - Adding agent instructions for autonomous execution
35
-
36
- ### 2. Execute the Plan
37
-
38
- ```bash
39
- # Start autonomous execution:
40
- /execute-plan <plan-id>
41
- ```
42
-
43
- Claude will:
44
- - Load the plan from MCP
45
- - Work through tasks one by one
46
- - Launch specialized Task agents for each task
47
- - Update status in real-time
48
- - Log all progress
49
- - Report completion or blockers
50
-
51
- ### 3. Monitor Progress
52
-
53
- ```bash
54
- # Check status anytime:
55
- /plan-status <plan-id>
56
- ```
57
-
58
- Shows:
59
- - Overall progress (% complete)
60
- - Current task being worked on
61
- - Any blockers
62
- - Recent activity
63
- - Next suggested actions
64
-
65
- ## Available Commands
66
-
67
- ### `/create-plan`
68
- Interactive plan builder that helps you structure work into phases and tasks.
69
-
70
- **When to use**: Starting a new feature, bug fix, refactoring, or any multi-step work.
71
-
72
- **Output**: A complete plan with hierarchical structure stored in MCP.
73
-
74
- ### `/execute-plan <plan-id>`
75
- Autonomous execution orchestrator that works through tasks systematically.
76
-
77
- **When to use**: After creating a plan, or to resume interrupted execution.
78
-
79
- **What it does**:
80
- - Fetches tasks from the plan
81
- - Executes them one by one using Task agents
82
- - Updates MCP with progress
83
- - Handles errors and blockers
84
- - Reports final summary
85
-
86
- ### `/plan-status <plan-id>`
87
- Real-time status reporter showing plan progress and activity.
88
-
89
- **When to use**: Check progress during execution, review completed work, identify blockers.
90
-
91
- **Output**: Formatted report with statistics, task breakdown, and recent activity.
92
-
93
- ## How Autonomous Execution Works
94
-
95
- ### The Execution Loop
96
-
97
- 1. **Fetch Plan**: Load plan structure from MCP
98
- 2. **Find Next Task**: Get first task with status "not_started"
99
- 3. **Get Context**: Load task details, acceptance criteria, agent instructions
100
- 4. **Update Status**: Mark task as "in_progress" in MCP
101
- 5. **Execute**: Launch Task agent with full context
102
- 6. **Wait**: Agent works autonomously (reads code, makes changes, runs tests)
103
- 7. **Process Result**:
104
- - If successful → Mark "completed", log progress, move to next task
105
- - If blocked → Mark "blocked", log issue, ask user for guidance
106
- 8. **Repeat**: Continue until all tasks done or blocked
107
-
108
- ### Task Agent Execution
109
-
110
- Each task gets a dedicated `general-purpose` agent that:
111
- - Has access to all Claude Code tools (Read, Write, Edit, Bash, etc.)
112
- - Receives full task context from the plan
113
- - Works autonomously to complete the task
114
- - Reports back with summary of changes
115
- - Verifies acceptance criteria are met
116
-
117
- ### State Management
118
-
119
- All state is stored in the MCP planning system:
120
- - **Plans**: Title, description, status (draft/active/completed)
121
- - **Nodes**: Hierarchical tasks/phases/milestones
122
- - **Logs**: Activity timeline (progress, challenges, decisions)
123
- - **Artifacts**: File references and resources
124
-
125
- **Key benefit**: Execution can be interrupted and resumed. State persists across sessions.
126
-
127
- ## Writing Good Plans
128
-
129
- ### Task Structure
130
-
131
- Each task should have:
132
-
133
- 1. **Clear Title**: "Create user authentication API endpoint"
134
- 2. **Description**: What needs to be done and why
135
- 3. **Acceptance Criteria**:
136
- - Specific, measurable outcomes
137
- - "API returns 200 on valid credentials"
138
- - "Returns 401 on invalid credentials"
139
- - "Integration tests pass with 80%+ coverage"
140
- 4. **Agent Instructions**:
141
- - Specific file paths or patterns to follow
142
- - Technologies/frameworks to use
143
- - Testing requirements
144
- - Related files to reference
145
-
146
- ### Example: Good vs. Bad Tasks
147
-
148
- ❌ **Bad Task**:
149
- ```
150
- Title: Add login
151
- Description: Add login functionality
152
- Acceptance Criteria: Login works
153
- Agent Instructions: Add login
154
- ```
155
-
156
- ✅ **Good Task**:
157
- ```
158
- Title: Create login API endpoint
159
- Description: Add POST /api/v1/auth/login endpoint that validates credentials and returns JWT token
160
- Acceptance Criteria:
161
- - Endpoint accepts email and password
162
- - Returns JWT token on valid credentials
163
- - Returns 401 on invalid credentials
164
- - Returns 400 on missing fields
165
- - Integration tests pass with 80%+ coverage
166
- - Swagger docs updated
167
- Agent Instructions:
168
- Create route in agent-planner/src/routes/auth.routes.js following pattern in users.routes.js.
169
- Create controller in src/controllers/auth.controller.js.
170
- Use bcrypt for password hashing.
171
- Generate JWT using jsonwebtoken library.
172
- Add validation middleware using express-validator.
173
- Write integration tests in tests/integration/auth.test.js.
174
- Run 'npm test' to verify.
175
- Update API docs with 'npm run docs:all'.
176
- ```
177
-
178
- ### Task Ordering
179
-
180
- Consider dependencies:
181
- 1. Database migrations before API endpoints
182
- 2. API endpoints before frontend components
183
- 3. Core functionality before tests
184
- 4. Tests before documentation
185
-
186
- ## Project Context
187
-
188
- The orchestrator and agents have access to CLAUDE.md which provides:
189
- - Multi-repo structure (backend, frontend, MCP, homepage)
190
- - Development commands for each repo
191
- - Testing patterns
192
- - Authentication flow
193
- - Database migration system
194
- - Deployment procedures
195
-
196
- Agents automatically reference this context when executing tasks.
197
-
198
- ## Backend-Specific Tasks
199
-
200
- For backend tasks (migrations, API endpoints, database):
201
- - Agents know to use `npm run db:init` after creating migrations
202
- - Follow patterns in src/routes/*.routes.js and src/controllers/*.controller.js
203
- - Add RLS policies for security
204
- - Update API docs with `npm run docs:all`
205
- - Run appropriate test suites
206
-
207
- ## Frontend-Specific Tasks
208
-
209
- For frontend tasks (components, pages, hooks):
210
- - Agents use React + TypeScript patterns
211
- - Follow Tailwind CSS conventions
212
- - Create components in src/components/
213
- - Use React Query for server state
214
- - Write tests with React Testing Library
215
-
216
- ## Tips for Success
217
-
218
- 1. **Be Specific**: Vague tasks lead to vague implementations
219
- 2. **One Thing Per Task**: Don't combine multiple concerns
220
- 3. **Clear Success Criteria**: Agent needs to know when done
221
- 4. **Reference Existing Code**: Help agents find patterns
222
- 5. **Include Testing**: Every code task should mention tests
223
- 6. **Review Agent Instructions**: These guide the autonomous agent
224
-
225
- ## Troubleshooting
226
-
227
- ### "Plan not found"
228
- - Check plan ID is correct
229
- - List plans with `/plan-status` (no ID) to see available plans
230
-
231
- ### "Task is blocked"
232
- - Check logs with `/plan-status <plan-id>`
233
- - Review what blocked the task
234
- - Update agent instructions if needed
235
- - Manually unblock or fix issue, then change status back to "not_started"
236
-
237
- ### "Agent didn't follow instructions"
238
- - Review agent_instructions in the task
239
- - Make them more specific with file paths and patterns
240
- - Reference similar existing code to follow
241
- - Update task and retry
242
-
243
- ### Execution interrupted
244
- - No problem! Just run `/execute-plan <plan-id>` again
245
- - It will resume from where it left off
246
- - All progress is saved in MCP
247
-
248
- ## MCP Configuration
249
-
250
- Your `.claude/settings.local.json` should include:
251
-
252
- ```json
253
- {
254
- "permissions": {
255
- "allow": [
256
- "mcp__planning-system__create_node",
257
- "mcp__planning-system__create_plan",
258
- "mcp__planning-system__add_log",
259
- "mcp__planning-system__get_plan_summary",
260
- "mcp__planning-system__batch_update_nodes",
261
- "mcp__planning-system__update_node"
262
- ]
263
- }
264
- }
265
- ```
266
-
267
- These permissions let Claude autonomously update plans without asking for approval each time.
268
-
269
- ## Example Workflow
270
-
271
- ```bash
272
- # 1. Create a plan
273
- /create-plan
274
- # → Follow prompts to create "Feature: User Notifications" plan
275
- # → Plan ID: abc-123
276
-
277
- # 2. Execute autonomously
278
- /execute-plan abc-123
279
- # → Claude works through all tasks
280
- # → Creates migration
281
- # → Adds API endpoints
282
- # → Creates frontend components
283
- # → Writes tests
284
- # → Reports completion
285
-
286
- # 3. Check status anytime (in another session if needed)
287
- /plan-status abc-123
288
- # → Shows progress: 8/10 tasks complete
289
- # → 2 tasks in progress
290
-
291
- # 4. When done
292
- /plan-status abc-123
293
- # → Shows: All tasks completed!
294
- ```
295
-
296
- ## Advanced: Manual MCP Tool Usage
297
-
298
- You can also use MCP tools directly:
299
-
300
- ```javascript
301
- // List all plans
302
- mcp__planning-system__list_plans()
303
-
304
- // Create a plan
305
- mcp__planning-system__create_plan({
306
- title: "Feature: Dark Mode",
307
- description: "Add dark mode support across the app"
308
- })
309
-
310
- // Add a task
311
- mcp__planning-system__create_node({
312
- plan_id: "abc-123",
313
- node_type: "task",
314
- title: "Create dark mode toggle component",
315
- acceptance_criteria: "Toggle switches theme, persists preference"
316
- })
317
-
318
- // Update status
319
- mcp__planning-system__update_node({
320
- plan_id: "abc-123",
321
- node_id: "task-456",
322
- status: "completed"
323
- })
324
- ```
325
-
326
- But using the slash commands is much easier!
327
-
328
- ## Next Steps
329
-
330
- 1. Try creating a simple 2-3 task plan with `/create-plan`
331
- 2. Run `/execute-plan` and watch it work
332
- 3. Monitor with `/plan-status`
333
- 4. Iterate and refine your task definitions
334
-
335
- Happy autonomous coding! 🚀
@@ -1,112 +0,0 @@
1
- # Claude Code Slash Commands
2
-
3
- Custom slash commands for autonomous plan execution in the Talking Agents project.
4
-
5
- ## Available Commands
6
-
7
- ### `/create-plan`
8
- Interactive plan builder that guides you through creating a structured development plan.
9
-
10
- **Usage**: `/create-plan`
11
-
12
- **What it does**:
13
- - Asks for plan title and description
14
- - Helps break work into phases
15
- - Creates specific tasks with acceptance criteria
16
- - Adds agent instructions for autonomous execution
17
- - Stores everything in MCP planning system
18
-
19
- ### `/execute-plan`
20
- Autonomous execution orchestrator that works through plan tasks systematically.
21
-
22
- **Usage**: `/execute-plan <plan-id>` or `/execute-plan` (will prompt for ID)
23
-
24
- **What it does**:
25
- - Loads plan from MCP
26
- - Executes tasks sequentially using Task agents
27
- - Updates status in real-time
28
- - Logs all progress
29
- - Handles blockers and errors
30
- - Reports final summary
31
-
32
- ### `/plan-status`
33
- Status reporter showing plan progress and recent activity.
34
-
35
- **Usage**: `/plan-status <plan-id>` or `/plan-status` (will list all plans)
36
-
37
- **What it does**:
38
- - Shows overall progress statistics
39
- - Lists all tasks with current status
40
- - Highlights blockers
41
- - Shows recent activity logs
42
- - Suggests next actions
43
-
44
- ## How They Work Together
45
-
46
- ```
47
- 1. /create-plan
48
-
49
- Creates structured plan in MCP
50
-
51
- 2. /execute-plan <plan-id>
52
-
53
- Executes tasks autonomously
54
-
55
- 3. /plan-status <plan-id>
56
-
57
- Monitor progress anytime
58
- ```
59
-
60
- ## Requirements
61
-
62
- - MCP planning system must be configured and running
63
- - `.claude/settings.local.json` must have MCP permissions enabled
64
- - See AUTONOMOUS_EXECUTION_GUIDE.md for full setup details
65
-
66
- ## Examples
67
-
68
- ### Creating and executing a plan
69
- ```
70
- > /create-plan
71
- Claude: What is this plan for?
72
- You: Add user profile editing feature
73
-
74
- Claude: Let me help you break this down...
75
- [Interactive prompts follow]
76
-
77
- Claude: Plan created! Plan ID: plan_abc123
78
-
79
- > /execute-plan plan_abc123
80
- Claude: Starting execution...
81
- Task 1/5: Create migration... ✅ Complete
82
- Task 2/5: Add API endpoint... ✅ Complete
83
- Task 3/5: Create UI component... 🔄 In progress...
84
- ```
85
-
86
- ### Checking status
87
- ```
88
- > /plan-status plan_abc123
89
- # Plan Status Report
90
-
91
- ## 📋 Plan: Add user profile editing feature
92
- **Status**: active
93
- **Progress**: 3/5 tasks complete (60%)
94
-
95
- ## Task Status:
96
- - ✅ Completed: 3
97
- - 🔄 In Progress: 1
98
- - 📋 Not Started: 1
99
- ```
100
-
101
- ## Customization
102
-
103
- These commands can be modified by editing the .md files in this directory. Each file contains:
104
- - Instructions for Claude Code on how to execute the command
105
- - Templates for interacting with MCP
106
- - Guidance on error handling and edge cases
107
-
108
- ## See Also
109
-
110
- - [AUTONOMOUS_EXECUTION_GUIDE.md](../AUTONOMOUS_EXECUTION_GUIDE.md) - Comprehensive guide
111
- - [CLAUDE.md](/CLAUDE.md) - Project architecture and patterns
112
- - [.claude/settings.local.json](../settings.local.json) - MCP configuration
@@ -1,174 +0,0 @@
1
- # Create Plan - Interactive Plan Builder
2
-
3
- You are a plan creation assistant. Help the user create a structured plan in the MCP planning system.
4
-
5
- ## Step 1: Gather Plan Information
6
-
7
- Ask the user for:
8
- 1. **Plan title**: What is this plan for?
9
- 2. **Plan description**: What's the overall goal?
10
- 3. **Plan scope**: Is this for:
11
- - A new feature?
12
- - A bug fix?
13
- - A refactoring effort?
14
- - Testing work?
15
- - Documentation?
16
- - Other?
17
-
18
- ## Step 2: Create the Plan
19
-
20
- Use `mcp__planning-system__create_plan` with:
21
- - `title`: The plan title
22
- - `description`: The plan description
23
- - `status`: "draft" (user can activate it later)
24
-
25
- Save the returned `plan_id` - you'll need it for creating nodes.
26
-
27
- ## Step 3: Break Down Into Phases
28
-
29
- Ask the user what major phases this work involves. Common patterns:
30
-
31
- **For new features**:
32
- - Phase 1: Backend API
33
- - Phase 2: Frontend UI
34
- - Phase 3: Testing
35
- - Phase 4: Documentation
36
-
37
- **For bug fixes**:
38
- - Phase 1: Investigation & Root Cause
39
- - Phase 2: Fix Implementation
40
- - Phase 3: Testing & Verification
41
-
42
- **For refactoring**:
43
- - Phase 1: Analysis & Planning
44
- - Phase 2: Incremental Changes
45
- - Phase 3: Testing & Validation
46
-
47
- For each phase, create a node using `mcp__planning-system__create_node` with:
48
- - `plan_id`
49
- - `node_type: "phase"`
50
- - `title`: Phase name
51
- - `description`: What happens in this phase
52
- - `status: "not_started"`
53
-
54
- ## Step 4: Break Phases Into Tasks
55
-
56
- For each phase, ask the user what specific tasks are needed.
57
-
58
- **Guide the user with suggestions based on phase type**:
59
-
60
- **Backend API phase**:
61
- - Create database migration
62
- - Create/update routes
63
- - Create/update controllers
64
- - Add authentication/validation
65
- - Write API tests
66
- - Update API documentation
67
-
68
- **Frontend UI phase**:
69
- - Create React components
70
- - Set up React Query hooks
71
- - Add routing
72
- - Style with Tailwind CSS
73
- - Write component tests
74
-
75
- **Testing phase**:
76
- - Write unit tests
77
- - Write integration tests
78
- - Write E2E tests
79
- - Verify test coverage
80
-
81
- For each task, create a node using `mcp__planning-system__create_node` with:
82
- - `plan_id`
83
- - `node_type: "task"`
84
- - `parent_id`: The phase node_id
85
- - `title`: Task name
86
- - `description`: What needs to be done
87
- - `acceptance_criteria`: How to know it's complete (be specific!)
88
- - `agent_instructions`: Specific guidance for the AI agent executing this
89
- - `status: "not_started"`
90
-
91
- ## Step 5: Add Agent Instructions (Critical!)
92
-
93
- For each task, help user write clear `agent_instructions`. These guide the autonomous agent.
94
-
95
- **Good agent instructions examples**:
96
-
97
- ```markdown
98
- **Backend API Task**:
99
- Create a new Express route at /api/v1/users/:id/profile with GET and PUT methods.
100
- Follow patterns in src/routes/users.routes.js. Add Swagger annotations.
101
- Include validation middleware. Add RLS policies for the database.
102
-
103
- **Frontend Component Task**:
104
- Create a ProfileCard component in src/components/ProfileCard.tsx.
105
- Use Tailwind CSS for styling. Accept user prop with type User.
106
- Include loading and error states. Write tests in ProfileCard.test.tsx.
107
-
108
- **Testing Task**:
109
- Write integration tests for the user profile endpoints.
110
- Use patterns from tests/integration/users.test.js.
111
- Test success case, validation errors, and authentication.
112
- Ensure test coverage is above 80%.
113
- ```
114
-
115
- **Key elements**:
116
- - Specific file paths or patterns to follow
117
- - Technologies/tools to use
118
- - Error cases to handle
119
- - Related files to reference
120
- - Testing requirements
121
-
122
- ## Step 6: Review and Activate
123
-
124
- Show the user the full plan structure:
125
- - Plan title and description
126
- - All phases
127
- - All tasks under each phase
128
- - Acceptance criteria for each task
129
-
130
- Ask: "Does this look good? Any changes needed?"
131
-
132
- If approved, update plan status to "active":
133
- ```
134
- mcp__planning-system__update_plan with:
135
- - plan_id
136
- - status: "active"
137
- ```
138
-
139
- ## Step 7: Next Steps
140
-
141
- Tell the user:
142
- ```
143
- Plan created successfully!
144
-
145
- Plan ID: {plan_id}
146
-
147
- To execute this plan autonomously, run:
148
- /execute-plan {plan_id}
149
-
150
- To check status anytime:
151
- /plan-status {plan_id}
152
- ```
153
-
154
- ## Tips for Good Plans
155
-
156
- 1. **Be specific**: Vague tasks lead to vague implementations
157
- 2. **One concern per task**: Don't combine "add API + add UI + add tests" in one task
158
- 3. **Clear acceptance criteria**: "Add tests" ❌ | "Add integration tests with 80%+ coverage for all CRUD operations" ✅
159
- 4. **Reference existing code**: Help agents find patterns to follow
160
- 5. **Include test requirements**: Every code task should mention testing
161
- 6. **Think about order**: Some tasks depend on others being done first
162
-
163
- ## Example Complete Task
164
-
165
- ```json
166
- {
167
- "title": "Create user profile API endpoint",
168
- "description": "Add GET and PUT endpoints for user profile management at /api/v1/users/:id/profile",
169
- "acceptance_criteria": "- GET /api/v1/users/:id/profile returns user profile\n- PUT /api/v1/users/:id/profile updates profile\n- Returns 401 if not authenticated\n- Returns 403 if accessing other user's profile\n- Swagger documentation is complete\n- Integration tests pass with 80%+ coverage",
170
- "agent_instructions": "Create new route file: agent-planner/src/routes/profile.routes.js\n\nFollow the pattern in src/routes/users.routes.js:\n- Use authenticate middleware from src/middleware/auth.middleware.js\n- Create controller in src/controllers/profile.controller.js\n- Add Swagger JSDoc annotations for API docs\n- Validate request body using express-validator\n- Add RLS policy to ensure users can only access their own profile\n\nWrite integration tests in tests/integration/profile.test.js:\n- Test successful GET\n- Test successful PUT with valid data\n- Test 401 unauthorized\n- Test 403 forbidden (different user)\n- Test 400 validation errors\n\nRun npm test to verify all tests pass.\nRun npm run docs:all to update API documentation."
171
- }
172
- ```
173
-
174
- Now begin helping the user create their plan!