@geraldmaron/construct 1.0.14 → 1.0.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.
Files changed (275) hide show
  1. package/README.md +21 -2
  2. package/bin/construct +146 -83
  3. package/commands/build/feature.md +0 -6
  4. package/commands/build/fix.md +0 -6
  5. package/commands/design/access.md +0 -6
  6. package/commands/design/flow.md +0 -6
  7. package/commands/design/ui.md +0 -6
  8. package/commands/measure/experiment.md +0 -6
  9. package/commands/measure/metrics.md +0 -6
  10. package/commands/measure/results.md +0 -6
  11. package/commands/plan/api.md +0 -6
  12. package/commands/plan/challenge.md +0 -6
  13. package/commands/plan/decide.md +0 -6
  14. package/commands/plan/feature.md +0 -7
  15. package/commands/plan/requirements.md +0 -6
  16. package/commands/remember/context.md +0 -6
  17. package/commands/remember/handoff.md +0 -6
  18. package/commands/remember/runbook.md +0 -6
  19. package/commands/review/code.md +0 -6
  20. package/commands/review/quality.md +0 -6
  21. package/commands/review/security.md +0 -6
  22. package/commands/ship/ready.md +0 -6
  23. package/commands/ship/release.md +0 -6
  24. package/commands/ship/status.md +0 -6
  25. package/commands/understand/docs.md +0 -6
  26. package/commands/understand/research.md +0 -6
  27. package/commands/understand/this.md +0 -6
  28. package/commands/understand/why.md +0 -6
  29. package/commands/work/clean.md +0 -6
  30. package/commands/work/drive.md +0 -6
  31. package/commands/work/optimize-prompts.md +0 -6
  32. package/commands/work/parallel-review.md +0 -6
  33. package/db/schema/010_cx_scores.sql +51 -0
  34. package/lib/beads-client.mjs +19 -1
  35. package/lib/cli-commands.mjs +280 -146
  36. package/lib/comment-lint.mjs +5 -1
  37. package/lib/context-state.mjs +15 -3
  38. package/lib/contracts/validate.mjs +72 -18
  39. package/lib/contracts/violation-log.mjs +169 -0
  40. package/lib/document-extract/docling-client.mjs +114 -0
  41. package/lib/document-extract/docling-sidecar.py +122 -0
  42. package/lib/document-extract/whisper-client.mjs +79 -0
  43. package/lib/document-extract.mjs +73 -8
  44. package/lib/document-ingest.mjs +26 -4
  45. package/lib/embed/daemon.mjs +6 -1
  46. package/lib/flavors/loader.mjs +1 -1
  47. package/lib/handoffs/contract.mjs +2 -2
  48. package/lib/hooks/session-start.mjs +1 -1
  49. package/lib/hooks/stop-notify.mjs +7 -0
  50. package/lib/ingest/chunker.mjs +94 -0
  51. package/lib/ingest/pipeline.mjs +53 -0
  52. package/lib/ingest/store.mjs +82 -0
  53. package/lib/install/first-invocation.mjs +5 -1
  54. package/lib/intake/prepare.mjs +22 -4
  55. package/lib/integrations/intake-integrations.mjs +28 -2
  56. package/lib/knowledge/search.mjs +12 -0
  57. package/lib/mcp/server.mjs +142 -1
  58. package/lib/mcp/tools/skills.mjs +6 -3
  59. package/lib/mcp/tools/telemetry.mjs +30 -0
  60. package/lib/mcp/tools/workflow.mjs +6 -2
  61. package/lib/observation-store.mjs +14 -5
  62. package/lib/ollama-manager.mjs +32 -28
  63. package/lib/orchestration-policy.mjs +15 -0
  64. package/lib/prompt-composer.js +11 -1
  65. package/lib/roles/gateway.mjs +30 -1
  66. package/lib/runtime/uv-bootstrap.mjs +129 -0
  67. package/lib/runtime/whisper-bootstrap.mjs +102 -0
  68. package/lib/scheduler/index.mjs +24 -4
  69. package/lib/server/index.mjs +22 -1
  70. package/lib/server/insights.mjs +12 -0
  71. package/lib/server/static/index.html +1 -1
  72. package/lib/setup.mjs +54 -9
  73. package/lib/specialists/postconditions.mjs +1 -1
  74. package/lib/sync/skill-frontmatter.mjs +113 -21
  75. package/lib/tracking-surfaces.mjs +2 -0
  76. package/lib/update.mjs +31 -3
  77. package/lib/upgrade.mjs +31 -4
  78. package/lib/validators/skills.mjs +86 -54
  79. package/package.json +5 -5
  80. package/personas/construct.md +6 -7
  81. package/platforms/claude/CLAUDE.md +43 -15
  82. package/platforms/claude/settings.template.json +1 -1
  83. package/rules/common/beads-hygiene.md +3 -9
  84. package/rules/common/code-review.md +3 -6
  85. package/rules/common/coding-style.md +3 -6
  86. package/rules/common/comments.md +3 -7
  87. package/rules/common/commit-approval.md +3 -6
  88. package/rules/common/cx-agent-routing.md +3 -7
  89. package/rules/common/cx-skill-routing.md +3 -3
  90. package/rules/common/doc-ownership.md +3 -8
  91. package/rules/common/efficiency.md +3 -8
  92. package/rules/common/framing.md +3 -8
  93. package/rules/common/git-workflow.md +3 -5
  94. package/rules/common/no-fabrication.md +4 -12
  95. package/rules/common/patterns.md +3 -5
  96. package/rules/common/release-gates.md +3 -8
  97. package/rules/common/research.md +3 -8
  98. package/rules/common/review-before-change.md +3 -9
  99. package/rules/common/security.md +3 -6
  100. package/rules/common/skill-composition.md +3 -7
  101. package/rules/common/testing.md +3 -6
  102. package/rules/golang/coding-style.md +1 -5
  103. package/rules/golang/hooks.md +1 -5
  104. package/rules/golang/patterns.md +1 -5
  105. package/rules/golang/security.md +1 -5
  106. package/rules/golang/testing.md +1 -5
  107. package/rules/python/coding-style.md +1 -5
  108. package/rules/python/hooks.md +1 -5
  109. package/rules/python/patterns.md +1 -5
  110. package/rules/python/security.md +1 -5
  111. package/rules/python/testing.md +1 -5
  112. package/rules/swift/coding-style.md +1 -5
  113. package/rules/swift/hooks.md +1 -5
  114. package/rules/swift/patterns.md +1 -5
  115. package/rules/swift/security.md +1 -5
  116. package/rules/swift/testing.md +1 -5
  117. package/rules/typescript/coding-style.md +1 -5
  118. package/rules/typescript/hooks.md +1 -5
  119. package/rules/typescript/patterns.md +1 -5
  120. package/rules/typescript/security.md +1 -5
  121. package/rules/typescript/testing.md +1 -5
  122. package/rules/web/coding-style.md +3 -5
  123. package/rules/web/design-quality.md +3 -5
  124. package/rules/web/hooks.md +3 -5
  125. package/rules/web/patterns.md +3 -5
  126. package/rules/web/performance.md +3 -5
  127. package/rules/web/security.md +3 -5
  128. package/rules/web/testing.md +3 -5
  129. package/scripts/sync-specialists.mjs +20 -2
  130. package/skills/ai/agent-dev.md +4 -5
  131. package/skills/ai/llm-security.md +4 -5
  132. package/skills/ai/ml-ops.md +4 -5
  133. package/skills/ai/orchestration-workflow.md +4 -5
  134. package/skills/ai/prompt-and-eval.md +4 -5
  135. package/skills/ai/prompt-optimizer.md +4 -6
  136. package/skills/ai/rag-system.md +4 -5
  137. package/skills/architecture/api-design.md +4 -5
  138. package/skills/architecture/caching.md +4 -5
  139. package/skills/architecture/cloud-native.md +4 -5
  140. package/skills/architecture/message-queue.md +4 -5
  141. package/skills/architecture/security-arch.md +4 -5
  142. package/skills/compliance/ai-disclosure.md +4 -5
  143. package/skills/compliance/data-privacy.md +4 -5
  144. package/skills/compliance/license-audit.md +4 -5
  145. package/skills/compliance/regulatory-review.md +4 -5
  146. package/skills/development/cpp.md +4 -5
  147. package/skills/development/go.md +4 -5
  148. package/skills/development/java.md +4 -5
  149. package/skills/development/kotlin.md +4 -5
  150. package/skills/development/mobile-crossplatform.md +4 -5
  151. package/skills/development/python.md +4 -5
  152. package/skills/development/rust.md +4 -5
  153. package/skills/development/shell.md +4 -5
  154. package/skills/development/swift.md +4 -5
  155. package/skills/development/typescript.md +4 -5
  156. package/skills/devops/ci-cd.md +4 -5
  157. package/skills/devops/containerization.md +4 -5
  158. package/skills/devops/cost-optimization.md +4 -5
  159. package/skills/devops/data-engineering.md +4 -5
  160. package/skills/devops/database.md +4 -5
  161. package/skills/devops/dependency-management.md +4 -5
  162. package/skills/devops/devsecops.md +4 -5
  163. package/skills/devops/git-workflow.md +4 -5
  164. package/skills/devops/incident-response.md +4 -5
  165. package/skills/devops/monorepo.md +4 -5
  166. package/skills/devops/observability.md +4 -5
  167. package/skills/devops/performance.md +4 -5
  168. package/skills/devops/testing.md +4 -5
  169. package/skills/docs/adr-workflow.md +4 -7
  170. package/skills/docs/backlog-proposal-workflow.md +4 -3
  171. package/skills/docs/customer-profile-workflow.md +4 -3
  172. package/skills/docs/document-ingest-workflow.md +4 -3
  173. package/skills/docs/evidence-ingest-workflow.md +4 -3
  174. package/skills/docs/init-docs.md +4 -5
  175. package/skills/docs/init-project.md +4 -5
  176. package/skills/docs/prd-workflow.md +4 -7
  177. package/skills/docs/prfaq-workflow.md +4 -3
  178. package/skills/docs/product-intelligence-review.md +4 -3
  179. package/skills/docs/product-intelligence-workflow.md +4 -6
  180. package/skills/docs/product-signal-workflow.md +4 -5
  181. package/skills/docs/research-workflow.md +4 -5
  182. package/skills/docs/runbook-workflow.md +4 -5
  183. package/skills/docs/strategy-workflow.md +4 -5
  184. package/skills/exploration/dependency-graph-reading.md +4 -7
  185. package/skills/exploration/repo-map.md +4 -5
  186. package/skills/exploration/tracer-bullet-method.md +4 -7
  187. package/skills/exploration/unknown-codebase-onboarding.md +4 -7
  188. package/skills/frameworks/django.md +4 -5
  189. package/skills/frameworks/nextjs.md +4 -5
  190. package/skills/frameworks/react.md +4 -5
  191. package/skills/frameworks/spring-boot.md +4 -5
  192. package/skills/frontend-design/accessibility.md +4 -5
  193. package/skills/frontend-design/component-patterns.md +4 -5
  194. package/skills/frontend-design/engineering.md +4 -5
  195. package/skills/frontend-design/state-management.md +4 -5
  196. package/skills/frontend-design/ui-aesthetics.md +4 -5
  197. package/skills/frontend-design/ux-principles.md +4 -5
  198. package/skills/operating/change-management.md +4 -8
  199. package/skills/operating/incident-response.md +4 -8
  200. package/skills/operating/oncall-rotation.md +4 -7
  201. package/skills/operating/orchestration-reference.md +4 -10
  202. package/skills/quality-gates/review-work.md +4 -5
  203. package/skills/quality-gates/verify-change.md +4 -5
  204. package/skills/quality-gates/verify-module.md +4 -5
  205. package/skills/quality-gates/verify-quality.md +4 -5
  206. package/skills/quality-gates/verify-security.md +4 -5
  207. package/skills/roles/architect.ai-systems.md +6 -9
  208. package/skills/roles/architect.data.md +6 -9
  209. package/skills/roles/architect.enterprise.md +6 -9
  210. package/skills/roles/architect.integration.md +6 -9
  211. package/skills/roles/architect.md +7 -14
  212. package/skills/roles/architect.platform.md +6 -9
  213. package/skills/roles/data-analyst.experiment.md +6 -9
  214. package/skills/roles/data-analyst.md +6 -9
  215. package/skills/roles/data-analyst.product-intelligence.md +7 -9
  216. package/skills/roles/data-analyst.product.md +6 -9
  217. package/skills/roles/data-analyst.telemetry.md +7 -9
  218. package/skills/roles/data-engineer.pipeline.md +6 -9
  219. package/skills/roles/data-engineer.vector-retrieval.md +7 -9
  220. package/skills/roles/data-engineer.warehouse.md +6 -9
  221. package/skills/roles/debugger.md +6 -9
  222. package/skills/roles/designer.accessibility.md +6 -9
  223. package/skills/roles/designer.md +7 -9
  224. package/skills/roles/engineer.ai.md +6 -9
  225. package/skills/roles/engineer.data.md +6 -9
  226. package/skills/roles/engineer.md +9 -9
  227. package/skills/roles/engineer.platform.md +6 -9
  228. package/skills/roles/operator.docs.md +6 -9
  229. package/skills/roles/operator.md +9 -9
  230. package/skills/roles/operator.release.md +6 -9
  231. package/skills/roles/operator.sre.md +6 -9
  232. package/skills/roles/orchestrator.md +6 -9
  233. package/skills/roles/product-manager.ai-product.md +6 -9
  234. package/skills/roles/product-manager.business-strategy.md +6 -9
  235. package/skills/roles/product-manager.enterprise.md +6 -9
  236. package/skills/roles/product-manager.growth.md +7 -9
  237. package/skills/roles/product-manager.md +7 -9
  238. package/skills/roles/product-manager.platform.md +6 -9
  239. package/skills/roles/product-manager.product.md +6 -9
  240. package/skills/roles/qa.ai-eval.md +8 -9
  241. package/skills/roles/qa.api-contract.md +7 -9
  242. package/skills/roles/qa.data-pipeline.md +7 -9
  243. package/skills/roles/qa.md +7 -9
  244. package/skills/roles/qa.test-automation.md +6 -9
  245. package/skills/roles/qa.web-ui.md +7 -9
  246. package/skills/roles/researcher.explorer.md +6 -9
  247. package/skills/roles/researcher.md +8 -9
  248. package/skills/roles/researcher.ux.md +6 -9
  249. package/skills/roles/reviewer.devil-advocate.md +6 -9
  250. package/skills/roles/reviewer.evaluator.md +6 -9
  251. package/skills/roles/reviewer.md +9 -9
  252. package/skills/roles/reviewer.trace.md +6 -9
  253. package/skills/roles/security.ai.md +7 -9
  254. package/skills/roles/security.appsec.md +6 -9
  255. package/skills/roles/security.cloud.md +6 -9
  256. package/skills/roles/security.legal-compliance.md +6 -9
  257. package/skills/roles/security.md +7 -9
  258. package/skills/roles/security.privacy.md +7 -9
  259. package/skills/roles/security.supply-chain.md +7 -9
  260. package/skills/security/blue-team.md +4 -5
  261. package/skills/security/code-audit.md +4 -5
  262. package/skills/security/pentest.md +4 -5
  263. package/skills/security/red-team.md +4 -5
  264. package/skills/security/threat-intel.md +4 -5
  265. package/skills/security/vuln-research.md +4 -5
  266. package/skills/strategy/competitive-landscape.md +4 -8
  267. package/skills/strategy/market-research-methods.md +4 -8
  268. package/skills/strategy/narrative-arc.md +4 -8
  269. package/skills/strategy/pricing-positioning.md +4 -8
  270. package/skills/utility/clean-code.md +4 -5
  271. package/specialists/policy-inventory.json +14 -0
  272. package/lib/specialist-contracts-enforce.mjs +0 -172
  273. package/rules/common/agents.md +0 -28
  274. package/rules/common/development-workflow.md +0 -32
  275. package/rules/common/performance.md +0 -55
