@geraldmaron/construct 1.0.6 → 1.0.8

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 (218) hide show
  1. package/README.md +39 -34
  2. package/bin/construct +1403 -96
  3. package/commands/build/feature.md +1 -1
  4. package/commands/build/fix.md +1 -1
  5. package/commands/design/access.md +1 -1
  6. package/commands/design/flow.md +1 -1
  7. package/commands/design/ui.md +1 -1
  8. package/commands/measure/experiment.md +1 -1
  9. package/commands/measure/metrics.md +1 -1
  10. package/commands/measure/results.md +1 -1
  11. package/commands/plan/api.md +1 -1
  12. package/commands/plan/challenge.md +1 -1
  13. package/commands/plan/decide.md +1 -1
  14. package/commands/plan/feature.md +1 -1
  15. package/commands/plan/requirements.md +1 -1
  16. package/commands/remember/context.md +1 -1
  17. package/commands/remember/handoff.md +1 -1
  18. package/commands/remember/runbook.md +1 -1
  19. package/commands/review/code.md +1 -1
  20. package/commands/review/quality.md +1 -1
  21. package/commands/review/security.md +1 -1
  22. package/commands/ship/ready.md +1 -1
  23. package/commands/ship/release.md +1 -1
  24. package/commands/ship/status.md +1 -1
  25. package/commands/understand/docs.md +1 -1
  26. package/commands/understand/this.md +1 -1
  27. package/commands/understand/why.md +1 -1
  28. package/commands/work/clean.md +1 -1
  29. package/commands/work/drive.md +1 -1
  30. package/commands/work/optimize-prompts.md +2 -2
  31. package/commands/work/parallel-review.md +1 -1
  32. package/db/schema/007_tags.sql +30 -0
  33. package/db/schema/008_skill_usage.sql +24 -0
  34. package/db/schema/009_scheduler.sql +14 -0
  35. package/examples/internal/roles/architect/bad/clever-plan-without-contracts.md +1 -1
  36. package/examples/internal/roles/architect/golden/explicit-tradeoff-before-plan.md +1 -1
  37. package/examples/internal/roles/engineer/bad/speculative-abstraction.md +1 -1
  38. package/examples/internal/roles/engineer/golden/read-before-write.md +1 -1
  39. package/examples/internal/roles/qa/bad/coverage-theater.md +1 -1
  40. package/examples/internal/roles/qa/golden/regression-gate.md +1 -1
  41. package/examples/seed-observations/decisions.md +1 -1
  42. package/lib/audit-skills.mjs +3 -3
  43. package/lib/auto-docs.mjs +8 -8
  44. package/lib/boundary.mjs +126 -0
  45. package/lib/cache-strategy-google.js +26 -31
  46. package/lib/cli-commands.mjs +276 -122
  47. package/lib/comment-lint.mjs +139 -1
  48. package/lib/completions.mjs +1 -1
  49. package/lib/config/schema.mjs +15 -1
  50. package/lib/contracts/validate.mjs +371 -0
  51. package/lib/daemons/contract.mjs +210 -0
  52. package/lib/distill.mjs +22 -4
  53. package/lib/doc-stamp.mjs +48 -0
  54. package/lib/docs-verify.mjs +59 -6
  55. package/lib/doctor/cli.mjs +16 -1
  56. package/lib/doctor/index.mjs +3 -1
  57. package/lib/doctor/watchers/consistency.mjs +360 -0
  58. package/lib/doctor/watchers/mcp-protocol.mjs +232 -0
  59. package/lib/document-extract.mjs +420 -17
  60. package/lib/document-ingest.mjs +2 -0
  61. package/lib/embed/cli.mjs +124 -3
  62. package/lib/embed/daemon.mjs +43 -4
  63. package/lib/embed/docs-lifecycle.mjs +1 -1
  64. package/lib/embed/inbox.mjs +50 -3
  65. package/lib/embed/role-framing.mjs +3 -3
  66. package/lib/embed/scheduler.mjs +33 -5
  67. package/lib/env-config.mjs +9 -3
  68. package/lib/evaluator-optimizer.mjs +2 -3
  69. package/lib/extractors/calendar.mjs +173 -0
  70. package/lib/extractors/shared/drop-info.mjs +22 -0
  71. package/lib/extractors/transcript.mjs +0 -0
  72. package/lib/gates-audit.mjs +8 -2
  73. package/lib/git-hooks/prepare-commit-msg +1 -1
  74. package/lib/headhunt.mjs +2 -2
  75. package/lib/hooks/agent-tracker.mjs +6 -11
  76. package/lib/hooks/comment-lint.mjs +16 -0
  77. package/lib/hooks/guard-bash.mjs +35 -14
  78. package/lib/hooks/mcp-audit.mjs +14 -1
  79. package/lib/hooks/pre-compact.mjs +92 -5
  80. package/lib/hooks/pre-push-gate.mjs +41 -8
  81. package/lib/hooks/proactive-activation.mjs +0 -14
  82. package/lib/hooks/registry-sync.mjs +2 -2
  83. package/lib/hooks/rule-verifier.mjs +217 -0
  84. package/lib/hooks/session-optimize.mjs +2 -1
  85. package/lib/hooks/stop-notify.mjs +7 -6
  86. package/lib/host-capabilities.mjs +10 -1
  87. package/lib/hygiene/scan.mjs +141 -0
  88. package/lib/init-unified.mjs +73 -65
  89. package/lib/install/stage-project.mjs +4 -4
  90. package/lib/intake/classify.mjs +309 -58
  91. package/lib/intake/daemon.mjs +121 -0
  92. package/lib/intake/filesystem-queue.mjs +31 -6
  93. package/lib/intake/intake-config.mjs +2 -1
  94. package/lib/intake/postgres-queue.mjs +45 -3
  95. package/lib/intake/prepare.mjs +3 -1
  96. package/lib/intake/quarantine.mjs +205 -0
  97. package/lib/intake/session-prelude.mjs +7 -1
  98. package/lib/intake/traceability.mjs +90 -0
  99. package/lib/knowledge/postgres-search.mjs +132 -0
  100. package/lib/knowledge/research-store.mjs +2 -0
  101. package/lib/knowledge/search.mjs +14 -4
  102. package/lib/maintenance/cleanup.mjs +315 -0
  103. package/lib/mcp/memory-bridge.mjs +276 -0
  104. package/lib/mcp/server.mjs +11 -3
  105. package/lib/mcp/tools/skills.mjs +32 -11
  106. package/lib/mcp/tools/workflow.mjs +25 -0
  107. package/lib/mcp-catalog.json +12 -8
  108. package/lib/mcp-platform-config.mjs +16 -8
  109. package/lib/migrations/index.mjs +106 -0
  110. package/lib/migrations/v1-baseline.mjs +33 -0
  111. package/lib/model-registry.mjs +1 -1
  112. package/lib/observation-store.mjs +9 -4
  113. package/lib/opencode-runtime-plugin.mjs +1 -1
  114. package/lib/orchestration-policy.mjs +4 -4
  115. package/lib/outcomes/record.mjs +2 -0
  116. package/lib/overrides/resolver.mjs +3 -3
  117. package/lib/parity.mjs +4 -4
  118. package/lib/policy/engine.mjs +2 -2
  119. package/lib/profiles/lifecycle.mjs +1 -1
  120. package/lib/profiles/rebrand.mjs +46 -0
  121. package/lib/project-init-shared.mjs +12 -0
  122. package/lib/prompt-metadata.mjs +4 -4
  123. package/lib/provider-capabilities.js +20 -7
  124. package/lib/providers/auth-manager.mjs +58 -17
  125. package/lib/providers/circuit-breaker.mjs +14 -0
  126. package/lib/providers/contract.mjs +67 -3
  127. package/lib/providers/creds.mjs +219 -0
  128. package/lib/providers/scaffold.mjs +107 -0
  129. package/lib/reflect.mjs +49 -12
  130. package/lib/role-preload.mjs +5 -0
  131. package/lib/roles/catalog.mjs +1 -1
  132. package/lib/roles/manifest.mjs +2 -2
  133. package/lib/scheduler/index.mjs +112 -0
  134. package/lib/scheduler/solo.mjs +183 -0
  135. package/lib/server/index.mjs +29 -29
  136. package/lib/server/insights.mjs +14 -12
  137. package/lib/server/langfuse-login.mjs +58 -0
  138. package/lib/server/static/assets/index-ab25c707.js +1 -1
  139. package/lib/session-store.mjs +6 -4
  140. package/lib/setup.mjs +14 -3
  141. package/lib/{agent-contracts-enforce.mjs → specialist-contracts-enforce.mjs} +4 -4
  142. package/lib/{agent-contracts.mjs → specialist-contracts.mjs} +9 -8
  143. package/lib/{agents → specialists}/postconditions.mjs +3 -3
  144. package/lib/{agents → specialists}/schema.mjs +6 -6
  145. package/lib/status.mjs +13 -11
  146. package/lib/storage/backup.mjs +2 -2
  147. package/lib/tags/lifecycle.mjs +278 -0
  148. package/lib/tags/vocabulary.mjs +140 -0
  149. package/lib/telemetry/client.mjs +5 -1
  150. package/lib/telemetry/otel-tracer.mjs +184 -0
  151. package/lib/telemetry/skill-calls.mjs +73 -12
  152. package/lib/uninstall/uninstall.mjs +1 -1
  153. package/lib/update.mjs +1 -1
  154. package/lib/validator.mjs +57 -56
  155. package/lib/version.mjs +51 -0
  156. package/lib/worker/trace.mjs +5 -1
  157. package/lib/workflows/instantiate.mjs +320 -0
  158. package/package.json +16 -3
  159. package/personas/construct.md +5 -3
  160. package/platforms/claude/CLAUDE.md +1 -1
  161. package/rules/common/development-workflow.md +2 -1
  162. package/rules/common/no-fabrication.md +69 -0
  163. package/rules/common/review-before-change.md +58 -0
  164. package/scripts/{sync-agents.mjs → sync-specialists.mjs} +171 -68
  165. package/skills/ai/prompt-optimizer.md +3 -3
  166. package/skills/exploration/dependency-graph-reading.md +98 -0
  167. package/skills/exploration/tracer-bullet-method.md +71 -0
  168. package/skills/exploration/unknown-codebase-onboarding.md +91 -0
  169. package/skills/operating/change-management.md +91 -0
  170. package/skills/operating/incident-response.md +75 -0
  171. package/skills/operating/oncall-rotation.md +95 -0
  172. package/skills/operating/orchestration-reference.md +2 -2
  173. package/skills/strategy/competitive-landscape.md +75 -0
  174. package/skills/strategy/market-research-methods.md +87 -0
  175. package/skills/strategy/narrative-arc.md +77 -0
  176. package/skills/strategy/pricing-positioning.md +94 -0
  177. package/specialists/contracts.json +1002 -0
  178. package/specialists/contracts.schema.json +83 -0
  179. package/specialists/policy-inventory.json +160 -0
  180. package/{agents → specialists}/prompts/cx-accessibility.md +3 -1
  181. package/{agents → specialists}/prompts/cx-ai-engineer.md +3 -1
  182. package/{agents → specialists}/prompts/cx-architect.md +3 -1
  183. package/{agents → specialists}/prompts/cx-business-strategist.md +3 -1
  184. package/{agents → specialists}/prompts/cx-data-analyst.md +3 -1
  185. package/{agents → specialists}/prompts/cx-data-engineer.md +3 -1
  186. package/{agents → specialists}/prompts/cx-debugger.md +3 -1
  187. package/{agents → specialists}/prompts/cx-designer.md +3 -1
  188. package/{agents → specialists}/prompts/cx-devil-advocate.md +3 -1
  189. package/{agents → specialists}/prompts/cx-docs-keeper.md +4 -2
  190. package/{agents → specialists}/prompts/cx-engineer.md +4 -2
  191. package/{agents → specialists}/prompts/cx-evaluator.md +3 -1
  192. package/{agents → specialists}/prompts/cx-explorer.md +3 -1
  193. package/{agents → specialists}/prompts/cx-legal-compliance.md +3 -1
  194. package/{agents → specialists}/prompts/cx-operations.md +3 -1
  195. package/{agents → specialists}/prompts/cx-orchestrator.md +4 -2
  196. package/{agents → specialists}/prompts/cx-platform-engineer.md +3 -1
  197. package/{agents → specialists}/prompts/cx-product-manager.md +3 -1
  198. package/{agents → specialists}/prompts/cx-qa.md +3 -1
  199. package/{agents → specialists}/prompts/cx-rd-lead.md +3 -1
  200. package/{agents → specialists}/prompts/cx-release-manager.md +3 -1
  201. package/{agents → specialists}/prompts/cx-researcher.md +3 -1
  202. package/{agents → specialists}/prompts/cx-reviewer.md +4 -2
  203. package/{agents → specialists}/prompts/cx-security.md +3 -1
  204. package/{agents → specialists}/prompts/cx-sre.md +4 -2
  205. package/{agents → specialists}/prompts/cx-test-automation.md +3 -1
  206. package/{agents → specialists}/prompts/cx-trace-reviewer.md +5 -3
  207. package/{agents → specialists}/prompts/cx-ux-researcher.md +3 -1
  208. package/{agents → specialists}/registry.json +651 -418
  209. package/{agents → specialists}/role-manifests.json +8 -8
  210. package/templates/docs/construct_guide.md +6 -6
  211. package/templates/docs/skill-artifact.md +1 -1
  212. package/templates/provider-scaffold/health.test.mjs +30 -0
  213. package/templates/provider-scaffold/index.mjs +48 -0
  214. package/templates/workflows/cross-team-handoff.yml +85 -0
  215. package/templates/workflows/engineering-onboarding.yml +77 -0
  216. package/templates/workflows/new-feature.yml +53 -0
  217. package/agents/contracts.json +0 -387
  218. /package/{agents → specialists}/teams.json +0 -0
