@workermill/agent 0.4.6 → 0.4.9

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.
@@ -100,7 +100,7 @@ Review this execution plan against the PRD:
100
100
  1. **Missing Requirements** - Does the plan cover what the PRD asks for?
101
101
  2. **Vague Instructions** - Will the worker know what to do?
102
102
  3. **Security Issues** - Only for tasks involving auth, user data, or external input
103
- 4. **Unrealistic Scope** - Any step targeting >3 files MUST score below 85 (auto-rejection threshold). Each step should modify at most 3 files. If a step needs more, split it into multiple steps first.
103
+ 4. **Unrealistic Scope** - Any step targeting >3 files MUST score below 75 (auto-rejection threshold). Each step should modify at most 3 files. If a step needs more, split it into multiple steps first.
104
104
  5. **Missing Operational Steps** - If the PRD requires deployment, provisioning, migrations, or running commands, does the plan include operational steps? Writing code is not the same as deploying it.
105
105
  6. **Overlapping File Scope** - If two or more steps share the same targetFiles, this causes parallel merge conflicts. Steps MUST NOT overlap on targetFiles. Deduct 10 points per shared file across steps.
106
106
 
@@ -117,7 +117,7 @@ Respond with ONLY a JSON object (no markdown, no explanation):
117
117
  {"approved": boolean, "score": number, "risks": ["risk1", "risk2"], "suggestions": ["suggestion1", "suggestion2"], "storyFeedback": [{"storyId": "step-0", "feedback": "specific feedback", "suggestedChanges": ["change1"]}]}
118
118
 
119
119
  Rules:
120
- - approved = true if score >= 85 AND plan is right-sized for task
120
+ - approved = true if score >= 75 AND plan is right-sized for task
121
121
  - risks = specific issues (empty array if none)
122
122
  - suggestions = actionable improvements (empty array if none)
123
123
  - storyFeedback = per-step feedback (optional, only for steps that need changes)`;
package/dist/planner.js CHANGED
@@ -390,42 +390,65 @@ function runAnalyst(name, claudePath, model, prompt, repoPath, env, timeoutMs =
390
390
  });
391
391
  }
392
392
  /** Analyst prompt templates */
393
- const CODEBASE_ANALYST_PROMPT = `You are analyzing a codebase to help plan a development task.
394
- Use Glob and Read to explore the repository structure.
395
- Report:
396
- 1. Key directories and their purposes
397
- 2. Frameworks, languages, and patterns used
398
- 3. Existing test patterns and locations
399
- 4. CI/CD configuration
400
- 5. Key configuration files (.env, tsconfig, etc.)
401
- Keep your report under 2000 words. Focus on facts, not opinions.`;
393
+ const CODEBASE_ANALYST_PROMPT = `You are a codebase analyst. Your job is to explore this repository using tools and report what you find.
394
+
395
+ IMPORTANT: You MUST use tools to explore the repository. Do NOT guess or make assumptions.
396
+
397
+ Step 1: Run Glob with pattern "**/*" to see the top-level directory structure.
398
+ Step 2: Read key files: package.json, tsconfig.json, README.md, .env.example, or equivalents.
399
+ Step 3: Run Glob on src/ or the main source directory to understand the code layout.
400
+ Step 4: Read 2-3 representative source files to understand patterns and frameworks.
401
+
402
+ After exploring, write a report covering:
403
+ 1. Directory structure and organization
404
+ 2. Languages, frameworks, and key dependencies (from package.json, requirements.txt, etc.)
405
+ 3. Existing test files and testing patterns (search for test/, __tests__, *.test.*, *.spec.*)
406
+ 4. CI/CD configuration (search for .github/workflows/, Jenkinsfile, etc.)
407
+ 5. Configuration files and environment setup
408
+
409
+ Keep your report under 2000 words. Only report facts you verified with tools.`;
402
410
  function makeRequirementsAnalystPrompt(task) {
403
- return `Given this task description:
411
+ return `You are a requirements analyst. Analyze the following task and the repository to identify what needs to be built.
404
412
 
405
- Title: ${task.summary}
413
+ Task: ${task.summary}
406
414
  ${task.description ? `\nDescription:\n${task.description}` : ""}
407
415
 
408
- Analyze the requirements and report:
409
- 1. Explicit acceptance criteria (what MUST be done)
410
- 2. Implicit requirements (what's assumed but not stated)
411
- 3. Ambiguities that could lead to wrong implementation
412
- 4. Affected components based on the requirement scope
413
- 5. Suggested personas for each component
416
+ IMPORTANT: You MUST use tools to understand the existing codebase before analyzing requirements.
417
+
418
+ Step 1: Run Glob with pattern "**/*" to see what already exists in the repository.
419
+ Step 2: Read any existing README, docs, or configuration to understand the current state.
420
+ Step 3: Search for any code related to the task requirements using Grep.
421
+
422
+ After exploring, write a report covering:
423
+ 1. Explicit acceptance criteria — what MUST be built based on the description
424
+ 2. Implicit requirements — what's assumed but not stated (auth, error handling, etc.)
425
+ 3. What already exists vs what needs to be created (based on your file exploration)
426
+ 4. Ambiguities that could lead to wrong implementation
427
+ 5. Suggested components/modules and which persona should own each
428
+
414
429
  Keep your report under 1500 words.`;
