buildanything 2.0.0 → 2.1.1

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 (115) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +9 -1
  3. package/README.md +57 -61
  4. package/agents/a11y-architect.md +2 -0
  5. package/agents/briefing-officer.md +172 -0
  6. package/agents/business-model.md +14 -12
  7. package/agents/code-architect.md +6 -1
  8. package/agents/code-reviewer.md +3 -2
  9. package/agents/code-simplifier.md +12 -4
  10. package/agents/design-brand-guardian.md +19 -0
  11. package/agents/design-critic.md +16 -11
  12. package/agents/design-inclusive-visuals-specialist.md +2 -0
  13. package/agents/design-ui-designer.md +17 -0
  14. package/agents/design-ux-architect.md +15 -0
  15. package/agents/design-ux-researcher.md +102 -7
  16. package/agents/engineering-ai-engineer.md +2 -0
  17. package/agents/engineering-backend-architect.md +2 -0
  18. package/agents/engineering-data-engineer.md +2 -0
  19. package/agents/engineering-devops-automator.md +2 -0
  20. package/agents/engineering-frontend-developer.md +13 -0
  21. package/agents/engineering-mobile-app-builder.md +2 -0
  22. package/agents/engineering-rapid-prototyper.md +15 -2
  23. package/agents/engineering-security-engineer.md +2 -0
  24. package/agents/engineering-senior-developer.md +13 -0
  25. package/agents/engineering-sre.md +2 -0
  26. package/agents/engineering-technical-writer.md +2 -0
  27. package/agents/feature-intel.md +8 -7
  28. package/agents/ios-app-review-guardian.md +2 -0
  29. package/agents/ios-foundation-models-specialist.md +2 -0
  30. package/agents/ios-product-reality-auditor.md +292 -0
  31. package/agents/ios-storekit-specialist.md +2 -0
  32. package/agents/ios-swift-architect.md +1 -0
  33. package/agents/ios-swift-search.md +1 -0
  34. package/agents/ios-swift-ui-design.md +7 -4
  35. package/agents/marketing-app-store-optimizer.md +2 -0
  36. package/agents/planner.md +6 -1
  37. package/agents/pr-test-analyzer.md +3 -2
  38. package/agents/product-feedback-synthesizer.md +62 -0
  39. package/agents/product-owner.md +163 -0
  40. package/agents/product-reality-auditor.md +216 -0
  41. package/agents/product-spec-writer.md +176 -0
  42. package/agents/refactor-cleaner.md +9 -1
  43. package/agents/security-reviewer.md +2 -1
  44. package/agents/silent-failure-hunter.md +2 -1
  45. package/agents/swift-build-resolver.md +2 -0
  46. package/agents/swift-reviewer.md +2 -1
  47. package/agents/tech-feasibility.md +5 -3
  48. package/agents/testing-api-tester.md +2 -0
  49. package/agents/testing-evidence-collector.md +24 -0
  50. package/agents/testing-performance-benchmarker.md +2 -0
  51. package/agents/testing-reality-checker.md +2 -1
  52. package/agents/visual-research.md +7 -5
  53. package/bin/adapters/scribe-tool.ts +4 -2
  54. package/bin/adapters/write-lease-tool.ts +1 -1
  55. package/bin/buildanything-runtime.ts +20 -107
  56. package/bin/graph-index.js +24 -0
  57. package/bin/graph-index.ts +340 -0
  58. package/bin/mcp-servers/graph-mcp.js +26 -0
  59. package/bin/mcp-servers/graph-mcp.ts +481 -0
  60. package/bin/mcp-servers/orchestrator-mcp.js +26 -0
  61. package/bin/mcp-servers/orchestrator-mcp.ts +361 -0
  62. package/bin/setup.js +272 -111
  63. package/commands/build.md +371 -158
  64. package/commands/idea-sweep.md +2 -2
  65. package/commands/setup.md +15 -4
  66. package/commands/ux-review.md +3 -3
  67. package/commands/verify.md +3 -0
  68. package/docs/migration/phase-graph.yaml +573 -157
  69. package/hooks/design-md-lint +4 -0
  70. package/hooks/design-md-lint.ts +295 -0
  71. package/hooks/pre-tool-use.ts +37 -6
  72. package/hooks/record-mode-transitions.ts +63 -6
  73. package/hooks/subagent-start.ts +3 -2
  74. package/package.json +3 -1
  75. package/protocols/agent-prompt-authoring.md +165 -0
  76. package/protocols/architecture-schema.md +10 -3
  77. package/protocols/cleanup.md +4 -0
  78. package/protocols/decision-log.md +8 -4
  79. package/protocols/design-md-authoring.md +520 -0
  80. package/protocols/design-md-spec.md +362 -0
  81. package/protocols/fake-data-detector.md +1 -1
  82. package/protocols/ios-fake-data-detector.md +65 -0
  83. package/protocols/ios-phase-branches.md +112 -27
  84. package/protocols/launch-readiness.md +9 -5
  85. package/protocols/metric-loop.md +1 -1
  86. package/protocols/page-spec-schema.md +234 -0
  87. package/protocols/product-spec-schema.md +354 -0
  88. package/protocols/sprint-tasks-schema.md +53 -0
  89. package/protocols/state-schema.json +38 -3
  90. package/protocols/state-schema.md +32 -2
  91. package/protocols/verify.md +29 -1
  92. package/protocols/web-phase-branches.md +234 -64
  93. package/skills/ios/ios-bootstrap/SKILL.md +1 -1
  94. package/src/graph/ids.ts +86 -0
  95. package/src/graph/index.ts +32 -0
  96. package/src/graph/parser/architecture.ts +603 -0
  97. package/src/graph/parser/component-manifest.ts +268 -0
  98. package/src/graph/parser/decisions-jsonl.ts +407 -0
  99. package/src/graph/parser/design-md-pass2.ts +253 -0
  100. package/src/graph/parser/design-md.ts +477 -0
  101. package/src/graph/parser/page-spec.ts +496 -0
  102. package/src/graph/parser/product-spec.ts +930 -0
  103. package/src/graph/parser/screenshot.ts +342 -0
  104. package/src/graph/parser/sprint-tasks.ts +317 -0
  105. package/src/graph/storage/index.ts +1154 -0
  106. package/src/graph/types.ts +432 -0
  107. package/src/graph/util/dhash.ts +84 -0
  108. package/src/lrr/aggregator.ts +105 -10
  109. package/src/orchestrator/hooks/context-header.ts +34 -10
  110. package/src/orchestrator/hooks/token-accounting.ts +25 -14
  111. package/src/orchestrator/mcp/cycle-counter.ts +2 -1
  112. package/src/orchestrator/mcp/scribe.ts +27 -16
  113. package/src/orchestrator/mcp/write-lease.ts +30 -13
  114. package/src/orchestrator/phase4-shared-context.ts +20 -4
  115. package/protocols/visual-dna.md +0 -185
