@danmoisan/drm-copilot-mcp 0.0.1 → 0.0.5

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 (156) hide show
  1. package/out/mcp-server.js +5 -1
  2. package/package.json +21 -5
  3. package/resources/claude-customizations/.claude/agent-memory/orchestrator/MEMORY.md +15 -3
  4. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_branch_base_check_unmerged_pr_deps.md +16 -0
  5. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_every_change_through_lifecycle.md +15 -0
  6. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_policy_compliance_not_optional.md +18 -0
  7. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_potential_to_issue_creates_github_issue.md +13 -0
  8. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_remediation_plan_em_dash_required.md +13 -0
  9. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_small_bug_uses_minor_audit.md +13 -0
  10. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_test_files_count_against_500_cap.md +13 -0
  11. package/resources/claude-customizations/.claude/agents/atomic-executor.md +7 -7
  12. package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +4 -5
  13. package/resources/claude-customizations/.claude/agents/feature-review.md +7 -3
  14. package/resources/claude-customizations/.claude/agents/orchestrator.md +16 -1
  15. package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +1 -1
  16. package/resources/claude-customizations/.claude/hooks/enforce-checkpoint-monotonic.ps1 +245 -0
  17. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +273 -0
  18. package/resources/claude-customizations/.claude/hooks/enforce-feature-folder-order.ps1 +148 -0
  19. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.ps1 +190 -0
  20. package/resources/claude-customizations/.claude/hooks/enforce-prd-feature-before-planner.ps1 +216 -0
  21. package/resources/claude-customizations/.claude/hooks/enforce-promotion-mcp-only.ps1 +84 -15
  22. package/resources/claude-customizations/.claude/hooks/validate-executor-output.ps1 +1 -1
  23. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage.ps1 +75 -5
  24. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +93 -0
  25. package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +68 -0
  26. package/resources/claude-customizations/.claude/rules/architecture-boundaries.md +46 -0
  27. package/resources/claude-customizations/.claude/rules/benchmark-baselines.md +35 -0
  28. package/resources/claude-customizations/.claude/rules/ci-workflows.md +36 -0
  29. package/resources/claude-customizations/.claude/rules/csharp.md +62 -16
  30. package/resources/claude-customizations/.claude/rules/general-code-change.md +12 -3
  31. package/resources/claude-customizations/.claude/rules/general-unit-test.md +47 -2
  32. package/resources/claude-customizations/.claude/rules/orchestrator-state.md +39 -0
  33. package/resources/claude-customizations/.claude/rules/powershell.md +5 -5
  34. package/resources/claude-customizations/.claude/rules/python.md +4 -3
  35. package/resources/claude-customizations/.claude/rules/quality-tiers.md +51 -0
  36. package/resources/claude-customizations/.claude/rules/typescript.md +37 -8
  37. package/resources/claude-customizations/.claude/settings.json +37 -12
  38. package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +2 -2
  39. package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +25 -10
  40. package/resources/claude-customizations/.claude/skills/execute-hard-lock/SKILL.md +6 -6
  41. package/resources/claude-customizations/.claude/skills/feature-promotion-lifecycle/SKILL.md +8 -8
  42. package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +17 -6
  43. package/resources/claude-customizations/.claude/skills/human-exception-runbook/SKILL.md +52 -0
  44. package/resources/claude-customizations/.claude/skills/human-exception-runbook/example.runbook.md +36 -0
  45. package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +4 -4
  46. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +96 -3
  47. package/resources/claude-customizations/.claude/skills/policy-audit-template-usage/SKILL.md +3 -3
  48. package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +4 -4
  49. package/resources/claude-customizations/.claude/skills/pr-base-branch-merge-base/SKILL.md +3 -3
  50. package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +1 -1
  51. package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +90 -17
  52. package/resources/claude-dir-customizations/.mcp.json +3 -3
  53. package/resources/codex-and-agents-customizations/.agents/README.md +1 -1
  54. package/resources/codex-and-agents-customizations/.agents/skills/acceptance-criteria-tracking/SKILL.md +0 -5
  55. package/resources/codex-and-agents-customizations/.agents/skills/architecture-boundaries/SKILL.md +52 -0
  56. package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +16 -8
  57. package/resources/codex-and-agents-customizations/.agents/skills/benchmark-baselines/SKILL.md +44 -0
  58. package/resources/codex-and-agents-customizations/.agents/skills/ci-workflows/SKILL.md +45 -0
  59. package/resources/codex-and-agents-customizations/.agents/skills/commit-message/SKILL.md +3 -11
  60. package/resources/codex-and-agents-customizations/.agents/skills/csharp/SKILL.md +1 -5
  61. package/resources/codex-and-agents-customizations/.agents/skills/csharp-change-budget-router/SKILL.md +1 -6
  62. package/resources/codex-and-agents-customizations/.agents/skills/csharp-orchestration-state-machine/SKILL.md +0 -5
  63. package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +0 -5
  64. package/resources/codex-and-agents-customizations/.agents/skills/evidence-and-timestamp-conventions/SKILL.md +0 -5
  65. package/resources/codex-and-agents-customizations/.agents/skills/execute-hard-lock/SKILL.md +8 -17
  66. package/resources/codex-and-agents-customizations/.agents/skills/feature-promotion-lifecycle/SKILL.md +13 -14
  67. package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +1 -6
  68. package/resources/codex-and-agents-customizations/.agents/skills/fill-feature-docs/SKILL.md +0 -5
  69. package/resources/codex-and-agents-customizations/.agents/skills/general-code-change/SKILL.md +86 -0
  70. package/resources/codex-and-agents-customizations/.agents/skills/general-unit-test/SKILL.md +111 -0
  71. package/resources/codex-and-agents-customizations/.agents/skills/human-exception-runbook/SKILL.md +57 -0
  72. package/resources/codex-and-agents-customizations/.agents/skills/human-exception-runbook/example.runbook.md +36 -0
  73. package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +0 -9
  74. package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +0 -9
  75. package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +0 -9
  76. package/resources/codex-and-agents-customizations/.agents/skills/make-skill-template/SKILL.md +0 -5
  77. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +93 -8
  78. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +48 -0
  79. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +61 -2
  80. package/resources/codex-and-agents-customizations/.agents/skills/policy-audit-template-usage/SKILL.md +3 -8
  81. package/resources/codex-and-agents-customizations/.agents/skills/policy-compliance-order/SKILL.md +0 -10
  82. package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +4 -8
  83. package/resources/codex-and-agents-customizations/.agents/skills/powershell-change-budget-router/SKILL.md +1 -6
  84. package/resources/codex-and-agents-customizations/.agents/skills/powershell-orchestration-state-machine/SKILL.md +0 -5
  85. package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +3 -9
  86. package/resources/codex-and-agents-customizations/.agents/skills/pr-author/SKILL.md +1 -9
  87. package/resources/codex-and-agents-customizations/.agents/skills/pr-base-branch-merge-base/SKILL.md +4 -9
  88. package/resources/codex-and-agents-customizations/.agents/skills/pr-context-artifacts/SKILL.md +0 -5
  89. package/resources/codex-and-agents-customizations/.agents/skills/python/SKILL.md +1 -5
  90. package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +1 -6
  91. package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +0 -5
  92. package/resources/codex-and-agents-customizations/.agents/skills/python-suppressions/SKILL.md +2 -6
  93. package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +57 -0
  94. package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +0 -5
  95. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +91 -72
  96. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/agents/openai.yaml +1 -1
  97. package/resources/codex-and-agents-customizations/.agents/skills/research-issue/SKILL.md +0 -10
  98. package/resources/codex-and-agents-customizations/.agents/skills/review-epic/SKILL.md +0 -5
  99. package/resources/codex-and-agents-customizations/.agents/skills/review-feature/SKILL.md +0 -5
  100. package/resources/codex-and-agents-customizations/.agents/skills/review-staged/SKILL.md +0 -5
  101. package/resources/codex-and-agents-customizations/.agents/skills/self-explanatory-code-commenting/SKILL.md +2 -6
  102. package/resources/codex-and-agents-customizations/.agents/skills/skill-canonical-location-audit/SKILL.md +0 -5
  103. package/resources/codex-and-agents-customizations/.agents/skills/tonality/SKILL.md +86 -0
  104. package/resources/codex-and-agents-customizations/.agents/skills/translate-claude-to-codex/SKILL.md +297 -0
  105. package/resources/codex-and-agents-customizations/.agents/skills/translate-copilot-to-claude/SKILL.md +0 -22
  106. package/resources/codex-and-agents-customizations/.agents/skills/typescript/SKILL.md +1 -5
  107. package/resources/codex-and-agents-customizations/.agents/skills/typescript-suppressions/SKILL.md +2 -6
  108. package/resources/codex-and-agents-customizations/.agents/skills/update-status/SKILL.md +0 -5
  109. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +5 -5
  110. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +91 -63
  111. package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +1 -1
  112. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +1 -1
  113. package/resources/codex-and-agents-customizations/.codex/config.toml +51 -136
  114. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +1 -1
  115. package/resources/codex-and-agents-customizations/.codex/prompts/orchestrate-work.md +4 -3
  116. package/resources/codex-and-agents-customizations/.codex/scripts/post-codex-worktree-session.ps1 +5 -0
  117. package/resources/codex-and-agents-customizations/.github/workflows/_validate-orchestrator-state.yml +68 -0
  118. package/resources/codex-and-agents-customizations/.github/workflows/validate-orchestrator-state.yml +15 -0
  119. package/resources/config/orchestration-routing.json +84 -0
  120. package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +1 -1
  121. package/resources/customizations/.github/agents/atomic_executor.agent.md +1 -1
  122. package/resources/customizations/.github/agents/atomic_planning.agent.md +10 -10
  123. package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +6 -2
  124. package/resources/customizations/.github/agents/feature-review.agent.md +2 -2
  125. package/resources/customizations/.github/agents/orchestrator.agent.md +6 -2
  126. package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +4 -4
  127. package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +10 -10
  128. package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -2
  129. package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +2 -2
  130. package/resources/customizations/.github/agents/python-orchestrator.agent.md +6 -2
  131. package/resources/customizations/.github/agents/staged-review.agent.md +1 -1
  132. package/resources/customizations/.github/instructions/powershell-code-change.instructions.md +6 -6
  133. package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +1 -1
  134. package/resources/customizations/.github/prompts/orchestrate-csharp-work.prompt.md +5 -3
  135. package/resources/customizations/.github/prompts/orchestrate-work.prompt.md +5 -3
  136. package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +14 -1
  137. package/resources/customizations/.github/skills/feature-promotion-lifecycle/SKILL.md +11 -7
  138. package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +10 -1
  139. package/resources/customizations/.github/skills/pr-base-branch-merge-base/SKILL.md +2 -2
  140. package/resources/customizations/.github/skills/remediation-handoff-atomic-planner/SKILL.md +5 -0
  141. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +7 -0
  142. package/resources/scripts/dev_tools/_orchestrator_state_human_interaction.py +127 -0
  143. package/resources/scripts/dev_tools/_orchestrator_state_routing.py +216 -0
  144. package/resources/scripts/dev_tools/push_down_claude_customizations.py +191 -5
  145. package/resources/scripts/dev_tools/validate_orchestration_artifacts.py +103 -411
  146. package/resources/scripts/dev_tools/validate_orchestration_review_artifacts.py +107 -0
  147. package/resources/scripts/dev_tools/validate_orchestrator_state.py +428 -0
  148. package/resources/scripts/dev_tools/validate_policy_audit_artifact.py +448 -0
  149. package/resources/templates/push_down_claude_customizations.py +227 -6
  150. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_repo_root_is_source_of_truth.md +0 -11
  151. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_vsce_verify_package_location.md +0 -19
  152. package/resources/claude-customizations/.claude/agent-memory/orchestrator/project_extension_location.md +0 -11
  153. package/resources/claude-customizations/.claude/agent-memory/prd-feature/MEMORY.md +0 -1
  154. package/resources/claude-customizations/.claude/agent-memory/prd-feature/project_push_down_pattern.md +0 -13
  155. package/resources/claude-customizations/.claude/agent-memory/task-researcher/MEMORY.md +0 -3
  156. package/resources/claude-customizations/.claude/agent-memory/task-researcher/project_push_down_claude_dir.md +0 -11
