@danmoisan/drm-copilot-mcp 0.0.1 → 0.0.6

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 (183) hide show
  1. package/out/mcp-server.js +98 -21
  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 +22 -3
  15. package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +1 -1
  16. package/resources/claude-customizations/.claude/agents/pr-author.md +78 -0
  17. package/resources/claude-customizations/.claude/agents/task-researcher.md +10 -6
  18. package/resources/claude-customizations/.claude/hooks/enforce-checkpoint-monotonic.ps1 +303 -0
  19. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +300 -0
  20. package/resources/claude-customizations/.claude/hooks/enforce-evidence-locations.ps1 +40 -14
  21. package/resources/claude-customizations/.claude/hooks/enforce-feature-folder-order.ps1 +148 -0
  22. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +210 -0
  23. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.ps1 +333 -0
  24. package/resources/claude-customizations/.claude/hooks/enforce-prd-feature-before-planner.ps1 +216 -0
  25. package/resources/claude-customizations/.claude/hooks/enforce-promotion-mcp-only.ps1 +84 -15
  26. package/resources/claude-customizations/.claude/hooks/validate-executor-output.ps1 +1 -1
  27. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage.ps1 +75 -5
  28. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +93 -0
  29. package/resources/claude-customizations/.claude/hooks/validate-pr-author-output.ps1 +136 -0
  30. package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +90 -6
  31. package/resources/claude-customizations/.claude/rules/architecture-boundaries.md +46 -0
  32. package/resources/claude-customizations/.claude/rules/benchmark-baselines.md +35 -0
  33. package/resources/claude-customizations/.claude/rules/ci-workflows.md +36 -0
  34. package/resources/claude-customizations/.claude/rules/csharp.md +62 -16
  35. package/resources/claude-customizations/.claude/rules/general-code-change.md +12 -3
  36. package/resources/claude-customizations/.claude/rules/general-unit-test.md +47 -2
  37. package/resources/claude-customizations/.claude/rules/orchestrator-state.md +39 -0
  38. package/resources/claude-customizations/.claude/rules/powershell.md +5 -5
  39. package/resources/claude-customizations/.claude/rules/python.md +4 -3
  40. package/resources/claude-customizations/.claude/rules/quality-tiers.md +51 -0
  41. package/resources/claude-customizations/.claude/rules/typescript.md +37 -8
  42. package/resources/claude-customizations/.claude/settings.json +59 -12
  43. package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +2 -2
  44. package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +25 -10
  45. package/resources/claude-customizations/.claude/skills/evidence-and-timestamp-conventions/SKILL.md +0 -1
  46. package/resources/claude-customizations/.claude/skills/execute-hard-lock/SKILL.md +6 -6
  47. package/resources/claude-customizations/.claude/skills/feature-promotion-lifecycle/SKILL.md +8 -8
  48. package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +17 -6
  49. package/resources/claude-customizations/.claude/skills/human-exception-runbook/SKILL.md +52 -0
  50. package/resources/claude-customizations/.claude/skills/human-exception-runbook/example.runbook.md +36 -0
  51. package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +4 -4
  52. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +172 -5
  53. package/resources/claude-customizations/.claude/skills/policy-audit-template-usage/SKILL.md +3 -3
  54. package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +4 -4
  55. package/resources/claude-customizations/.claude/skills/pr-base-branch-merge-base/SKILL.md +3 -3
  56. package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +1 -1
  57. package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +90 -17
  58. package/resources/claude-customizations/.claude/skills/research-issue/SKILL.md +5 -3
  59. package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +69 -0
  60. package/resources/claude-customizations/.claude-variants/csharp-legacy/rules/csharp.md +96 -0
  61. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +77 -0
  62. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +64 -0
  63. package/resources/claude-customizations/pack-manifests/core.json +65 -0
  64. package/resources/claude-customizations/pack-manifests/csharp-legacy.json +11 -0
  65. package/resources/claude-customizations/pack-manifests/csharp-modern.json +12 -0
  66. package/resources/claude-customizations/pack-manifests/powershell.json +14 -0
  67. package/resources/claude-customizations/pack-manifests/python.json +14 -0
  68. package/resources/claude-customizations/pack-manifests/typescript.json +9 -0
  69. package/resources/claude-dir-customizations/.mcp.json +3 -3
  70. package/resources/codex-and-agents-customizations/.agents/README.md +1 -1
  71. package/resources/codex-and-agents-customizations/.agents/skills/acceptance-criteria-tracking/SKILL.md +0 -5
  72. package/resources/codex-and-agents-customizations/.agents/skills/architecture-boundaries/SKILL.md +52 -0
  73. package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +16 -8
  74. package/resources/codex-and-agents-customizations/.agents/skills/benchmark-baselines/SKILL.md +44 -0
  75. package/resources/codex-and-agents-customizations/.agents/skills/ci-workflows/SKILL.md +45 -0
  76. package/resources/codex-and-agents-customizations/.agents/skills/commit-message/SKILL.md +3 -11
  77. package/resources/codex-and-agents-customizations/.agents/skills/csharp/SKILL.md +1 -5
  78. package/resources/codex-and-agents-customizations/.agents/skills/csharp-change-budget-router/SKILL.md +1 -6
  79. package/resources/codex-and-agents-customizations/.agents/skills/csharp-orchestration-state-machine/SKILL.md +0 -5
  80. package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +0 -5
  81. package/resources/codex-and-agents-customizations/.agents/skills/evidence-and-timestamp-conventions/SKILL.md +0 -5
  82. package/resources/codex-and-agents-customizations/.agents/skills/execute-hard-lock/SKILL.md +8 -17
  83. package/resources/codex-and-agents-customizations/.agents/skills/feature-promotion-lifecycle/SKILL.md +41 -25
  84. package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +1 -6
  85. package/resources/codex-and-agents-customizations/.agents/skills/fill-feature-docs/SKILL.md +0 -5
  86. package/resources/codex-and-agents-customizations/.agents/skills/general-code-change/SKILL.md +86 -0
  87. package/resources/codex-and-agents-customizations/.agents/skills/general-unit-test/SKILL.md +111 -0
  88. package/resources/codex-and-agents-customizations/.agents/skills/human-exception-runbook/SKILL.md +57 -0
  89. package/resources/codex-and-agents-customizations/.agents/skills/human-exception-runbook/example.runbook.md +36 -0
  90. package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +0 -9
  91. package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +0 -9
  92. package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +0 -9
  93. package/resources/codex-and-agents-customizations/.agents/skills/make-skill-template/SKILL.md +0 -5
  94. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +206 -18
  95. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +48 -0
  96. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +94 -10
  97. package/resources/codex-and-agents-customizations/.agents/skills/policy-audit-template-usage/SKILL.md +3 -8
  98. package/resources/codex-and-agents-customizations/.agents/skills/policy-compliance-order/SKILL.md +0 -10
  99. package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +4 -8
  100. package/resources/codex-and-agents-customizations/.agents/skills/powershell-change-budget-router/SKILL.md +1 -6
  101. package/resources/codex-and-agents-customizations/.agents/skills/powershell-orchestration-state-machine/SKILL.md +0 -5
  102. package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +3 -9
  103. package/resources/codex-and-agents-customizations/.agents/skills/pr-author/SKILL.md +1 -9
  104. package/resources/codex-and-agents-customizations/.agents/skills/pr-base-branch-merge-base/SKILL.md +4 -9
  105. package/resources/codex-and-agents-customizations/.agents/skills/pr-context-artifacts/SKILL.md +0 -5
  106. package/resources/codex-and-agents-customizations/.agents/skills/python/SKILL.md +1 -5
  107. package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +1 -6
  108. package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +0 -5
  109. package/resources/codex-and-agents-customizations/.agents/skills/python-suppressions/SKILL.md +2 -6
  110. package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +57 -0
  111. package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +0 -5
  112. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +96 -72
  113. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/agents/openai.yaml +1 -1
  114. package/resources/codex-and-agents-customizations/.agents/skills/research-issue/SKILL.md +0 -10
  115. package/resources/codex-and-agents-customizations/.agents/skills/review-epic/SKILL.md +0 -5
  116. package/resources/codex-and-agents-customizations/.agents/skills/review-feature/SKILL.md +0 -5
  117. package/resources/codex-and-agents-customizations/.agents/skills/review-staged/SKILL.md +0 -5
  118. package/resources/codex-and-agents-customizations/.agents/skills/self-explanatory-code-commenting/SKILL.md +2 -6
  119. package/resources/codex-and-agents-customizations/.agents/skills/skill-canonical-location-audit/SKILL.md +0 -5
  120. package/resources/codex-and-agents-customizations/.agents/skills/tonality/SKILL.md +86 -0
  121. package/resources/codex-and-agents-customizations/.agents/skills/translate-claude-to-codex/SKILL.md +297 -0
  122. package/resources/codex-and-agents-customizations/.agents/skills/translate-copilot-to-claude/SKILL.md +0 -22
  123. package/resources/codex-and-agents-customizations/.agents/skills/typescript/SKILL.md +1 -5
  124. package/resources/codex-and-agents-customizations/.agents/skills/typescript-suppressions/SKILL.md +2 -6
  125. package/resources/codex-and-agents-customizations/.agents/skills/update-status/SKILL.md +0 -5
  126. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +5 -5
  127. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +91 -63
  128. package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +1 -1
  129. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +1 -1
  130. package/resources/codex-and-agents-customizations/.codex/config.toml +111 -137
  131. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-checkpoint-monotonic.ps1 +303 -0
  132. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-completion-consistency.ps1 +300 -0
  133. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +148 -0
  134. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-pr-author-skill.ps1 +336 -0
  135. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +84 -18
  136. package/resources/codex-and-agents-customizations/.codex/prompts/orchestrate-work.md +4 -3
  137. package/resources/codex-and-agents-customizations/.codex/scripts/post-codex-worktree-session.ps1 +5 -0
  138. package/resources/codex-and-agents-customizations/.github/workflows/_validate-orchestrator-state.yml +68 -0
  139. package/resources/codex-and-agents-customizations/.github/workflows/validate-orchestrator-state.yml +15 -0
  140. package/resources/config/orchestration-routing.json +76 -0
  141. package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +1 -1
  142. package/resources/customizations/.github/agents/atomic_executor.agent.md +1 -1
  143. package/resources/customizations/.github/agents/atomic_planning.agent.md +10 -10
  144. package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +6 -2
  145. package/resources/customizations/.github/agents/feature-review.agent.md +2 -2
  146. package/resources/customizations/.github/agents/orchestrator.agent.md +6 -2
  147. package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +4 -4
  148. package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +10 -10
  149. package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -2
  150. package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +2 -2
  151. package/resources/customizations/.github/agents/pr-author.agent.md +25 -0
  152. package/resources/customizations/.github/agents/python-orchestrator.agent.md +6 -2
  153. package/resources/customizations/.github/agents/staged-review.agent.md +1 -1
  154. package/resources/customizations/.github/agents/task-researcher.agent.md +4 -4
  155. package/resources/customizations/.github/instructions/powershell-code-change.instructions.md +6 -6
  156. package/resources/customizations/.github/prompts/fillout-prd-feature.prompt.md +1 -1
  157. package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +1 -1
  158. package/resources/customizations/.github/prompts/orchestrate-csharp-work.prompt.md +5 -3
  159. package/resources/customizations/.github/prompts/orchestrate-work.prompt.md +5 -3
  160. package/resources/customizations/.github/prompts/research-issue.prompt.md +4 -3
  161. package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +14 -1
  162. package/resources/customizations/.github/skills/feature-promotion-lifecycle/SKILL.md +11 -7
  163. package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +10 -1
  164. package/resources/customizations/.github/skills/pr-base-branch-merge-base/SKILL.md +2 -2
  165. package/resources/customizations/.github/skills/remediation-handoff-atomic-planner/SKILL.md +5 -0
  166. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +7 -0
  167. package/resources/scripts/dev_tools/_orchestrator_state_human_interaction.py +127 -0
  168. package/resources/scripts/dev_tools/_orchestrator_state_routing.py +216 -0
  169. package/resources/scripts/dev_tools/push_down_claude_customizations.py +276 -61
  170. package/resources/scripts/dev_tools/push_down_claude_filesystem.py +472 -0
  171. package/resources/scripts/dev_tools/push_down_claude_pack_selection.py +401 -0
  172. package/resources/scripts/dev_tools/validate_orchestration_artifacts.py +103 -411
  173. package/resources/scripts/dev_tools/validate_orchestration_review_artifacts.py +107 -0
  174. package/resources/scripts/dev_tools/validate_orchestrator_state.py +505 -0
  175. package/resources/scripts/dev_tools/validate_policy_audit_artifact.py +472 -0
  176. package/resources/templates/push_down_claude_customizations.py +162 -117
  177. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_repo_root_is_source_of_truth.md +0 -11
  178. package/resources/claude-customizations/.claude/agent-memory/orchestrator/feedback_vsce_verify_package_location.md +0 -19
  179. package/resources/claude-customizations/.claude/agent-memory/orchestrator/project_extension_location.md +0 -11
  180. package/resources/claude-customizations/.claude/agent-memory/prd-feature/MEMORY.md +0 -1
  181. package/resources/claude-customizations/.claude/agent-memory/prd-feature/project_push_down_pattern.md +0 -13
  182. package/resources/claude-customizations/.claude/agent-memory/task-researcher/MEMORY.md +0 -3
  183. package/resources/claude-customizations/.claude/agent-memory/task-researcher/project_push_down_claude_dir.md +0 -11