@@ -4,7 +4,7 @@ commands/build/feature.md (Build a feature) implement it end to end, tested and
4
4
  Build a feature: implement it end to end, tested and ready to ship
5
5
  -->
6
6
  ---
7
- description: Build a feature: implement it end to end, tested and ready to ship
7
+ description: "Build a feature: implement it end to end, tested and ready to ship"
8
8
  ---
9
9
 
10
10
  You are Construct. Build the following: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/build/fix.md (Fix something broken) reproduce, find the root cause, app
4
4
  Fix something broken: reproduce, find the root cause, apply the smallest safe change
5
5
  -->
6
6
  ---
7
- description: Fix something broken: reproduce, find the root cause, apply the smallest safe change
7
+ description: "Fix something broken: reproduce, find the root cause, apply the smallest safe change"
8
8
  ---
9
9
 
10
10
  You are Construct.
@@ -4,7 +4,7 @@ commands/design/access.md (Accessibility audit) WCAG 2.1 AA, keyboard, screen re
4
4
  Accessibility audit: WCAG 2.1 AA, keyboard, screen readers, contrast, motion
5
5
  -->
6
6
  ---
7
- description: Accessibility audit: WCAG 2.1 AA, keyboard, screen readers, contrast, motion
7
+ description: "Accessibility audit: WCAG 2.1 AA, keyboard, screen readers, contrast, motion"
8
8
  ---
