@starlein/paperclip-plugin-company-wizard 0.3.18 → 0.3.20

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.
Files changed (48) hide show
  1. package/LICENSE +5 -1
  2. package/README.md +21 -5
  3. package/dist/manifest.js +7 -2
  4. package/dist/manifest.js.map +2 -2
  5. package/dist/ui/index.css +1 -1
  6. package/dist/ui/index.css.map +2 -2
  7. package/dist/ui/index.js +2 -2
  8. package/dist/ui/index.js.map +1 -1
  9. package/dist/worker.js +48 -7
  10. package/dist/worker.js.map +2 -2
  11. package/package.json +17 -16
  12. package/templates/ai-wizard/interview-system.md +1 -1
  13. package/templates/ai-wizard/single-shot-system.md +1 -1
  14. package/templates/modules/accessibility/skills/accessibility-audit.bar.md +11 -0
  15. package/templates/modules/architecture-plan/agents/ui-designer/skills/design-system.bar.md +11 -0
  16. package/templates/modules/architecture-plan/docs/architecture-template.md +1 -1
  17. package/templates/modules/architecture-plan/docs/design-system-template.md +1 -1
  18. package/templates/modules/architecture-plan/skills/architecture-plan.bar.md +11 -0
  19. package/templates/modules/backlog/skills/backlog-health.bar.md +11 -0
  20. package/templates/modules/brand-identity/docs/brand-identity-template.md +1 -1
  21. package/templates/modules/brand-identity/skills/brand-identity.bar.md +11 -0
  22. package/templates/modules/build-api/skills/api-design.bar.md +11 -0
  23. package/templates/modules/ci-cd/skills/ci-cd.bar.md +11 -0
  24. package/templates/modules/codebase-onboarding/skills/codebase-audit.bar.md +11 -0
  25. package/templates/modules/market-analysis/docs/market-analysis-template.md +1 -1
  26. package/templates/modules/market-analysis/skills/market-analysis.bar.md +11 -0
  27. package/templates/modules/monitoring/skills/monitoring.bar.md +11 -0
  28. package/templates/modules/security-audit/skills/security-review.bar.md +11 -0
  29. package/templates/modules/security-audit/skills/threat-model.bar.md +11 -0
  30. package/templates/modules/tech-stack/docs/tech-stack-template.md +1 -1
  31. package/templates/modules/tech-stack/skills/tech-stack.bar.md +11 -0
  32. package/templates/modules/user-testing/docs/user-testing-template.md +1 -1
  33. package/templates/modules/user-testing/skills/user-testing.bar.md +11 -0
  34. package/templates/modules/vision-workshop/docs/vision-template.md +1 -1
  35. package/templates/roles/code-reviewer/DONE.md +10 -0
  36. package/templates/roles/code-reviewer/LENSES.md +11 -0
  37. package/templates/roles/devops/DONE.md +10 -0
  38. package/templates/roles/devops/LENSES.md +12 -0
  39. package/templates/roles/engineer/DONE.md +10 -0
  40. package/templates/roles/product-owner/DONE.md +10 -0
  41. package/templates/roles/product-owner/LENSES.md +11 -0
  42. package/templates/roles/qa/DONE.md +10 -0
  43. package/templates/roles/security-engineer/DONE.md +10 -0
  44. package/templates/roles/security-engineer/LENSES.md +16 -0
  45. package/templates/roles/ui-designer/DONE.md +10 -0
  46. package/templates/roles/ui-designer/LENSES.md +13 -0
  47. package/templates/roles/ux-researcher/DONE.md +10 -0
  48. package/templates/roles/ux-researcher/LENSES.md +14 -0
package/dist/worker.js CHANGED
@@ -9366,6 +9366,9 @@ async function appendToFile(filePath, content) {
9366
9366
  await appendFile(filePath, content);
9367
9367
  }
9368
9368
  }