@@ -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 `.claude/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,6 +1,6 @@
1
1
  ---
2
2
  name: invoke-csharp-engineer
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.
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 -> xUnit toolchain, the 1-3 production-file small-path budget, and zero-regression quality gates.
4
4
  ---
5
5
 
6
6
  # Implement C# Skill
@@ -13,7 +13,7 @@ Use this skill when:
13
13
 
14
14
  - The user requests a C# code change, bug fix, refactor, or test addition.
15
15
  - Estimated scope fits the small path (1-3 production files plus corresponding tests).
16
- - The toolchain (CSharpier, .NET Analyzers, Nullable Analysis, MSTest) can be run in the current environment, or the user has explicitly authorized an unverified plan-only response.
16
+ - The toolchain (CSharpier, .NET Analyzers, Nullable Analysis, xUnit) can be run in the current environment, or the user has explicitly authorized an unverified plan-only response.
17
17
 
18
18
  If the estimated scope exceeds the small-path budget, this skill defers to the orchestrated flow via `csharp-change-budget-router` instead of proceeding directly.
19
19
 
@@ -37,10 +37,10 @@ If the estimated scope exceeds the small-path budget, this skill defers to the o
37
37
  The worker must return the following reporting block:
38
38
 
39
39
  1. Scope (exact file list).
40
- 2. Baseline (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, coverage status).
40
+ 2. Baseline (CSharpier, .NET Analyzers, Nullable Analysis, xUnit, coverage status).
41
41
  3. Plan (design and test strategy).
42
42
  4. Diffs (patch-style or full-file replacements).
43
- 5. QA Gate Results (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, and coverage deltas, or clearly marked **unverified**).
43
+ 5. QA Gate Results (CSharpier, .NET Analyzers, Nullable Analysis, xUnit, and coverage deltas, or clearly marked **unverified**).
44
44
 
45
45
  ## Worker Routing
46
46
 
@@ -24,6 +24,36 @@ On every invocation, the main session must:
24
24
  2. If a valid checkpoint exists with a matching objective, resume from the recorded `next_step`.
25
25
  3. If no checkpoint exists or the objective is new, begin the orchestration lifecycle from the start.
26
26
 
27
+ ## Autonomous-Execution Mandate
28
+
29
+ The orchestrator must achieve all actions agentically with no human interaction; full autonomy is a hard requirement. A silent manual blocker discovered at the end of a workflow is a defect, not an acceptable outcome. Every unautomatable (human-interaction) requirement must be detected early, resolved by exactly one of three permitted responses, and recorded in orchestrator state.
30
+
31
+ ### Detection points
32
+
33
+ - Unautomatable requirements are enumerated as mandatory-unachievable requirements **before kickoff** wherever they are knowable up front.
34
+ - Where research is needed to discover them, they MUST be surfaced **no later than the research stage**.
35
+ - Research that touches third-party UIs (for example the Azure portal / Entra admin center, Outlook desktop or mobile, the Microsoft 365 admin center) MUST include an explicit automation-feasibility / human-interaction assessment recorded under an `## Automation Feasibility` section in the research artifact.
36
+
37
+ ### Three permitted responses
38
+
39
+ When a step cannot be performed without a human, the orchestrator chooses exactly one response per requirement and records it in orchestrator state under `human_interaction.requirements[]`:
40
+
41
+ 1. **`scope_change`** — change the scope to remove the manual dependency (for example, replace a portal click with an `az` CLI step that runs unattended).
42
+ 2. **`exception`** — permit an exception. This requires emitting a human-exception runbook (see below). The exception is unresolved until its runbook file exists on disk.
43
+ 3. **`halt`** — halt until further instruction. A `halt` blocks DONE while present. A `halt` is recoverable: a later checkpoint update that resolves the requirement (to `scope_change` or a runbook-backed `exception`, or clears the halt) lifts the block.
44
+
45
+ ### Exception-runbook requirement
46
+
47
+ On a permitted `exception`, the orchestrator emits a human-readable runbook at `<FEATURE>/runbooks/<name>.runbook.md` and records its repo-root-relative path in `human_interaction.requirements[].runbook_path`. The runbook contract — canonical path, the five required sections (Cue, Prerequisites, Step-by-step Instructions, Verification, Source and Citation), and the MCP-first / web-second sourcing rule — is defined authoritatively in `.claude/skills/human-exception-runbook/SKILL.md`.
48
+
49
+ ### Enforcement points
50
+
51
+ The mandate is enforced mechanically, so DONE cannot be written while a human-interaction requirement is unresolved:
52
+
53
+ - **Validator invariants.** The top-level `human_interaction.requirements[]` invariants — the `response` enum `scope_change` | `exception` | `halt`, and the exception-requires-runbook invariant (`response == "exception"` requires a non-empty `runbook_path`) — are enforced by `scripts/dev_tools/validate_orchestrator_state.py` and by `Test-HumanInteractionShape` in `.claude/hooks/validate-orchestrator-output.ps1`, per the documented contract in `.claude/rules/orchestrator-state.md`. Checkpoints without a `human_interaction` key stay valid, so existing checkpoints are unaffected.
54
+ - **Completion gate.** `Test-HumanInteractionShape` in `.claude/hooks/validate-orchestrator-output.ps1` blocks DONE when a requirement has no resolved `response`, a `response` outside the enum, any `response == "halt"`, or an `exception` whose `runbook_path` is missing/empty or whose file does not exist. An absent `human_interaction` key passes.
55
+ - **Research gate.** `Test-AutomationFeasibilitySection` in `.claude/hooks/validate-task-researcher-output.ps1` requires the `## Automation Feasibility` section for applicable autonomous-execution research artifacts and blocks otherwise; non-applicable research is unaffected.
56
+
27
57
  ## Delegation Model
