millhouse 0.1.0 → 0.3.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.
- package/README.md +40 -27
- package/dist/analysis/issue-analyzer.d.ts.map +1 -1
- package/dist/analysis/issue-analyzer.js +25 -38
- package/dist/analysis/issue-analyzer.js.map +1 -1
- package/dist/analysis/plan-parser.d.ts.map +1 -1
- package/dist/analysis/plan-parser.js +18 -47
- package/dist/analysis/plan-parser.js.map +1 -1
- package/dist/cli/commands/run.d.ts +1 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +4 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/core/orchestrator.d.ts +4 -0
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +72 -7
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/execution/claude-runner.d.ts +2 -2
- package/dist/execution/claude-runner.d.ts.map +1 -1
- package/dist/execution/claude-runner.js +17 -51
- package/dist/execution/claude-runner.js.map +1 -1
- package/dist/execution/project-scanner.d.ts +10 -0
- package/dist/execution/project-scanner.d.ts.map +1 -0
- package/dist/execution/project-scanner.js +48 -0
- package/dist/execution/project-scanner.js.map +1 -0
- package/dist/execution/worktree-manager.d.ts +4 -3
- package/dist/execution/worktree-manager.d.ts.map +1 -1
- package/dist/execution/worktree-manager.js +21 -29
- package/dist/execution/worktree-manager.js.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/template-loader.d.ts +6 -0
- package/dist/utils/template-loader.d.ts.map +1 -0
- package/dist/utils/template-loader.js +34 -0
- package/dist/utils/template-loader.js.map +1 -0
- package/package.json +3 -2
- package/prompts/implementation.prompt.md +190 -0
- package/prompts/issue-analysis.prompt.md +34 -0
- package/prompts/plan-analysis.prompt.md +45 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Your Task
|
|
2
|
+
|
|
3
|
+
Implement task #{{issue.number}}: {{issue.title}}
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
{{issue.body}}
|
|
8
|
+
|
|
9
|
+
## Likely Affected Files
|
|
10
|
+
|
|
11
|
+
{{affectedPaths}}
|
|
12
|
+
|
|
13
|
+
## Project Context
|
|
14
|
+
|
|
15
|
+
A summary of the project structure is available in `CLAUDE.md` in the repository root. **Read this file first** to understand the codebase architecture, conventions, and where different types of code belong.
|
|
16
|
+
{{#if hasPriorWork}}
|
|
17
|
+
|
|
18
|
+
## Prior Work
|
|
19
|
+
|
|
20
|
+
This task depends on work that has already been completed. Summaries of that prior work are available in `MILLHOUSE_PRIOR_WORK.md` in the repository root. **Read this file first** to understand what has already been implemented before starting your work.
|
|
21
|
+
{{/if}}
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
You are an expert software engineer implementing a specific task. Follow these steps:
|
|
26
|
+
|
|
27
|
+
### 1. Understand the Context
|
|
28
|
+
- Read the task description carefully, paying close attention to any **acceptance criteria**
|
|
29
|
+
- Explore the relevant code paths mentioned in "Likely Affected Files"
|
|
30
|
+
- Understand the existing patterns and conventions in the codebase
|
|
31
|
+
- If the task references other tasks or PRs, consider their context
|
|
32
|
+
|
|
33
|
+
### 2. Plan Your Implementation
|
|
34
|
+
- Identify all files that need to be modified
|
|
35
|
+
- Consider edge cases and error handling
|
|
36
|
+
- Think about backward compatibility if relevant
|
|
37
|
+
- Keep changes minimal and focused on the task
|
|
38
|
+
|
|
39
|
+
### 3. Implement the Solution
|
|
40
|
+
- Make the necessary code changes
|
|
41
|
+
- Follow the existing code style and patterns
|
|
42
|
+
- Add appropriate error handling
|
|
43
|
+
- Update or add tests if the codebase has them
|
|
44
|
+
|
|
45
|
+
### 4. Test and Verify - CRITICAL
|
|
46
|
+
|
|
47
|
+
**You MUST verify your implementation before completing:**
|
|
48
|
+
|
|
49
|
+
1. Run all existing tests to ensure nothing is broken
|
|
50
|
+
2. Think deeply about how to fully test the acceptance criteria from the task
|
|
51
|
+
3. Run any test commands specified in the task
|
|
52
|
+
4. Verify each acceptance criterion is satisfied
|
|
53
|
+
|
|
54
|
+
**If any tests fail or acceptance criteria are not met:**
|
|
55
|
+
- Analyze the failure and make corrections
|
|
56
|
+
- Re-run tests and re-verify
|
|
57
|
+
- Repeat until ALL tests pass and ALL acceptance criteria are satisfied
|
|
58
|
+
|
|
59
|
+
**If you cannot make progress:**
|
|
60
|
+
- If you've made several attempts without progress, or you detect you're in a loop, exit with an error explaining the situation
|
|
61
|
+
- If human input is required to proceed, exit with an error explaining what's needed
|
|
62
|
+
|
|
63
|
+
**DO NOT REPORT SUCCESS IF ANY TESTS FAIL OR ANY ACCEPTANCE CRITERIA ARE NOT MET.**
|
|
64
|
+
|
|
65
|
+
### 5. Commit and Update Run Branch
|
|
66
|
+
|
|
67
|
+
First, commit your changes on your issue branch:
|
|
68
|
+
|
|
69
|
+
- Stage your changes with `git add <files>`
|
|
70
|
+
- Create a single commit with a comprehensive message that includes:
|
|
71
|
+
- A clear summary line describing the change
|
|
72
|
+
- A detailed body explaining:
|
|
73
|
+
- What was implemented
|
|
74
|
+
- Key files added or modified
|
|
75
|
+
- How acceptance criteria were satisfied
|
|
76
|
+
- Any important implementation decisions
|
|
77
|
+
- End with "Fixes #{{issue.number}}"
|
|
78
|
+
|
|
79
|
+
Then, merge your changes INTO the run branch:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Loop until we successfully update the run branch
|
|
83
|
+
while true; do
|
|
84
|
+
# Merge the latest run branch into your issue branch
|
|
85
|
+
git merge millhouse/run-{{runId}} --no-edit
|
|
86
|
+
|
|
87
|
+
# If there are merge conflicts, resolve them:
|
|
88
|
+
# - Carefully examine each conflict
|
|
89
|
+
# - Preserve both your changes and changes from other workers
|
|
90
|
+
# - Test that everything still works after resolving
|
|
91
|
+
# - Stage resolved files with: git add <resolved-files>
|
|
92
|
+
# - Complete the merge with: git commit --no-edit
|
|
93
|
+
|
|
94
|
+
# Update the run branch to point to your merged commit
|
|
95
|
+
# This will fail if another worker updated it since we merged
|
|
96
|
+
if git push . HEAD:millhouse/run-{{runId}}; then
|
|
97
|
+
echo "Successfully updated run branch"
|
|
98
|
+
break
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
echo "Run branch was updated by another worker, merging again..."
|
|
102
|
+
done
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**IMPORTANT**: You MUST successfully update the run branch before exiting. The orchestrator relies on this to collect all changes.
|
|
106
|
+
|
|
107
|
+
## Important Rules
|
|
108
|
+
|
|
109
|
+
1. **You are working in a git worktree** on your own issue branch
|
|
110
|
+
- Your working directory is isolated from other parallel tasks
|
|
111
|
+
- After committing, you MUST merge your changes into the run branch `millhouse/run-{{runId}}`
|
|
112
|
+
|
|
113
|
+
2. **Do NOT create a pull request**
|
|
114
|
+
- The orchestrator handles PR creation after all tasks complete
|
|
115
|
+
- Just commit your changes with proper messages
|
|
116
|
+
|
|
117
|
+
3. **Stay focused on this task**
|
|
118
|
+
- Don't fix unrelated problems you notice
|
|
119
|
+
- Don't refactor code beyond what's needed for this task
|
|
120
|
+
- If you notice important problems, mention them in your summary
|
|
121
|
+
|
|
122
|
+
4. **Handle blockers appropriately**
|
|
123
|
+
- If you encounter a blocker that requires human input, exit with an error
|
|
124
|
+
- Don't try to work around fundamental problems
|
|
125
|
+
|
|
126
|
+
5. **Keep changes minimal**
|
|
127
|
+
- Your changes will be merged with other parallel tasks
|
|
128
|
+
- Minimize the chance of merge conflicts by changing only what's necessary
|
|
129
|
+
|
|
130
|
+
## Git Commands Reference
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Stage specific files
|
|
134
|
+
git add src/path/to/file.ts
|
|
135
|
+
|
|
136
|
+
# Stage all changes (use with caution)
|
|
137
|
+
git add -A
|
|
138
|
+
|
|
139
|
+
# Commit with comprehensive message
|
|
140
|
+
git commit -m "feat: add math utility functions
|
|
141
|
+
|
|
142
|
+
Implemented add() and multiply() functions in src/utils/math.ts.
|
|
143
|
+
|
|
144
|
+
Changes:
|
|
145
|
+
- Created src/utils/math.ts with exported functions
|
|
146
|
+
- Added input validation for edge cases
|
|
147
|
+
- Verified TypeScript compilation passes
|
|
148
|
+
|
|
149
|
+
Acceptance criteria satisfied:
|
|
150
|
+
- [x] Functions exported correctly
|
|
151
|
+
- [x] No type errors
|
|
152
|
+
|
|
153
|
+
Fixes #{{issue.number}}"
|
|
154
|
+
|
|
155
|
+
# Check status
|
|
156
|
+
git status
|
|
157
|
+
|
|
158
|
+
# View changes
|
|
159
|
+
git diff
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## When You're Done
|
|
163
|
+
|
|
164
|
+
**Create a summary file** called `MILLHOUSE_SUMMARY.md` in the repository root with the following format:
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
## Summary
|
|
168
|
+
[2-3 sentence description of what was accomplished]
|
|
169
|
+
|
|
170
|
+
## Files Changed
|
|
171
|
+
- path/to/file1.ts (created|modified|deleted)
|
|
172
|
+
- path/to/file2.ts (created|modified|deleted)
|
|
173
|
+
|
|
174
|
+
## Key Changes
|
|
175
|
+
- [Important change 1]
|
|
176
|
+
- [Important change 2]
|
|
177
|
+
- [Important change 3]
|
|
178
|
+
|
|
179
|
+
## Test Status
|
|
180
|
+
[passed|failed|skipped] - [brief note if relevant]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This summary will be passed to any dependent tasks that run after you.
|
|
184
|
+
|
|
185
|
+
Then provide a final message that includes:
|
|
186
|
+
1. What you changed and why
|
|
187
|
+
2. Any important implementation decisions
|
|
188
|
+
3. Test results and verification of acceptance criteria
|
|
189
|
+
4. Any notes for reviewers
|
|
190
|
+
5. Any potential concerns or follow-up items
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Analyze these GitHub issues and determine their dependencies and execution order.
|
|
2
|
+
|
|
3
|
+
## Issues to Analyze
|
|
4
|
+
|
|
5
|
+
{{issuesList}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Your Task
|
|
10
|
+
|
|
11
|
+
Analyze each issue and determine:
|
|
12
|
+
1. **dependencies**: Which issues MUST be completed BEFORE this issue can start
|
|
13
|
+
2. **affectedPaths**: File paths this issue will likely create or modify
|
|
14
|
+
|
|
15
|
+
Respond with ONLY a JSON array (no markdown, no explanation):
|
|
16
|
+
[
|
|
17
|
+
{
|
|
18
|
+
"issueNumber": 1,
|
|
19
|
+
"dependencies": [],
|
|
20
|
+
"affectedPaths": ["src/path/to/file.ts"]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"issueNumber": 2,
|
|
24
|
+
"dependencies": [1],
|
|
25
|
+
"affectedPaths": ["src/other/file.ts"]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
Rules:
|
|
30
|
+
- Look for explicit dependency mentions: "depends on #X", "after #X", "blocked by #X", "requires #X"
|
|
31
|
+
- Also infer logical dependencies (e.g., if issue B imports from a file that issue A creates)
|
|
32
|
+
- Only include dependencies between issues in this list
|
|
33
|
+
- affectedPaths should be specific file paths mentioned or implied
|
|
34
|
+
- Respond with ONLY valid JSON, nothing else
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Analyze this plan and break it into discrete, implementable work items.
|
|
2
|
+
|
|
3
|
+
## Plan
|
|
4
|
+
|
|
5
|
+
{{plan}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Your Task
|
|
10
|
+
|
|
11
|
+
Break this plan into discrete work items that can be implemented independently (but may have dependencies on each other).
|
|
12
|
+
|
|
13
|
+
For each work item, provide:
|
|
14
|
+
1. **id**: Sequential number starting from 1
|
|
15
|
+
2. **title**: Short descriptive title
|
|
16
|
+
3. **body**: Full implementation details including:
|
|
17
|
+
- What to create/modify
|
|
18
|
+
- Specific file paths
|
|
19
|
+
- Function signatures or interfaces
|
|
20
|
+
- Testing instructions
|
|
21
|
+
- Acceptance criteria
|
|
22
|
+
4. **dependencies**: IDs of work items that MUST be completed before this one
|
|
23
|
+
|
|
24
|
+
Respond with ONLY a JSON array (no markdown, no explanation):
|
|
25
|
+
[
|
|
26
|
+
{
|
|
27
|
+
"id": 1,
|
|
28
|
+
"title": "Initialize project",
|
|
29
|
+
"body": "Create the project structure...\n\n## Implementation\n...",
|
|
30
|
+
"dependencies": []
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": 2,
|
|
34
|
+
"title": "Create utilities",
|
|
35
|
+
"body": "Create utility functions...\n\n**Depends on #1**\n\n## Implementation\n...",
|
|
36
|
+
"dependencies": [1]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
Rules:
|
|
41
|
+
- Each work item should be self-contained with all context needed to implement it
|
|
42
|
+
- Include "**Depends on #N**" in the body text for any dependencies
|
|
43
|
+
- Work items should be small enough to implement in one session
|
|
44
|
+
- Include specific file paths, function signatures, and acceptance criteria
|
|
45
|
+
- Respond with ONLY valid JSON, nothing else
|