@papi-ai/server 0.7.14 → 0.7.16
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 +2 -6
- package/dist/index.js +3147 -925
- package/dist/prompts.js +45 -18
- package/package.json +2 -1
package/dist/prompts.js
CHANGED
|
@@ -193,6 +193,7 @@ Standard planning cycle with full board review.
|
|
|
193
193
|
- **P3 Low** \u2014 Nice-to-have, speculative, or future-horizon work.
|
|
194
194
|
**\u26A0\uFE0F PRIORITY RECALIBRATION \u2014 do NOT rubber-stamp the submitted priority.** The priority set at idea submission reflects the submitter's view at that time, which may be outdated by the time the planner runs. For EVERY unreviewed task, evaluate its priority FROM SCRATCH against: (a) current horizon/stage/phase goals, (b) recent Active Decision changes, (c) recently shipped functionality that makes this task more or less urgent. If your assessed priority differs from the submitted one, set the new priority in \`boardCorrections\` and include the change in a **Priority Recalibration** paragraph in your cycle log (Step 8): list each changed task by ID, old priority \u2192 new priority, and a 1-sentence rationale. This paragraph is how the user sees what the planner recalibrated and why. If no priorities changed during triage, omit the paragraph.
|
|
195
195
|
Also set complexity using the full range \u2014 **XS, Small, Medium, Large, XL** \u2014 based on actual scope, not conservatively. XS = single-line or config change. Small = one file, < 50 lines. Medium = 2-5 files. Large = cross-module, multiple components. XL = architectural, multi-day.
|
|
196
|
+
**Module classification for cross-cutting tasks:** When a task title contains "audit"/"unfiltered"/"scoping"/"leak" plus a database-entity name (e.g. "audit ... cycle_learnings reads", "unfiltered cycle_tasks queries"), classify the module by the actual code surface that reads/writes the entity \u2014 not by the tool names mentioned in the title. The reasoning surface (e.g. "health" or "strategy_review") is often unrelated to the data-access surface. Resolve this by treating the entity name as the routing signal: tasks touching dashboard read/write paths belong to the Dashboard module even if the title mentions an MCP tool. Misclassification routes the task to the wrong shared cycle branch and surfaces the wrong MODULE INSTRUCTIONS to the builder.
|
|
196
197
|
If a task is clearly obsolete, duplicated, or rejected, set its status to "Cancelled" with a \`closureReason\` explaining why.
|
|
197
198
|
**\u2192 PERSIST:** For each task you set reviewed: true, corrected fields on, or marked "Cancelled", include it in \`boardCorrections\` in Part 2.
|
|
198
199
|
|
|
@@ -285,11 +286,11 @@ ${AD_REJECTION_RULES}
|
|
|
285
286
|
|
|
286
287
|
**UI/visual task detection:** Apply these additions ONLY to tasks whose PRIMARY scope is frontend visual work \u2014 the task's main deliverable must be a UI change, new component, visual design, or page. Do NOT apply to backend tasks, DB migrations, or prompt/config changes that merely mention a dashboard or page in passing. Signal: the task would fail if no .tsx/.css files were changed. If uncertain, skip the UI additions.
|
|
287
288
|
When a task IS a UI task (primary scope is visual/frontend):
|
|
288
|
-
- Add to SCOPE: "Read \`.impeccable.md\` for
|
|
289
|
+
- Add to SCOPE: "Read \`.impeccable.md\` for component patterns, anti-patterns, and dev-loop design rules. Read \`docs/branding/brand-book.html\` for brand identity (positioning, voice, palette as final canon). Use the \`frontend-design\` skill for implementation."
|
|
289
290
|
- For M/L UI tasks, add to SCOPE: "Use the full UI toolchain: Playground (design preview) \u2192 Frontend-design (build) \u2192 Playwright (verify). The playground is the quality bar. Expect 2-3 iterations."
|
|
290
291
|
- Add to ACCEPTANCE CRITERIA: "[ ] Visually verify rendered output in browser \u2014 provide localhost URL or screenshot to user for review." and "[ ] No raw IDs, abbreviations, or jargon visible without human-readable labels or tooltips."
|
|
291
|
-
- If the task involves image selection, add to SCOPE: "Include brand/theme direction constraints for image selection."
|
|
292
|
-
The planner's job is scoping, not design direction. Design decisions happen at build time via \`.impeccable.md\` and the frontend-design skill \u2014 don't try to write design specs in the handoff.
|
|
292
|
+
- If the task involves image selection, add to SCOPE: "Include brand/theme direction constraints for image selection \u2014 pull from \`docs/branding/brand-book.html\` for canonical brand identity."
|
|
293
|
+
The planner's job is scoping, not design direction. Design decisions happen at build time via \`.impeccable.md\` (dev patterns) + \`docs/branding/brand-book.html\` (brand identity) and the frontend-design skill \u2014 don't try to write design specs in the handoff.
|
|
293
294
|
|
|
294
295
|
11. **New Tasks (max 3 per cycle)** \u2014 Actively mine the Recent Build Reports for task candidates. For each report, check:
|
|
295
296
|
- **Discovered Issues:** If a build report lists a discovered issue and no existing board task covers it, propose a new task.
|
|
@@ -357,7 +358,7 @@ var PLAN_FRAGMENT_SPIKE = `
|
|
|
357
358
|
var PLAN_FRAGMENT_DESIGN_BRIEF = `
|
|
358
359
|
**Design brief task detection:** When a task's task type is "design-brief", generate a DESIGN BRIEF handoff. Replace the standard SCOPE (DO THIS) section with these type-specific sections:
|
|
359
360
|
- AUDIENCE: Who this design is for \u2014 persona and context of use (e.g. "non-technical Owner, first dashboard visit")
|
|
360
|
-
- BRAND CONSTRAINTS: Palette, typography, tone \u2014 pull from \`.impeccable.md\`
|
|
361
|
+
- BRAND CONSTRAINTS: Palette, typography, tone \u2014 pull from \`.impeccable.md\` (dev patterns, anti-patterns, component rules) AND \`docs/branding/brand-book.html\` (brand identity, positioning, voice canon) if present. If neither exists, state "No brand doc \u2014 Owner should define constraints before starting."
|
|
361
362
|
- DELIVERABLE FORMAT: What the output looks like \u2014 Claude Design handoff package / annotated mockup / style spec. Be specific so the person doing the work knows what "done" means.
|
|
362
363
|
- REVIEW POINTS: What the Owner must approve before the design is considered done (e.g. layout, copy, colour, imagery).
|
|
363
364
|
Keep SCOPE BOUNDARY, ACCEPTANCE CRITERIA, SECURITY CONSIDERATIONS, and PRE-BUILD VERIFICATION sections as normal.
|
|
@@ -389,11 +390,11 @@ var PLAN_FRAGMENT_OPS_BRIEF = `
|
|
|
389
390
|
var PLAN_FRAGMENT_UI = `
|
|
390
391
|
**UI/visual task detection:** Apply these additions ONLY to tasks whose PRIMARY scope is frontend visual work \u2014 the task's main deliverable must be a UI change, new component, visual design, or page. Do NOT apply to backend tasks, DB migrations, or prompt/config changes that merely mention a dashboard or page in passing. Signal: the task would fail if no .tsx/.css files were changed. If uncertain, skip the UI additions.
|
|
391
392
|
When a task IS a UI task (primary scope is visual/frontend):
|
|
392
|
-
- Add to SCOPE: "Read \`.impeccable.md\` for
|
|
393
|
+
- Add to SCOPE: "Read \`.impeccable.md\` for component patterns, anti-patterns, and dev-loop design rules. Read \`docs/branding/brand-book.html\` for brand identity (positioning, voice, palette as final canon). Use the \`frontend-design\` skill for implementation."
|
|
393
394
|
- For M/L UI tasks, add to SCOPE: "Use the full UI toolchain: Playground (design preview) \u2192 Frontend-design (build) \u2192 Playwright (verify). The playground is the quality bar. Expect 2-3 iterations."
|
|
394
395
|
- Add to ACCEPTANCE CRITERIA: "[ ] Visually verify rendered output in browser \u2014 provide localhost URL or screenshot to user for review." and "[ ] No raw IDs, abbreviations, or jargon visible without human-readable labels or tooltips."
|
|
395
|
-
- If the task involves image selection, add to SCOPE: "Include brand/theme direction constraints for image selection."
|
|
396
|
-
The planner's job is scoping, not design direction. Design decisions happen at build time via \`.impeccable.md\` and the frontend-design skill \u2014 don't try to write design specs in the handoff.`;
|
|
396
|
+
- If the task involves image selection, add to SCOPE: "Include brand/theme direction constraints for image selection \u2014 pull from \`docs/branding/brand-book.html\` for canonical brand identity."
|
|
397
|
+
The planner's job is scoping, not design direction. Design decisions happen at build time via \`.impeccable.md\` (dev patterns) + \`docs/branding/brand-book.html\` (brand identity) and the frontend-design skill \u2014 don't try to write design specs in the handoff.`;
|
|
397
398
|
var PLAN_FRAGMENT_PRODUCT_BRIEF = `
|
|
398
399
|
12. **Product Brief** \u2014 Check whether the product brief still reflects reality. Update the brief when ANY of these apply:
|
|
399
400
|
- A new AD was created or an existing AD was superseded that changes product scope, target user, or positioning
|
|
@@ -431,6 +432,7 @@ Standard planning cycle with full board review.
|
|
|
431
432
|
- **P3 Low** \u2014 Nice-to-have, speculative, or future-horizon work.
|
|
432
433
|
**\u26A0\uFE0F PRIORITY RECALIBRATION \u2014 do NOT rubber-stamp the submitted priority.** The priority set at idea submission reflects the submitter's view at that time, which may be outdated by the time the planner runs. For EVERY unreviewed task, evaluate its priority FROM SCRATCH against: (a) current horizon/stage/phase goals, (b) recent Active Decision changes, (c) recently shipped functionality that makes this task more or less urgent. If your assessed priority differs from the submitted one, set the new priority in \`boardCorrections\` and include the change in a **Priority Recalibration** paragraph in your cycle log (Step 8): list each changed task by ID, old priority \u2192 new priority, and a 1-sentence rationale. This paragraph is how the user sees what the planner recalibrated and why. If no priorities changed during triage, omit the paragraph.
|
|
433
434
|
Also set complexity using the full range \u2014 **XS, Small, Medium, Large, XL** \u2014 based on actual scope, not conservatively. XS = single-line or config change. Small = one file, < 50 lines. Medium = 2-5 files. Large = cross-module, multiple components. XL = architectural, multi-day.
|
|
435
|
+
**Module classification for cross-cutting tasks:** When a task title contains "audit"/"unfiltered"/"scoping"/"leak" plus a database-entity name (e.g. "audit ... cycle_learnings reads", "unfiltered cycle_tasks queries"), classify the module by the actual code surface that reads/writes the entity \u2014 not by the tool names mentioned in the title. The reasoning surface (e.g. "health" or "strategy_review") is often unrelated to the data-access surface. Resolve this by treating the entity name as the routing signal: tasks touching dashboard read/write paths belong to the Dashboard module even if the title mentions an MCP tool. Misclassification routes the task to the wrong shared cycle branch and surfaces the wrong MODULE INSTRUCTIONS to the builder.
|
|
434
436
|
If a task is clearly obsolete, duplicated, or rejected, set its status to "Cancelled" with a \`closureReason\` explaining why.
|
|
435
437
|
**\u2192 PERSIST:** For each task you set reviewed: true, corrected fields on, or marked "Cancelled", include it in \`boardCorrections\` in Part 2.
|
|
436
438
|
|
|
@@ -645,6 +647,16 @@ function buildPlanUserMessage(ctx) {
|
|
|
645
647
|
if (ctx.registeredDocs) {
|
|
646
648
|
parts.push("### Relevant Research Docs", "", ctx.registeredDocs, "");
|
|
647
649
|
}
|
|
650
|
+
if (ctx.unactionedDocs) {
|
|
651
|
+
parts.push(
|
|
652
|
+
"### Unactioned Research (soft-warn)",
|
|
653
|
+
"",
|
|
654
|
+
"These registered docs still have pending actions. Before adding net-new tasks, consider whether one of these unactioned items should be promoted into this cycle via `doc_action_promote`. Surface this in your plan output so the user can decide.",
|
|
655
|
+
"",
|
|
656
|
+
ctx.unactionedDocs,
|
|
657
|
+
""
|
|
658
|
+
);
|
|
659
|
+
}
|
|
648
660
|
if (ctx.carryForwardStaleness) {
|
|
649
661
|
parts.push("### Carry-Forward Staleness", "", ctx.carryForwardStaleness, "");
|
|
650
662
|
}
|
|
@@ -857,6 +869,13 @@ ${AD_REJECTION_RULES}
|
|
|
857
869
|
|
|
858
870
|
**Registered Documents:** If a "### Registered Documents" section is present in context, scan it for: (a) research findings that contradict current ADs or strategy, (b) unactioned research that should influence the next plan. Reference relevant docs by title in your review. If unregistered docs are listed, flag 1-2 that look strategically relevant and suggest registering them.
|
|
859
871
|
|
|
872
|
+
**Doc Action Staleness:** If a "### Doc Action Staleness" section is present, treat it as a research-to-action audit. For each entry:
|
|
873
|
+
- **Stale** (no Done task, >20 cycles old): explicitly call it out in section 2 (Product Gaps) or 3 (Opportunities) \u2014 research that's been sitting unactioned this long is either (a) no longer relevant (recommend marking the doc archived) or (b) silently dropped (recommend promoting via \`doc_action_promote\` into the next plan).
|
|
874
|
+
- **Completed but not closed** (linked task is Done): instruct in your review that the action should be marked resolved \u2014 it's done work the registry hasn't caught up to.
|
|
875
|
+
- **Deferred** (<20 cycles, no matching Done task): only mention if it relates to a current strategic theme; otherwise leave it.
|
|
876
|
+
|
|
877
|
+
For every stale or unresolved item you call out, propose a concrete next step (promote, archive, or supersede) \u2014 don't just observe.
|
|
878
|
+
|
|
860
879
|
## CONDITIONAL SECTIONS (include only when genuinely useful \u2014 most reviews should have 0-2 of these)
|
|
861
880
|
|
|
862
881
|
6. **Security Posture Review** \u2014 Only if \`[SECURITY]\` tags exist in recent cycle logs.
|
|
@@ -965,7 +984,7 @@ After your natural language output, include this EXACT format on its own line:
|
|
|
965
984
|
"content": "string \u2014 specific observation from using PAPI on this project (e.g. 'deprioritise clears handoffs unnecessarily, wasting planner tokens')"
|
|
966
985
|
}
|
|
967
986
|
],
|
|
968
|
-
"northStar": "string or null \u2014 the current North Star statement. Include if you assessed it in section 4 and it is still accurate (copy the current statement verbatim). Include the updated version if you revised it. Use null ONLY if no North Star has ever been set for this project."
|
|
987
|
+
"northStar": "string or null \u2014 the current North Star statement. Include if you assessed it in section 4 and it is still accurate (copy the current statement verbatim). Include the updated version if you revised it. Use null ONLY if no North Star has ever been set for this project. PLAIN TEXT ONLY \u2014 no markdown formatting, no **bold**, no _italic_, no ##headings, no quote marks around the whole statement. Just the statement itself."
|
|
969
988
|
}
|
|
970
989
|
\`\`\`
|
|
971
990
|
|
|
@@ -1273,12 +1292,16 @@ This is an existing project being adopted into PAPI. Use the codebase analysis b
|
|
|
1273
1292
|
|
|
1274
1293
|
${inputs.codebaseContext}
|
|
1275
1294
|
` : "";
|
|
1295
|
+
const description = inputs.description?.trim() ? `**Description:** ${inputs.description}
|
|
1296
|
+
` : `**Description:** (not provided \u2014 derive from the codebase analysis below)
|
|
1297
|
+
`;
|
|
1298
|
+
const targetUsers = inputs.targetUsers?.trim() ? `**Target users:** ${inputs.targetUsers}
|
|
1299
|
+
` : `**Target users:** (not provided \u2014 derive from the codebase analysis below)
|
|
1300
|
+
`;
|
|
1276
1301
|
return `Generate a Product Brief for this project.
|
|
1277
1302
|
|
|
1278
1303
|
**Project name:** ${inputs.projectName}
|
|
1279
|
-
**
|
|
1280
|
-
**Target users:** ${inputs.targetUsers}
|
|
1281
|
-
**Key problems it solves:** ${inputs.problems}${codebaseSection}
|
|
1304
|
+
${description}${targetUsers}**Key problems it solves:** ${inputs.problems}${codebaseSection}
|
|
1282
1305
|
|
|
1283
1306
|
Return the Product Brief using this exact markdown structure (fill in each section with specific, concrete content \u2014 no placeholder text):
|
|
1284
1307
|
|
|
@@ -1366,8 +1389,8 @@ function buildAdSeedPrompt(ctx) {
|
|
|
1366
1389
|
"",
|
|
1367
1390
|
`**Project:** ${ctx.projectName}`,
|
|
1368
1391
|
`**Type:** ${ctx.projectType}`,
|
|
1369
|
-
`**Description:** ${ctx.description}`,
|
|
1370
|
-
`**Target users:** ${ctx.targetUsers}`,
|
|
1392
|
+
`**Description:** ${ctx.description?.trim() || "(not provided \u2014 derive from project type and problems)"}`,
|
|
1393
|
+
`**Target users:** ${ctx.targetUsers?.trim() || "(not provided \u2014 infer reasonable defaults from project type)"}`,
|
|
1371
1394
|
`**Problems solved:** ${ctx.problems}`
|
|
1372
1395
|
];
|
|
1373
1396
|
parts.push(`**Team size:** ${ctx.teamSize}`);
|
|
@@ -1412,8 +1435,8 @@ function buildConventionsPrompt(ctx) {
|
|
|
1412
1435
|
"",
|
|
1413
1436
|
`**Project:** ${ctx.projectName}`,
|
|
1414
1437
|
`**Type:** ${ctx.projectType}`,
|
|
1415
|
-
`**Description:** ${ctx.description}`,
|
|
1416
|
-
`**Target users:** ${ctx.targetUsers}`,
|
|
1438
|
+
`**Description:** ${ctx.description?.trim() || "(not provided \u2014 infer from project type)"}`,
|
|
1439
|
+
`**Target users:** ${ctx.targetUsers?.trim() || "(not provided \u2014 infer reasonable defaults from project type)"}`,
|
|
1417
1440
|
`**Problems solved:** ${ctx.problems}`,
|
|
1418
1441
|
`**Team size:** ${ctx.teamSize}`,
|
|
1419
1442
|
`**Deployment:** ${ctx.deploymentTarget}`
|
|
@@ -1451,12 +1474,16 @@ Return a JSON array of 3-10 tasks. Each task must have:
|
|
|
1451
1474
|
- Tasks should be specific enough to execute without further investigation
|
|
1452
1475
|
- Maximum 10 tasks \u2014 fewer is better if the codebase is well-maintained`;
|
|
1453
1476
|
function buildInitialTasksPrompt(inputs) {
|
|
1477
|
+
const description = inputs.description?.trim() ? `**Description:** ${inputs.description}
|
|
1478
|
+
` : `**Description:** (not provided \u2014 derive from the codebase analysis below)
|
|
1479
|
+
`;
|
|
1480
|
+
const targetUsers = inputs.targetUsers?.trim() ? `**Target users:** ${inputs.targetUsers}
|
|
1481
|
+
` : `**Target users:** (not provided \u2014 derive from the codebase analysis below)
|
|
1482
|
+
`;
|
|
1454
1483
|
return `Analyse this existing codebase and generate initial backlog tasks.
|
|
1455
1484
|
|
|
1456
1485
|
**Project:** ${inputs.projectName}
|
|
1457
|
-
|
|
1458
|
-
**Target users:** ${inputs.targetUsers}
|
|
1459
|
-
|
|
1486
|
+
${description}${targetUsers}
|
|
1460
1487
|
${inputs.codebaseContext}
|
|
1461
1488
|
|
|
1462
1489
|
Return a JSON array of 3-10 tasks based on gaps, improvements, and next steps visible from the codebase analysis above.`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papi-ai/server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"description": "PAPI MCP server — AI-powered sprint planning, build execution, and strategy review for software projects",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"start": "node dist/index.js",
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"test:watch": "vitest",
|
|
26
|
+
"lint": "eslint src",
|
|
26
27
|
"prepack": "rm -rf dist && npm run build"
|
|
27
28
|
},
|
|
28
29
|
"keywords": [
|