28
58
 
29
59
  After reading `artifacts/orchestration/orchestrator-state.json`, the main session delegates work exclusively through configured workers:
@@ -31,17 +61,29 @@ After reading `artifacts/orchestration/orchestrator-state.json`, the main sessio
31
61
  - `atomic-planner` — generates phased implementation plans
32
62
  - `atomic-executor` — executes approved plans task-by-task
33
63
  - `feature-review` — produces policy, code, and feature audit artifacts
34
- - `task-researcher` — performs deep research and writes findings to `artifacts/research/`
64
+ - `task-researcher` — performs deep research and writes findings to the research path the orchestrator resolves before delegating: `docs/features/<feature>/research/` when an active `feature-folder` is in scope in `orchestrator-state.json`, otherwise `docs/research/` for one-off research. The orchestrator passes the resolved path in the delegation prompt.
35
65
 
36
66
  The orchestrator does not perform deep implementation itself. It coordinates, tracks state, and enforces completion.
37
67
 
68
+ ## PR Creation Delegation
69
+
70
+ PR creation and PR body edits are delegated work, not orchestrator work. The orchestrator MUST NOT call `gh pr create` or `gh pr edit --body*` directly from the main thread; the `enforce-pr-author-skill.ps1` PreToolUse hook blocks those commands unless a valid authorization sentinel issued by the `pr-author` agent is present.
71
+
72
+ The mandatory sequence is:
73
+
74
+ 1. The orchestrator first produces the PR-context artifact via `mcp__drm-copilot__collect_pr_context` (or the equivalent context-collection mechanism), which writes `artifacts/pr_context.summary.txt`.
75
+ 2. The orchestrator then delegates PR creation and any PR body edits to `Agent(pr-author)`. The `pr-author` agent runs the `pr-author` skill, writes the short-lived authorization sentinel `artifacts/pr_author_authorization.json` immediately before each `gh` command, issues `gh pr create`/`gh pr edit --body-file ...` within the TTL, deletes the sentinel afterward, and reports the resulting PR URL or PR number.
76
+
77
+ `Agent(pr-author)` is the mandatory delegate for PR creation and PR body edits. Direct `gh pr create`/`gh pr edit --body*` from the main thread is prohibited and is blocked by the hook.
78
+
79
+ The authorization sentinel is a policy guardrail, not a cryptographic or security control; any actor with `Write(/artifacts/**)` access can forge it. It prevents accidental bypass and requires a deliberate, documented act to circumvent.
80
+
38
81
  ## Evidence Location Authority
