@orchestrator-claude/definitions 3.32.2 → 3.34.0

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 (117) hide show
  1. package/README.md +145 -0
  2. package/agents/adversarial-reviewer.md +2 -2
  3. package/agents/azure-devops-engineer.md +9 -1
  4. package/agents/cicd-platform-engineer.md +477 -0
  5. package/agents/debug-sidecar.md +6 -1
  6. package/agents/doc-sidecar.md +6 -1
  7. package/agents/frontend-engineer.md +173 -0
  8. package/agents/implementer.md +39 -23
  9. package/agents/methodology-researcher.md +2 -1
  10. package/agents/operational-artifact-builder.md +2 -1
  11. package/agents/orchestrator.md +47 -76
  12. package/agents/planner.md +2 -2
  13. package/agents/presentation-engineer.md +1 -1
  14. package/agents/python-data-engineer.md +214 -0
  15. package/agents/reviewer.md +16 -8
  16. package/agents/specifier.md +1 -1
  17. package/agents/task-generator.md +1 -1
  18. package/agents/test-sidecar.md +15 -4
  19. package/dist/cli.js +78 -0
  20. package/dist/cli.js.map +1 -1
  21. package/dist/commands/DiffCommand.js +1 -1
  22. package/dist/commands/DiffCommand.js.map +1 -1
  23. package/dist/commands/InstallCommand.d.ts +41 -0
  24. package/dist/commands/InstallCommand.d.ts.map +1 -0
  25. package/dist/commands/InstallCommand.js +253 -0
  26. package/dist/commands/InstallCommand.js.map +1 -0
  27. package/dist/http/ApiClient.d.ts +5 -0
  28. package/dist/http/ApiClient.d.ts.map +1 -1
  29. package/dist/http/ApiClient.js.map +1 -1
  30. package/dist/install/DevCheckoutDetector.d.ts +66 -0
  31. package/dist/install/DevCheckoutDetector.d.ts.map +1 -0
  32. package/dist/install/DevCheckoutDetector.js +150 -0
  33. package/dist/install/DevCheckoutDetector.js.map +1 -0
  34. package/dist/install/HooksWirer.d.ts +29 -0
  35. package/dist/install/HooksWirer.d.ts.map +1 -0
  36. package/dist/install/HooksWirer.js +80 -0
  37. package/dist/install/HooksWirer.js.map +1 -0
  38. package/dist/install/LocalDiffReporter.d.ts +25 -0
  39. package/dist/install/LocalDiffReporter.d.ts.map +1 -0
  40. package/dist/install/LocalDiffReporter.js +50 -0
  41. package/dist/install/LocalDiffReporter.js.map +1 -0
  42. package/dist/install/Materializer.d.ts +67 -0
  43. package/dist/install/Materializer.d.ts.map +1 -0
  44. package/dist/install/Materializer.js +196 -0
  45. package/dist/install/Materializer.js.map +1 -0
  46. package/dist/install/McpRegistrar.d.ts +63 -0
  47. package/dist/install/McpRegistrar.d.ts.map +1 -0
  48. package/dist/install/McpRegistrar.js +114 -0
  49. package/dist/install/McpRegistrar.js.map +1 -0
  50. package/dist/install/ProcessRunner.d.ts +25 -0
  51. package/dist/install/ProcessRunner.d.ts.map +1 -0
  52. package/dist/install/ProcessRunner.js +41 -0
  53. package/dist/install/ProcessRunner.js.map +1 -0
  54. package/dist/install/ProjectSettingsNeutralizer.d.ts +39 -0
  55. package/dist/install/ProjectSettingsNeutralizer.d.ts.map +1 -0
  56. package/dist/install/ProjectSettingsNeutralizer.js +100 -0
  57. package/dist/install/ProjectSettingsNeutralizer.js.map +1 -0
  58. package/dist/install/types.d.ts +52 -0
  59. package/dist/install/types.d.ts.map +1 -0
  60. package/dist/install/types.js +8 -0
  61. package/dist/install/types.js.map +1 -0
  62. package/dist/manifest/ManifestLoader.d.ts.map +1 -1
  63. package/dist/manifest/ManifestLoader.js +3 -2
  64. package/dist/manifest/ManifestLoader.js.map +1 -1
  65. package/dist/manifest/types.d.ts +3 -0
  66. package/dist/manifest/types.d.ts.map +1 -1
  67. package/dist/scripts/bundle-hooks.d.ts +39 -0
  68. package/dist/scripts/bundle-hooks.d.ts.map +1 -0
  69. package/dist/scripts/bundle-hooks.js +165 -0
  70. package/dist/scripts/bundle-hooks.js.map +1 -0
  71. package/dist/scripts/generate-manifest.d.ts +22 -3
  72. package/dist/scripts/generate-manifest.d.ts.map +1 -1
  73. package/dist/scripts/generate-manifest.js +78 -35
  74. package/dist/scripts/generate-manifest.js.map +1 -1
  75. package/hooks/dangling-guard.mjs +7426 -0
  76. package/hooks/dangling-guard.ts +223 -6
  77. package/hooks/gate-guardian.mjs +463 -0
  78. package/hooks/hooks.json +63 -0
  79. package/hooks/lib/additional-directories-sync.ts +295 -0
  80. package/hooks/lib/api-client.ts +388 -7
  81. package/hooks/lib/session-selection.ts +81 -0
  82. package/hooks/mailbox-listener.mjs +259 -0
  83. package/hooks/post-compact.mjs +7931 -0
  84. package/hooks/post-implement.mjs +238 -0
  85. package/hooks/session-start.mjs +8234 -0
  86. package/hooks/session-start.ts +264 -23
  87. package/hooks/sprint-registry.mjs +59 -0
  88. package/hooks/subagent-start.mjs +289 -0
  89. package/hooks/subagent-stop.mjs +7793 -0
  90. package/hooks/subagent-stop.ts +4 -2
  91. package/hooks/user-prompt.mjs +329 -0
  92. package/hooks/workflow-guard.mjs +7805 -0
  93. package/hooks/workflow-guard.ts +360 -119
  94. package/hooks-settings-template.json +63 -0
  95. package/manifest.json +124 -90
  96. package/mcp-servers.json +48 -0
  97. package/package.json +10 -4
  98. package/personas/auditor-compliance.md +104 -0
  99. package/personas/cfo-conservador.md +88 -0
  100. package/personas/designer-perfeccionista.md +104 -0
  101. package/personas/diretor-cetico-fmcg.md +80 -0
  102. package/personas/engenheiro-cetico-construcao.md +107 -0
  103. package/skills/artifact-generator/SKILL.md +1 -1
  104. package/skills/artifact-production/SKILL.md +28 -0
  105. package/skills/backlog-synthesis/SKILL.md +8 -3
  106. package/skills/checkpoint-protocol/SKILL.md +7 -0
  107. package/skills/infographic-engine/SKILL.md +116 -0
  108. package/skills/orchestrator/SKILL.md +93 -7
  109. package/skills/persona-library/SKILL.md +1 -1
  110. package/skills/project-conventions/SKILL.md +53 -30
  111. package/skills/project-management-enterprise/SKILL.md +1 -1
  112. package/skills/python-data-engineering/SKILL.md +792 -0
  113. package/skills/release/SKILL.md +29 -18
  114. package/skills/release/release.sh +65 -4
  115. package/skills/storybook-validated-loop/SKILL.md +110 -0
  116. package/skills/tdd-discipline/SKILL.md +16 -0
  117. package/skills/workflow-coordination/SKILL.md +117 -16