9
9
 
10
10
  You are Construct. Audit: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/design/flow.md (Map the user flow) entry to success, friction points, j
4
4
  Map the user flow: entry to success, friction points, jobs-to-be-done
5
5
  -->
6
6
  ---
7
- description: Map the user flow: entry to success, friction points, jobs-to-be-done
7
+ description: "Map the user flow: entry to success, friction points, jobs-to-be-done"
8
8
  ---
9
9
 
10
10
  You are Construct. Map the user flow for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/design/ui.md (Design or review UI) visual hierarchy, states, interactio
4
4
  Design or review UI: visual hierarchy, states, interaction model, accessibility baseline
5
5
  -->
6
6
  ---
7
- description: Design or review UI: visual hierarchy, states, interaction model, accessibility baseline
7
+ description: "Design or review UI: visual hierarchy, states, interaction model, accessibility baseline"
8
8
  ---
9
9
 
10
10
  You are Construct. Design or review the UI for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/measure/experiment.md (Design an experiment) hypothesis, test, evidence
4
4
  Design an experiment: hypothesis, test, evidence threshold, go/no-go decision
5
5
  -->
6
6
  ---
7
- description: Design an experiment: hypothesis, test, evidence threshold, go/no-go decision
7
+ description: "Design an experiment: hypothesis, test, evidence threshold, go/no-go decision"
8
8
  ---