39
82
 
40
83
  All evidence artifacts produced during orchestration MUST comply with the canonical scheme defined in `.claude/skills/evidence-and-timestamp-conventions/SKILL.md`. Evidence MUST be written to `<FEATURE>/evidence/<kind>/` only.
41
84
 
42
85
  Permitted `artifacts/`-rooted sub-paths (non-evidence orchestration use only):
43
86
  - `artifacts/orchestration/` — orchestrator state and checkpoints
44
- - `artifacts/research/` — research outputs from task-researcher
45
87
  - `artifacts/pr_context` — PR context artifacts
46
88
  - `artifacts/reviews/` — review staging artifacts
47
89
  - `artifacts/status/` — status update artifacts
@@ -51,6 +93,10 @@ Permitted `artifacts/`-rooted sub-paths (non-evidence orchestration use only):
51
93
 
52
94
  All other `artifacts/` sub-paths (e.g., `artifacts/baselines/`, `artifacts/qa/`, `artifacts/coverage/`, `artifacts/evidence/`) are FORBIDDEN for evidence output and will be blocked by the `enforce-evidence-locations.ps1` PreToolUse hook.
53
95
 
96
+ ## GitHub Actions Reusable Workflows
97
+
98
+ Every new CI gate in this repository ships as a callable reusable workflow named `_<name>.yml` that declares both `on: workflow_call:` and `on: workflow_dispatch:`. Orchestrator workflows (for example `pr-pipeline.yml`) reference these callees via `uses: ./.github/workflows/_<name>.yml` and contain no inline `steps:` of their own. Cross-job filesystem reliance is not implicit; any job that needs to share files with another job must use explicit `actions/upload-artifact` + `actions/download-artifact`. The GitHub Actions reusable-workflow nesting depth cap is 4; this repository uses one level of nesting and does not introduce additional levels without an explicit design review. See `.github/workflows/README.md` for the full per-stage dispatch and branch-protection rename procedure.
99
+
54
100
  ## Completion Requirements
55
101
 
56
102
  The orchestrator must not report completion until:
@@ -101,16 +147,75 @@ Every delegation prompt to `atomic-planner`, `atomic-executor`, and `feature-rev
101
147
 
102
148
  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.
103
149
 
150
+ ## Step S9 — CI Green Gate
151
+
152
+ `S9_ci_green` runs after `S8_create_pr` and before any DONE transition. It is the structural guarantee that the orchestrator observes what GitHub Actions produces against the live PR head SHA before writing DONE. S9 applies to every feature, not only features that modify CI paths.
153
+
154
+ S9 procedure:
155
+
156
+ 1. Resolve the live PR head SHA for the feature branch (`gh pr view --json headRefOid` or equivalent).
157
+ 2. Invoke `gh pr checks --required --json bucket,name,state,link,workflow` (or an equivalent JSON-emitting command) against that head SHA. `gh` is the only sanctioned channel for querying GitHub Actions state.
158
+ 3. Parse the JSON via `scripts/orchestration/Invoke-CiGateParser.ps1`, which emits the `ci_gate` object defined below and derives `ci_gate.conclusion` as `success` when all required checks pass, `failure` when any required check failed, and `pending` when any required check is still in progress.
159
+ 4. Poll with a bounded interval and a documented total timeout while `conclusion == "pending"`. When the timeout is exhausted, set `step9_status: "failed_remediation_required"` and enter the remediation-loop CI-failure handling below with a timeout log.
160
+ 5. Write the `ci_gate` object and `last_verified_ci_sha` to the checkpoint, and set `step9_status` to `passed` only when `ci_gate.conclusion == "success"` AND `ci_gate.head_sha` equals the current PR head SHA.
161
+
162
+ DONE is not written while `step9_status` is anything other than `passed`.
163
+
164
+ ## Checkpoint Schema — CI Gate Fields
165
+
166
+ The orchestrator checkpoint (`artifacts/orchestration/orchestrator-state.json`) is extended with:
167
+
168
+ - a top-level `ci_gate` object containing:
169
+ - `head_sha` — the PR head SHA that the required checks were observed against.
170
+ - `pr_pipeline_run_id` — the GitHub Actions run id for the PR Pipeline.
171
+ - `pr_pipeline_run_url` — the URL of that run.
172
+ - `conclusion` — one of `success`, `failure`, `pending`.
173
+ - `verified_at` — ISO-8601 timestamp of when S9 recorded the result.
174
+ - a top-level `last_verified_ci_sha` — the most recent head SHA for which S9 recorded a result.
175
+ - a top-level `step9_status` — an enumeration with at minimum the values `pending`, `passed`, `failed_remediation_required`, and `blocked_ci_loop_limit`.
176
+
177
+ Illustrative shape:
178
+
179
+ ```jsonc
180
+ {
181
+ "completed_steps": ["...", "S8_create_pr", "S9_ci_green"],
182
+ "step9_status": "pending|passed|failed_remediation_required|blocked_ci_loop_limit",
183
+ "ci_gate": {
184
+ "head_sha": "<sha>",
185
+ "pr_pipeline_run_id": "<id>",
186
+ "pr_pipeline_run_url": "<url>",
187
+ "conclusion": "success",
188
+ "verified_at": "<iso8601>"
189
+ },
190
+ "last_verified_ci_sha": "<sha>"
191
+ }
192
+ ```
193
+
194
+ ### Backward compatibility
195
+
196
+ A checkpoint that predates this schema and has no `ci_gate` object (or no `step9_status`) is treated as `step9_status: "pending"`. Missing CI-gate fields are never interpreted as `passed`; the gate fails closed. The orchestrator runs S9 to populate the fields before any DONE transition.
197
+
198
+ ## Remediation Loop — CI-Failure Handling
199
+
200
+ When S9 records `step9_status: "failed_remediation_required"` (a failed required check or an exhausted poll timeout):
201
+
202
+ 1. The failed-check log from `gh run view <run-id> --log-failed` (or the timeout log) is written as `remediation-inputs.<timestamp>.md` in the active feature folder.
203
+ 2. The failure is converted to a synthetic finding with severity `Blocking` that identifies the failing check by name and the failing job by URL.
204
+ 3. The existing R1-R5 remediation loop processes that finding exactly as it processes a local blocking finding. No new loop is introduced.
205
+ 4. The `remediation_pass` counter is shared with local-finding passes; the cap is 3.
206
+ 5. On the third CI-failure pass without resolution, the orchestrator records `step9_status: "blocked_ci_loop_limit"`, does not write DONE, and halts. No further automation is attempted.
207
+
104
208
  ## PR Creation Gate
105
209
 
106
- The orchestrator must not create a PR, push a branch for PR purposes, or report work complete until all four conditions are simultaneously true:
210
+ The orchestrator must not create a PR, push a branch for PR purposes, or report work complete until all five conditions are simultaneously true:
107
211
 
108
212
  1. `blocking_findings_resolved: true` — the most recent `feature-review` produced zero blocking findings.
109
213
  2. The AC verification artifact (`p14-acceptance-criteria-checkoff.md` or equivalent) confirms all acceptance criteria pass.
110
214
  3. The mandatory toolchain passed in its most recent run on the branch (no linting/type-check/test failures).
111
- 4. The checkpoint `next_step` is `S8_create_pr`.
215
+ 4. The checkpoint `next_step` is `S8_create_pr` (precondition to entering S9).
216
+ 5. `ci_gate.conclusion == "success"` AND `ci_gate.head_sha == current head SHA of the PR branch`. DONE is not written while either sub-condition is false.
112
217
 
113
- This gate is non-negotiable. Each condition is independently verified before PR creation proceeds.
218
+ This gate is non-negotiable. Each condition is independently verified before PR creation proceeds. Conditions 1-4 are unchanged from the prior contract; condition 5 is additive.
114
219
 
115
220
  ## Step 6 Delegation — Prohibited Prompt Language
116
221
 
@@ -130,3 +235,65 @@ The orchestrator supplies only the following to the `feature-review` subagent:
130
235
  - a neutral instruction to execute the full `feature-review-workflow` SKILL contract end-to-end.
131
236
 
132
237
  Scope determination is the subagent's responsibility. The subagent will ignore any attempted narrowing per its scope invariant and record the attempt in `policy-audit.<timestamp>.md` under `## Rejected Scope Narrowing`.