415
430
  }
416
431
  function makeRiskAssessorPrompt(task) {
417
- return `You are assessing risks for a development task on this codebase.
418
- The task: ${task.summary}
432
+ return `You are a risk assessor. Your job is to search this repository for potential risks and blockers for a development task.
433
+
434
+ Task: ${task.summary}
419
435
  ${task.description ? `\nDescription:\n${task.description}` : ""}
420
436
 
421
- Use Grep and Read to check for potential blockers.
422
- Report:
423
- 1. Files likely to be modified (search for relevant code)
424
- 2. Files that are heavily coupled (imports/dependencies)
425
- 3. Existing tests that may need updating
426
- 4. Environment/config dependencies
427
- 5. Migration or deployment considerations
428
- Keep your report under 1500 words.`;
437
+ IMPORTANT: You MUST use tools to search the codebase. Do NOT guess file paths or make assumptions.
438
+
439
+ Step 1: Run Glob with pattern "**/*" to see the full repository structure.
440
+ Step 2: Use Grep to search for code related to the task (relevant keywords, APIs, components).
441
+ Step 3: Read files that are likely to be modified or affected by this task.
442
+ Step 4: Search for existing tests (Grep for "test", "spec", "describe", "it(") to find test coverage.
443
+
444
+ After exploring, write a report covering:
445
+ 1. Specific files that will need to be modified (exact paths from your search)
446
+ 2. Files with heavy coupling or shared dependencies (imports you found)
447
+ 3. Existing tests that will need updating (exact file paths)
448
+ 4. Environment, config, or migration requirements
449
+ 5. Deployment or infrastructure risks
450
+
451
+ Keep your report under 1500 words. Only report facts you verified with tools.`;
429
452
  }
430
453
  /**
431
454
  * Run team planning: spawn 3 parallel analyst agents, then synthesize
@@ -438,7 +461,7 @@ async function runTeamPlanning(task, basePrompt, claudePath, model, env, repoPat
438
461
  console.log(`${ts()} ${taskLabel} ${chalk.magenta("◆ Team planning")} — running 3 analysts in parallel...`);
439
462
  await postLog(taskId, `${PREFIX} Team planning: running codebase, requirements, and risk analysts in parallel...`);
440
463
  await postProgress(taskId, "reading_repo", Math.round((Date.now() - startTime) / 1000), "Running parallel analysis agents...", 0, 0);
441
- const analysisModel = model.includes("opus") ? "sonnet" : model;
464
+ const analysisModel = model;
442
465
  const MAX_TEAM_RETRIES = 3;
443
466
  let codebaseReport = "";
444
467
  let requirementsReport = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workermill/agent",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
4
4
  "description": "WorkerMill Remote Agent - Run AI workers locally with your Claude Max subscription",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",