9369
+ function isEnrichmentFragment(name) {
9370
+ return name === "LENSES.md" || name === "DONE.md" || name.endsWith(".bar.md");
9371
+ }
9369
9372
  async function readJson(p) {
9370
9373
  if (!await exists(p)) return null;
9371
9374
  return JSON.parse(await readFile(p, "utf-8"));
@@ -9397,6 +9400,7 @@ async function assembleCompany({
9397
9400
  presetRoutines = [],
9398
9401
  presetLabels = [],
9399
9402
  enableIsolatedWorktrees = false,
9403
+ enableEnrichedPersonas = false,
9400
9404
  outputDir,
9401
9405
  templatesDir,
9402
9406
  onProgress = () => {
@@ -9480,7 +9484,7 @@ async function assembleCompany({
9480
9484
  await copyDir(join(roleSrc, entry.name), join(roleDest, entry.name), {
9481
9485
  skipExt: ".meta.json"
9482
9486
  });
9483
- } else if (!entry.name.endsWith(".meta.json")) {
9487
+ } else if (!entry.name.endsWith(".meta.json") && !isEnrichmentFragment(entry.name)) {
9484
9488
  await copyFile(join(roleSrc, entry.name), join(roleDest, entry.name));
9485
9489
  }
9486
9490
  }
@@ -9497,6 +9501,7 @@ async function assembleCompany({
9497
9501
  const entries = await readdir(roleDir, { withFileTypes: true });
9498
9502
  for (const entry of entries) {
9499
9503
  if (entry.isDirectory() || !entry.name.endsWith(".md")) continue;
9504
+ if (isEnrichmentFragment(entry.name)) continue;
9500
9505
  await copyFile(join(roleDir, entry.name), join(destDir, entry.name));
9501
9506
  }
9502
9507
  onProgress(`+ agents/${roleName}/ (role)`);
@@ -9671,7 +9676,18 @@ ${stages.join("\n")}
9671
9676
  if (!resolved) return false;
9672
9677
  const destSkillsDir = join(companyDir, "agents", roleName, "skills");
9673
9678
  await mkdir(destSkillsDir, { recursive: true });
9674
- await copyFile(resolved.path, join(destSkillsDir, fileName));
9679
+ const destFile = join(destSkillsDir, fileName);
9680
+ await copyFile(resolved.path, destFile);
9681
+ let barApplied = false;
9682
+ if (enableEnrichedPersonas && label === "primary") {
9683
+ const barFileName = fileName.replace(/\.md$/, ".bar.md");
9684
+ const bar = await resolveSkillFile(roleName, barFileName);
9685
+ if (bar) {
9686
+ const barContent = await readFile(bar.path, "utf-8");
9687
+ await appendToFile(destFile, "\n" + barContent.trim() + "\n");
9688
+ barApplied = true;
9689
+ }
9690
+ }
9675
9691
  await appendToFile(
9676
9692
  join(companyDir, "agents", roleName, "AGENTS.md"),
9677
9693
  `
@@ -9679,7 +9695,10 @@ Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9679
9695
  `
9680
9696
  );
9681
9697
  const sourceTag = resolved.source === "shared" ? ", shared" : "";
9682
- onProgress(`+ agents/${roleName}/skills/${fileName} (${moduleName}, ${label}${sourceTag})`);
9698
+ const barTag = barApplied ? ", output bar" : "";
9699
+ onProgress(
9700
+ `+ agents/${roleName}/skills/${fileName} (${moduleName}, ${label}${sourceTag}${barTag})`
9701
+ );
9683
9702
  return true;
9684
9703
  }
9685
9704
  for (const [skillName, { primary, cap }] of capabilityOwners) {
@@ -9701,6 +9720,7 @@ Read and follow: \`$AGENT_HOME/skills/${fileName}\`
9701
9720
  if (!await exists(skillsDir)) continue;
9702
9721
  const skills = await readdir(skillsDir);
9703
9722
  for (const skillFile of skills) {
9723
+ if (skillFile.endsWith(".bar.md")) continue;
9704
9724
  const skillName = skillFile.replace(/\.md$/, "");
9705
9725
  const skillBaseName = skillName.replace(/\.fallback$/, "");
9706
9726
  if (capabilityOwners.has(skillBaseName)) continue;
@@ -9744,6 +9764,24 @@ Read and follow: \`$AGENT_HOME/skills/${skillFile}\`
9744
9764
  onProgress(`+ agents/${modRole.name}/HEARTBEAT.md (${moduleName}, heartbeat section)`);
9745
9765
  }
9746
9766
  }
9767
+ if (enableEnrichedPersonas) {
9768
+ for (const roleName of allRoles) {
9769
+ const lensesSrc = join(rolesDir, roleName, "LENSES.md");
9770
+ const soulPath = join(companyDir, "agents", roleName, "SOUL.md");
9771
+ if (await exists(lensesSrc) && await exists(soulPath)) {
9772
+ const lenses = await readFile(lensesSrc, "utf-8");
9773
+ await appendToFile(soulPath, "\n" + lenses.trim() + "\n");
9774
+ onProgress(`+ agents/${roleName}/SOUL.md (domain lenses)`);
9775
+ }
9776
+ const doneSrc = join(rolesDir, roleName, "DONE.md");
9777
+ const heartbeatPath = join(companyDir, "agents", roleName, "HEARTBEAT.md");
9778
+ if (await exists(doneSrc) && await exists(heartbeatPath)) {
9779
+ const done = await readFile(doneSrc, "utf-8");
9780
+ await appendToFile(heartbeatPath, "\n" + done.trim() + "\n");
9781
+ onProgress(`+ agents/${roleName}/HEARTBEAT.md (done criteria)`);
9782
+ }
9783
+ }
9784
+ }
9747
9785
  const finalDocsDir = join(companyDir, "docs");
9748
9786
  if (await exists(finalDocsDir)) {
9749
9787
  const docs = (await readdir(finalDocsDir)).sort();
@@ -10647,11 +10685,11 @@ var PaperclipClient = class {
10647
10685
  });
10648
10686
  }
10649
10687
  /**
10650
- * Resolve a clipper role name to a Paperclip API role enum.
10688
+ * Resolve a role name to a Paperclip API role enum.
10651
10689
  * Uses role.json's paperclipRole field, falls back to 'general'.
10652
10690
  */
10653
- static resolveRole(clipperRole, roleData) {
10654
- if (BASE_ROLE_MAP[clipperRole]) return BASE_ROLE_MAP[clipperRole];
10691
+ static resolveRole(roleName, roleData) {
10692
+ if (BASE_ROLE_MAP[roleName]) return BASE_ROLE_MAP[roleName];
10655
10693
  if (roleData?.paperclipRole) return roleData.paperclipRole;
10656
10694
  return "general";
10657
10695
  }
@@ -11121,7 +11159,7 @@ var plugin = definePlugin({
11121
11159
  const cfg = await ctx.config.get() ?? {};
11122
11160
  const companyName = typeof params.companyName === "string" && params.companyName.trim() ? params.companyName.trim() : "Preview";
11123
11161
  const templatesDir = await ensureTemplatesDir(cfg);
11124
- tmpDir = path2.join(os.tmpdir(), `clipper-preview-${Date.now()}`);
11162
+ tmpDir = path2.join(os.tmpdir(), `company-wizard-preview-${Date.now()}`);
11125
11163
  const companiesDir = resolveCompaniesDir(cfg);
11126
11164
  const [presets, allModules] = await Promise.all([
11127
11165
  loadPresets(templatesDir),
@@ -11150,6 +11188,7 @@ var plugin = definePlugin({
11150
11188
  presetRoutines: presetBootstrapData.routines,
11151
11189
  presetLabels: presetBootstrapData.labels,
11152
11190
  enableIsolatedWorktrees: await resolveEnableIsolatedWorkspacesFromInstance(cfg),
11191
+ enableEnrichedPersonas: cfgBool(cfg, "enableEnrichedPersonas"),
11153
11192
  outputDir: tmpDir,
11154
11193
  templatesDir
11155
11194
  });
@@ -11255,6 +11294,7 @@ var plugin = definePlugin({
11255
11294
  "disableBoardApprovalOnNewCompanies"
11256
11295
  );
11257
11296
  const enableIsolatedWorktrees = await resolveEnableIsolatedWorkspacesFromInstance(cfg, log);
11297
+ const enableEnrichedPersonas = cfgBool(cfg, "enableEnrichedPersonas");
11258
11298
  const companyName = typeof params.companyName === "string" ? params.companyName.trim() : "";
11259
11299
  const existingCompanyId = typeof params.existingCompanyId === "string" && params.existingCompanyId.trim() ? params.existingCompanyId.trim() : "";
11260
11300
  if (!companyName) return { error: "companyName is required", logs };
@@ -11295,6 +11335,7 @@ var plugin = definePlugin({
11295
11335
  presetRoutines: presetBootstrapData.routines,
11296
11336
  presetLabels: presetBootstrapData.labels,
11297
11337
  enableIsolatedWorktrees,
11338
+ enableEnrichedPersonas,
11298
11339
  outputDir,
11299
11340
  templatesDir,
11300
11341
  onProgress: log