238
+
239
+ ## Routing-Contract Receipt Emission
240
+
241
+ The orchestrator must write three receipt arrays into `artifacts/orchestration/orchestrator-state.json` for the retained required names of the selected route. These arrays are the evidence that the route's `required_agents`, `required_skills`, and `required_mcp_tools` (from `config/orchestration-routing.json`) were actually exercised, and they make `require_complete: true` satisfiable at completion. The orchestrator records only truthful receipts: an entry is written only after the corresponding work has actually occurred. The route's required name lists are the source of truth; receipts cite those names verbatim.
242
+
243
+ These shapes are read by `_receipt_agents`, `_receipt_skills`, and `_mcp_tools` in `scripts/dev_tools/_orchestrator_state_routing.py`. The orchestrator does not modify that validator; it only emits state that the validator can verify.
244
+
245
+ ### delegation_receipts[]
246
+
247
+ For each required agent in the selected route's `required_agents`, append one object to `delegation_receipts[]` after that delegation returns. Each object must carry:
248
+
249
+ - `agent_name`: a non-empty string equal to the required agent name (for example `"feature-review"`).
250
+
251
+ Example:
252
+
253
+ ```json
254
+ "delegation_receipts": [
255
+ { "agent_name": "atomic-planner" },
256
+ { "agent_name": "atomic-executor" },
257
+ { "agent_name": "feature-review" }
258
+ ]
259
+ ```
260
+
261
+ The validator collects each receipt whose `agent_name` is a non-empty string and requires every `required_agents` entry to be present.
262
+
263
+ ### skill_receipts[]
264
+
265
+ For each required skill in the selected route's `required_skills`, append one object to `skill_receipts[]` after that required skill is read. Each entry must be an object with:
266
+
267
+ - `skill`: a non-empty string equal to a `required_skills` entry (for example `"orchestrate"`).
268
+ - `required`: the literal boolean `true`.
269
+ - `evidence`: a non-empty string, for example `"read:.claude/skills/orchestrate/SKILL.md"`.
270
+
271
+ Example:
272
+
273
+ ```json
274
+ "skill_receipts": [
275
+ { "skill": "orchestrate", "required": true, "evidence": "read:.claude/skills/orchestrate/SKILL.md" }
276
+ ]
277
+ ```
278
+
279
+ The validator counts a skill as acknowledged only when `skill` is a non-empty string, `required` is exactly `true`, and `evidence` is a non-empty string. Every `required_skills` entry must have such a receipt.
280
+
281
+ ### mcp_call_receipts[]
282
+
283
+ For each required MCP tool in the selected route's `required_mcp_tools`, append one object to `mcp_call_receipts[]` after each successful required MCP call. Each entry must be an object with:
284
+
285
+ - `tool`: a non-empty string equal to a `required_mcp_tools` entry (for example `"validate_orchestration_artifacts"`).
286
+ - `ok`: the literal boolean `true`.
287
+ - `evidence`: a non-empty string, such as the MCP response summary or an artifact path.
288
+
289
+ Example:
290
+
291
+ ```json
292
+ "mcp_call_receipts": [
293
+ { "tool": "validate_orchestration_artifacts", "ok": true, "evidence": "plan validator exit 0" }
294
+ ]
295
+ ```
296
+
297
+ The validator counts an MCP receipt as successful only when `tool` is a non-empty string, `ok` is exactly `true`, and `evidence` is a non-empty string. Every `required_mcp_tools` entry must have such a receipt.
298
+
299
+ These three receipt arrays, populated with the retained required names of the selected route, are what allow the routing-contract validation under `require_complete: true` to pass.
@@ -15,13 +15,13 @@ Use this skill when:
15
15
 
16
16
  ## Template Source
17
17
 
18
- - Required template source: the MCP server tool `mcp__drmCopilotExtension__resolve_policy_audit_template_asset` with asset selector `template`.
18
+ - Required template source: the MCP server tool `mcp__drm-copilot__resolve_policy_audit_template_asset` with asset selector `template`.
19
19
  - The resolved MCP asset is authoritative even when a matching repo file also exists.
20
20
  - If MCP asset resolution fails, create a minimal policy audit artifact marked BLOCKED and document the missing template resolution.
21
21
 
22
22
  ## Required Steps
23
23
 