@@ -1,30 +1,58 @@
1
1
  # Construct: Claude Code Integration
2
2
 
3
- This project uses Construct. Personas and specialists are defined in `specialists/registry.json` and synced to Claude Code via `construct sync`.
3
+ This file ships as a reference template alongside the Construct npm package. The canonical project-instructions file is `/CLAUDE.md` at your repo root — that's the file Claude Code actually reads at session start. The structure here mirrors that canonical file so users know what shape their own `/CLAUDE.md` should take after `construct init` scaffolds a project.
4
+
5
+ Personas and specialists are defined in `specialists/registry.json` and rendered into Claude Code agents on every `construct sync`. The single user-facing persona is `construct`; the 28 specialists (cx-engineer, cx-security, cx-devil-advocate, …) are routed internally — you address Construct, Construct dispatches.
6
+
7
+ ## Critical rules (mirror in your project /CLAUDE.md)
8
+
9
+ - **Never fabricate.** Every load-bearing claim cites a verifiable source. When a fact isn't in the source, write `unknown` or `[unverified]`. See `rules/common/no-fabrication.md`.
10
+ - **Confirm the working branch every session.** Session-start surfaces `## Working branch: <name>` at the top of the injected context.
11
+ - **Never commit, push, or merge without asking first.** State the branch, state the action, wait for explicit yes.
12
+ - **Never edit running hook files** without testing them in isolation. A broken hook blocks all tool use.
13
+ - **Hooks fire unconditionally. No skip env vars on quality gates.** If a check fires wrong, repair the check — do not re-introduce `CONSTRUCT_SKIP_*` / `CONSTRUCT_ALLOW_*`.
14
+ - **Never commit directly to main.** Branch, test, then merge.
15
+ - **Run `construct doctor`** after structural changes.
4
16
 