9
9
 
10
10
  You are Construct. Design an experiment for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/measure/metrics.md (Define metrics) what to measure, baselines, success
4
4
  Define metrics: what to measure, baselines, success thresholds, instrumentation needed
5
5
  -->
6
6
  ---
7
- description: Define metrics: what to measure, baselines, success thresholds, instrumentation needed
7
+ description: "Define metrics: what to measure, baselines, success thresholds, instrumentation needed"
8
8
  ---
9
9
 
10
10
  You are Construct. Define metrics for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/measure/results.md (Analyze results) interpret data, separate signal fr
4
4
  Analyze results: interpret data, separate signal from noise, produce a recommendation
5
5
  -->
6
6
  ---
7
- description: Analyze results: interpret data, separate signal from noise, produce a recommendation
7
+ description: "Analyze results: interpret data, separate signal from noise, produce a recommendation"
8
8
  ---
9
9
 
10
10
  You are Construct. Analyze: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/plan/api.md (Design an API) contracts, endpoints, error model, data sch
4
4
  Design an API: contracts, endpoints, error model, data schema
5
5
  -->
6
6
  ---
7
- description: Design an API: contracts, endpoints, error model, data schema
7
+ description: "Design an API: contracts, endpoints, error model, data schema"
8
8
  ---
9
9
 
10
10
  You are Construct. Design the API for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/plan/challenge.md (Challenge a plan) stress-test assumptions, surface f
4
4
  Challenge a plan: stress-test assumptions, surface failure modes and risks
5
5
  -->
6
6
  ---
7
- description: Challenge a plan: stress-test assumptions, surface failure modes and risks
7
+ description: "Challenge a plan: stress-test assumptions, surface failure modes and risks"
8
8
  ---
9
9
 
10
10
  You are Construct. Challenge the following: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/plan/decide.md (Record a decision) context, options considered, consequ
4
4
  Record a decision: context, options considered, consequences, what it locks in
5
5
  -->
6
6
  ---
7
- description: Record a decision: context, options considered, consequences, what it locks in
7
+ description: "Record a decision: context, options considered, consequences, what it locks in"
8
8
  ---
9
9
 
10
10
  You are Construct. Document the decision about: $ARGUMENTS
@@ -5,7 +5,7 @@ Produces a structured spec using the canonical Construct plan format, saves it
5
5
  to .cx/plans/ as a durable planning artifact linked to the active tracker slice.
6
6
  -->
7
7
  ---
8
- description: Plan a feature: produce a structured spec and link it to the active tracker-backed plan
8
+ description: "Plan a feature: produce a structured spec and link it to the active tracker-backed plan"
9
9
  ---
10
10
 
11
11
  You are Construct. Plan the following: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/plan/requirements.md (Define requirements) what needs to be true for th
4
4
  Define requirements: what needs to be true for this to be done
5
5
  -->
6
6
  ---
7
- description: Define requirements: what needs to be true for this to be done
7
+ description: "Define requirements: what needs to be true for this to be done"
8
8
  ---
9
9
 
10
10
  You are Construct. Define requirements for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/remember/context.md (Save project context) update .cx/context.md so the
4
4
  Save project context: update .cx/context.md so the next session picks up where this one left off
5
5
  -->
6
6
  ---
7
- description: Save project context: update .cx/context.md so the next session picks up where this one left off
7
+ description: "Save project context: update .cx/context.md so the next session picks up where this one left off"
8
8
  ---
9
9
 
10
10
  You are Construct. Save context for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/remember/handoff.md (Write a handoff) transfer context so the next sess
4
4
  Write a handoff: transfer context so the next session or person can continue without loss
5
5
  -->
6
6
  ---
7
- description: Write a handoff: transfer context so the next session or person can continue without loss
7
+ description: "Write a handoff: transfer context so the next session or person can continue without loss"
8
8
  ---
9
9
 
10
10
  You are Construct. Write a handoff for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/remember/runbook.md (Write a runbook) step-by-step procedure for a recu
4
4
  Write a runbook: step-by-step procedure for a recurring task or incident
5
5
  -->
6
6
  ---
7
- description: Write a runbook: step-by-step procedure for a recurring task or incident
7
+ description: "Write a runbook: step-by-step procedure for a recurring task or incident"
8
8
  ---
9
9
 
10
10
  You are Construct. Write a runbook for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/review/code.md (Code review) correctness, regressions, security, test c
4
4
  Code review: correctness, regressions, security, test coverage
5
5
  -->
6
6
  ---
7
- description: Code review: correctness, regressions, security, test coverage
7
+ description: "Code review: correctness, regressions, security, test coverage"
8
8
  ---
9
9
 
10
10
  You are Construct. Review: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/review/quality.md (Quality audit) complexity, naming, duplication, dead
4
4
  Quality audit: complexity, naming, duplication, dead code, maintainability
5
5
  -->
6
6
  ---
7
- description: Quality audit: complexity, naming, duplication, dead code, maintainability
7
+ description: "Quality audit: complexity, naming, duplication, dead code, maintainability"
8
8
  ---