24
- 1) Resolve the policy-audit template through the MCP server tool `mcp__drmCopilotExtension__resolve_policy_audit_template_asset` with asset `template`, then copy the resolved asset to the target location using an ISO-8601 timestamp.
24
+ 1) Resolve the policy-audit template through the MCP server tool `mcp__drm-copilot__resolve_policy_audit_template_asset` with asset `template`, then copy the resolved asset to the target location using an ISO-8601 timestamp.
25
25
  2) Replace placeholders with actual values (component, date, files under test, commits).
26
26
  3) Remove any template usage instructions per template guidance.
27
27
  4) Mark each section PASS/FAIL/N/A using the template’s expected conventions.
@@ -39,7 +39,7 @@ Use this skill when:
39
39
  - `## 10. Compliance Verdict`
40
40
  - `## Appendix A: Test Inventory`
41
41
  - `## Appendix B: Toolchain Commands Reference`
42
- 6) Run the `mcp__drmCopilotExtension__validate_orchestration_artifacts` MCP tool with `artifact_type: "policy-audit"` and `artifact_path: <path>` and fail closed on any non-zero result.
42
+ 6) Run the `mcp__drm-copilot__validate_orchestration_artifacts` MCP tool with `artifact_type: "policy-audit"` and `artifact_path: <path>` and fail closed on any non-zero result.
43
43
 
44
44
  ## Invalid Outputs
45
45
 
@@ -27,9 +27,9 @@ Before invoking this gate, the agent must have:
27
27
 
28
28
  Run the full toolchain in this exact order. If any step fails or modifies files, fix the issue and restart from step 1. Do not stop the loop until all steps complete without errors in a single pass.
29
29
 
30
- 1. `mcp__drmCopilotExtension__run_poshqc_format`
31
- 2. `mcp__drmCopilotExtension__run_poshqc_analyze`
32
- 3. `mcp__drmCopilotExtension__run_poshqc_test`
30
+ 1. `mcp__drm-copilot__run_poshqc_format`
31
+ 2. `mcp__drm-copilot__run_poshqc_analyze`
32
+ 3. `mcp__drm-copilot__run_poshqc_test`
33
33
  4. Coverage check (when enforced by task/repo flow) — use the Pester coverage output from step 3 or the repo coverage task.
34
34
 
35
35
  If the environment prevents running any tool, stop and report the change as **unverified**. Do not declare completion.
@@ -42,7 +42,7 @@ Compare the final results to the Phase A baseline. All of the following must hol
42
42
  - **Pester delta**: 0 new failing tests.
43
43
  - **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.
44
44
  - **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.
45
- - **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.
45
+ - **New modules, classes, or methods**: line coverage >= 85% and branch coverage >= 75% per the uniform tier rule (`.claude/rules/quality-tiers.md`). No tier-specific lower thresholds. No regression on changed lines.
46
46
 
47
47
  If any delta check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all deltas are clean.
48
48
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-base-branch-merge-base
3
- description: 'Resolve PRBaseBranch for mcp__drmCopilotExtension__collect_pr_context using merge-base ancestry. Use when orchestrators or review workflows need the correct comparison base branch and must select the branch with the most recent common ancestor commit with HEAD.'
3
+ description: 'Resolve PRBaseBranch for mcp__drm-copilot__collect_pr_context using merge-base ancestry. Use when orchestrators or review workflows need the correct comparison base branch and must select the branch with the most recent common ancestor commit with HEAD.'
4
4
  ---
5
5
 
6
6
  # PR Base Branch (Merge-Base)
@@ -10,7 +10,7 @@ Deterministic branch-selection rules for PR context collection.
10
10
  ## When to Use This Skill
11
11
 
12
12
  Use this skill when:
13
- - running `mcp__drmCopilotExtension__collect_pr_context`,
13
+ - running `mcp__drm-copilot__collect_pr_context`,
14
14
  - delegating post-implementation review that depends on `PRBaseBranch`,
15
15
  - constructing PR context artifacts where the base must not be hard-coded.
16
16
 
@@ -44,7 +44,7 @@ Definition of correct base:
44
44
 
45
45
  When invoking PR context collection, pass the resolved base explicitly:
46
46
 
47
- - `mcp__drmCopilotExtension__collect_pr_context` with `base=<resolved-PRBaseBranch>`
47
+ - `mcp__drm-copilot__collect_pr_context` with `base=<resolved-PRBaseBranch>`
48
48
 
49
49
  ## Evidence Recommendation
50
50
 
@@ -43,7 +43,7 @@ Compare the final results to the Phase A baseline. All of the following must hol
43
43
  - **Pytest delta**: 0 new failing tests.
44
44
  - **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.
45
45
  - **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.
46
- - **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.
46
+ - **New modules, classes, or methods**: line coverage >= 85% and branch coverage >= 75% per the uniform tier rule (`.claude/rules/quality-tiers.md`). No tier-specific lower thresholds. No regression on changed lines.
47
47
 
48
48
  If any delta check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all deltas are clean.
49
49
 
@@ -1,40 +1,113 @@
1
1
  ---
2
2
  name: remediation-handoff-atomic-planner
3
- description: 'Reusable remediation trigger and atomic_planner handoff steps. Use when audits require remediation inputs and a delegated remediation plan.'
3
+ description: 'Remediation handoff chain from orchestrator through atomic-planner, atomic-executor, and feature-review. Use when an audit cycle requires a delegated remediation plan, preflight clearance, task-by-task execution, and reaudit.'
4
4
  ---
5
5
 
6
- # Remediation Handoff to atomic_planner
6
+ # Remediation Handoff to atomic-planner
7
7
 
8
- Shared remediation workflow and handoff expectations for agents that delegate to `atomic_planner`.
8
+ Strict handoff chain for orchestrator-initiated remediation cycles. The chain enforces that an `atomic-planner`-authored plan is preflighted by `atomic-executor`, revised through a preflight sub-loop if needed, executed by `atomic-executor` task-by-task, and reaudited by `feature-review`. Workers are never invoked directly by the orchestrator.
9
9
 
10
10
  ## When to Use This Skill
11
11
 
12
12
  Use this skill when:
13
- - Audit findings require remediation.
14
- - You must create remediation inputs and delegate plan creation to `atomic_planner`.
15
13
 