@@ -1,11 +1,6 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - None
5
-
6
1
  ---
7
2
  name: feature-promotion-lifecycle
8
- description: Deterministic promotion workflow from potential feature/bug entry to issue, branch, active feature folder, and downstream spec/research handoffs. Agent sessions must use the drmCopilotExtension MCP tool surface and record raw promotion receipts under the canonical checkpoint namespace.
3
+ description: Deterministic promotion workflow from potential feature/bug entry to issue, branch, active feature folder, and downstream spec/research handoffs. Agent sessions must use the drm-copilot MCP tool surface and record raw promotion receipts under the canonical checkpoint namespace.
9
4
  ---
10
5
 
11
6
  # Feature Promotion Lifecycle
@@ -22,13 +17,13 @@ Use this skill when:
22
17
 
23
18
  ## MCP Tool Availability Preflight
24
19
 
25
- Before any promotion step starts, verify that the required `drmCopilotExtension` MCP tools are available in the current agent session.
20
+ Before any promotion step starts, verify that the required `drm-copilot` MCP tools are available in the current agent session.
26
21
 
27
22
  Required MCP tool set:
28
- - feature potential entry: `mcp__drmCopilotExtension__new_potential_entry` with `short_name=${short-name}`
29
- - bug potential entry: `mcp__drmCopilotExtension__new_potential_bug_entry` with `short_name=${short-name}`
30
- - potential-to-issue promotion: `mcp__drmCopilotExtension__potential_to_issue` with `potential_path=${relativeFile}`, `promotion_type=${promotion-type}`, `work_mode=${work-mode}`
31
- - active feature folder creation: `mcp__drmCopilotExtension__new_active_feature_folder` with `feature_name=${long-name}`, `type=${promotion-type}`, `issue_number=${issue-num}`, `work_mode=${work-mode}`
23
+ - feature potential entry: `mcp__drm-copilot__new_potential_entry` with `short_name=${short-name}`
24
+ - bug potential entry: `mcp__drm-copilot__new_potential_bug_entry` with `short_name=${short-name}`
25
+ - potential-to-issue promotion: `mcp__drm-copilot__potential_to_issue` with `potential_path=${relativeFile}`, `promotion_type=${promotion-type}`, `work_mode=${work-mode}`
26
+ - active feature folder creation: `mcp__drm-copilot__new_active_feature_folder` with `feature_name=${long-name}`, `type=${promotion-type}`, `issue_number=${issue-num}`, `work_mode=${work-mode}`
32
27
 