package/README.md ADDED
@@ -0,0 +1,145 @@
1
+ # @orchestrator-claude/definitions
2
+
3
+ Built-in definitions (agents, skills, hooks, workflows, KB seeds) for the
4
+ Orchestrator ecosystem, distributed as an npm package and installed into
5
+ `~/.claude/*` via `orch-defs install`.
6
+
7
+ ## CLI
8
+
9
+ ```bash
10
+ npx orch-defs <command>
11
+ ```
12
+
13
+ | Command | Purpose |
14
+ |---|---|
15
+ | `install` | Materialize agents/skills/hooks/personas/kb into `~/.claude/*`, wire hooks into `~/.claude/settings.json`, and register MCP servers via `claude mcp add --scope user` (RFC-040 ④) |
16
+ | `seed` | Seed a project's definitions into the orchestrator API (Postgres) |
17
+ | `diff` | Compare the local package's definitions against a target |
18
+ | `verify` | Verify manifest checksums |
19
+ | `info` | Show manifest metadata |
20
+
21
+ Run `npx orch-defs install --help` for the full flag reference and the
22
+ in-context risk notes summarized below.
23
+
24
+ ## `install`: two configuration owners (RF-006)
25
+
26
+ `orch-defs install` writes to **two physically distinct configuration
27
+ surfaces**, each owned by a different Claude Code subsystem, and **never
28
+ attempts to unify them**:
29
+
30
+ | Surface | Owner | How the installer writes it |
31
+ |---|---|---|
32
+ | `~/.claude.json` (MCP server registry) | Internal Claude Code state — rewritten live by the running CLI, ~200KB, mostly telemetry | **Never** written directly. The installer only ever invokes `claude mcp add --scope user <name> ...` and checks `claude mcp list` first for idempotency. |
33
+ | `~/.claude/settings.json` (`hooks` block) | Documented contract surface (published precedence, stable schema) | Read-modify-write JSON merge — existing non-orchestrator keys survive. |
34
+
35
+ **Why not unified?** `~/.claude.json` is Claude Code's own live-rewritten
36
+ internal state file — editing it directly races with the running CLI and
37
+ risks corruption/state loss (`~/.claude/.mcp.json` is a dead path that Claude
38
+ Code never reads, confirmed both in official docs and empirically). By
39
+ contrast, `~/.claude/settings.json` is a documented, stable contract surface
40
+ safe to edit directly. Collapsing both into one "installer config" write path
41
+ would hide this differing discipline and reintroduce the exact corruption
42
+ risk the split is designed to avoid (spec RF-006 / RF-004).
43
+
44
+ The codebase enforces this split structurally: MCP registration
45
+ (`McpRegistrar`) and hooks wiring (`HooksWirer`) are two separate modules,
46
+ not one generic "write config" function that treats both files as
47
+ interchangeable.
48
+
49
+ ## `install`: MCP server registration — dual-mode (`--monorepo-root` vs bare)
50
+
51
+ The stdio MCP servers (`orchestrator-tools`, `orchestrator-extended`,
52
+ `perplexity`) are declared in the bundled **`mcp-servers.json`**, whose stdio
53
+ `args` carry a `{{MONOREPO_ROOT}}` placeholder. `orch-defs install` resolves
54
+ that placeholder in one of two modes (RFC-040 §16, spec ADR-007 + ADR-P001):
55
+
56
+ | Mode | Trigger | Resolution |
57
+ |---|---|---|
58
+ | **dev-checkout** | `--monorepo-root <path>` given | In-place substitution of the placeholder with `<path>` — byte-for-byte the original ADR-007 behavior. Use when running against a monorepo checkout on disk. |
59
+ | **npm-user** (self-contained) | `--monorepo-root` **absent** | Resolves the real installed location of `@orchestrator-claude/mcp-server` via `createRequire(import.meta.url).resolve()` and rewrites the whole placeholder-bearing arg to it. **No monorepo on disk required.** |
60
+ | **fallback** | resolution fails (no hoisting, Yarn PnP, …) | Skips the servers that need the placeholder + emits a warning (`Use --monorepo-root to register them`); placeholder-free servers still register. |
61
+
62
+ **Self-contained by construction.** `@orchestrator-claude/mcp-server` is a real
63
+ runtime **dependency** of this package (not a peer/dev dep), so a plain
64
+ `npm i -g @orchestrator-claude/definitions` pulls the MCP backbone with it and
65
+ the npm-user resolution above finds it on disk. mcp-server in turn depends on
66
+ `@orchestrator-claude/project-root-resolver` — **published to npm since
67
+ v3.33.0** (S388) — so the whole chain resolves from the registry with no
68
+ monorepo checkout.
69
+
70
+ The `files[]` allowlist ships the two runtime-required, non-`dist` assets the
71
+ installer reads at runtime — **`mcp-servers.json`** and
72
+ **`hooks-settings-template.json`**. Omitting them (the pre-S387 bug) made a real
73
+ tarball install `ENOENT` while `--dry-run` masked it. **`--dry-run` does not
74
+ prove a tarball — only `npm pack` + an isolated install does.**
75
+
76
+ > **ESM note:** this package is `"type": "module"`, so bare `require.resolve`
77
+ > is unavailable; `createRequire(import.meta.url)` synthesizes a CJS-style
78
+ > resolver. `import.meta.resolve` is deliberately **not** used (ADR-P001 —
79
+ > historically unstable across Node versions).
80
+
81
+ ## Dev-checkout mode (spec §5.2) — primary use case, not an edge case
82
+
83
+ `orch-defs install` detects two modes:
84
+
85
+ - **Clean-install**: cwd is a consumer project (e.g. `orch-testproj-rfc040`,
86
+ `trc`, `red-bull`) or a fresh machine — nothing competes with the
87
+ newly-materialized user-scope copy.
88
+ - **Dev-checkout**: cwd is inside the orchestrator monorepo itself, where
89
+ `.claude/agents/`, `.claude/skills/` are the authored, git-tracked,
90
+ PR-reviewed source.
91
+
92
+ **Dev-checkout is cmac's primary, everyday use case** — not a rare edge
93
+ case. The "launch-from-root" goal (RFC-040) is primarily about starting
94
+ sessions *outside* the monorepo, but cmac continues developing the
95
+ orchestrator itself *from inside* the monorepo checkout on a daily basis.
96
+
97
+ ### Precedence — MEASURED (AC-007/TASK-036, S385)
98
+
99
+ An earlier draft of this spec (§3.3) treated the precedence direction between
100
+ project-scope and user-scope as **asserted by Claude Code's official docs but
101
+ not empirically measured**. `scripts/probes/ac007-precedence-probe.ts`
102
+ (TASK-035) has since run that probe for real (TASK-036): an isolated
103
+ `CLAUDE_CONFIG_DIR` fixture, 3/3 deterministic runs per axis, with a
104
+ hard isolation gate confirming the real `~/.claude` and the real repo were
105
+ never mutated by the probe itself.
106
+
107
+ **Verdict: CONFIRMS the documented claim.** Agents resolve by **project**
108
+ scope (a local edit inside this repo takes effect on the next live session
109
+ immediately); skills resolve by **user** scope (`~/.claude/skills` — editing
110
+ a skill here has **no** effect on a live session until `orch-defs install`
111
+ re-runs, unless the file happens to be an INTERIM per-file symlink,
112
+ C6/TD-204). The precedence direction is **not inverted**.
113
+
114
+ **The risk that remains is silent drift, not precedence direction.** Because
115
+ `~/.claude/agents|skills` now resolves from the distributed **package**
116
+ copy while `<repo>/.claude/agents|skills` remains the **authored** copy,
117
+ the two can silently diverge over time — a project-scope skill edit has no
118
+ effect on a live session until you re-run `orch-defs install` to refresh
119
+ `~/.claude/skills`. `orch-defs install` detects dev-checkout mode and
120
+ requires an explicit `--dev-checkout-ack` before proceeding, precisely
121
+ because this drift risk is real and ongoing, not a one-time inverted-
122
+ precedence hazard.
123
+
124
+ ### Full convergence — open question, not closed by this backlog
125
+
126
+ Fully resolving requirement (a) for the dev-checkout case — converging
127
+ `<repo>/.claude/{agents,skills}` into symlinks pointing at
128
+ `packages/definitions/` (the C6 model, in the reverse direction) — is
129
+ **bigger than this installer** and is explicitly **out of scope** here
130
+ (spec §3.2/§5.2). `orch-defs install` v1 detects-and-warns; full repo
131
+ convergence is a separate design decision, not implemented in this version.
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ npm run build # tsc + bundle-hooks + generate-manifest
137
+ npm run test # vitest run
138
+ npm run test:coverage # vitest run --coverage
139
+ ```
140
+
141
+ Hooks (`hooks/*.ts`) are bundled into self-contained `hooks/*.mjs` bundles at
142
+ build time (`npm run bundle-hooks`, `src/scripts/bundle-hooks.ts`) — a fresh
143
+ install target has no `node_modules` of its own, so hooks must not depend on
144
+ runtime module resolution outside the bundle. `tests/HooksBundleFreshness.test.ts`
145
+ guards against source/bundle drift (see below).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: adversarial-reviewer
3
- description: PME workflow adversarial review gate executor (per ADR-021). Use as gate (NOT phase) after RESEARCH / FRAMEWORK / DELIVER phases when task scopes critical review through assigned persona's bias lens. Read-only artifact handling: NEVER writes to artifact under review, only outputs critique with severity:high|medium|low findings. Max 3 iterations, converges when severity:high count == 0. NAO use para code review (use coderabbit:code-reviewer ou reviewer) ou para friendly review (use reviewer).
3
+ description: "PME workflow adversarial review gate executor (per ADR-021). Use as gate (NOT phase) after RESEARCH / FRAMEWORK / DELIVER phases when task scopes critical review through assigned persona's bias lens. Read-only artifact handling: NEVER writes to artifact under review, only outputs critique with severity:high|medium|low findings. Max 3 iterations, converges when severity:high count == 0. NAO use para code review (use coderabbit:code-reviewer ou reviewer) ou para friendly review (use reviewer)."
4
4
  tools: Read, Grep, Glob, mcp__orchestrator-tools__startAgentInvocation, mcp__orchestrator-tools__completeAgentInvocation, mcp__orchestrator-extended__artifactRetrieve, mcp__orchestrator-extended__artifactStore
5
5
  model: sonnet
6
6
  color: red
@@ -96,7 +96,7 @@ The iteration counter is **per-gate**, not per-workflow. Each new gate invocatio
96
96
  4. MUST NOT proceed with a generic critique when persona file is missing.
97
97
  5. MUST NOT auto-iterate beyond iteration 3 — BLOCKED verdict is the terminal state.
98
98
  6. MUST NOT apply code-quality standards (SOLID, TypeScript, test coverage) unless the persona's own demands explicitly invoke them.
99
- 7. MUST NOT store the critique in `.orchestrator/artifacts/` directly — use `artifactStore` MCP tool only.
99
+ 7. MUST NOT store the critique on the filesystem directly — use the `artifactStore` MCP tool only.
100
100
 
101
101
  ### SHOULD (Recommended)
102
102
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: azure-devops-engineer
3
- description: Engenheiro DevOps senior especializado em Azure stack — Bicep + Azure Verified Modules, Azure Developer CLI (AZD), GitHub Actions com OIDC federated credentials, Deployment Stacks, ACA/APIM/Functions/Cosmos DB, Lighthouse delegation, Súmula 331 audit-trail patterns. Use durante phase IMPLEMENT de workflows com escopo IaC ou CI/CD em Azure (Bicep changes, GHA workflows, Azure resource provisioning, AZD CLI ops, schema migrations, Entra ID app registrations, audit-trail evidence pack wiring). NÃO use para application code TypeScript/React (mantém implementer genérico) ou design decisions arquiteturais (mantém specifier/planner).
3
+ description: "Engenheiro DevOps senior especializado em Azure stack — Bicep + Azure Verified Modules, Azure Developer CLI (AZD), GitHub Actions com OIDC federated credentials PARA AZURE, Deployment Stacks, ACA/APIM/Functions/Cosmos DB, Lighthouse delegation, Súmula 331 audit-trail patterns. Use durante phase IMPLEMENT de workflows com escopo IaC ou CI/CD ESPECÍFICO de Azure (Bicep changes, GHA workflows que provisionam/deployam recursos Azure, Azure resource provisioning, AZD CLI ops, schema migrations Cosmos, Entra ID app registrations, audit-trail evidence pack wiring). NÃO use para application code TypeScript/React (mantém implementer genérico), design decisions arquiteturais (mantém specifier/planner), nem para containers/CI/git-pipelines NÃO-específicos de Azure (Docker/docker-compose, GHA service containers genéricos, Neo4j/Postgres/Redis em CI, debugging de CI vermelho cloud-agnóstico, Dockerfile authoring → use cicd-platform-engineer). Em escopo misto (pipeline GHA genérico que faz deploy para Azure), colabore com cicd-platform-engineer: ele cuida do scaffolding container/CI/git/readiness, você cuida da parte Azure (Bicep, azd, OIDC-to-Azure, recursos)."
4
4
  tools: Read, Edit, Write, Bash, Grep, Glob, mcp__plugin_azure_azure__acr, mcp__plugin_azure_azure__advisor, mcp__plugin_azure_azure__aks, mcp__plugin_azure_azure__appconfig, mcp__plugin_azure_azure__applens, mcp__plugin_azure_azure__applicationinsights, mcp__plugin_azure_azure__appservice, mcp__plugin_azure_azure__azd, mcp__plugin_azure_azure__azurebackup, mcp__plugin_azure_azure__azuremigrate, mcp__plugin_azure_azure__azureterraform, mcp__plugin_azure_azure__azureterraformbestpractices, mcp__plugin_azure_azure__bicepschema, mcp__plugin_azure_azure__cloudarchitect, mcp__plugin_azure_azure__compute, mcp__plugin_azure_azure__containerapps, mcp__plugin_azure_azure__cosmos, mcp__plugin_azure_azure__deploy, mcp__plugin_azure_azure__documentation, mcp__plugin_azure_azure__eventgrid, mcp__plugin_azure_azure__eventhubs, mcp__plugin_azure_azure__extension_azqr, mcp__plugin_azure_azure__extension_cli_generate, mcp__plugin_azure_azure__extension_cli_install, mcp__plugin_azure_azure__functionapp, mcp__plugin_azure_azure__functions, mcp__plugin_azure_azure__get_azure_bestpractices, mcp__plugin_azure_azure__group_list, mcp__plugin_azure_azure__group_resource_list, mcp__plugin_azure_azure__keyvault, mcp__plugin_azure_azure__loadtesting, mcp__plugin_azure_azure__managedlustre, mcp__plugin_azure_azure__monitor, mcp__plugin_azure_azure__mysql, mcp__plugin_azure_azure__policy, mcp__plugin_azure_azure__postgres, mcp__plugin_azure_azure__pricing, mcp__plugin_azure_azure__quota, mcp__plugin_azure_azure__redis, mcp__plugin_azure_azure__resourcehealth, mcp__plugin_azure_azure__role, mcp__plugin_azure_azure__search, mcp__plugin_azure_azure__servicebus, mcp__plugin_azure_azure__signalr, mcp__plugin_azure_azure__sql, mcp__plugin_azure_azure__storage, mcp__plugin_azure_azure__subscription_list, mcp__plugin_azure_azure__wellarchitectedframework, mcp__plugin_azure_azure__workbooks, mcp__plugin_microsoft-docs_microsoft-learn__microsoft_code_sample_search, mcp__plugin_microsoft-docs_microsoft-learn__microsoft_docs_fetch, mcp__plugin_microsoft-docs_microsoft-learn__microsoft_docs_search, mcp__orchestrator-tools__createCheckpoint, mcp__orchestrator-tools__startAgentInvocation, mcp__orchestrator-tools__completeAgentInvocation, mcp__orchestrator-extended__artifactStore, mcp__orchestrator-extended__artifactRetrieve
5
5
  model: sonnet
6
6
  color: blue
@@ -779,6 +779,14 @@ Use `implementer` (genérico) para:
779
779
  - Database queries / Cosmos document modeling (não schema migration)
780
780
  - Business logic / domain layer
781
781
 
782
+ Use `cicd-platform-engineer` (DevOps cloud-agnóstico) para:
783
+ - Docker / docker-compose / Dockerfile authoring & optimization
784
+ - GitHub Actions genéricos (CI lint/test/build, service containers, matrix, caching, reusable) que NÃO provisionam/deployam recursos Azure
785
+ - Orquestração de serviços efêmeros em CI (Neo4j, Postgres, Redis, MinIO)
786
+ - RCA de CI vermelho com reprodução local (docker/act), readiness/healthcheck patterns
787
+ - git pipelines & workflow hygiene (unmask de `continue-on-error` com prova)
788
+ - **Colaboração:** em pipeline GHA misto (CI genérico + deploy Azure), ele cuida do scaffolding container/CI/git/readiness e você da parte Azure (Bicep/azd/OIDC-to-Azure/recursos).
789
+
782
790
  Use `specifier` para: feature spec inicial.
783
791
  Use `planner` para: technical implementation plan.
784
792
  Use `task-generator` para: backlog atomic.