9
9
 
10
10
  You are Construct. Audit quality for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/review/security.md (Security scan) secrets, auth, injection, data expos
4
4
  Security scan: secrets, auth, injection, data exposure, dependency risk
5
5
  -->
6
6
  ---
7
- description: Security scan: secrets, auth, injection, data exposure, dependency risk
7
+ description: "Security scan: secrets, auth, injection, data exposure, dependency risk"
8
8
  ---
9
9
 
10
10
  You are Construct. Scan: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/ship/ready.md (Pre-release check) is this ready to ship?
4
4
  Pre-release check: is this ready to ship?
5
5
  -->
6
6
  ---
7
- description: Pre-release check: is this ready to ship?
7
+ description: "Pre-release check: is this ready to ship?"
8
8
  ---
9
9
 
10
10
  You are Construct. Check if the following is ready: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/ship/release.md (Release) plan rollout, changelog, rollback, and post-r
4
4
  Release: plan rollout, changelog, rollback, and post-release verification
5
5
  -->
6
6
  ---
7
- description: Release: plan rollout, changelog, rollback, and post-release verification
7
+ description: "Release: plan rollout, changelog, rollback, and post-release verification"
8
8
  ---
9
9
 
10
10
  You are Construct. Release the following: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/ship/status.md (Status) current project state, workflow, uncommitted ch
4
4
  Status: current project state, workflow, uncommitted changes, recent activity
5
5
  -->
6
6
  ---
7
- description: Status: current project state, workflow, uncommitted changes, recent activity
7
+ description: "Status: current project state, workflow, uncommitted changes, recent activity"
8
8
  ---
9
9
 
10
10
  You are Construct. Report status for: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/understand/docs.md (Look up documentation) current behavior from primar
4
4
  Look up documentation: current behavior from primary sources, not training memory
5
5
  -->
6
6
  ---
7
- description: Look up documentation: current behavior from primary sources, not training memory
7
+ description: "Look up documentation: current behavior from primary sources, not training memory"
8
8
  ---
9
9
 
10
10
  You are Construct. Look up: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/understand/this.md (Explore and understand something) trace execution p
4
4
  Explore and understand something: trace execution paths, map structure, gather evidence
5
5
  -->
6
6
  ---
7
- description: Explore and understand something: trace execution paths, map structure, gather evidence
7
+ description: "Explore and understand something: trace execution paths, map structure, gather evidence"
8
8
  ---
9
9
 
10
10
  You are Construct. Explore and explain: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/understand/why.md (Investigate a failure) why is this broken, what is t
4
4
  Investigate a failure: why is this broken, what is the root cause
5
5
  -->
6
6
  ---
7
- description: Investigate a failure: why is this broken, what is the root cause
7
+ description: "Investigate a failure: why is this broken, what is the root cause"
8
8
  ---
9
9
 
10
10
  You are Construct. Investigate: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/work/clean.md (Remove AI-generated code smells) verbosity, hedging, dea
4
4
  Remove AI-generated code smells: verbosity, hedging, dead comments, generic names
5
5
  -->
6
6
  ---
7
- description: Remove AI-generated code smells: verbosity, hedging, dead comments, generic names
7
+ description: "Remove AI-generated code smells: verbosity, hedging, dead comments, generic names"
8
8
  ---
9
9
 
10
10
  You are cx-reviewer identifying AI slop in: $ARGUMENTS
@@ -4,7 +4,7 @@ commands/work/drive.md (Full autonomous execution) explore, plan, implement, ver
4
4
  Full autonomous execution: explore, plan, implement, verify, loop until done
5
5
  -->
6
6
  ---
7
- description: Full autonomous execution: explore, plan, implement, verify, loop until done
7
+ description: "Full autonomous execution: explore, plan, implement, verify, loop until done"
8
8
  ---
9
9
 
10
10
  You are Construct in drive mode. Execute $ARGUMENTS fully and autonomously without stopping for confirmation.
@@ -4,7 +4,7 @@ commands/work/optimize-prompts.md: Prompt optimization command.
4
4
  Runs the closed-loop prompt optimization workflow using telemetry trace data.
5
5
  -->
6
6
  ---
7
- description: Closed-loop prompt optimization: read telemetry traces, diagnose failures, push improved version to staging
7
+ description: "Closed-loop prompt optimization: read telemetry traces, diagnose failures, push improved version to staging"
8
8
  ---
9
9
 
10
10
  You are cx-trace-reviewer running a prompt optimization cycle for: $ARGUMENTS
@@ -18,7 +18,7 @@ Optimize prompt fragments and overlays, not the runtime orchestration policy. If
18
18
 
19
19
  ## Required steps
20
20
 
21
- 1. **Read current prompt**: read the agent's prompt from `agents/registry.json` (or its `promptFile`)
21
+ 1. **Read current prompt**: read the agent's prompt from `specialists/registry.json` (or its `promptFile`)
22
22
  2. **Fetch recent scores**: GET `{CONSTRUCT_TELEMETRY_URL}/api/public/scores?name=quality&limit=200`
23
23
  3. **Skip agents with fewer than 20 scored traces**: insufficient signal; note them but do not optimize
24
24
  4. **Diagnose failure patterns**: analyze low-scoring traces, identify top 3 recurring patterns
@@ -4,7 +4,7 @@ commands/work/parallel-review.md (Adversarial parallel review) 5 reviewers must
4
4
  Adversarial parallel review: 5 reviewers must agree before output ships
5
5
  -->
6
6
  ---