5
17
  ## Workflow roles
6
18
 
7
- Construct is the only intended user-facing surface.
19
+ | Role | What it covers |
20
+ |---|---|
21
+ | **Planning** | Requirements, strategy, architecture, framing challenges |
22
+ | **Implementation** | Builds features and fixes bugs |
23
+ | **Validation** | Quality gates, code review, security, accessibility |
24
+ | **Research** | Docs, debugging, codebase exploration, external research |
25
+ | **Operations** | Releases, dev servers, health checks, observability |
26
+
27
+ Construct routes complex work through the full pipeline (plan → implement → validate → operate). For simple tasks, Construct acts directly without exposing the internal routing.
28
+
29
+ ## Beads issue tracker
30
+
31
+ This project uses **bd (beads)** for issue tracking. Run `bd prime` for the full workflow context.
8
32
 
9
- - **Planning**: requirements, strategy, architecture
10
- - **Implementation**: builds features and fixes bugs
11
- - **Validation**: quality gates, security, accessibility
12
- - **Research**: docs, debugging, codebase exploration
13
- - **Operations**: releases, dev servers, health checks
33
+ ```bash
34
+ bd ready # Find available work
35
+ bd show <id> # View issue details
36
+ bd update <id> --claim # Claim work
37
+ bd close <id> # Complete work
38
+ ```
14
39
 