33
28
  If the required MCP tools are unavailable, stop before potential-entry creation, issue promotion, or active-folder creation begins. Restore MCP connectivity first. Agent sessions do not have an approved non-MCP execution branch for promotion work.
34
29
 
@@ -71,12 +66,12 @@ Lifecycle guardrails:
71
66
 
72
67
  1) Use the same MCP tool-availability preflight described above and continue only when the required promotion tools are available.
73
68
 
74
- 2) Promote the potential document through `mcp__drmCopilotExtension__potential_to_issue` with `work_mode=minor-audit`.
69
+ 2) Promote the potential document through `mcp__drm-copilot__potential_to_issue` with `work_mode=minor-audit`.
75
70
 
76
71
  3) Create branch:
77
72
  - `${promotion-type}/${short-name}-${issue-num}`
78
73
 
79
- 4) Create the active feature folder through `mcp__drmCopilotExtension__new_active_feature_folder` with `work_mode=minor-audit`.
74
+ 4) Create the active feature folder through `mcp__drm-copilot__new_active_feature_folder` with `work_mode=minor-audit`.
80
75
 
81
76
  4a) Verify minor-audit folder integrity before proceeding:
82
77
  - `${feature-folder}/issue.md` exists and contains `- Work Mode: minor-audit`
@@ -98,9 +93,13 @@ Lifecycle guardrails:
98
93
  7) Execute plan Phase 0 only via executor and checkpoint evidence.
99
94
 
100
95
  8) Branch:
101
- - manual bootstrap: save state and stop,
96
+ - manual bootstrap: save state and stop ONLY when the initial user request explicitly opted into manual orchestration from the beginning,
102
97
  - non-bootstrap: continue with constrained small-path development.
103
98
 
99
+ Automation rule:
100
+ - do not introduce manual bootstrap, human-operator validation, or any other manual handoff later in orchestration unless that initial explicit opt-in exists
101
+ - if automation cannot proceed, record blocked automated state instead of asking for manual intervention
102
+
104
103
  9) Validate delivery via executor against `issue.md`, then run reduced audit/remediation loop until ready-to-merge.
105
104
 
106
105
  ## Required Outputs for Downstream Handoffs
@@ -1,8 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - None
5
-
6
1
  ---
7
2
  name: feature-review-workflow
8
3
  description: 'Feature-branch review workflow for base-branch resolution, PR-context refresh, active feature folder selection, review artifact generation, validator gates, acceptance-criteria check-off, and remediation triggers. Use when authoring or executing PR-style feature reviews.'
@@ -100,7 +95,7 @@ Always apply:
100
95
  5. coverage (mandatory for every language that has changed files)
101
96
  - TypeScript: `npm run test:unit:coverage` → artifact: `coverage/lcov.info`
102
97
  - Python: `poetry run pytest --cov` → artifact: `artifacts/python/lcov.info`
103
- - PowerShell: `mcp__drmCopilotExtension__run_poshqc_test` → artifact: `artifacts/pester/powershell-coverage.xml`
98
+ - PowerShell: `mcp__drm-copilot__run_poshqc_test` → artifact: `artifacts/pester/powershell-coverage.xml`
104
99
  - C#: `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage` → artifact: `artifacts/csharp/coverage.xml`
105
100
  - Coverage thresholds:
106
101
  - New code files (added in this feature): line coverage must be >= 90%. Flag as FAIL otherwise.
@@ -1,8 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - None
5
-
6
1
  ---
7
2
  name: fill-feature-docs
8
3
  description: Invoke the prd-feature worker to produce feature-document outputs from issue and research inputs.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: general-code-change