7
- description: Adversarial parallel review: 5 reviewers must agree before output ships
7
+ description: "Adversarial parallel review: 5 reviewers must agree before output ships"
8
8
  ---
9
9
 
10
10
  You are Construct running a parallel adversarial review of: $ARGUMENTS
@@ -0,0 +1,30 @@
1
+ -- Tag attribution and migration tracking for construct_documents.
2
+ -- The construct_documents.tags JSONB column already exists in 001_init.sql.
3
+ -- This migration adds GIN indexing, attribution history, and migration audit.
4
+
5
+ create index if not exists construct_documents_tags_gin_idx
6
+ on construct_documents using gin (tags jsonb_path_ops);
7
+
8
+ create table if not exists construct_tag_attribution (
9
+ document_id text not null references construct_documents(id) on delete cascade,
10
+ tag text not null,
11
+ source text not null, -- 'agent:classifier' | 'user' | 'curator'
12
+ confidence numeric,
13
+ applied_at timestamptz not null default now(),
14
+ migrated_from text,
15
+ primary key (document_id, tag, source)
16
+ );
17
+ create index if not exists construct_tag_attribution_tag_idx on construct_tag_attribution (tag);
18
+
19
+ create table if not exists construct_tag_migrations (
20
+ id text primary key,
21
+ from_tag text not null,
22
+ to_tag text,
23
+ executed_at timestamptz not null default now(),
24
+ executed_by text not null,
25
+ reason text not null,
26
+ doc_count_before integer not null,
27
+ doc_count_after integer,
28
+ reversible boolean not null default true,
29
+ rolled_back_at timestamptz
30
+ );
@@ -0,0 +1,24 @@
1
+ -- db/schema/008_skill_usage.sql — Per-skill invocation log.
2
+ --
3
+ -- Backs `construct skills usage/orphans/hot`. The local
4
+ -- JSONL path (~/.cx/skill-calls.jsonl) is primary in solo mode; this table is
5
+ -- primary in team/enterprise mode. One-time backfill via
6
+ -- `construct skills backfill-postgres`.
7
+
8
+ create table if not exists construct_skill_invocations (
9
+ id bigserial primary key,
10
+ ts timestamptz not null,
11
+ skill_id text not null,
12
+ source text not null, -- 'mcp' | 'role-preload' | 'prompt-composer' | …
13
+ agent_id text,
14
+ session_id text,
15
+ caller_context text,
16
+ latency_ms integer,
17
+ tokens_returned integer
18
+ );
19
+
20
+ create index if not exists construct_skill_invocations_skill_ts_idx
21
+ on construct_skill_invocations (skill_id, ts desc);
22
+
23
+ create index if not exists construct_skill_invocations_session_idx
24
+ on construct_skill_invocations (session_id);
@@ -0,0 +1,14 @@
1
+ -- Scheduler job state for team and enterprise deployment modes.
2
+ -- Solo mode uses native trigger files instead of this table.
3
+ -- The lock_holder column stores a short identifier for the process/host
4
+ -- that currently holds the advisory lock for a running job.
5
+
6
+ create table if not exists construct_scheduled_jobs (
7
+ id text primary key,
8
+ schedule text not null,
9
+ last_run_at timestamptz,
10
+ last_run_status text,
11
+ lock_holder text,
12
+ lock_acquired_at timestamptz,
13
+ created_at timestamptz not null default now()
14
+ );
@@ -7,7 +7,7 @@ verdict: fail
7
7
  summary: Recommends a clever architecture without exposing contracts or rejected alternatives.
8
8
  references:
9
9
  - skills/roles/architect.md
10
- - agents/prompts/cx-architect.md
10
+ - specialists/prompts/cx-architect.md
11
11
  tags:
12
12
  - missing-contracts
13
13
  - hidden-dependencies
@@ -7,7 +7,7 @@ verdict: pass
7
7
  summary: Makes interface and dependency tradeoffs explicit before locking in a plan.
8
8
  references:
9
9
  - skills/roles/architect.md
10
- - agents/prompts/cx-architect.md
10
+ - specialists/prompts/cx-architect.md
11
11
  tags:
12
12
  - tradeoffs
13
13
  - contracts
@@ -7,7 +7,7 @@ verdict: fail
7
7
  summary: Introduces an abstraction for future cases without evidence from the code.
8
8
  references:
9
9
  - skills/roles/engineer.md
10
- - agents/prompts/cx-engineer.md
10
+ - specialists/prompts/cx-engineer.md
11
11
  tags:
12
12
  - speculative-abstraction
13
13
  - unnecessary-surface-area
@@ -7,7 +7,7 @@ verdict: pass
7
7
  summary: Reads the touched files and surrounding pattern before proposing code changes.
8
8
  references:
9
9
  - skills/roles/engineer.md
10
- - agents/prompts/cx-engineer.md
10
+ - specialists/prompts/cx-engineer.md
11
11
  tags:
12
12
  - read-before-write
13
13
  - local-conventions
@@ -7,7 +7,7 @@ verdict: fail
7
7
  summary: Treats a green suite or coverage number as proof that the behavior is safe.
8
8
  references:
9
9
  - skills/roles/qa.md
10
- - agents/prompts/cx-qa.md
10
+ - specialists/prompts/cx-qa.md
11
11
  tags:
12
12
  - coverage-theater
13
13
  - false-confidence
@@ -7,7 +7,7 @@ verdict: pass
7
7
  summary: Verifies changed behavior with regression-oriented tests instead of coverage theater.