15
- ## Usage
40
+ Use `bd` for all task tracking. Do NOT use TodoWrite, TaskCreate, or markdown TODO lists.
16
41
 
17
- Talk to Construct normally. It routes complex work through the full pipeline internally:
18
- plan → implement → validate → operate
42
+ ## Session completion
19
43
 
20
- For simple tasks, Construct can act directly without exposing internal routing.
44
+ When ending a work session, **work is not complete until `git push` succeeds.**
21
45
 
22
- All 26 internal specialists (cx-engineer, cx-security, cx-devil-advocate, etc.) are available as subagents.
46
+ ```bash
47
+ git pull --rebase
48
+ git push
49
+ git status # MUST show "up to date with origin"
50
+ ```
23
51
 
24
- ## Tool Calls
52
+ ## Tool calls
25
53
 
26
54
  When using Bash, always provide both `command` and `description` string fields. Do not emit XML-style fallback tool calls.
27
55
 
28
- ## Cross-Tool Memory
56
+ ## Cross-tool memory
29
57
 
30
- Construct uses cass-memory for cross-tool memory. Start the local HTTP server with `cm serve`, then use `memory_search` to find prior context.
58
+ Construct uses cass-memory for cross-tool memory. Start the local HTTP server with `cm serve`, then `memory_search` to find prior context. Memory and beads are complementary: memory holds knowledge, beads hold tasks.
@@ -151,7 +151,7 @@
151
151
  }