@@ -0,0 +1,86 @@
1
+ // Stable ID generation for Slice 1 nodes. Determinism matters: same
2
+ // product-spec.md → identical IDs → SHA256 cache hits. Source of truth for
3
+ // the rules: docs/graph/04-slice1-schema.md §3.
4
+
5
+ import { createHash } from "node:crypto";
6
+
7
+ const KEBAB_REPLACE = /[^a-z0-9]+/g;
8
+ const KEBAB_TRIM = /^-+|-+$/g;
9
+
10
+ export function kebab(input: string): string {
11
+ return input
12
+ .toLowerCase()
13
+ .replace(KEBAB_REPLACE, "-")
14
+ .replace(KEBAB_TRIM, "");
15
+ }
16
+
17
+ // Strip-and-normalize before hashing so trivial wording changes (whitespace,
18
+ // punctuation) don't churn IDs. Internal whitespace collapses to single
19
+ // spaces; surrounding whitespace and trailing punctuation are dropped.
20
+ export function normalizeForHash(input: string): string {
21
+ return input.trim().replace(/\s+/g, " ");
22
+ }
23
+
24
+ export function sha256_8(input: string): string {
25
+ return createHash("sha256")
26
+ .update(normalizeForHash(input))
27
+ .digest("hex")
28
+ .slice(0, 8);
29
+ }
30
+
31
+ export function sha256Hex(input: string): string {
32
+ return createHash("sha256").update(input).digest("hex");
33
+ }
34
+
35
+ export const ids = {
36
+ feature: (name: string): string => `feature__${kebab(name)}`,
37
+ screen: (name: string): string => `screen__${kebab(name)}`,
38
+ state: (featureName: string, stateName: string): string =>
39
+ `state__${kebab(featureName)}__${kebab(stateName)}`,
40
+ transition: (featureName: string, fromState: string, toState: string): string =>
41
+ `transition__${kebab(featureName)}__${kebab(fromState)}__${kebab(toState)}`,
42
+ businessRule: (featureName: string, text: string): string =>
43
+ `rule__${kebab(featureName)}__${sha256_8(text)}`,
44
+ failureMode: (featureName: string, trigger: string): string =>
45
+ `failure__${kebab(featureName)}__${sha256_8(trigger)}`,
46
+ acceptanceCriterion: (featureName: string, text: string): string =>
47
+ `accept__${kebab(featureName)}__${sha256_8(text)}`,
48
+ persona: (label: string): string => `persona__${kebab(label)}`,
49
+ personaConstraint: (featureName: string, text: string): string =>
50
+ `pconstraint__${kebab(featureName)}__${sha256_8(text)}`,
51
+ // Slice 2 additions. Source of truth: docs/graph/05-slice2-schema.md.
52
+ designDocRoot: (): string => "design_md__root",
53
+ dnaAxis: (axisName: string): string => `dna_axis__${kebab(axisName)}`,
54
+ dnaGuideline: (polarity: "do" | "dont", text: string): string =>
55
+ `dna_guideline__${polarity}__${sha256_8(text)}`,
56
+ brandReference: (urlOrLabel: string): string =>
57
+ `brand_reference__${sha256_8(urlOrLabel)}`,
58
+ manifestEntry: (slot: string): string => `manifest_entry__${kebab(slot)}`,
59
+ componentSlot: (slot: string): string => `slot__${kebab(slot)}`,
60
+ // Slice 3 additions. Source of truth: docs/graph/07-slice3-schema.md.
61
+ token: (layer: string, name: string): string =>
62
+ `token__${kebab(layer)}__${kebab(name)}`,
63
+ pageSpec: (screenName: string): string =>
64
+ `page_spec__${kebab(screenName)}`,
65
+ wireframeSection: (screenName: string, sectionName: string, order: number): string =>
66
+ `wireframe_section__${kebab(screenName)}__${kebab(sectionName)}__${order}`,
67
+ screenStateSlot: (screenName: string, stateName: string): string =>
68
+ `screen_state_slot__${kebab(screenName)}__${kebab(stateName)}`,
69
+ screenComponentUse: (screenName: string, slot: string, position: string): string =>
70
+ `screen_component_use__${kebab(screenName)}__${kebab(slot)}__${kebab(position)}`,
71
+ keyCopy: (screenName: string, text: string): string =>
72
+ `key_copy__${kebab(screenName)}__${sha256_8(text)}`,
73
+ // Slice 4 additions. Source of truth: docs/graph/09-slice4-schema.md.
74
+ architectureModule: (name: string): string => `module__${kebab(name)}`,
75
+ apiContract: (endpoint: string): string => `api_contract__${kebab(endpoint)}`,
76
+ dataModel: (entityName: string): string => `data_model__${kebab(entityName)}`,
77
+ task: (taskId: string): string => `task__${kebab(taskId)}`,
78
+ decision: (decisionId: string): string => `decision__${kebab(decisionId)}`,
79
+ // Slice 5 additions. Source of truth: docs/graph/11-slice5-schema.md.
80
+ screenshot: (basenameKebab: string, contentSha256First8: string): string =>
81
+ `screenshot__${basenameKebab}__${contentSha256First8}`,
82
+ imageComponentDetection: (screenshotId: string, label: string, order: number): string =>
83
+ `image_component_detection__${screenshotId.replace(/^screenshot__/, "")}__${kebab(label)}__${order}`,
84
+ dogfoodFinding: (findingId: string): string => `dogfood_finding__${kebab(findingId)}`,
85
+ brandDriftObservation: (observationId: string): string => `brand_drift_observation__${kebab(observationId)}`,
86
+ };
@@ -0,0 +1,32 @@
1
+ // Slice 1 module barrel. Public surface for orchestrator + MCP handlers.
2
+
3
+ export * from "./types.js";
4
+ export { ids, kebab, sha256_8, sha256Hex, normalizeForHash } from "./ids.js";
5
+ export { extractProductSpec } from "./parser/product-spec.js";
6
+ export { extractDesignMd } from "./parser/design-md.js";
7
+ export { extractComponentManifest } from "./parser/component-manifest.js";
8
+ export { extractPageSpec } from "./parser/page-spec.js";
9
+ export { extractDesignMdTokens } from "./parser/design-md-pass2.js";
10
+ export { extractArchitecture } from "./parser/architecture.js";
11
+ export { extractSprintTasks } from "./parser/sprint-tasks.js";
12
+ export { extractDecisionsJsonl } from "./parser/decisions-jsonl.js";
13
+ export { extractScreenshot } from "./parser/screenshot.js";
14
+ export {
15
+ loadGraph,
16
+ loadAllGraphs,
17
+ saveGraph,
18
+ queryFeature,
19
+ queryScreen,
20
+ queryAcceptance,
21
+ queryDna,
22
+ queryManifest,
23
+ queryToken,
24
+ queryScreenFull,
25
+ queryDependencies,
26
+ queryCrossContracts,
27
+ queryDecisions,
28
+ queryScreenshot,
29
+ queryScreenshotSimilar,
30
+ queryBrandDrift,
31
+ graphPath,
32
+ } from "./storage/index.js";