8
8
  references:
9
9
  - skills/roles/qa.md
10
- - agents/prompts/cx-qa.md
10
+ - specialists/prompts/cx-qa.md
11
11
  tags:
12
12
  - regression
13
13
  - changed-behavior
@@ -33,4 +33,4 @@ Hook guards for workflow, drive, bootstrap, and task behavior are expressed as Y
33
33
 
34
34
  ## Registry as Single Source of Truth
35
35
 
36
- `agents/registry.json` is the canonical definition for all agents on all platforms (Claude Code, OpenCode, Codex, Copilot). `construct sync` regenerates all platform-specific files from the registry. Never edit generated files directly: edits are overwritten on the next sync.
36
+ `specialists/registry.json` is the canonical definition for all agents on all platforms (Claude Code, OpenCode, Codex, Copilot). `construct sync` regenerates all platform-specific files from the registry. Never edit generated files directly: edits are overwritten on the next sync.
@@ -11,7 +11,7 @@ import path from 'node:path';
11
11
  function findConstructRoot(startPath = process.cwd()) {
12
12
  let current = path.resolve(startPath);
13
13
  while (true) {
14
- if (fs.existsSync(path.join(current, 'agents', 'registry.json'))) return current;
14
+ if (fs.existsSync(path.join(current, 'specialists', 'registry.json'))) return current;
15
15
  const parent = path.dirname(current);
16
16
  if (parent === current) return path.resolve(startPath);
17
17
  current = parent;
@@ -36,7 +36,7 @@ function collectSkillFiles(skillsDir) {
36
36
 
37
37
  export function auditSkills({ rootDir, silent = false } = {}) {
38
38
  const root = rootDir ?? findConstructRoot();
39
- const registryPath = path.join(root, 'agents', 'registry.json');
39
+ const registryPath = path.join(root, 'specialists', 'registry.json');
40
40
  const skillsDir = path.join(root, 'skills');
41
41
 
42
42
  const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
@@ -46,7 +46,7 @@ export function auditSkills({ rootDir, silent = false } = {}) {
46
46
  const agentsWithNoSkills = [];
47
47
  const missingSkillFiles = [];
48
48
 
49
- for (const agent of registry.agents ?? []) {
49
+ for (const agent of registry.specialists ?? []) {
50
50
  const skills = agent.skills ?? [];
51
51
  if (skills.length === 0) {
52
52
  agentsWithNoSkills.push(agent.name);
package/lib/auto-docs.mjs CHANGED
@@ -158,10 +158,10 @@ function buildAgentsTable(rootDir) {
158
158
  const agents = registry.agents ?? registry;
159
159
  if (!Array.isArray(agents)) return '';
160
160
 
161
- const rows = ['| Agent | Tier | Purpose |', '|---|---|---|'];
161
+ const rows = ['| Specialist | Tier | Purpose |', '|---|---|---|'];
162
162
  for (const agent of agents.slice(0, 30)) {
163
- const name = agent.id ?? agent.name ?? 'n/a';
164
- const tier = agent.tier ?? agent.model_tier ?? 'n/a';
163
+ const name = agent.name ?? agent.id ?? 'n/a';
164
+ const tier = agent.modelTier ?? agent.tier ?? agent.model_tier ?? 'n/a';
165
165
  // Strip em-dashes from descriptions so the prose lint stays clean across
166
166
  // AUTO regen. Em-dashes are allowed in the registry's source descriptions
167
167
  // but never in the rendered markdown.
@@ -195,7 +195,7 @@ export async function regenerateDocs({ rootDir, check = false } = {}) {
195
195
  },
196
196
  },
197
197
  {
198
- file: path.join(rootDir, 'docs', 'concepts', 'architecture.md'),
198
+ file: path.join(rootDir, 'docs', 'concepts', 'architecture.mdx'),
199
199
  regions: {
200
200
  agents: buildAgentsTable(rootDir),
201
201
  },
@@ -396,13 +396,13 @@ function renderAgentsPage(rootDir) {
396
396
  if (!table) return null;
397
397
  return [
398
398
  '---',
399
- 'title: Agents',
400
- 'description: The 28 cx-* specialists plus the construct persona. Generated from agents/registry.json.',
399
+ 'title: Specialists',
400
+ 'description: The 28 specialists behind the construct persona. Generated from specialists/registry.json.',
401
401
  '---',
402
402
  '',
403
- '> Generated from `agents/registry.json`. Re-run `construct docs:site` to refresh.',
403
+ '> Generated from `specialists/registry.json`. Re-run `construct docs:site` to refresh.',
404
404
  '',
405
- 'Construct ships one persona (`construct`) plus 28 specialists. Each specialist has a role, model tier, and prompt that defines its decision authority. Specialists are addressable directly when you want a focused conversation; for everyday work, address `@construct` and let it route.',
405
+ 'Construct ships one persona (`construct`) and 28 specialists behind it. You address `@construct` for all everyday work; it routes to specialists internally. Each specialist has a role, model tier, and prompt file that defines its decision authority.',
406
406
  '',
407
407
  table,
408
408
  '',
@@ -0,0 +1,126 @@
1
+ /**
2
+ * lib/boundary.mjs — Authenticated parent/child boundary registration.
3
+ *
4
+ * Verifies a parent Construct instance is reachable, validates an HMAC
5
+ * signature over `childInstanceId|nonce` when a shared secret is configured,
6
+ * and persists the binding to ~/.construct/boundary.json (mode 0600). A
7
+ * different parent rotates the registration only when explicitly allowed via
8
+ * CONSTRUCT_BOUNDARY_ALLOW_OVERRIDE=1; prior configs are archived alongside
9
+ * the active one. Exposed as a standalone module so the dashboard endpoint
10
+ * and the functional tests share the same logic.
11
+ */
12
+
13
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
14
+ import { join } from 'node:path';
15
+ import { homedir } from 'node:os';
16
+ import { createHmac, timingSafeEqual, randomBytes } from 'node:crypto';
17
+ import { request as httpRequest } from 'node:http';
18
+ import { request as httpsRequest } from 'node:https';
19
+
20
+ export const BOUNDARY_VERSION = '1.0';
21
+
22
+ function boundaryDir(home = homedir()) {
23
+ return join(home, '.construct');
24
+ }
25
+
26
+ export function boundaryConfigPath(home = homedir()) {
27
+ return join(boundaryDir(home), 'boundary.json');
28
+ }
29
+
30
+ export async function registerBoundary({
31
+ parentInstance,
32
+ parentUrl,
33
+ childInstanceId,
34
+ nonce,
35
+ signature,
36
+ sharedSecret = null,
37
+ home = homedir(),
38
+ allowOverride = process.env.CONSTRUCT_BOUNDARY_ALLOW_OVERRIDE === '1',
39
+ probe = probeParent,
40
+ }) {
41
+ if (!parentInstance || !parentUrl) {
42
+ return { ok: false, status: 400, error: 'parentInstance and parentUrl are required' };
43
+ }
44
+ if (!childInstanceId) {
45
+ return { ok: false, status: 400, error: 'childInstanceId is required' };
46
+ }
47
+
48
+ if (sharedSecret) {
49
+ if (!nonce || !signature) {
50
+ return { ok: false, status: 401, error: 'nonce and signature are required when a shared secret is configured' };
51
+ }
52
+ const expected = createHmac('sha256', sharedSecret).update(`${childInstanceId}|${nonce}`).digest('hex');
53
+ const a = Buffer.from(expected, 'hex');
54
+ let b;
55
+ try { b = Buffer.from(String(signature), 'hex'); } catch { return { ok: false, status: 401, error: 'invalid signature encoding' }; }
56
+ if (a.length !== b.length || !timingSafeEqual(a, b)) {
57
+ return { ok: false, status: 401, error: 'signature mismatch' };
58
+ }
59
+ }
60
+
61
+ const reachable = await probe(parentUrl);
62
+ if (!reachable.ok) {
63
+ return { ok: false, status: 502, error: `parent unreachable: ${reachable.error}` };
64
+ }
65
+
66
+ const dir = boundaryDir(home);
67
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
68
+ const cfgPath = boundaryConfigPath(home);
69
+
70
+ let prior = null;
71
+ if (existsSync(cfgPath)) {
72
+ try { prior = JSON.parse(readFileSync(cfgPath, 'utf8')); } catch { prior = null; }
73
+ }
74
+
75
+ if (prior && prior.parentInstance && prior.parentInstance !== parentInstance) {
76
+ if (!allowOverride) {
77
+ return {
78
+ ok: false,
79
+ status: 409,
80
+ error: `child already bound to parent '${prior.parentInstance}'; set CONSTRUCT_BOUNDARY_ALLOW_OVERRIDE=1 to rotate`,
81
+ };
82
+ }
83
+ const archivePath = join(dir, `boundary.${Date.now()}.json`);
84
+ try { writeFileSync(archivePath, JSON.stringify(prior, null, 2)); } catch { /* archive is best effort */ }
85
+ }
86
+
87
+ const config = {
88
+ parentInstance,
89
+ parentUrl,
90
+ childInstanceId,
91
+ registeredAt: new Date().toISOString(),
92
+ rotatedFrom: prior?.parentInstance || null,
93
+ nonce: nonce || randomBytes(16).toString('hex'),
94
+ boundaryVersion: BOUNDARY_VERSION,
95
+ };
96
+
97
+ writeFileSync(cfgPath, JSON.stringify(config, null, 2), { mode: 0o600 });
98
+ return { ok: true, config, path: cfgPath };
99
+ }
100
+
101
+ export function probeParent(parentUrl) {
102
+ return new Promise((resolve) => {
103
+ let parsed;
104
+ try { parsed = new URL(parentUrl); } catch { return resolve({ ok: false, error: 'invalid URL' }); }
105
+ if (!/^https?:$/.test(parsed.protocol)) return resolve({ ok: false, error: 'unsupported protocol' });
106
+ const fn = parsed.protocol === 'https:' ? httpsRequest : httpRequest;
107
+ const req = fn({
108
+ method: 'HEAD',
109
+ protocol: parsed.protocol,
110
+ hostname: parsed.hostname,
111
+ port: parsed.port,
112
+ path: parsed.pathname || '/',
113
+ timeout: 3000,
114
+ }, (response) => {
115
+ resolve({ ok: response.statusCode < 500 });
116
+ response.resume();
117
+ });
118
+ req.on('timeout', () => { req.destroy(); resolve({ ok: false, error: 'timeout' }); });
119
+ req.on('error', (err) => resolve({ ok: false, error: err.message }));
120
+ req.end();
121
+ });
122
+ }
123
+
124
+ export function signBoundaryRequest({ childInstanceId, nonce, sharedSecret }) {
125
+ return createHmac('sha256', sharedSecret).update(`${childInstanceId}|${nonce}`).digest('hex');
126
+ }