prloom 0.1.0 → 0.1.2

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/index.js CHANGED
@@ -16688,42 +16688,113 @@ var require_lib = __commonJS((exports, module) => {
16688
16688
  var BUILTIN_PROMPTS;
16689
16689
  var init_prompt_sources = __esm(() => {
16690
16690
  BUILTIN_PROMPTS = {
16691
- designer: `# Designer Instructions
16691
+ designer_new: `# Designer: Create a New Plan
16692
16692
 
16693
- You are helping the user create or refine a plan for a coding task.
16693
+ You are helping a software engineer **plan** a coding task.
16694
16694
 
16695
- ## Your Role
16695
+ > [!CAUTION] > **You are PLANNING, not building.**
16696
+ >
16697
+ > - Do NOT modify any code files
16698
+ > - The ONLY file you may edit is: \`{{plan_path}}\`
16699
+
16700
+ ## Repository Context
16701
+
16702
+ You are working in:
16703
+
16704
+ - **Repo**: \`{{repo_path}}\`
16705
+ - **Base branch**: \`{{base_branch}}\`
16706
+ - **Worker agent**: \`{{worker_agent}}\`
16707
+
16708
+ Explore the codebase freely to understand context. Do NOT ask questions you can answer by exploring (e.g., test commands, file locations, package.json contents).
16709
+
16710
+ ## Your Philosophy
16711
+
16712
+ You are working with a technical user who knows what they want. Your job is to **extract requirements** and **discuss implementation**, not to make decisions for them.
16713
+
16714
+ - **Explore the codebase** to understand context before asking questions
16715
+ - **Ask clarifying questions** about user preferences and acceptance criteria
16716
+ - **Discuss implementation approach** — do not jump straight to writing the plan
16717
+ - **Defer to the user's judgment** on design decisions
16718
+ - Only fill in the plan when the user confirms they're ready
16719
+
16720
+ {{#if user_description}}
16721
+
16722
+ ## User's Initial Request
16723
+
16724
+ > {{user_description}}
16725
+
16726
+ Explore relevant files, then discuss the implementation approach with the user before writing the plan.
16727
+ {{else}}
16728
+
16729
+ ## Your First Step
16730
+
16731
+ Ask the user: **What would you like to build?**
16696
16732
 
16697
- 1. Clarify what they want to build
16698
- 2. Discuss implementation approach if they want input
16699
- 3. Identify files, test commands, and context needed
16700
- 4. Fill in the plan sections
16733
+ Then:
16734
+
16735
+ 1. Explore the codebase to understand the relevant areas
16736
+ 2. Discuss how to implement it (files to change, approach, trade-offs)
16737
+ 3. Confirm acceptance criteria
16738
+ 4. When the user is ready, write the plan
16739
+ {{/if}}
16701
16740
 
16702
16741
  ## Plan Structure
16703
16742
 
16704
- A plan file has already been created at the correct location (either \`.prloom/inbox/<id>.md\` before dispatch, or \`plans/<id>.md\` inside a worktree after dispatch).
16705
- Your job is to fill in the sections of the existing file; do NOT create new plan files elsewhere.
16743
+ The plan file already has a template with these sections. Fill them in:
16744
+
16745
+ - **Objective**: What will be built (1-2 sentences)
16746
+ - **Context**: Files to modify, constraints, any notes the Worker needs
16747
+ - **TODO (Commits)**: Each item is ONE commit the Worker will make
16748
+
16749
+ ### TODO Rules
16750
+
16751
+ Each TODO item represents a **single commit**. Think of them as the git log you want to see:
16752
+
16753
+ ✅ Good TODOs (commits):
16754
+
16755
+ - \`Fix PDF viewer to load beyond 10 pages\`
16756
+ - \`Add horizontal resize handle to Learn panel\`
16757
+ - \`Update LearnStore to trigger page prefetch\`
16758
+
16759
+ ❌ Bad TODOs (not commits):
16706
16760
 
16707
- - **Objective**: Clear, specific description of what will be built
16708
- - **Context**: Key files to modify, test commands, architecture notes, constraints
16709
- - **TODO**: Granular, sequential tasks (keep them small and completable)
16761
+ - \`Run npm test\` this is verification, not a commit
16762
+ - \`Trace the code to understand X\` this is research, not a commit
16763
+ - \`Validate acceptance criteria\` this is testing, not a commit
16710
16764
 
16711
- The frontmatter (\`id\`, \`status\`, \`agent\`) is managed by the system — do not modify it.
16765
+ The Worker will run tests and type-checks before each commit automatically.
16712
16766
 
16713
- ## Guidelines
16767
+ ## Important
16714
16768
 
16715
- - TODOs should be small, completable in one session
16716
- - Include test commands in Context if tests should be run
16717
- - Inline all necessary context — Workers don't read other files
16769
+ - The plan template already has a \`## Progress Log\` section — do NOT duplicate it
16770
+ - Leave the frontmatter (\`id\`, \`status\`, \`agent\`, \`base_branch\`) alone
16771
+ `,
16772
+ designer_edit: `# Designer: Edit an Existing Plan
16718
16773
 
16719
- {{#if existing_plan}}
16774
+ You are helping a software engineer **refine** an existing plan.
16720
16775
 
16721
- ## Existing Plan
16776
+ > [!CAUTION] > **You are PLANNING, not building.**
16777
+ >
16778
+ > - Do NOT modify any code files
16779
+ > - The ONLY file you may edit is: \`{{plan_path}}\`
16722
16780
 
16723
- The user wants to edit this existing plan:
16781
+ ## Current Contents
16724
16782
 
16725
16783
  {{existing_plan}}
16726
- {{/if}}
16784
+
16785
+ ## Your Philosophy
16786
+
16787
+ - **Ask what changes the user wants** — do not assume
16788
+ - **Do NOT fill in gaps** — defer to the user
16789
+ - Only make changes the user explicitly requests
16790
+
16791
+ ## Your Role
16792
+
16793
+ 1. Ask what needs to change
16794
+ 2. Update Objective, Context, or TODOs per user's direction
16795
+ 3. Keep TODOs small and sequential
16796
+
16797
+ Leave the frontmatter alone.
16727
16798
  `,
16728
16799
  worker: `# Worker Instructions
16729
16800
 
@@ -16840,11 +16911,23 @@ function renderWorkerPrompt(repoRoot, plan, todo) {
16840
16911
  plan: plan.raw
16841
16912
  });
16842
16913
  }
16843
- function renderDesignerPrompt(repoRoot, existingPlan) {
16844
- const template = loadTemplate(repoRoot, "designer");
16914
+ function renderDesignerNewPrompt(repoPath, planPath, baseBranch, workerAgent, userDescription) {
16915
+ const template = BUILTIN_PROMPTS["designer_new"];
16845
16916
  const compiled = import_handlebars.default.compile(template);
16846
16917
  return compiled({
16847
- existing_plan: existingPlan ?? ""
16918
+ repo_path: repoPath,
16919
+ plan_path: planPath,
16920
+ base_branch: baseBranch,
16921
+ worker_agent: workerAgent,
16922
+ user_description: userDescription ?? ""
16923
+ });
16924
+ }
16925
+ function renderDesignerEditPrompt(planPath, existingPlan) {
16926
+ const template = BUILTIN_PROMPTS["designer_edit"];
16927
+ const compiled = import_handlebars.default.compile(template);
16928
+ return compiled({
16929
+ plan_path: planPath,
16930
+ existing_plan: existingPlan
16848
16931
  });
16849
16932
  }
16850
16933
  function renderTriagePrompt(repoRoot, plan, feedback) {
@@ -17209,7 +17292,7 @@ async function runNew(repoRoot, planId, agentOverride, noDesigner) {
17209
17292
  console.log(`Designer agent: ${designerAgent}`);
17210
17293
  console.log("");
17211
17294
  console.log("Starting Designer session to fill in the plan...");
17212
- const prompt = renderDesignerPrompt(repoRoot, skeleton);
17295
+ const prompt = renderDesignerNewPrompt(repoRoot, planPath, baseBranch, workerAgent);
17213
17296
  await adapter.interactive({ cwd: repoRoot, prompt });
17214
17297
  console.log("Designer session ended.");
17215
17298
  console.log("Plan is now in inbox. Run 'prloom start' to dispatch.");
@@ -17266,7 +17349,7 @@ async function runEdit(repoRoot, planId, agentOverride, noDesigner) {
17266
17349
  const agentName = agentOverride ?? config.agents.designer ?? config.agents.default;
17267
17350
  const adapter = getAdapter(agentName);
17268
17351
  console.log(`Agent: ${agentName}`);
17269
- const prompt = renderDesignerPrompt(repoRoot, existingPlan);
17352
+ const prompt = renderDesignerEditPrompt(planPath, existingPlan);
17270
17353
  await adapter.interactive({ cwd, prompt });
17271
17354
  console.log("Designer session ended.");
17272
17355
  }
@@ -18029,6 +18112,57 @@ var init_poll = __esm(() => {
18029
18112
  init_github();
18030
18113
  });
18031
18114
 
18115
+ // src/cli/clean.ts
18116
+ var exports_clean = {};
18117
+ __export(exports_clean, {
18118
+ runClean: () => runClean
18119
+ });
18120
+ import { statSync as statSync6 } from "fs";
18121
+ async function runClean(repoRoot) {
18122
+ const planIds = listInboxPlanIds(repoRoot);
18123
+ if (planIds.length === 0) {
18124
+ console.log("Inbox is empty. Nothing to clean.");
18125
+ return;
18126
+ }
18127
+ console.log("Inbox plans:");
18128
+ console.log("");
18129
+ for (const id of planIds) {
18130
+ const filePath = getInboxPath(repoRoot, id);
18131
+ try {
18132
+ const stat = statSync6(filePath);
18133
+ const created = stat.birthtime.toLocaleString();
18134
+ console.log(` ${id}.md (created: ${created})`);
18135
+ } catch {
18136
+ console.log(` ${id}.md`);
18137
+ }
18138
+ }
18139
+ console.log("");
18140
+ console.log(`Found ${planIds.length} plan(s) in inbox.`);
18141
+ console.log("");
18142
+ const readline = await import("readline");
18143
+ const rl = readline.createInterface({
18144
+ input: process.stdin,
18145
+ output: process.stdout
18146
+ });
18147
+ const answer = await new Promise((resolve6) => {
18148
+ rl.question("Delete all inbox plans? [y/N] ", resolve6);
18149
+ });
18150
+ rl.close();
18151
+ if (answer.toLowerCase() !== "y") {
18152
+ console.log("Aborted.");
18153
+ return;
18154
+ }
18155
+ for (const id of planIds) {
18156
+ deleteInboxPlan(repoRoot, id);
18157
+ console.log(`Deleted: ${id}.md`);
18158
+ }
18159
+ console.log("");
18160
+ console.log("Inbox cleaned.");
18161
+ }
18162
+ var init_clean = __esm(() => {
18163
+ init_state();
18164
+ });
18165
+
18032
18166
  // node_modules/yargs/lib/platform-shims/esm.mjs
18033
18167
  import { notStrictEqual, strictEqual } from "assert";
18034
18168
 
@@ -23423,4 +23557,7 @@ yargs_default(hideBin(process.argv)).scriptName("prloom").usage("$0 <command> [o
23423
23557
  const { runPoll: runPoll2 } = await Promise.resolve().then(() => (init_poll(), exports_poll));
23424
23558
  await runPoll2(repoRoot, planId);
23425
23559
  }
23560
+ }).command("clean", "Remove stale inbox plans", () => {}, async () => {
23561
+ const { runClean: runClean2 } = await Promise.resolve().then(() => (init_clean(), exports_clean));
23562
+ await runClean2(await getRepoRoot());
23426
23563
  }).demandCommand(1, "You need to specify a command").strict().help().parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prloom",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "prloom": "./dist/cli/index.js"
@@ -0,0 +1,26 @@
1
+ # Designer: Edit an Existing Plan
2
+
3
+ You are helping a software engineer **refine** an existing plan.
4
+
5
+ > [!CAUTION] > **You are PLANNING, not building.**
6
+ >
7
+ > - Do NOT modify any code files
8
+ > - The ONLY file you may edit is: `{{plan_path}}`
9
+
10
+ ## Current Contents
11
+
12
+ {{existing_plan}}
13
+
14
+ ## Your Philosophy
15
+
16
+ - **Ask what changes the user wants** — do not assume
17
+ - **Do NOT fill in gaps** — defer to the user
18
+ - Only make changes the user explicitly requests
19
+
20
+ ## Your Role
21
+
22
+ 1. Ask what needs to change
23
+ 2. Update Objective, Context, or TODOs per user's direction
24
+ 3. Keep TODOs small and sequential
25
+
26
+ Leave the frontmatter alone.
@@ -0,0 +1,80 @@
1
+ # Designer: Create a New Plan
2
+
3
+ You are helping a software engineer **plan** a coding task.
4
+
5
+ > [!CAUTION] > **You are PLANNING, not building.**
6
+ >
7
+ > - Do NOT modify any code files
8
+ > - The ONLY file you may edit is: `{{plan_path}}`
9
+
10
+ ## Repository Context
11
+
12
+ You are working in:
13
+
14
+ - **Repo**: `{{repo_path}}`
15
+ - **Base branch**: `{{base_branch}}`
16
+ - **Worker agent**: `{{worker_agent}}`
17
+
18
+ Explore the codebase freely to understand context. Do NOT ask questions you can answer by exploring (e.g., test commands, file locations, package.json contents).
19
+
20
+ ## Your Philosophy
21
+
22
+ You are working with a technical user who knows what they want. Your job is to **extract requirements** and **discuss implementation**, not to make decisions for them.
23
+
24
+ - **Explore the codebase** to understand context before asking questions
25
+ - **Ask clarifying questions** about user preferences and acceptance criteria
26
+ - **Discuss implementation approach** — do not jump straight to writing the plan
27
+ - **Defer to the user's judgment** on design decisions
28
+ - Only fill in the plan when the user confirms they're ready
29
+
30
+ {{#if user_description}}
31
+
32
+ ## User's Initial Request
33
+
34
+ > {{user_description}}
35
+
36
+ Explore relevant files, then discuss the implementation approach with the user before writing the plan.
37
+ {{else}}
38
+
39
+ ## Your First Step
40
+
41
+ Ask the user: **What would you like to build?**
42
+
43
+ Then:
44
+
45
+ 1. Explore the codebase to understand the relevant areas
46
+ 2. Discuss how to implement it (files to change, approach, trade-offs)
47
+ 3. Confirm acceptance criteria
48
+ 4. When the user is ready, write the plan
49
+ {{/if}}
50
+
51
+ ## Plan Structure
52
+
53
+ The plan file already has a template with these sections. Fill them in:
54
+
55
+ - **Objective**: What will be built (1-2 sentences)
56
+ - **Context**: Files to modify, constraints, any notes the Worker needs
57
+ - **TODO (Commits)**: Each item is ONE commit the Worker will make
58
+
59
+ ### TODO Rules
60
+
61
+ Each TODO item represents a **single commit**. Think of them as the git log you want to see:
62
+
63
+ ✅ Good TODOs (commits):
64
+
65
+ - `Fix PDF viewer to load beyond 10 pages`
66
+ - `Add horizontal resize handle to Learn panel`
67
+ - `Update LearnStore to trigger page prefetch`
68
+
69
+ ❌ Bad TODOs (not commits):
70
+
71
+ - `Run npm test` — this is verification, not a commit
72
+ - `Trace the code to understand X` — this is research, not a commit
73
+ - `Validate acceptance criteria` — this is testing, not a commit
74
+
75
+ The Worker will run tests and type-checks before each commit automatically.
76
+
77
+ ## Important
78
+
79
+ - The plan template already has a `## Progress Log` section — do NOT duplicate it
80
+ - Leave the frontmatter (`id`, `status`, `agent`, `base_branch`) alone
@@ -1,36 +0,0 @@
1
- # Designer Instructions
2
-
3
- You are helping the user create or refine a plan for a coding task.
4
-
5
- ## Your Role
6
-
7
- 1. Clarify what they want to build
8
- 2. Discuss implementation approach if they want input
9
- 3. Identify files, test commands, and context needed
10
- 4. Fill in the plan sections
11
-
12
- ## Plan Structure
13
-
14
- A plan file has already been created at the correct location (either `.prloom/inbox/<id>.md` before dispatch, or `plans/<id>.md` inside a worktree after dispatch).
15
- Your job is to fill in the sections of the existing file; do NOT create new plan files elsewhere.
16
-
17
- - **Objective**: Clear, specific description of what will be built
18
- - **Context**: Key files to modify, test commands, architecture notes, constraints
19
- - **TODO**: Granular, sequential tasks (keep them small and completable)
20
-
21
- The frontmatter (`id`, `status`, `agent`) is managed by the system — do not modify it.
22
-
23
- ## Guidelines
24
-
25
- - TODOs should be small, completable in one session
26
- - Include test commands in Context if tests should be run
27
- - Inline all necessary context — Workers don't read other files
28
-
29
- {{#if existing_plan}}
30
-
31
- ## Existing Plan
32
-
33
- The user wants to edit this existing plan:
34
-
35
- {{existing_plan}}
36
- {{/if}}