3
+ description: Cross-language code change policy for all files.
4
+ paths:
5
+ - "**"
6
+ description: Cross-language code change policy. Applies to all files.
7
+ ---
8
+
9
+ # Converted rule
10
+
11
+ Source: legacy Claude rule `general-code-change`.
12
+
13
+ # General Code Change Policy
14
+
15
+ This rule file summarizes the cross-language code change policy for this repository.
16
+
17
+ ## Design Principles
18
+
19
+ Apply these priorities in order when designing or changing code:
20
+
21
+ 1. **Simplicity first** — Prefer the simplest design that works and is readable. Avoid cleverness and deep indirection.
22
+ 2. **Reusability** — Factor out logic that is clearly reusable. Avoid copy-paste; share behavior via composition or helper methods.
23
+ 3. **Extensibility** — Design public APIs so they can be extended without breaking callers. Prefer keyword-style parameters with defaults. Prefer composition over inheritance. Use interfaces/abstract types/protocols to support multiple implementations.
24
+ 4. **Separation of concerns** — Keep pure logic (transforms, calculations, parsing) separate from I/O (disk, network, DB), UI/CLI, and framework-specific glue.
25
+
26
+ ## Classes, Functions, and APIs
27
+
28
+ - Create a class when: there is a clear domain concept with data + behavior, state and invariants must travel together, multiple implementations behind an interface are expected, or a multi-step workflow shares context.
29
+ - Create a standalone function when: the operation is pure, stateless, and simple; it is a small helper that does not naturally belong on a domain class; or it is a simple transformation from inputs to outputs.
30
+ - Keep methods small and focused. Avoid god objects.
31
+ - Use interfaces/abstract types/protocols when multiple implementations are likely.
32
+
33
+ ## Module Rigor Tiers
34
+
35
+ Module rigor tiers (T1–T4) and the uniform-versus-tier-dependent gate matrix are defined in `.agents/skills/quality-tiers.md`. Every project must be classified in `quality-tiers.yml` at repo root.
36
+
37
+ ## Mandatory Toolchain Loop
38
+
39
+ Run the full seven-stage toolchain in this exact order and repeat until all stages pass in a single pass:
40
+
41
+ 1. **Formatting** (e.g., Black, Prettier, CSharpier, Invoke-Formatter)
42
+ 2. **Linting** (e.g., Ruff, ESLint, PSScriptAnalyzer, .NET analyzers)
43
+ 3. **Type checking** (e.g., Pyright, TSC, nullable analysis; skip for PowerShell)
44
+ 4. **Architecture-boundary tests** (e.g., dependency-cruiser, NetArchTest.Rules)
45
+ 5. **Unit tests** (e.g., Pytest, Vitest, MSTest, Pester) including property-based tests where applicable per `quality-tiers.md`
46
+ 6. **Contract / schema compatibility checks** (e.g., oasdiff, schema-snapshot diff)
47
+ 7. **Integration tests**
48
+
49
+ **Restart from step 1** if any stage fails or auto-fixes any files. Do not stop the loop until all seven stages complete without errors in a single pass.
50
+
51
+ Mutation testing and golden tests run in pre-merge or nightly pipelines, not the per-commit loop.
52
+
53
+ ## File Size Limit
54
+
55
+ - No production code, test code, or reusable script file may exceed **500 lines**.
56
+ - Exceptions: temporary throwaway scripts created and deleted within an agent session; raw text fixtures for language-processing test data; Markdown documentation files.
57
+
58
+ ## Error Handling and Logging
59
+
60
+ - **Fail fast and explicitly**: raise or return clear, specific errors when invariants are violated.
61
+ - Do not silently ignore errors. Do not use broad catch-all handlers unless you immediately re-raise or propagate with added context.
62
+ - Use the project's established logging pattern. Log at appropriate levels (`debug`, `info`, `warning`, `error`).
63
+ - Enforce invariants at construction/initialization time.
64
+ - Use assertions only for internal sanity checks, not user-facing error handling.
65
+
66
+ ## Naming
67
+
68
+ - Names must be descriptive. Abbreviations are acceptable only when they are standard (`id`, `url`, `db`).
69
+ - Language-specific conventions: `snake_case` for Python functions/variables, `PascalCase` for Python classes, `camelCase` for TypeScript/C# locals, `PascalCase` for TypeScript/C# types and public members.
70
+
71
+ ## Public APIs and Compatibility
72
+
73
+ - Prefer keyword-style parameters with defaults.
74
+ - Prefer composition over inheritance when possible.
75
+ - Avoid breaking public APIs. If a breaking change is necessary, update all callers in-repo and call it out clearly in the change description.
76
+
77
+ ## Dependencies
78
+
79
+ - Use only libraries already approved in the project unless explicitly told to add more.
80
+ - If adding a dependency is unavoidable, choose a well-maintained, widely used package and document why it is required.
81
+
82
+ ## I/O Boundaries
83
+
84
+ - Isolate I/O (disk, network, APIs) into specific classes or modules.
85
+ - Core domain logic must be testable without touching the network or filesystem.
86
+ - Use of temporary files within tests is strictly prohibited.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: general-unit-test
3
+ description: Cross-language unit test policy for all files.
4
+ paths:
5
+ - "**"
6
+ description: Cross-language unit test policy. Applies to all files.
7
+ ---
8
+
9
+ # Converted rule
10
+
11
+ Source: legacy Claude rule `general-unit-test`.
12
+
13
+ # General Unit Test Policy
14
+
15
+ This rule file summarizes the cross-language unit test policy for this repository.
16
+
17
+ ## Core Principles
18
+
19
+ Every unit test must satisfy all five of these properties:
20
+
21
+ 1. **Independence** — Tests must be able to run in any order without impacting each other.
22
+ 2. **Isolation** — Each unit test targets a single function, method, or unit of behavior so failures clearly identify the faulty unit.
23
+ 3. **Fast execution** — Tests must be fast enough to support frequent runs and rapid feedback loops.
24
+ 4. **Determinism** — Given the same inputs and environment, tests must produce the same results. Avoid flakiness.
25
+ 5. **Readability and maintainability** — Test names, structure, and assertions must be clear and easy to understand.
26
+
27
+ ## Coverage Requirements
28
+
29
+ - **Line coverage must remain >= 85% across all tiers (T1–T4).**
30
+ - **Branch coverage must remain >= 75% across all tiers (T1–T4).**
31
+ - Code changes or refactors must not reduce coverage for the lines that were changed.
32
+ - Tier-specific lower coverage thresholds are not used in this repository. See `.agents/skills/quality-tiers.md` for the full tier system.
33
+ - Coverage is a supporting metric, not the sole quality gate. Untested critical behavior is not acceptable even if the overall percentage looks good.
34
+ - Configure coverage tooling to exclude test files (e.g., `tests/`) so metrics reflect application code, not tests.
35
+ - Type-only / interface-only modules with no executable behavior may be omitted from coverage measurement. Examples: Python `Protocol`-only modules consumed only under `TYPE_CHECKING`, TypeScript interface/type-only files, and C# interface-only files. Such modules legitimately report 0% executable coverage and may be excluded from measurement. This is a clarification only; it does not lower any coverage threshold.
36
+
37
+ ## Coverage Exclusion Policy
38
+
39
+ No production file may be excluded from coverage measurement. Every production source file is in the denominator of the coverage metric, regardless of whether its lines are reachable in the test environment.
40
+
41
+ The correct response to a file that contains untestable lines is to refactor it — extract all logic into host-neutral, testable modules and leave only the thinnest possible wiring in the host-bound entry point. The entry point's uncovered lines then represent a real and visible cost in the coverage metric, which creates ongoing pressure to keep those files minimal.
42
+
43
+ **Permitted `exclude` entries** (non-production paths only):
44
+ - Build output directories: `dist/**`, `lib/**`, `lib-amd/**`.
45
+ - Test files and test infrastructure: `**/*.test.ts`, `tests/**`, `src/test-support/**`.
46
+ - Config files that are not production code: `vitest.config.ts`, `eslint.config.mjs`, `.dependency-cruiser.cjs`, `webpack.config.js`.
47
+ - `node_modules/**`.
48
+
49
+ **Prohibited `exclude` entries:**
50
+ - Any path under `src/` that contains production runtime code, regardless of whether it is auto-generated, host-bound, or difficult to test.
51
+
52
+ **Enforcement:** Feature-review agents must treat any `exclude` entry that matches a production source path as a **Blocking** finding.
53
+
54
+ ## Scenario Completeness
55
+
56
+ For each unit or behavior, tests must cover:
57
+
58
+ - Positive flows with valid inputs
59
+ - Negative flows for invalid or missing inputs
60
+ - Edge cases and boundary conditions
61
+ - Error-handling behavior
62
+ - Concurrency behavior when relevant
63
+ - State transitions for stateful components
64
+
65
+ ## Test Structure — Arrange–Act–Assert
66
+
67
+ Organize each test into three sections:
68
+
69
+ - **Arrange** — set up inputs, environment, and dependencies
70
+ - **Act** — execute the behavior under test
71
+ - **Assert** — verify outcomes via assertions
72
+
73
+ Assertions must produce clear, actionable failure messages.
74
+
75
+ ## External Dependencies
76
+
77
+ - Unit tests must not depend on external services (databases, networks, remote APIs, external processes).
78
+ - Use mocks, stubs, or fakes to isolate the unit under test when code interacts with external systems.
79
+ - **Creation and use of temporary files in tests is strictly prohibited.**
80
+ - Tests must not rely on mutable global state or external configuration that can change between runs.
81
+
82
+ ## Test File Location
83
+
84
+ Test files must live in a `tests/` directory tree that mirrors the production source structure. The test for `src/foo/bar.ts` belongs at `tests/foo/bar.test.ts`; the test for `scripts/powershell/Foo.ps1` belongs at `tests/scripts/powershell/Foo.Tests.ps1`. Language-specific rules may add further naming conventions (framework suffix, file extension) on top of this universal layout requirement.
85
+
86
+ Colocation — placing test files alongside production source files in `src/` or equivalent — is not permitted. An agent that creates or moves a test file into the production source tree has violated this rule.
87
+
88
+ ## Documentation
89
+
90
+ - Each test must clearly communicate its purpose via a descriptive name and/or a short docstring or comment summarizing the scenario and expected outcome.
91
+ - Group related tests logically within the same file or test class.
92
+
93
+ ## Test Categories
94
+
95
+ The following test categories apply across the repository, with tier-dependent obligations per `.agents/skills/quality-tiers.md`:
96
+
97
+ - **Unit tests** — required for all tiers (T1–T4). Cover single units of behavior in isolation.
98
+ - **Property-based tests** — required for T1 and T2 modules: at least one property test per pure function. Use `fast-check` (TypeScript) or `hypothesis` (Python) where applicable.
99
+ - **Golden / snapshot tests** — required only for T1 classifier-output modules, tested against a versioned corpus. Snapshot tests are otherwise discouraged unless stable and intentional.
100
+ - **Contract / schema tests** — required at every host-service boundary (e.g., Office.js, Microsoft Graph, internal API contracts).
101
+ - **Mutation tests** — required for T1 modules: mutation score >= 75%. Run in pre-merge or nightly pipelines.
102
+ - **Integration tests** — required where adapters interact with external systems; scoped per tier in the gate matrix.
103
+
104
+ ## Determinism Infrastructure
105
+
106
+ All test code must be deterministic. The following infrastructure requirements apply uniformly:
107
+
108
+ - **Controllable clock** — use a `Clock` interface (TypeScript) or `TimeProvider` (.NET) injected into code under test. Do not read wall-clock time directly in production code under test.
109
+ - **Seeded RNG** — randomness must be supplied via a seedable interface; on test failure the seed must be printed so the failure is reproducible.
110
+ - **Banned APIs in test code** — `setTimeout`, `Thread.Sleep`, `Task.Delay`, real wall-clock waits, and `Date.now()` outside the clock interface are prohibited in tests.
111
+ - **Virtual scheduler / fake timers / `FakeTimeProvider`** — async tests must use the framework's fake-timer facility (`vi.useFakeTimers()` for Vitest, `FakeTimeProvider` for .NET) to advance simulated time deterministically.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: human-exception-runbook
3
+ description: Contract for runbooks that document permitted human exceptions recorded in orchestrator state.
4
+ ---
5
+
6
+ # Human-Exception Runbook
7
+
8
+ Defines the contract for a human-exception runbook: the artifact the orchestrator emits when an unautomatable requirement is resolved with the `exception` response under the autonomous-execution mandate (see `.agents/skills/orchestrate/SKILL.md`).
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when:
13
+
14
+ - The orchestrator detects an unautomatable (human-interaction) requirement and resolves it with the `exception` response rather than `scope_change` or `halt`.
15
+ - A permitted exception is recorded in orchestrator state and the schema's exception-requires-runbook invariant must be satisfied (`response == "exception"` requires a non-empty `runbook_path` pointing to an existing file).
16
+ - Authoring or reviewing a runbook that a human will follow to complete a step the workflow cannot automate.
17
+
18
+ ## Canonical Path
19
+
20
+ A human-exception runbook is stored per-feature at:
21
+
22
+ ```
23
+ <FEATURE>/runbooks/<name>.runbook.md
24
+ ```
25
+
26
+ The `runbook_path` recorded in `orchestrator-state.json` (`human_interaction.requirements[].runbook_path`) is the path relative to the repo root. This path is under the feature folder but is not an `evidence/` sub-path, so it is not governed by `enforce-evidence-locations.ps1` (OD-45-6).
27
+
28
+ ## Required Sections
29
+
30
+ Every human-exception runbook MUST contain these five sections, in this order:
31
+
32
+ 1. **Cue** — when to act; the event or state that triggers the runbook (for example, "the orchestrator recorded an `exception` for Global-Administrator admin consent").
33
+ 2. **Prerequisites** — what must be true before the human starts: accounts, roles, devices, tools, and any prior state.
34
+ 3. **Step-by-step Instructions** — numbered steps, including detailed third-party UI navigation where applicable. Each step is concrete and verifiable.
35
+ 4. **Verification** — how the human confirms success: the observable state, confirmation dialog, or command output that proves the step completed.
36
+ 5. **Source and Citation** — the source URL(s) and a dated capture (`updated_at`) for each cited step. Third-party UI sections record the navigation source; non-UI CLI steps record the documentation source for the command used.
37
+
38
+ ## Sourcing Rule (MCP-first / web-second)
39
+
40
+ Third-party UI steps (for example Azure portal / Entra admin center, Outlook desktop or mobile, the Microsoft 365 admin center) MUST be sourced **MCP-first, web-second**:
41
+
42
+ 1. Prefer an MCP documentation source (for example a Microsoft Learn MCP query) as the primary source.
43
+ 2. Use a web source (the vendor's current published documentation) only when no MCP source is available.
44
+ 3. Training data is NOT an acceptable sole source for any third-party UI step, because vendor UIs drift and stale navigation produces incorrect instructions.
45
+
46
+ Per OD-45-5, the MCP-first / web-second ordering is mandatory for third-party UI navigation. Non-UI CLI steps (for example `az` commands) do not require the UI ordering, but every step type — UI and CLI alike — MUST carry a current, dated citation in the Source-and-Citation section. A runbook step without a dated source is not contract-conformant.
47
+
48
+ ## Conformance
49
+
50
+ A runbook is contract-conformant when:
51
+
52
+ - it lives at `<FEATURE>/runbooks/<name>.runbook.md`,
53
+ - it contains all five required sections (Cue, Prerequisites, Step-by-step Instructions, Verification, Source and Citation),
54
+ - its Source-and-Citation section records at least one source URL and a capture date,
55
+ - third-party UI steps were sourced MCP-first / web-second.
56
+
57
+ A self-contained, conformant example is provided at `.agents/skills/human-exception-runbook/example.runbook.md`.
@@ -0,0 +1,36 @@
1
+ # Example Human-Exception Runbook — Grant Tenant-Wide Admin Consent for an Entra Application
2
+
3
+ This is a self-contained, contract-conformant example runbook per `.agents/skills/human-exception-runbook/SKILL.md`. It demonstrates the required five sections and the dated-citation requirement. It does not reference any other feature folder. The values below (tenant, application name) are illustrative placeholders.
4
+
5
+ ## Cue
6
+
7
+ Act on this runbook when the orchestrator records an `exception` response for the requirement "tenant-wide admin consent for the Entra application." Admin consent for delegated Microsoft Graph permissions that require administrator approval cannot be granted unattended without a Global-Administrator service principal in CI (declined per the autonomous-execution mandate's scope decisions), so it is resolved as a permitted exception and this runbook is the human follow-up.
8
+
9
+ ## Prerequisites
10
+
11
+ - An account with the **Global Administrator** or **Privileged Role Administrator** role in the target Microsoft Entra tenant.
12
+ - The application's **Application (client) ID** and the tenant's display name.
13
+ - Access to the Microsoft Entra admin center (https://entra.microsoft.com).
14
+ - The set of delegated permissions the application requests is already declared on the app registration (this runbook grants consent for them; it does not add them).
15
+
16
+ ## Step-by-step Instructions
17
+
18
+ 1. Sign in to the Microsoft Entra admin center at https://entra.microsoft.com with the Global Administrator account.
19
+ 2. In the left navigation, select **Identity** > **Applications** > **App registrations**.
20
+ 3. Select **All applications**, then open the application by its Application (client) ID.
21
+ 4. In the application's left menu, select **API permissions**.
22
+ 5. Review the listed permissions and confirm the requested delegated Microsoft Graph permissions are present with status "Not granted for <tenant>".
23
+ 6. Select **Grant admin consent for <tenant>** at the top of the **Configured permissions** list.
24
+ 7. In the confirmation dialog, select **Yes** to grant tenant-wide admin consent.
25
+
26
+ ## Verification
27
+
28
+ - After step 7, each affected permission row shows the status **Granted for <tenant>** with a green check mark.
29
+ - Re-open **API permissions** and confirm no permission remains in the "Not granted" state.
30
+ - Optionally, confirm programmatically that the consent exists by querying the service principal's OAuth2 permission grants with the Microsoft Graph CLI or `az ad`.
31
+
32
+ ## Source and Citation
33
+
34
+ - Step source (third-party UI navigation, sourced MCP-first): Microsoft Learn — "Grant tenant-wide admin consent to an application." Source URL: https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent — updated_at: 2026-06-01.
35
+ - API permissions UI reference (web-second corroboration): Microsoft Learn — "Configure a client application to access a web API." Source URL: https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-configure-app-access-web-apis — updated_at: 2026-06-01.
36
+ - Verification reference (CLI corroboration for the optional programmatic check): Microsoft Learn — "az ad app permission" command reference. Source URL: https://learn.microsoft.com/en-us/cli/azure/ad/app/permission — updated_at: 2026-06-01.
@@ -1,12 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
5
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
6
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
7
- - Rewrite Claude skill paths to shared skill paths.
8
- - Rewrite Claude rule paths to shared skill paths.
9
-
10
1
  ---
11
2
  name: invoke-csharp-engineer
12
3
  description: Invoke the csharp-typed-engineer worker to design, implement, and verify C# changes within typed repository boundaries. Applies CSharpier -> .NET Analyzers -> Nullable Analysis -> MSTest toolchain, the 1-3 production-file small-path budget, and zero-regression quality gates.
@@ -1,12 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
5
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
6
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
7
- - Rewrite Claude skill paths to shared skill paths.
8
- - Rewrite Claude rule paths to shared skill paths.
9
-
10
1
  ---
11
2
  name: invoke-powershell-engineer
12
3
  description: Invoke the powershell-typed-engineer worker to design, implement, and verify PowerShell changes within typed repository boundaries. Applies PoshQC format -> analyze -> test toolchain, the 1-2 production-file direct-mode budget, the 3-production + 3-test per-batch cap, and zero-regression quality gates.
@@ -1,12 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
5
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
6
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
7
- - Rewrite Claude skill paths to shared skill paths.
8
- - Rewrite Claude rule paths to shared skill paths.
9
-
10
1
  ---
11
2
  name: invoke-python-engineer
12
3
  description: Invoke the python-typed-engineer worker to design, implement, and verify Python changes within typed repository boundaries. Applies Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
@@ -1,8 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - None
5
-
6
1
  ---
7
2
  name: make-skill-template
8
3
  description: 'Create new Agent Skills for GitHub Copilot from prompts or by duplicating this template. Use when asked to "create a skill", "make a new skill", "scaffold a skill", or when building specialized AI capabilities with bundled resources. Generates SKILL.md files with proper frontmatter, directory structure, and optional scripts/references/assets folders.'
@@ -1,10 +1,3 @@
1
- # Converted skill
2
-
3
- Applied rewrites:
4
- - Rewrite merged standing-guidance source paths to the native AGENTS.md target.
5
- - Rewrite Claude skill paths to shared skill paths.
6
- - Rewrite Claude rules-directory references to the native skill root.
7
-
8
1
  ---
9
2
  name: orchestrate
10
3
  description: Route a repository request through the deterministic orchestration workflow for feature, bug, research, planning, execution, and review handoffs.
@@ -30,6 +23,64 @@ On every invocation, the main session must:
30
23
  1. Read `artifacts/orchestration/orchestrator-state.json` to check for existing state.
31
24
  2. If a valid checkpoint exists with a matching objective, resume from the recorded `next_step`.
32
25
  3. If no checkpoint exists or the objective is new, begin the orchestration lifecycle from the start.
26
+ 4. Read `config/orchestration-routing.json` before route selection and copy the
27
+ selected route's required agents, skills, and MCP tools into checkpoint
28
+ state.
29
+
30
+ ## Hard Enforcement Boundary
31
+
32
+ The hard completion boundary for Codex orchestration is the deterministic
33
+ orchestrator-state validator exposed through the `drm-copilot` MCP server, not
34
+ a Codex lifecycle hook. Before any DONE transition, PR creation gate, or final
35
+ completion report, the orchestrator must validate the canonical checkpoint with
36
+ `validate_orchestration_artifacts` on the `drm-copilot` MCP server using
37
+ `artifact_type: "orchestrator-state"`,
38
+ `artifact_path: "artifacts/orchestration/orchestrator-state.json"`, and
39
+ `require_complete: true`.
40
+
41
+ There is no fallback. If the MCP server or validation tool is unavailable, or
42
+ if validation fails, the orchestrator must update blocked state and stop rather
43
+ than reporting completion.
44
+
45
+ The repository CI gate `Orchestrator State Gate` runs the same validator when a
46
+ checkpoint is present. Branch protection should require this check for branches
47
+ that use orchestrated completion.
48
+
49
+ Completion validation requires the checkpoint to prove mandatory handoffs and
50
+ skill use. The checkpoint must include:
51
+
52
+ - `route_id`: the selected route key from `config/orchestration-routing.json`
53
+ - `required_agents`: exactly the selected route's `required_agents`
54
+ - `required_skills`: exactly the selected route's `required_skills`
55
+ - `required_mcp_tools`: exactly the selected route's `required_mcp_tools`
56
+ - `delegation_receipts`: one receipt for each required agent
57
+ - `skill_receipts`: one required receipt for each required skill, with evidence
58
+ - `mcp_call_receipts`: one successful receipt for each required MCP tool
59
+ - `local_execution_overrides`: an empty list at completion
60
+ - `delegation_bypasses`: an empty list at completion
61
+ - `lifecycle_operations`: any lifecycle operation must record `surface: "mcp"`
62
+
63
+ If any required handoff, skill receipt, MCP receipt, or empty bypass list is
64
+ missing, `validate_orchestration_artifacts --require-complete` fails and the
65
+ orchestrator must not report DONE.
66
+
67
+ ## Autonomous-Execution Mandate
68
+
69
+ The orchestrator must achieve all actions agentically with no unrecorded manual
70
+ dependency. Every unautomatable requirement must be detected early, resolved by
71
+ exactly one of the permitted responses below, and recorded in checkpoint state
72
+ under `human_interaction.requirements[]`.
73
+
74
+ Permitted responses:
75
+
76
+ - `scope_change`: change scope to remove the manual dependency.
77
+ - `exception`: permit an exception only when a runbook exists and its path is
78
+ recorded in `runbook_path`.
79
+ - `halt`: halt until further instruction. A `halt` blocks DONE while present.
80
+
81
+ The checkpoint validator enforces the `human_interaction` invariants. An
82
+ unresolved response, invalid response value, `halt`, or exception without an
83
+ existing runbook path blocks completion.
33
84
 
34
85
  ## Delegation Model
35
86
 
@@ -38,11 +89,36 @@ After reading `artifacts/orchestration/orchestrator-state.json`, the main sessio
38
89
  - `atomic-planner` — generates phased implementation plans
39
90
  - `atomic-executor` — executes approved plans task-by-task
40
91
  - `feature-review` — produces policy, code, and feature audit artifacts
41
- - `commit-steward` — writes commit messages from commit-context artifacts
42
92
  - `task-researcher` — performs deep research and writes findings to `artifacts/research/`
93
+ - `prd-feature` — produces issue, specification, and user-story artifacts when required by the selected workflow
94
+ - `staged-review` — reviews staged changes when a pre-commit review is required
95
+ - `epic-review` — reviews epic-level artifacts when the work item is an epic
96
+ - `status-updater` — produces status update artifacts when the workflow requires status synchronization
97
+ - `python-typed-engineer` — performs delegated Python implementation work
98
+ - `powershell-typed-engineer` — performs delegated PowerShell implementation work
99
+ - `csharp-typed-engineer` — performs delegated C# implementation work
100
+ - `typescript-engineer` — performs delegated TypeScript implementation work
101
+ - `commit-steward` — writes commit messages from commit-context artifacts
43
102
 
44
103
  The orchestrator does not perform deep implementation itself. It coordinates, tracks state, and enforces completion.
45
104
 
105
+ Every worker listed above must exist as a native Codex agent under `.codex/agents/`.
106
+ For required delegated steps, missing agent configuration, failed spawn, missing
107
+ receipt, or missing required artifact output is a hard block. The orchestrator
108
+ must persist blocked state and stop rather than performing that step locally.
109
+
110
+ Every required skill listed in the selected route must be acknowledged in
111
+ `skill_receipts[]` with:
112
+
113
+ - `skill`
114
+ - `required: true`
115
+ - `acknowledged_at_phase`
116
+ - `evidence`
117
+
118
+ The evidence value must point to objective evidence: a checkpoint field, MCP
119
+ receipt, artifact path, validator output, or test result. A bare narrative
120
+ statement is not sufficient.
121
+
46
122
  ## Evidence Location Authority
47
123
 
48
124
  All evidence artifacts produced during orchestration MUST comply with the canonical scheme defined in `.agents/skills/evidence-and-timestamp-conventions/SKILL.md`. Evidence MUST be written to `<FEATURE>/evidence/<kind>/` only.
@@ -66,6 +142,7 @@ The orchestrator must not report completion until:
66
142
  1. All required artifacts for the selected workflow path are present on disk.
67
143
  2. All validation gates (toolchain, acceptance criteria, audit artifacts) have passed.
68
144
  3. The checkpoint file at `artifacts/orchestration/orchestrator-state.json` reflects the completed state.
145
+ 4. The orchestrator-state validator passes with `--require-complete`.
69
146
 
70
147
  ## Pre-Feature-Review Commit
71
148
 
@@ -111,6 +188,13 @@ Every delegation prompt to `atomic-planner`, `atomic-executor`, and `feature-rev
111
188
 
112
189
  If a subagent artifact references a different issue number, the orchestrator rejects it, requests correction, and records the discrepancy under `artifact_errors` in the checkpoint.
113
190
 
191
+ ## CI Green Gate
192
+
193
+ Before PR/DONE completion, the orchestrator must observe the live PR head SHA
194
+ and required GitHub checks through `gh`. The checkpoint must record the checked
195
+ head SHA and CI result. DONE is blocked unless the required checks pass for the
196
+ current PR head SHA.
197
+
114
198
  ## PR Creation Gate
115
199
 
116
200
  The orchestrator must not create a PR, push a branch for PR purposes, or report work complete until all four conditions are simultaneously true:
@@ -120,6 +204,7 @@ The orchestrator must not create a PR, push a branch for PR purposes, or report
120
204
  2. The AC verification artifact (`p14-acceptance-criteria-checkoff.md` or equivalent) confirms all acceptance criteria pass.
121
205
  3. The mandatory toolchain passed in its most recent run on the branch (no linting/type-check/test failures).
122
206
  4. The checkpoint `next_step` is `S8_create_pr`.
207
+ 5. The required CI checks pass for the current PR head SHA.
123
208
 
124
209
  This gate is non-negotiable. Each condition is independently verified before PR creation proceeds.
125
210
 
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: orchestrator-state
3
+ description: Orchestrator-state remediation-cycle and human-interaction invariants.
4
+ ---
5
+
6
+ # Converted rule
7
+
8
+ Source: legacy Claude rule `orchestrator-state`.
9
+
10
+ # Orchestrator-State Remediation-Cycle and Human-Interaction Invariants
11
+
12
+ This rule governs remediation-cycle records and the optional `human_interaction` block in the orchestrator-state checkpoint at `artifacts/orchestration/orchestrator-state.json`. It documents three invariants that must hold for each remediation cycle, plus three invariants for the `human_interaction` block, so that resume and review workflows do not depend on a structurally invalid checkpoint.
13
+
14
+ ## Foreign Schema Warning (do not copy verbatim)
15
+
16
+ A hardened snapshot from another repository contains a JSON Schema for the orchestrator-state artifact whose `$id` references a foreign origin (`drmoisan.github.io/mix-calculator/`). That schema MUST NOT be copied verbatim into this repository: its `$id`, its top-level required-field set, and its cycle-level `additionalProperties: false` do not match this repository's checkpoint contract. The invariants below are re-expressed here as prose and enforced by validator logic in `scripts/dev_tools/validate_orchestrator_state.py`, not by importing a foreign schema file.
17
+
18
+ This prohibition is specific to the disqualified foreign schema identified by the `drmoisan.github.io/mix-calculator/` `$id`. A schema whose `$id` is repo-local and whose required-field set and `additionalProperties` policy match this repository's checkpoint contract is not the disqualified foreign artifact; even so, the repository's enforcement mechanism remains the Python validator prose-and-logic above, not an imported schema file.
19
+
20
+ ## Scope and Backward Compatibility
21
+
22
+ These invariants apply only when the checkpoint contains a top-level `remediation_loop` with a `cycles` array. A checkpoint with no `remediation_loop` (the existing step-based checkpoint shape) is unaffected: it validates exactly as before and produces no new errors. The invariants are additive.
23
+
24
+ ## Invariants (per remediation cycle)
25
+
26
+ 1. **Non-empty `plan_path`.** Each cycle's `plan_path` must be a non-empty string. A missing value, a non-string value, or an empty/whitespace-only string is a malformed cycle.
27
+
28
+ 2. **Execution requires cleared preflight.** A cycle's `execution_status` may be in `{in_progress, complete, failed}` only when that cycle's `preflight.final_status` is exactly `'clear'`. Any other preflight status with one of those execution statuses is a malformed cycle (execution was recorded before preflight cleared).
29
+
30
+ 3. **Exit gate requires zero blocking findings.** When a cycle's `exit_condition_met == true`, its `blocking_count` must be `0`. A non-zero `blocking_count` with `exit_condition_met == true` is a malformed cycle (the exit gate was marked satisfied while blocking findings remained).
31
+
32
+ ## Human-Interaction Scope and Backward Compatibility
33
+
34
+ These invariants apply only when the checkpoint contains a top-level `human_interaction` block. A checkpoint with no `human_interaction` key (the existing checkpoint shape) is unaffected: it validates exactly as before and produces no new errors. The invariants are additive and support the autonomous-execution mandate documented in `.agents/skills/orchestrate/SKILL.md`.
35
+
36
+ ## Invariants (human_interaction block)
37
+
38
+ 1. **Required `requirements` list.** When `human_interaction` is present, it must be an object containing a `requirements` list. A non-object `human_interaction`, or a `requirements` value that is not a list, is a malformed block.
39
+
40
+ 2. **Per-requirement `response` enum membership.** Each requirement must be an object whose `response` value is one of `scope_change`, `exception`, or `halt`. A requirement that is not an object, or whose `response` is outside this enum, is a malformed requirement.
41
+
42
+ 3. **Exception requires `runbook_path`.** A requirement whose `response == "exception"` must carry a non-empty `runbook_path` string. A missing, non-string, or empty/whitespace-only `runbook_path` on an `exception` requirement is a malformed requirement.
43
+
44
+ ## Enforcement
45
+
46
+ - `scripts/dev_tools/validate_orchestrator_state.py` appends one error per violated invariant when a `remediation_loop` is present, using the existing validator message style (literal, checkpoint-context prefixed). The validator returns a list of error strings and does not mutate its input.
47
+ - `scripts/dev_tools/validate_orchestrator_state.py` likewise appends one error per violated `human_interaction` invariant when a `human_interaction` key is present, using the same literal, checkpoint-context-prefixed message style. The check does not import or read any schema file.
48
+ - The validator is consumed by the MCP tool `validate_orchestration_artifacts`; backward compatibility for existing step-based checkpoints is preserved.