16
- ## Trigger Conditions (Generic)
14
+ - Audit findings require remediation (FAIL or material PARTIAL findings).
15
+ - Toolchain checks fail.
16
+ - Acceptance criteria are unmet.
17
+ - A required CI check fails after the pull request is open.
18
+ - Any new finding surfaces during execution of an active cycle (in which case begin a new cycle, do not extend the active one).
19
+
20
+ ## Full Handoff Chain
21
+
22
+ ```
23
+ orchestrator
24
+ -> writes remediation-inputs.<entry-ts>.md
25
+ -> delegates to atomic-planner
26
+ -> atomic-planner authors remediation-plan.<entry-ts>.md
27
+ (plan shape per .claude/skills/atomic-plan-contract/SKILL.md)
28
+ -> orchestrator hands plan to atomic-executor for preflight
29
+ -> atomic-executor returns one of:
30
+ PREFLIGHT: ALL CLEAR -> proceed to execution
31
+ PREFLIGHT: REVISIONS REQUIRED -> route back to atomic-planner
32
+ with a precise plan delta; planner revises in place and
33
+ orchestrator re-runs preflight (sub-loop until clear)
34
+ -> atomic-executor executes the cleared plan task-by-task
35
+ (workers are invoked by atomic-executor only)
36
+ -> orchestrator delegates to feature-review
37
+ -> feature-review writes code-review.<exit-ts>.md,
38
+ feature-audit.<exit-ts>.md, and policy-audit.<exit-ts>.md
39
+ -> orchestrator evaluates exit condition:
40
+ blocking_count == 0 -> mark exit_condition_met = true, end loop
41
+ blocking_count > 0 -> begin cycle N+1 with new remediation-inputs.<new-ts>.md
42
+ ```
43
+
44
+ The orchestrator must not call typed-engineer workers directly during any phase of the cycle. The orchestrator must not act on a preflight delta itself; revisions are routed to `atomic-planner`.
45
+
46
+ ## Trigger Conditions
17
47
 
18
48
  Trigger remediation when any of these are true:
49
+
19
50
  - Audit artifacts contain FAIL or meaningful PARTIAL findings.
20
- - Toolchain checks fail.
51
+ - Toolchain checks fail (format, lint, type-check, test, contract, or integration stages).
21
52
  - Acceptance criteria are not met.
53
+ - A required CI check fails after the PR is open (workflow-file changes specifically must enter the loop and trigger the `modified-workflow-needs-green-run` rule defined in `.claude/skills/feature-review-workflow/SKILL.md`).
22
54
 
23
55
  ## Required Remediation Inputs
24
56
 
25
- Create `remediation-inputs.<timestamp>.md` with:
57
+ The orchestrator authors `remediation-inputs.<entry-ts>.md` with:
58
+
26
59
  - Enumerated fix list with file paths, expected behavior, and verification commands.
27
- - A do not do list (no scope creep, no policy weakening, no silent skips).
60
+ - A "do not do" list (no scope creep, no policy weakening, no silent skips).
61
+ - A pointer to the audit artifacts that produced the findings.
28
62
 
29
- ## Plan Creation and Handoff
63
+ ## Required Artifacts
30
64
 
31
- 1) Create a remediation plan target file using the repo’s plan template.
32
- 2) Delegate to `atomic_planner` with:
33
- - `${spec}` pointing to remediation inputs (authoritative)
34
- - `${file}` pointing to the remediation plan target file
35
- 3) Require `atomic_planner` to output a deterministic, atomic plan with phases and `[P#-T#]` IDs.
65
+ Each remediation cycle produces exactly five artifacts under the active feature folder:
36
66
 
37
- ## Context Package (When Required)
67
+ 1. `docs/features/active/<slug>/remediation-inputs.<entry-ts>.md` orchestrator authors at cycle entry.
68
+ 2. `docs/features/active/<slug>/remediation-plan.<entry-ts>.md` — `atomic-planner` authors at cycle entry.
69
+ 3. `docs/features/active/<slug>/code-review.<exit-ts>.md` — `feature-review` authors at cycle exit.
70
+ 4. `docs/features/active/<slug>/feature-audit.<exit-ts>.md` — `feature-review` authors at cycle exit.
71
+ 5. `docs/features/active/<slug>/policy-audit.<exit-ts>.md` — `feature-review` authors at cycle exit.
72
+
73
+ Timestamp rule:
74
+
75
+ - `<entry-ts>` is the ISO-8601 timestamp at cycle entry, in the `yyyy-MM-ddTHH-mm` format defined in `.claude/skills/evidence-and-timestamp-conventions/SKILL.md`. It applies to both `remediation-inputs.<entry-ts>.md` and `remediation-plan.<entry-ts>.md`.
76
+ - `<exit-ts>` is the ISO-8601 timestamp at cycle exit (when `feature-review` runs), in the same `yyyy-MM-ddTHH-mm` format. It applies to all three reaudit artifacts: `code-review.<exit-ts>.md`, `feature-audit.<exit-ts>.md`, and `policy-audit.<exit-ts>.md`.
77
+
78
+ A cycle with fewer than five artifacts is malformed. A cycle that uses a single timestamp for both entry and exit is malformed unless both phases ran within the same minute.
79
+
80
+ ## Plan Shape
38
81
 
39
- If the calling agent requires a context package, inline the specified audit artifacts, PR context artifacts, and any relevant plan files in the delegated prompt.
82
+ `remediation-plan.<entry-ts>.md` MUST conform to `.claude/skills/atomic-plan-contract/SKILL.md`. In particular:
83
+
84
+ - Phase headings: `### Phase N — <Title>`.
85
+ - Tasks: `- [ ] [P#-T#]` with sequential per-phase IDs.
86
+ - Phase 0 captures policy reads and baseline toolchain results per `policy-compliance-order` and `evidence-and-timestamp-conventions`.
87
+ - Final phase runs the full toolchain QA loop in the order specified by `atomic-plan-contract` and records numeric coverage values where the repository policy requires coverage.
88
+ - Evidence paths resolve to `<FEATURE>/evidence/<kind>/` per the non-overridable evidence path clause.
89
+
90
+ The plan must pass the `mcp__drm-copilot__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>` before `atomic-executor` runs preflight against it.
91
+
92
+ ## Preflight Sub-Loop
93
+
94
+ After the plan is authored, `atomic-executor` runs preflight under the directive `DIRECTIVE: PREFLIGHT VALIDATION ONLY`. The exact signal returned is either:
95
+
96
+ - `PREFLIGHT: ALL CLEAR` — the plan proceeds to execution.
97
+ - `PREFLIGHT: REVISIONS REQUIRED` — `atomic-executor` returns a precise plan delta. The orchestrator routes the delta to `atomic-planner` for revision. `atomic-planner` updates the same plan file in place (per the plan-path continuity contract in `atomic-plan-contract`). The orchestrator then re-runs preflight. The sub-loop repeats until `PREFLIGHT: ALL CLEAR` is returned.
98
+
99
+ The orchestrator records the preflight outcome in `remediation_loop.cycles[current_cycle].preflight` with `iterations` (counter) and `final_status` (`clear|changes_requested|pending`).
100
+
101
+ ## Execution and Reaudit
102
+
103
+ When preflight is clear, `atomic-executor` executes the plan task-by-task. The executor invokes workers (`python-typed-engineer`, `typescript-engineer`, `csharp-typed-engineer`, `powershell-typed-engineer`) internally as needed. The orchestrator does not call workers.
104
+
105
+ When execution is complete, the orchestrator delegates to `feature-review`. `feature-review` produces the three reaudit artifacts under the active feature folder using the exit timestamp.
106
+
107
+ ## Exit Gate
108
+
109
+ The orchestrator reads the latest cycle's three reaudit artifacts and computes `blocking_count` as the total number of FAIL findings plus material PARTIAL findings flagged as blocking. Only when `blocking_count == 0` does the orchestrator set `exit_condition_met = true` on the current cycle and mark the remediation loop complete. Otherwise, the orchestrator opens cycle N+1 with a new `remediation-inputs.<new-ts>.md` and runs the full chain again.
110
+
111
+ ## Context Package (When Required)
40
112
 
