lalph 0.1.39 → 0.1.41
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/dist/cli.mjs +27 -50
- package/package.json +1 -1
- package/src/PromptGen.ts +27 -50
package/dist/cli.mjs
CHANGED
|
@@ -140412,7 +140412,8 @@ are:
|
|
|
140412
140412
|
### Adding tasks
|
|
140413
140413
|
|
|
140414
140414
|
To add a new task, append a new item to the prd.yml file with the id set to
|
|
140415
|
-
\`null
|
|
140415
|
+
\`null\`, a title, state set to "todo", and a concise description that includes
|
|
140416
|
+
a short summary of the task and a brief list of steps to complete it.
|
|
140416
140417
|
|
|
140417
140418
|
When adding a new task, it will take about 5 seconds for the system to update the
|
|
140418
140419
|
prd.yml file with a new id for the task.
|
|
@@ -140428,9 +140429,7 @@ To remove a task, simply delete the item from the prd.yml file.
|
|
|
140428
140429
|
\`\`\`json
|
|
140429
140430
|
${JSON.stringify(PrdIssue.jsonSchema, null, 2)}
|
|
140430
140431
|
\`\`\``;
|
|
140431
|
-
const promptChoose =
|
|
140432
|
-
|
|
140433
|
-
Your job is to choose the next task to work on from the prd.yml file. **DO NOT** implement the task yet.
|
|
140432
|
+
const promptChoose = `Your job is to choose the next task to work on from the prd.yml file. **DO NOT** implement the task yet.
|
|
140434
140433
|
|
|
140435
140434
|
The following instructions should be done without interaction or asking for permission.
|
|
140436
140435
|
|
|
@@ -140454,25 +140453,12 @@ The following instructions should be done without interaction or asking for perm
|
|
|
140454
140453
|
}
|
|
140455
140454
|
\`\`\`
|
|
140456
140455
|
|
|
140457
|
-
## Important: Task sizing
|
|
140458
|
-
|
|
140459
|
-
If at any point you decide that a task is too large or complex to complete in a
|
|
140460
|
-
single iteration, break it down into smaller tasks and add them to the prd.yml
|
|
140461
|
-
file. Then, mark the original task as "done" by updating its \`state\`.
|
|
140462
|
-
|
|
140463
|
-
Each task should be an atomic, committable piece of work.
|
|
140464
|
-
Instead of creating tasks like "Refactor the authentication system", create
|
|
140465
|
-
smaller tasks like "Implement OAuth2 login endpoint", "Add JWT token refresh mechanism", etc.
|
|
140466
|
-
|
|
140467
140456
|
${prdNotes}`;
|
|
140468
|
-
const prompt = (options) =>
|
|
140469
|
-
|
|
140470
|
-
The following instructions should be done without interaction or asking for
|
|
140471
|
-
permission.
|
|
140457
|
+
const prompt = (options) => `The following instructions should be done without interaction or asking for permission.
|
|
140472
140458
|
|
|
140473
140459
|
1. Your job is to complete the task with id \`${options.taskId}\` from the prd.yml file.
|
|
140474
140460
|
Read the entire prd.yml file to understand the context of the task and any
|
|
140475
|
-
key learnings from previous work.
|
|
140461
|
+
key learnings from previous work. Study the .specs/README.md file.
|
|
140476
140462
|
2. Check if there is an existing Github PR for the task, otherwise create a new
|
|
140477
140463
|
branch for the task.${options.targetBranch ? ` The target branch for the PR should be \`${options.targetBranch}\`. If the target branch does not exist, create it first.` : ""}
|
|
140478
140464
|
- If there is an existing PR, checkout the branch for that PR.
|
|
@@ -140483,20 +140469,25 @@ permission.
|
|
|
140483
140469
|
- New branches should be named using the format \`{task id}/description\`.
|
|
140484
140470
|
- When checking for PR reviews, make sure to check the "reviews" field and read ALL unresolved comments.
|
|
140485
140471
|
Also read the normal comments to see if there are any additional requests.
|
|
140486
|
-
|
|
140487
|
-
|
|
140488
|
-
|
|
140472
|
+
3. Implement the task.
|
|
140473
|
+
4. Run any checks / feedback loops, such as type checks, unit tests, or linting.
|
|
140474
|
+
5. Create or update the pull request with your progress.
|
|
140489
140475
|
${sourceMeta.githubPrInstructions}
|
|
140490
140476
|
The PR description should include a summary of the changes made.
|
|
140491
140477
|
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
140492
140478
|
- You have permission to create or update the PR as needed. You have full
|
|
140493
140479
|
permission to push branches, create PRs or create git commits.
|
|
140494
|
-
|
|
140480
|
+
6. Update the prd.yml file to reflect any changes in task states.
|
|
140495
140481
|
- Update the prd.yml file after the GitHub PR has been created or updated.
|
|
140496
140482
|
- Rewrite the notes in the description to include only the key discoveries
|
|
140497
140483
|
and information that could speed up future work on other tasks.
|
|
140498
140484
|
- If you believe the task is complete, update the \`state\` to "in-review".
|
|
140499
140485
|
|
|
140486
|
+
## Important: Adding new tasks
|
|
140487
|
+
|
|
140488
|
+
**If at any point** you discover something that needs fixing, or another task
|
|
140489
|
+
that needs doing, immediately add it to the prd.yml file as a new task.
|
|
140490
|
+
|
|
140500
140491
|
## Important: Recording key information
|
|
140501
140492
|
|
|
140502
140493
|
This session will time out after a certain period, so make sure to record
|
|
@@ -140505,14 +140496,11 @@ Record the information **in the moment** as you discover it,
|
|
|
140505
140496
|
do not wait until the end of the task. Things to record include:
|
|
140506
140497
|
|
|
140507
140498
|
- Important discoveries about the codebase.
|
|
140508
|
-
- Any challenges faced and how you overcame them.
|
|
140499
|
+
- Any challenges faced and how you overcame them. For example:
|
|
140509
140500
|
- If it took multiple attempts to get something working, record what worked.
|
|
140510
140501
|
- If you found a library api was renamed or moved, record the new name.
|
|
140511
140502
|
- Any other information that could help future work on similar tasks.
|
|
140512
140503
|
|
|
140513
|
-
**If at any point** you discover something that needs fixing, or another task
|
|
140514
|
-
that needs doing, immediately add it to the prd.yml file as a new task.
|
|
140515
|
-
|
|
140516
140504
|
## Handling blockers
|
|
140517
140505
|
|
|
140518
140506
|
If for any reason you get stuck on a task, mark the task back as "todo" by updating its
|
|
@@ -140523,9 +140511,7 @@ If it feels like you are brute forcing your way through a task, STOP and move th
|
|
|
140523
140511
|
task back to "todo" state with notes on why in the description.
|
|
140524
140512
|
|
|
140525
140513
|
${prdNotes}`;
|
|
140526
|
-
const promptTimeout = (options) =>
|
|
140527
|
-
|
|
140528
|
-
Your earlier attempt to complete the task with id \`${options.taskId}\` took too
|
|
140514
|
+
const promptTimeout = (options) => `Your earlier attempt to complete the task with id \`${options.taskId}\` took too
|
|
140529
140515
|
long and has timed out. You can find the task details in the prd.yml file.
|
|
140530
140516
|
|
|
140531
140517
|
The following instructions should be done without interaction or asking for
|
|
@@ -140547,20 +140533,14 @@ permission.
|
|
|
140547
140533
|
to assign ids to the new tasks before you can setup dependencies.
|
|
140548
140534
|
|
|
140549
140535
|
${prdNotes}`;
|
|
140550
|
-
const planPrompt = (options) =>
|
|
140551
|
-
|
|
140552
|
-
|
|
140553
|
-
|
|
140554
|
-
|
|
140555
|
-
|
|
140556
|
-
|
|
140557
|
-
|
|
140558
|
-
2. Once you have saved the specification, your next job is to break down the
|
|
140559
|
-
specification into smaller, manageable tasks and add them to the prd.yml file.
|
|
140560
|
-
Each task should have a id of \`null\`, a title, and a concise description that
|
|
140561
|
-
includes a where to find the plan specification, a short summary of the task and a
|
|
140562
|
-
brief list of steps to complete it.
|
|
140563
|
-
- The tasks should start in the "todo" state.
|
|
140536
|
+
const planPrompt = (options) => `1. Ask the user for the idea / request, then your job is to create a detailed
|
|
140537
|
+
specification to fulfill the request and save it as a file. Interview the user
|
|
140538
|
+
to gather all the necessary requirements and details for the specification.
|
|
140539
|
+
You need to be curious and ask lots of questions.
|
|
140540
|
+
2. Once you have saved the specification, your next job is to create an implementation
|
|
140541
|
+
plan by breaking down the specification into smaller, manageable tasks and add
|
|
140542
|
+
them to the prd.yml file.
|
|
140543
|
+
Each task include in the description where to find the plan specification.
|
|
140564
140544
|
- Each task should be an atomic, committable piece of work.
|
|
140565
140545
|
Instead of creating tasks like "Refactor the authentication system", create
|
|
140566
140546
|
smaller tasks like "Implement OAuth2 login endpoint", "Add JWT token refresh mechanism", etc.
|
|
@@ -140577,12 +140557,9 @@ ${prdNotes}`;
|
|
|
140577
140557
|
|
|
140578
140558
|
- Should go into a \`${options.specsDirectory}\` directory, with a filename that reflects the
|
|
140579
140559
|
project name.
|
|
140580
|
-
|
|
140581
|
-
|
|
140582
|
-
|
|
140583
|
-
- Requirements: functional and non-functional requirements.
|
|
140584
|
-
- Design: technical design, architecture decisions, data models, etc.
|
|
140585
|
-
- Acceptance criteria that define when the project is considered complete.
|
|
140560
|
+
- When adding a new specification, add a link to in the README.md file in the
|
|
140561
|
+
\`${options.specsDirectory}\` directory along with a brief overview of the specification.
|
|
140562
|
+
If the README.md file does not exist, create it.
|
|
140586
140563
|
|
|
140587
140564
|
${prdNotes}`;
|
|
140588
140565
|
return {
|
package/package.json
CHANGED
package/src/PromptGen.ts
CHANGED
|
@@ -26,7 +26,8 @@ are:
|
|
|
26
26
|
### Adding tasks
|
|
27
27
|
|
|
28
28
|
To add a new task, append a new item to the prd.yml file with the id set to
|
|
29
|
-
\`null
|
|
29
|
+
\`null\`, a title, state set to "todo", and a concise description that includes
|
|
30
|
+
a short summary of the task and a brief list of steps to complete it.
|
|
30
31
|
|
|
31
32
|
When adding a new task, it will take about 5 seconds for the system to update the
|
|
32
33
|
prd.yml file with a new id for the task.
|
|
@@ -43,9 +44,7 @@ To remove a task, simply delete the item from the prd.yml file.
|
|
|
43
44
|
${JSON.stringify(PrdIssue.jsonSchema, null, 2)}
|
|
44
45
|
\`\`\``
|
|
45
46
|
|
|
46
|
-
const promptChoose =
|
|
47
|
-
|
|
48
|
-
Your job is to choose the next task to work on from the prd.yml file. **DO NOT** implement the task yet.
|
|
47
|
+
const promptChoose = `Your job is to choose the next task to work on from the prd.yml file. **DO NOT** implement the task yet.
|
|
49
48
|
|
|
50
49
|
The following instructions should be done without interaction or asking for permission.
|
|
51
50
|
|
|
@@ -69,29 +68,16 @@ The following instructions should be done without interaction or asking for perm
|
|
|
69
68
|
}
|
|
70
69
|
\`\`\`
|
|
71
70
|
|
|
72
|
-
## Important: Task sizing
|
|
73
|
-
|
|
74
|
-
If at any point you decide that a task is too large or complex to complete in a
|
|
75
|
-
single iteration, break it down into smaller tasks and add them to the prd.yml
|
|
76
|
-
file. Then, mark the original task as "done" by updating its \`state\`.
|
|
77
|
-
|
|
78
|
-
Each task should be an atomic, committable piece of work.
|
|
79
|
-
Instead of creating tasks like "Refactor the authentication system", create
|
|
80
|
-
smaller tasks like "Implement OAuth2 login endpoint", "Add JWT token refresh mechanism", etc.
|
|
81
|
-
|
|
82
71
|
${prdNotes}`
|
|
83
72
|
|
|
84
73
|
const prompt = (options: {
|
|
85
74
|
readonly taskId: string
|
|
86
75
|
readonly targetBranch: string | undefined
|
|
87
|
-
}) =>
|
|
88
|
-
|
|
89
|
-
The following instructions should be done without interaction or asking for
|
|
90
|
-
permission.
|
|
76
|
+
}) => `The following instructions should be done without interaction or asking for permission.
|
|
91
77
|
|
|
92
78
|
1. Your job is to complete the task with id \`${options.taskId}\` from the prd.yml file.
|
|
93
79
|
Read the entire prd.yml file to understand the context of the task and any
|
|
94
|
-
key learnings from previous work.
|
|
80
|
+
key learnings from previous work. Study the .specs/README.md file.
|
|
95
81
|
2. Check if there is an existing Github PR for the task, otherwise create a new
|
|
96
82
|
branch for the task.${options.targetBranch ? ` The target branch for the PR should be \`${options.targetBranch}\`. If the target branch does not exist, create it first.` : ""}
|
|
97
83
|
- If there is an existing PR, checkout the branch for that PR.
|
|
@@ -102,20 +88,25 @@ permission.
|
|
|
102
88
|
- New branches should be named using the format \`{task id}/description\`.
|
|
103
89
|
- When checking for PR reviews, make sure to check the "reviews" field and read ALL unresolved comments.
|
|
104
90
|
Also read the normal comments to see if there are any additional requests.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
3. Implement the task.
|
|
92
|
+
4. Run any checks / feedback loops, such as type checks, unit tests, or linting.
|
|
93
|
+
5. Create or update the pull request with your progress.
|
|
108
94
|
${sourceMeta.githubPrInstructions}
|
|
109
95
|
The PR description should include a summary of the changes made.
|
|
110
96
|
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
111
97
|
- You have permission to create or update the PR as needed. You have full
|
|
112
98
|
permission to push branches, create PRs or create git commits.
|
|
113
|
-
|
|
99
|
+
6. Update the prd.yml file to reflect any changes in task states.
|
|
114
100
|
- Update the prd.yml file after the GitHub PR has been created or updated.
|
|
115
101
|
- Rewrite the notes in the description to include only the key discoveries
|
|
116
102
|
and information that could speed up future work on other tasks.
|
|
117
103
|
- If you believe the task is complete, update the \`state\` to "in-review".
|
|
118
104
|
|
|
105
|
+
## Important: Adding new tasks
|
|
106
|
+
|
|
107
|
+
**If at any point** you discover something that needs fixing, or another task
|
|
108
|
+
that needs doing, immediately add it to the prd.yml file as a new task.
|
|
109
|
+
|
|
119
110
|
## Important: Recording key information
|
|
120
111
|
|
|
121
112
|
This session will time out after a certain period, so make sure to record
|
|
@@ -124,14 +115,11 @@ Record the information **in the moment** as you discover it,
|
|
|
124
115
|
do not wait until the end of the task. Things to record include:
|
|
125
116
|
|
|
126
117
|
- Important discoveries about the codebase.
|
|
127
|
-
- Any challenges faced and how you overcame them.
|
|
118
|
+
- Any challenges faced and how you overcame them. For example:
|
|
128
119
|
- If it took multiple attempts to get something working, record what worked.
|
|
129
120
|
- If you found a library api was renamed or moved, record the new name.
|
|
130
121
|
- Any other information that could help future work on similar tasks.
|
|
131
122
|
|
|
132
|
-
**If at any point** you discover something that needs fixing, or another task
|
|
133
|
-
that needs doing, immediately add it to the prd.yml file as a new task.
|
|
134
|
-
|
|
135
123
|
## Handling blockers
|
|
136
124
|
|
|
137
125
|
If for any reason you get stuck on a task, mark the task back as "todo" by updating its
|
|
@@ -145,9 +133,7 @@ ${prdNotes}`
|
|
|
145
133
|
|
|
146
134
|
const promptTimeout = (options: {
|
|
147
135
|
readonly taskId: string
|
|
148
|
-
}) =>
|
|
149
|
-
|
|
150
|
-
Your earlier attempt to complete the task with id \`${options.taskId}\` took too
|
|
136
|
+
}) => `Your earlier attempt to complete the task with id \`${options.taskId}\` took too
|
|
151
137
|
long and has timed out. You can find the task details in the prd.yml file.
|
|
152
138
|
|
|
153
139
|
The following instructions should be done without interaction or asking for
|
|
@@ -172,20 +158,14 @@ ${prdNotes}`
|
|
|
172
158
|
|
|
173
159
|
const planPrompt = (options: {
|
|
174
160
|
readonly specsDirectory: string
|
|
175
|
-
}) =>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
2. Once you have saved the specification, your next job is to break down the
|
|
184
|
-
specification into smaller, manageable tasks and add them to the prd.yml file.
|
|
185
|
-
Each task should have a id of \`null\`, a title, and a concise description that
|
|
186
|
-
includes a where to find the plan specification, a short summary of the task and a
|
|
187
|
-
brief list of steps to complete it.
|
|
188
|
-
- The tasks should start in the "todo" state.
|
|
161
|
+
}) => `1. Ask the user for the idea / request, then your job is to create a detailed
|
|
162
|
+
specification to fulfill the request and save it as a file. Interview the user
|
|
163
|
+
to gather all the necessary requirements and details for the specification.
|
|
164
|
+
You need to be curious and ask lots of questions.
|
|
165
|
+
2. Once you have saved the specification, your next job is to create an implementation
|
|
166
|
+
plan by breaking down the specification into smaller, manageable tasks and add
|
|
167
|
+
them to the prd.yml file.
|
|
168
|
+
Each task include in the description where to find the plan specification.
|
|
189
169
|
- Each task should be an atomic, committable piece of work.
|
|
190
170
|
Instead of creating tasks like "Refactor the authentication system", create
|
|
191
171
|
smaller tasks like "Implement OAuth2 login endpoint", "Add JWT token refresh mechanism", etc.
|
|
@@ -202,12 +182,9 @@ ${prdNotes}`
|
|
|
202
182
|
|
|
203
183
|
- Should go into a \`${options.specsDirectory}\` directory, with a filename that reflects the
|
|
204
184
|
project name.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
- Requirements: functional and non-functional requirements.
|
|
209
|
-
- Design: technical design, architecture decisions, data models, etc.
|
|
210
|
-
- Acceptance criteria that define when the project is considered complete.
|
|
185
|
+
- When adding a new specification, add a link to in the README.md file in the
|
|
186
|
+
\`${options.specsDirectory}\` directory along with a brief overview of the specification.
|
|
187
|
+
If the README.md file does not exist, create it.
|
|
211
188
|
|
|
212
189
|
${prdNotes}`
|
|
213
190
|
|