152
152
  ],
153
153
  "id": "post:edit:comment-lint",
154
- "description": "Block edits that violate comment policy (banned patterns, missing required header). Bypass: CONSTRUCT_SKIP_COMMENT_LINT=1"
154
+ "description": "Block edits that violate comment policy (banned patterns, missing required header). No bypass — repair the policy if it fires wrong."
155
155
  },
156
156
  {
157
157
  "matcher": "Write|Edit|MultiEdit",
@@ -1,12 +1,6 @@
1
- <!--
2
- rules/common/beads-hygiene.md: Beads issue tracker hygiene contract.
3
-
4
- Beads is the system of record for durable work in this project. Status drifts
5
- when issues are not updated alongside the code, so every agent and persona
6
- operating in Construct treats hygiene as part of the work, not as cleanup.
7
- Loaded by AGENTS.md, CLAUDE.md, the construct persona, and the engineer /
8
- operator / planner role overlays.
9
- -->
1
+ ---
2
+ description: Beads issue tracker hygiene contract.
3
+ ---
10
4
  # Beads Hygiene: Project Contract
11
5
 
12
6
  Beads (`bd`) is the canonical durable tracker for Construct. Beads only earn their keep when their state matches the world. Stale "open" issues pollute `bd ready`, hide real work, and let agents propose work that already shipped. Every agent (human or AI, on any platform) is responsible for keeping the tracker honest.
@@ -1,9 +1,6 @@
1
- <!--
2
- rules/common/code-review.md: when and how to conduct code reviews.
3
-
4
- Defines mandatory review triggers, severity levels, approval criteria,
5
- and references coding-style.md and security.md for checklists.
6
- -->
1
+ ---
2
+ description: when and how to conduct code reviews.
3
+ ---
7
4
  # Code Review Standards
8
5
 
9
6
  ## When to Review
@@ -1,9 +1,6 @@
1
- <!--
2
- rules/common/coding-style.md: language-agnostic coding standards.
3
-
4
- Covers immutability, core principles (KISS/DRY/YAGNI), file organization,
5
- error handling, input validation, naming conventions, and quality checklist.
6
- -->
1
+ ---
2
+ description: language-agnostic coding standards.
3
+ ---
7
4
  # Coding Style
8
5
 
9
6
  ## Immutability (CRITICAL)
@@ -1,10 +1,6 @@
1
- <!--
2
- rules/common/comments.md: Construct comment convention for JS/TS/MJS source files.
3
-
4
- Defines the two allowed comment forms (file header, section context block) and
5
- what is never allowed (inline narration, trailing comments, mid-function notes).
6
- Enforced by lib/hooks/comment-lint.mjs and tests/hooks-budget.test.mjs.
7
- -->
1
+ ---
2
+ description: Construct comment convention for JS/TS/MJS source files.
3
+ ---
8
4
  # Comment Convention
9
5
 
10
6
  Two forms are allowed. Everything else is deleted.
@@ -1,9 +1,6 @@
1
- <!--
2
- rules/common/commit-approval.md: conversational approval rule for mutating git operations.
3
-
4
- Behavioral rule, not a hook. The agent asks and waits for a yes; the user
5
- replies in chat. Infrastructure stays out of the way.
6
- -->
1
+ ---
2
+ description: conversational approval rule for mutating git operations.
3
+ ---
7
4
  # Commit Approval
8
5
 
9
6
  Construct does not commit, push, or merge without the user explicitly saying yes in the current conversation.
@@ -1,10 +1,6 @@
1
- <!--
2
- rules/common/cx-agent-routing.md: auto-trigger routing rules for cx-* specialist agents.
3
-
4
- Defines when to route directly to a cx-* specialist vs through Construct orchestration.
5
- Covers intent-based routing table, complexity gate, and routing rules.
6
- Loaded by rule-loading systems that look for cx-agent-routing in the rules hierarchy.
7
- -->
1
+ ---
2
+ description: auto-trigger routing rules for cx-* specialist agents.
3
+ ---
8
4
  # cx-* Agent Routing: Auto-trigger Rules
9
5
 
10
6
  When a request matches the trigger patterns below, automatically route to the corresponding cx-* specialist or persona before responding.
@@ -1,6 +1,6 @@
1
- <!--
2
- rules/common/cx-skill-routing.md: Redirect to canonical skill routing table.
3
- -->
1
+ ---
2
+ description: Redirect to canonical skill routing table.
3
+ ---
4
4
  # cx-* Skill Routing
5
5
 
6
6
  > **Canonical file:** [`skills/routing.md`](../../skills/routing.md)
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/doc-ownership.md: which specialist owns which document type.
3
-
4
- Prevents the orchestrator (or any general persona) from authoring specialist
5
- documents directly. Routing authorship to the owning role is how research,
6
- framing, and domain scrutiny actually fire: writing a PRD without the
7
- product manager bypasses those checks entirely.
8
- -->
1
+ ---
2
+ description: which specialist owns which document type.
3
+ ---
9
4
  # Document Ownership
10
5
 
11
6
  A document type names a body of work. That body of work has an owner. The orchestrator routes; it does not author.
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/efficiency.md: session context and tool-use efficiency standards.
3
-
4
- Applies to all agents operating in a Construct session. Violations compound context
5
- cost and reduce throughput. These rules are enforced by read-tracker.mjs and surfaced
6
- in the session-start efficiency digest.
7
- -->
8
-
1
+ ---
2
+ description: session context and tool-use efficiency standards.
3
+ ---
9
4
  # Session Efficiency
10
5
 
11
6
  ## Read discipline
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/framing.md: how to frame a problem before acting on it.
3
-
4
- Establishes the hard separation between execution artifacts (tickets, chat
5
- transcripts, existing docs) and sources of truth (the underlying problem).
6
- Applies to every specialist working on architecture, documentation, research,
7
- product, or strategy work. Read before scaffolding anything.
8
- -->
1
+ ---
2
+ description: how to frame a problem before acting on it.
3
+ ---
9
4
  # Framing Policy
10
5
 
11
6
  Most agent failures on ambiguous work trace to a single mistake: anchoring on the most concrete input available (usually a ticket or a prior doc) and building the output around its structure instead of around the actual problem.
@@ -1,8 +1,6 @@
1
- <!--
2
- rules/common/git-workflow.md: commit message format and PR workflow.
3
-
4
- Defines conventional commit types and pull request creation steps.
5
- -->
1
+ ---
2
+ description: commit message format and PR workflow.
3
+ ---
6
4
  # Git Workflow
7
5
 
8
6
  ## Commit Message Format
@@ -1,14 +1,6 @@
1
- <!--
2
- rules/common/no-fabrication.md: canonical anti-fabrication policy for Construct.
3
-
4
- Defines the trust contract between operators and the system: outputs stick to
5
- source, gaps stay visible, and confidence reflects evidence. Applies to every
6
- specialist, every artifact, and every summary — intake processing, document
7
- evaluation, knowledge writing, plan drafting, review verdicts, handoffs.
8
-
9
- Sibling rules: research.md (evidence hierarchy), framing.md (execution
10
- artifacts are not sources), comments.md (banned voice patterns).
11
- -->
1
+ ---
2
+ description: canonical anti-fabrication policy for Construct.
3
+ ---
12
4
  # No-Fabrication Policy
13
5
 
14
6
  Fabrication is the single largest threat to trust in an agent system. A persona that invents a customer quote, sharpens a vague signal into a confident assertion, or papers over a gap with plausible-sounding prose corrupts every artifact downstream. This rule applies to **every output** Construct produces: intake summaries, classification rationales, PRDs, ADRs, RFCs, knowledge notes, handoffs, review verdicts, plan entries, beads issues, MCP tool responses, dashboard text.
@@ -61,7 +53,7 @@ Fabrication is the single largest threat to trust in an agent system. A persona
61
53
  ## Enforcement
62
54
 
63
55
  - `lib/comment-lint.mjs` enforces a subset of these patterns on artifact paths (`docs/prd/**`, `docs/adr/**`, `docs/rfc/**`, `docs/research/**`, `.cx/knowledge/**`, `.cx/handoffs/**`, `.cx/research/**`). PostToolUse warns; `npm run lint:comments`, `construct lint:comments`, and the release gate block.
64
- - `specialists/contracts.json` postconditions check structural requirements (mandatory sections, intake traceability, citation density). `lib/contracts/validate.mjs#validateHandoff` blocks handoffs that fail validation when `CONSTRUCT_CONTRACT_ENFORCEMENT=block`.
56
+ - `specialists/contracts.json` postconditions check structural requirements (mandatory sections, intake traceability, citation density). `lib/contracts/validate.mjs#validateHandoff` blocks handoffs that fail validation; binary postconditions in `lib/specialists/postconditions.mjs` block rubber-stamp reviews, post-hoc threat models, symptom-only fixes, stale-doc PRs, and post-hoc accessibility. Enforcement is hard-default `block`.
65
57
  - `construct intake done <id> --output=<path>` stamps `intake_id`, `intake_confidence`, and `intake_rationale` into the artifact's frontmatter so every intake-derived artifact carries verifiable provenance.
66
58
 
67
59
  ## Bypass
@@ -1,8 +1,6 @@
1
- <!--
2
- rules/common/patterns.md: reusable design patterns and skeleton project strategy.
3
-
4
- Covers skeleton project evaluation, repository pattern, and API response format.
5
- -->
1
+ ---
2
+ description: reusable design patterns and skeleton project strategy.
3
+ ---
6
4
  # Common Patterns
7
5
 
8
6
  ## Skeleton Projects
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/release-gates.md: Hard release gates for Construct work.
3
-
4
- Defines the blocking contracts every agent and persona must satisfy locally
5
- before any commit, push, or "done" claim. Loaded by the construct persona,
6
- AGENTS.md, and the engineer/reviewer/operator role overlays. Enforcement is at
7
- the prompt level: CI is a backstop, not the primary gate.
8
- -->
1
+ ---
2
+ description: Hard release gates for Construct work.
3
+ ---
9
4
  # Release Gates: Hard Contracts
10
5
 
11
6
  These are blocking gates. Every agent, persona, and harness session working in or shipping Construct must satisfy them locally **before** any commit, push, or "done" claim. CI is a backstop, not the primary check.
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/research.md: canonical research and evidence policy for Construct.
3
-
4
- Defines how research starts, which sources to prefer, how claims are verified,
5
- and what must be recorded so findings are reproducible. Applies to research,
6
- product evidence synthesis, document ingest follow-up, and any recommendation
7
- that depends on external facts or evolving internal evidence.
8
- -->
1
+ ---
2
+ description: canonical research and evidence policy for Construct.
3
+ ---
9
4
  # Research Policy
10
5
 
11
6
  Construct treats research as a reproducible evidence-gathering process, not free-form browsing. If a claim could change decisions, scope, architecture, or roadmap, it must be tied to verifiable evidence.
@@ -1,11 +1,6 @@
1
- <!--
2
- rules/common/review-before-change.md: audit the current state before authoring anything new.
3
-
4
- Applies to every specialist on every platform. Pairs with framing.md (frame the
5
- problem) and development-workflow.md step 0 (research and reuse before code).
6
- This rule extends the same discipline to artifacts: docs, strategy, PRDs, ADRs,
7
- RFCs, rules, templates, and any other durable file. Read before scaffolding.
8
- -->
1
+ ---
2
+ description: audit the current state before authoring anything new.
3
+ ---
9
4
  # Review Before Change
10
5
 
11
6
  Before creating or rewriting a durable artifact, check what already exists.
@@ -54,5 +49,4 @@ For artifacts that go through a review cycle (strategy, PRD, ADR, RFC), the fram
54
49
  ## Related
55
50
 
56
51
  - `rules/common/framing.md`: frame the underlying problem before reaching for inputs.
57
- - `rules/common/development-workflow.md`: step 0 covers the same discipline for code.
58
52
  - `rules/common/doc-ownership.md`: which specialist owns which artifact type.
@@ -1,9 +1,6 @@
1
- <!--
2
- rules/common/security.md: mandatory security checks and secret management.
3
-
4
- Defines pre-commit security checklist, secret management rules,
5
- and response protocol for discovered vulnerabilities.
6
- -->
1
+ ---
2
+ description: mandatory security checks and secret management.
3
+ ---
7
4
  # Security Guidelines
8
5
 
9
6
  ## Mandatory Security Checks
@@ -1,10 +1,6 @@
1
- <!--
2
- rules/common/skill-composition.md: how specialist prompts compose with skill files.
3
-
4
- Defines the default boundary between what lives in the agent's base prompt and
5
- what is fetched via `get_skill` at runtime. Aims to keep prompts lean while
6
- keeping domain knowledge reliably available when needed.
7
- -->
1
+ ---
2
+ description: how specialist prompts compose with skill files.
3
+ ---
8
4
  # Skill Composition Policy
9
5
 
10
6
  Specialist agent prompts are lean on purpose. Domain depth lives in skill files and is pulled in on demand, not pre-inlined.
@@ -1,9 +1,6 @@
1
- <!--
2
- rules/common/testing.md: test coverage requirements and TDD workflow.
3
-
4
- Defines minimum 80% coverage, TDD red-green-refactor cycle,
5
- AAA test structure, and descriptive naming conventions.
6
- -->
1
+ ---
2
+ description: test coverage requirements and TDD workflow.
3
+ ---
7
4
  # Testing Requirements
8
5
 
9
6
  ## Minimum Test Coverage: 80%
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/golang/coding-style.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct golang coding style rule. Applies to files matching **/*.go, **/go.mod, **/go.sum. Use when writing or reviewing golang code that involves coding style.
7
3
  paths:
8
4
  - "**/*.go"
9
5
  - "**/go.mod"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/golang/hooks.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct golang hooks rule. Applies to files matching **/*.go, **/go.mod, **/go.sum. Use when writing or reviewing golang code that involves hooks.
7
3
  paths:
8
4
  - "**/*.go"
9
5
  - "**/go.mod"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/golang/patterns.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct golang patterns rule. Applies to files matching **/*.go, **/go.mod, **/go.sum. Use when writing or reviewing golang code that involves patterns.
7
3
  paths:
8
4
  - "**/*.go"
9
5
  - "**/go.mod"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/golang/security.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct golang security rule. Applies to files matching **/*.go, **/go.mod, **/go.sum. Use when writing or reviewing golang code that involves security.
7
3
  paths:
8
4
  - "**/*.go"
9
5
  - "**/go.mod"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/golang/testing.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct golang testing rule. Applies to files matching **/*.go, **/go.mod, **/go.sum. Use when writing or reviewing golang code that involves testing.
7
3
  paths:
8
4
  - "**/*.go"
9
5
  - "**/go.mod"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/python/coding-style.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct python coding style rule. Applies to files matching **/*.py, **/*.pyi. Use when writing or reviewing python code that involves coding style.
7
3
  paths:
8
4
  - "**/*.py"
9
5
  - "**/*.pyi"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/python/hooks.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct python hooks rule. Applies to files matching **/*.py, **/*.pyi. Use when writing or reviewing python code that involves hooks.
7
3
  paths:
8
4
  - "**/*.py"
9
5
  - "**/*.pyi"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/python/patterns.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct python patterns rule. Applies to files matching **/*.py, **/*.pyi. Use when writing or reviewing python code that involves patterns.
7
3
  paths:
8
4
  - "**/*.py"
9
5
  - "**/*.pyi"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/python/security.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct python security rule. Applies to files matching **/*.py, **/*.pyi. Use when writing or reviewing python code that involves security.
7
3
  paths:
8
4
  - "**/*.py"
9
5
  - "**/*.pyi"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/python/testing.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct python testing rule. Applies to files matching **/*.py, **/*.pyi. Use when writing or reviewing python code that involves testing.
7
3
  paths:
8
4
  - "**/*.py"
9
5
  - "**/*.pyi"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/swift/coding-style.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct swift coding style rule. Applies to files matching **/*.swift, **/Package.swift. Use when writing or reviewing swift code that involves coding style.
7
3
  paths:
8
4
  - "**/*.swift"
9
5
  - "**/Package.swift"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/swift/hooks.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: "Flag `print()` statements: use `os.Logger` or structured logging instead for production code."
7
3
  paths:
8
4
  - "**/*.swift"
9
5
  - "**/Package.swift"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/swift/patterns.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct swift patterns rule. Applies to files matching **/*.swift, **/Package.swift. Use when writing or reviewing swift code that involves patterns.
7
3
  paths:
8
4
  - "**/*.swift"
9
5
  - "**/Package.swift"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/swift/security.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct swift security rule. Applies to files matching **/*.swift, **/Package.swift. Use when writing or reviewing swift code that involves security.
7
3
  paths:
8
4
  - "**/*.swift"
9
5
  - "**/Package.swift"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/swift/testing.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct swift testing rule. Applies to files matching **/*.swift, **/Package.swift. Use when writing or reviewing swift code that involves testing.
7
3
  paths:
8
4
  - "**/*.swift"
9
5
  - "**/Package.swift"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/typescript/coding-style.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct typescript coding style rule. Applies to files matching **/*.ts, **/*.tsx, **/*.js, **/*.jsx. Use when writing or reviewing typescript code that involves coding style.
7
3
  paths:
8
4
  - "**/*.ts"
9
5
  - "**/*.tsx"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/typescript/hooks.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct typescript hooks rule. Applies to files matching **/*.ts, **/*.tsx, **/*.js, **/*.jsx. Use when writing or reviewing typescript code that involves hooks.
7
3
  paths:
8
4
  - "**/*.ts"
9
5
  - "**/*.tsx"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/typescript/patterns.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct typescript patterns rule. Applies to files matching **/*.ts, **/*.tsx, **/*.js, **/*.jsx. Use when writing or reviewing typescript code that involves patterns.
7
3
  paths:
8
4
  - "**/*.ts"
9
5
  - "**/*.tsx"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/typescript/security.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct typescript security rule. Applies to files matching **/*.ts, **/*.tsx, **/*.js, **/*.jsx. Use when writing or reviewing typescript code that involves security.
7
3
  paths:
8
4
  - "**/*.ts"
9
5
  - "**/*.tsx"
@@ -1,9 +1,5 @@
1
- <!--
2
- rules/typescript/testing.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
6
1
  ---
2
+ description: Construct typescript testing rule. Applies to files matching **/*.ts, **/*.tsx, **/*.js, **/*.jsx. Use when writing or reviewing typescript code that involves testing.
7
3
  paths:
8
4
  - "**/*.ts"
9
5
  - "**/*.tsx"
@@ -1,8 +1,6 @@
1
- <!--
2
- rules/web/coding-style.md: <one-line purpose>
3
-
4
- <2–6 line summary.>
5
- -->
1
+ ---
2
+ description: Construct web coding style rule. Use when writing or reviewing web code that involves coding style.
3
+ ---
6
4
  > This file extends [common/coding-style.md](../common/coding-style.md) with web-specific frontend content.
7
5
 
8
6
  # Web Coding Style