113
+ If the calling agent requires a context package, inline the relevant audit artifacts, PR context artifacts, and any active plan files in the delegated prompt to `atomic-planner` rather than referencing them by path alone.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: research-issue
3
- description: Investigate the best implementation approach for a feature or bug by analyzing the codebase and external references, then writing structured findings to artifacts/research/.
3
+ description: Investigate the best implementation approach for a feature or bug by analyzing the codebase and external references, then writing structured findings to the resolved research path under docs/features/<feature>/research/ (feature-associated) or docs/research/ (one-off).
4
4
  allowed-tools:
5
5
  - Read
6
6
  - Grep
@@ -22,9 +22,11 @@ Accept one or more feature documents as context:
22
22
 
23
23
  ## Output
24
24
 
25
- Create or update a single research file:
25
+ Create or update a single research file at one of the two tracked research roots:
26
26
 
27
- - Path: `artifacts/research/<timestamp>-<short-name>-research.md`
27
+ - Feature-associated research: `docs/features/<feature>/research/<timestamp>-<short-name>-research.md` (for example `docs/features/active/<feature>/research/<timestamp>-<short-name>-research.md`).
28
+ - One-off research not tied to a feature: `docs/research/<timestamp>-<short-name>-research.md`.
29
+ - Routing rule: write to the feature research root when an active feature folder is in scope (the orchestrator supplies the resolved path from `feature-folder` in `orchestrator-state.json`); otherwise write to `docs/research/`. The filename convention `<timestamp>-<short-name>-research.md` is unchanged.
28
30
  - Use the Task Researcher template from the repository exactly.
29
31
  - Place rejected-alternatives summaries inside `## Recommended Approach`, not as a separate top-level header.
30
32
 
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: csharp-typed-engineer
3
+ description: Project-scoped worker that implements and verifies C# changes within typed repository boundaries. Applies the CSharpier -> .NET Analyzers -> Nullable Analysis -> MSTest toolchain, the 1-3 production-file small-path budget, and zero-regression quality gates.
4
+ tools:
5
+ - Read
6
+ - Grep
7
+ - Glob
8
+ - "Bash(msbuild *)"
9
+ - "Bash(dotnet *)"
10
+ skills:
11
+ - policy-compliance-order
12
+ - csharp-change-budget-router
13
+ - atomic-plan-contract
14
+ - csharp-qa-gate
15
+ - acceptance-criteria-tracking
16
+ - feature-promotion-lifecycle
17
+ - remediation-handoff-atomic-planner
18
+ - evidence-and-timestamp-conventions
19
+ memory: project
20
+ ---
21
+
22
+ # CSharp Typed Engineer Agent
23
+
24
+ Senior C# engineer specialized in small cohesive classes and modules, strong typing under nullable reference types, minimal DI seams, and deterministic MSTest coverage. Implement C# changes within the approved scope, preserve typed boundaries, and verify results with the repository C# toolchain.
25
+
26
+ ## Standing Rules
27
+
28
+ Language standards and toolchain are defined in `.claude/rules/csharp.md` and `.claude/rules/general-code-change.md`, auto-loaded for `**/*.cs` and `**/*.csproj` edits. Tonality is defined in `.claude/rules/tonality.md` and `CLAUDE.md`.
29
+
30
+ ## Workflow
31
+
32
+ Follow the phased workflow defined by the preloaded skills:
33
+
34
+ 1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
35
+ 2. **Routing and scope** — apply `csharp-change-budget-router` to estimate scope, select direct vs orchestrator handoff mode, and enforce the 3 production + 3 test per-batch cap.
36
+ 3. **Plan and baseline** — apply `atomic-plan-contract` for Phase 0 baseline capture and atomic plan structure. Delegate plan authoring to `atomic_planner` when no plan is supplied. Plans must include the proposed class and module structure, minimal DI seams, MSTest scenario-level test strategy, and Moq mock strategy.
37
+ 4. **Implement in batches** — apply the approved plan. After each batch, run targeted analyzer and nullable builds on touched projects plus targeted MSTest, and confirm per-file coverage.
38
+ 5. **Final QA gate** — apply `csharp-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
39
+ 6. **Evidence and handoff** — store baseline and post-change evidence per `evidence-and-timestamp-conventions`. Trigger remediation via `remediation-handoff-atomic-planner` when deltas fail.
40
+
41
+ ## Mode Marker Resolution
42
+
43
+ For feature-scoped work, resolve Work Mode from `issue.md` per `feature-promotion-lifecycle`:
44
+
45
+ - `- Work Mode: minor-audit`
46
+ - `- Work Mode: full-feature`
47
+ - `- Work Mode: full-bug`
48
+ - legacy `- Work Mode: full` -> interpret as `full-feature`.
49
+
50
+ If the marker is missing or malformed, fail closed to `full-feature`.
51
+
52
+ ## Stop Conditions
53
+
54
+ Stop implementation and return to the user when:
55
+
56
+ - the scope estimate or an in-flight batch would exceed the 3-production-file cap in direct mode,
57
+ - a file is near or would exceed the 500-line limit,
58
+ - any QA gate delta is non-zero after self-correction,
59
+ - the toolchain cannot be executed in the current environment (mark the change **unverified**),
60
+ - orchestrator handoff mode is requested but the required context package is incomplete,
61
+ - policy instructions conflict.
62
+
63
+ ## Evidence Location Invariant
64
+
65
+ All evidence artifacts this agent produces (baselines, QA gates, regression results, coverage) MUST be written to `<FEATURE>/evidence/<kind>/` as defined in `.claude/skills/evidence-and-timestamp-conventions/SKILL.md`.
66
+
67
+ Writing to `artifacts/baselines/`, `artifacts/qa/`, `artifacts/coverage/`, or any other non-canonical path is a policy violation and will be caught by the `enforce-evidence-locations.ps1` PreToolUse hook.
68
+
69
+ If a delegation prompt, plan, or caller instruction specifies a non-canonical evidence path (e.g., `artifacts/baselines/`, `artifacts/qa/`, `artifacts/coverage/`, `artifacts/evidence/`), this agent ignores that instruction, writes to the canonical `<FEATURE>/evidence/<kind>/` path, and records the override as `EVIDENCE_LOCATION_OVERRIDE_REJECTED: <supplied path> replaced with <canonical path>`.