@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
@@ -13,7 +13,7 @@ This rule file summarizes the TypeScript-specific policies for this repository.
13
13
  1. **Formatting — Prettier**: All TypeScript must be formatted with the repository Prettier configuration. Command: `npm run format`
14
14
  2. **Linting — ESLint**: TypeScript must pass ESLint using the repository configuration. Command: `npm run lint`
15
15
  3. **Type Checking — TSC**: TypeScript must pass the compiler type-check. Avoid `any`; prefer `unknown` plus narrowing. Command: `npm run typecheck`
16
- 4. **Testing — Jest**: All TypeScript unit tests must use Jest. Command: `npm run test:unit`
16
+ 4. **Testing — Vitest**: All TypeScript unit tests must use Vitest. Command: `npm run test`
17
17
 
18
18
  Run the toolchain in order: format → lint → type-check → test. Restart from step 1 if any step fails or changes files.
19
19
 
@@ -25,21 +25,50 @@ Run the toolchain in order: format → lint → type-check → test. Restart fro
25
25
  - **Domain types**: Model domain concepts with interfaces/types that encode invariants. Prefer discriminated unions for state machines.
26
26
  - **Naming**: `PascalCase` for classes, interfaces, enums, and type aliases. `camelCase` for functions, methods, variables, and object properties. No `I` prefix on interfaces.
27
27
  - **File naming**: Prefer kebab-case filenames (e.g., `user-session.ts`, `task-runner.ts`).
28
- - **Separation of concerns**: Keep pure logic separate from VS Code extension APIs, filesystem/network I/O, and UI wiring.
28
+ - **Separation of concerns**: Keep pure logic separate from Office.js, Microsoft Graph SDK, and other host-bound APIs, filesystem/network I/O, and UI wiring.
29
29
  - **Error handling**: Fail fast with clear errors. Avoid catch-all `catch (e)` without rethrowing or adding context.
30
30
  - **Dependencies**: Do not add new runtime dependencies unless explicitly approved.
31
31
 
32
+ ## ESLint Stack
33
+
34
+ - Require `typescript-eslint` strict-type-checked + stylistic-type-checked rule sets.
35
+ - Enable type-aware parsing (`parserOptions.project = true`).
36
+ - Required plugins: `eslint-plugin-office-addins`, `eslint-plugin-promise`, `eslint-plugin-security`, `eslint-plugin-import`.
37
+ - Error-level rules: `no-floating-promises`, `no-misused-promises`, all `no-unsafe-*`.
38
+ - Add a `no-restricted-syntax` rule banning `Date.now`, `setTimeout`, `setInterval`, and `Math.random` outside an explicit infrastructure allowlist.
39
+
32
40
  ## Testing Standards
33
41
 
34
- - Use **Jest** as the test framework.
42
+ - Use **Vitest** as the test framework.
35
43
  - Name test files `*.test.ts`.
36
- - Unit tests must not require the VS Code extension host.
44
+ - Unit tests must not require the Outlook host runtime.
37
45
  - Follow Arrange–Act–Assert structure.
38
46
  - Each test targets one behavior.
39
- - Use `jest.spyOn` or `jest.mock` for targeted mocking; reset mocks with `afterEach(() => { jest.resetAllMocks(); })`.
47
+ - Use `vi.spyOn` or `vi.mock` for targeted mocking; reset mocks with `afterEach(() => { vi.resetAllMocks(); })`.
40
48
  - No external dependencies (network, filesystem temp files, external processes) in unit tests.
41
49
  - Avoid snapshot tests unless stable and intentional.
42
- - Repository-wide line coverage must remain >= 80%.
43
- - Any new module, class, or method must reach >= 90% coverage.
44
- - Coverage command: `npm run test:unit:coverage`
50
+ - Coverage thresholds follow the uniform tier rule defined in `.claude/rules/quality-tiers.md`: line coverage >= 85% and branch coverage >= 75% across all tiers (T1–T4).
51
+ - Coverage command: `npm run test:coverage` (the script is wired in Prompt B1 alongside the Vitest dependency).
45
52
  - Coverage regression on changed lines is a blocking finding.
53
+ - Interface/type-only files with no executable behavior — files consisting solely of `interface` or `type` declarations — may be omitted from coverage measurement. Such files legitimately report 0% executable coverage. This is a clarification only; it does not lower any coverage threshold.
54
+
55
+ ## Architecture Boundaries
56
+
57
+ Layer rules and the No-COM architecture assertions are defined in `.claude/rules/architecture-boundaries.md`. The TypeScript enforcement tool is `dependency-cruiser` with configuration file `.dependency-cruiser.cjs`.
58
+
59
+ ## Property-Based and Mutation Testing
60
+
61
+ - `fast-check` provides property-based tests; T1 and T2 modules require >= 1 property test per pure function.
62
+ - `StrykerJS` provides mutation testing; T1 modules require mutation score >= 75%.
63
+ - Both run in pre-merge or nightly pipelines per `general-code-change.md`.
64
+
65
+ ## Golden Tests
66
+
67
+ - T1 classifier modules require golden-output snapshots tested against a versioned corpus.
68
+ - The general guidance to avoid snapshot tests unless stable and intentional remains in force for all other scenarios; classifier-output and schema-evolution snapshots are explicitly permitted when versioned.
69
+
70
+ ## Runtime Determinism
71
+
72
+ - `Date`, `Math.random`, and `setTimeout` access must flow through an injected `Clock` / `Random` interface.
73
+ - Tests use Vitest fake timers (`vi.useFakeTimers()`).
74
+ - Prefer `await flushPromises()` over `setTimeout(0)` for awaiting micro-tasks.
@@ -10,18 +10,18 @@
10
10
  "Edit(/docs/**)",
11
11
  "Write(/docs/**)",
12
12
  "Write(/artifacts/**)",
13
- "mcp__drmCopilotExtension__run_poshqc_format",
14
- "mcp__drmCopilotExtension__run_poshqc_analyze",
15
- "mcp__drmCopilotExtension__run_poshqc_test",
16
- "mcp__drmCopilotExtension__run_poshqc_analyze_autofix",
17
- "mcp__drmCopilotExtension__resolve_execute_hard_lock_prompt",
18
- "mcp__drmCopilotExtension__collect_pr_context",
19
- "mcp__drmCopilotExtension__new_potential_entry",
20
- "mcp__drmCopilotExtension__new_potential_bug_entry",
21
- "mcp__drmCopilotExtension__potential_to_issue",
22
- "mcp__drmCopilotExtension__new_active_feature_folder",
23
- "mcp__drmCopilotExtension__validate_orchestration_artifacts",
24
- "mcp__drmCopilotExtension__resolve_atomic_plan_prompt",
13
+ "mcp__drm-copilot__run_poshqc_format",
14
+ "mcp__drm-copilot__run_poshqc_analyze",
15
+ "mcp__drm-copilot__run_poshqc_test",
16
+ "mcp__drm-copilot__run_poshqc_analyze_autofix",
17
+ "mcp__drm-copilot__resolve_execute_hard_lock_prompt",
18
+ "mcp__drm-copilot__collect_pr_context",
19
+ "mcp__drm-copilot__new_potential_entry",
20
+ "mcp__drm-copilot__new_potential_bug_entry",
21
+ "mcp__drm-copilot__potential_to_issue",
22
+ "mcp__drm-copilot__new_active_feature_folder",
23
+ "mcp__drm-copilot__validate_orchestration_artifacts",
24
+ "mcp__drm-copilot__resolve_atomic_plan_prompt",
25
25
  "Agent(atomic-planner)",
26
26
  "Agent(atomic-executor)",
27
27
  "Agent(feature-review)",
@@ -78,6 +78,10 @@
78
78
  {
79
79
  "type": "command",
80
80
  "command": "pwsh -NoProfile -File .claude/hooks/enforce-promotion-mcp-only.ps1"
81
+ },
82
+ {
83
+ "type": "command",
84
+ "command": "pwsh -NoProfile -File .claude/hooks/enforce-pr-author-skill.ps1"
81
85
  }
82
86
  ]
83
87
  },
@@ -103,6 +107,27 @@
103
107
  {
104
108
  "type": "command",
105
109
  "command": "pwsh -NoProfile -File .claude/hooks/enforce-evidence-locations.ps1"
110
+ },
111
+ {
112
+ "type": "command",
113
+ "command": "pwsh -NoProfile -File .claude/hooks/enforce-feature-folder-order.ps1"
114
+ },
115
+ {
116
+ "type": "command",
117
+ "command": "pwsh -NoProfile -File .claude/hooks/enforce-checkpoint-monotonic.ps1"
118
+ },
119
+ {
120
+ "type": "command",
121
+ "command": "pwsh -NoProfile -File .claude/hooks/enforce-completion-consistency.ps1"
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "matcher": "Agent",
127
+ "hooks": [
128
+ {
129
+ "type": "command",
130
+ "command": "pwsh -NoProfile -File .claude/hooks/enforce-prd-feature-before-planner.ps1"
106
131
  }
107
132
  ]
108
133
  }
@@ -19,7 +19,7 @@ Use this skill when:
19
19
  - Phase headings must be: `### Phase N — <Title>`
20
20
  - Tasks must start with: `- [ ] [P#-T#]` (or `[x]` for completed)
21
21
  - Task IDs must match their phase and be sequential per phase.
22
- - Plans must pass the `mcp__drmCopilotExtension__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>` before they can be reported as approved.
22
+ - Plans must pass the `mcp__drm-copilot__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>` before they can be reported as approved.
23
23
 
24
24
  ## Short-Path Minimal Plan Contract
25
25
 
@@ -153,7 +153,7 @@ When validating or handing off plans for execution:
153
153
 
154
154
  Before a plan can be treated as approved:
155
155
 
156
- - run the `mcp__drmCopilotExtension__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>`,
156
+ - run the `mcp__drm-copilot__validate_orchestration_artifacts` MCP tool with `artifact_type: "plan"` and `artifact_path: <plan-path>`,
157
157
  - reject the plan if that validator exits non-zero,
158
158
  - do not treat human-readable summaries as a substitute for validator success.
159
159
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: csharp-qa-gate
3
- description: Final QA gate for C# changes. Executes the full CSharpier -> .NET Analyzers -> Nullable Analysis -> MSTest toolchain, compares against a captured baseline, enforces zero-regression deltas, and produces the required reporting block before the agent declares the change complete.
3
+ description: Final QA gate for C# changes. Executes the full CSharpier -> .NET Analyzers -> Nullable Analysis -> xUnit toolchain (with architecture tests), compares against a captured baseline, enforces zero-regression deltas, and produces the required reporting block before the agent declares the change complete.
4
4
  ---
5
5
 
6
6
  # C# QA Gate
@@ -19,18 +19,32 @@ Use this skill when:
19
19
 
20
20
  Before invoking this gate, the agent must have:
21
21
 
22
- - a baseline record produced in Phase A, containing analyzer findings, compiler/nullable diagnostics, MSTest pass/fail status, and per-file coverage status for the in-scope files,
22
+ - a baseline record produced in Phase A, containing analyzer findings, compiler/nullable diagnostics, xUnit pass/fail status, and per-file coverage status for the in-scope files,
23
23
  - the exact list of touched production and test files,
24
24
  - a clean working tree (all planned edits committed to the working copy).
25
25
 
26
26
  ## Toolchain Execution Sequence
27
27
 
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 four steps complete without errors in a single pass.
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 five steps complete without errors in a single pass.
29
29
 
30
- 1. `dotnet tool run csharpier .`
31
- 2. `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true`
32
- 3. `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:Nullable=enable /p:TreatWarningsAsErrors=true`
33
- 4. `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage`
30
+ Analyzer settings (`AnalysisLevel`, `AnalysisMode`, `TreatWarningsAsErrors`, `Nullable`) are centralized in `Directory.Build.props` and apply to every project automatically. Per-project analyzer-enablement properties are not used — central settings are authoritative.
31
+
32
+ 1. `dotnet tool restore`
33
+ 2. `dotnet csharpier check .`
34
+ 3. `dotnet build` (analyzers and nullable analysis enforced via `Directory.Build.props`; `TreatWarningsAsErrors=true` fails the build on any warning)
35
+ 4. `dotnet test tests/*.ArchitectureTests/*.csproj --no-build` (architecture tests against the `*.ArchitectureTests` project)
36
+ 5. `dotnet test --collect:"XPlat Code Coverage"` (full unit-test pass with coverage)
37
+ 6. Emit canonical coverage artifact: after `dotnet test` completes, copy the newest `TestResults/*/coverage.cobertura.xml` to `artifacts/csharp/coverage.xml` so local runs produce the same canonical artifact as CI. PowerShell sketch:
38
+
39
+ ```pwsh
40
+ New-Item -ItemType Directory -Force -Path artifacts/csharp | Out-Null
41
+ $latest = Get-ChildItem TestResults -Recurse -Filter coverage.cobertura.xml |
42
+ Sort-Object LastWriteTime -Descending | Select-Object -First 1
43
+ if (-not $latest) { Write-Error 'No coverage.cobertura.xml found'; exit 1 }
44
+ Copy-Item $latest.FullName artifacts/csharp/coverage.xml -Force
45
+ ```
46
+
47
+ The step must fail non-zero when no `coverage.cobertura.xml` is present.
34
48
 
35
49
  If the environment prevents running any tool, stop and report the change as **unverified**. Do not declare completion.
36
50
 
@@ -40,7 +54,8 @@ Compare the final results to the Phase A baseline. All of the following must hol
40
54
 
41
55
  - **Analyzer delta**: 0 new findings across the repository.
42
56
  - **Compiler / nullable delta**: 0 new diagnostics across the repository.
43
- - **MSTest delta**: 0 new failing tests.
57
+ - **xUnit delta**: 0 new failing tests.
58
+ - **Architecture-test delta**: 0 new failing facts in the `*.ArchitectureTests` project.
44
59
  - **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.
45
60
  - **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.
46
61
  - **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.
@@ -52,10 +67,10 @@ If any delta check fails, the agent must revert or fix immediately and rerun the
52
67
  Every completion response must include the following sections:
53
68
 
54
69
  1. **Scope** — exact file list touched in this change.
55
- 2. **Baseline** — analyzer, compiler/nullable, MSTest, and coverage status recorded in Phase A.
70
+ 2. **Baseline** — analyzer, compiler/nullable, xUnit, and coverage status recorded in Phase A.
56
71
  3. **Plan** — design and test-strategy summary, referencing the approved plan.
57
72
  4. **Diffs** — patch-style or full-file replacements for scoped files only.
58
- 5. **QA Gate Results** — analyzer, compiler/nullable, MSTest, and coverage deltas. If any step could not be run, mark the corresponding line **unverified** and state why.
73
+ 5. **QA Gate Results** — analyzer, compiler/nullable, xUnit, architecture-test, and coverage deltas. If any step could not be run, mark the corresponding line **unverified** and state why.
59
74
 
60
75
  ## Evidence Storage
61
76
 
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: execute-hard-lock
3
- description: Place the session in atomic execution mode bound to a specific plan-of-record. Resolves the hard-lock prompt via the drmCopilotExtension MCP tool, then delegates to the atomic-executor subagent with the resolved text. Use when a caller provides ${plan-path} and ${work-mode} and requires strict plan-following behavior.
3
+ description: Place the session in atomic execution mode bound to a specific plan-of-record. Resolves the hard-lock prompt via the drm-copilot MCP tool, then delegates to the atomic-executor subagent with the resolved text. Use when a caller provides ${plan-path} and ${work-mode} and requires strict plan-following behavior.
4
4
  allowed-tools:
5
- - mcp__drmCopilotExtension__resolve_execute_hard_lock_prompt
5
+ - mcp__drm-copilot__resolve_execute_hard_lock_prompt
6
6
  - Read
7
7
  ---
8
8
 
9
9
  # Execute Hard Lock
10
10
 
11
- Thin wrapper that resolves the hard-lock prompt via the drmCopilotExtension MCP tool and hands the resolved text to the `atomic-executor` subagent as kickoff directives. The resolved prompt is the authoritative instruction set for the session; this skill does not duplicate its contents.
11
+ Thin wrapper that resolves the hard-lock prompt via the drm-copilot MCP tool and hands the resolved text to the `atomic-executor` subagent as kickoff directives. The resolved prompt is the authoritative instruction set for the session; this skill does not duplicate its contents.
12
12
 
13
13
  ## When to Use This Skill
14
14
 
@@ -16,7 +16,7 @@ Use this skill when:
16
16
 
17
17
  - The caller provides an explicit plan file path (`${plan-path}`) and a selected work mode (`${work-mode}`).
18
18
  - Strict plan-following behavior is required (no replanning, no reordering, no bucket tasks).
19
- - The drmCopilotExtension MCP server is registered and reachable.
19
+ - The drm-copilot MCP server is registered and reachable.
20
20
 
21
21
  ## Inputs
22
22
 
@@ -31,7 +31,7 @@ Required:
31
31
 
32
32
  Call the extension's resolver as the first action:
33
33
 
34
- - Tool: `mcp__drmCopilotExtension__resolve_execute_hard_lock_prompt`
34
+ - Tool: `mcp__drm-copilot__resolve_execute_hard_lock_prompt`
35
35
  - Parameters:
36
36
  - `target` (required): the plan-of-record path (`${plan-path}`).
37
37
  - `workspace_root` (optional): the workspace root. Omit to default to the current working directory.
@@ -61,7 +61,7 @@ Stop immediately and report `BLOCKED: execute-hard-lock <cause>` in any of these
61
61
 
62
62
  The three entry points below all produce the same resolved hard-lock prompt for a given plan path. This skill always uses the MCP form:
63
63
 
64
- - MCP (used by this skill): `mcp__drmCopilotExtension__resolve_execute_hard_lock_prompt` with `target=<plan-path>`. The extension passes `--output artifacts/hard_lock_prompt.txt` and `--quiet` to the bundled Python resolver.
64
+ - MCP (used by this skill): `mcp__drm-copilot__resolve_execute_hard_lock_prompt` with `target=<plan-path>`. The extension passes `--output artifacts/hard_lock_prompt.txt` and `--quiet` to the bundled Python resolver.
65
65
  - VS Code command: `@command:drmCopilotExtension.resolveExecuteHardLockPrompt` (interactive; writes to stdout + clipboard, no file artifact).
66
66
 
67
67
  ## Delegation Contract
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: feature-promotion-lifecycle
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 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.
4
4
  ---
5
5
 
6
6
  # Feature Promotion Lifecycle
@@ -17,13 +17,13 @@ Use this skill when:
17
17
 
18
18
  ## MCP Tool Availability Preflight
19
19
 
20
- 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.
21
21
 
22
22
  Required MCP tool set:
23
- - feature potential entry: `mcp__drmCopilotExtension__new_potential_entry` with `short_name=${short-name}`
24
- - bug potential entry: `mcp__drmCopilotExtension__new_potential_bug_entry` with `short_name=${short-name}`
25
- - potential-to-issue promotion: `mcp__drmCopilotExtension__potential_to_issue` with `potential_path=${relativeFile}`, `promotion_type=${promotion-type}`, `work_mode=${work-mode}`
26
- - 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}`
27
27
 
28
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.
29
29
 
@@ -56,12 +56,12 @@ When orchestrator routing selects short path, promotion/folder initialization st
56
56
 
57
57
  1) Use the same MCP tool-availability preflight described above and continue only when the required promotion tools are available.
58
58
 
59
- 2) Promote the potential document through `mcp__drmCopilotExtension__potential_to_issue` with `work_mode=minor-audit`.
59
+ 2) Promote the potential document through `mcp__drm-copilot__potential_to_issue` with `work_mode=minor-audit`.
60
60
 
61
61
  3) Create branch:
62
62
  - `${promotion-type}/${short-name}-${issue-num}`
63
63
 
64
- 4) Create the active feature folder through `mcp__drmCopilotExtension__new_active_feature_folder` with `work_mode=minor-audit`.
64
+ 4) Create the active feature folder through `mcp__drm-copilot__new_active_feature_folder` with `work_mode=minor-audit`.
65
65
 
66
66
  4a) Verify minor-audit folder integrity before proceeding:
67
67
  - `${feature-folder}/issue.md` exists and contains `- Work Mode: minor-audit`
@@ -63,6 +63,17 @@ Always apply:
63
63
  - if the marker is missing or malformed, use `full-feature`
64
64
  - if `minor-audit` is selected and `issue.md` lacks `## Acceptance Criteria`, require remediation
65
65
 
66
+ ## Policy Rules
67
+
68
+ ### modified-workflow-needs-green-run
69
+
70
+ If the branch diff modifies any path matching `.github/workflows/**`, `scripts/benchmarks/**`, or `.github/actions/**`, the policy audit emits a Blocking finding unless evidence of a green workflow run against the branch head is present in the remediation inputs.
71
+
72
+ - The rule provides a second, independent line of defense for CI-gate-modifying features, separate from and prior to the orchestrator's S9 CI green gate.
73
+ - "Green workflow run against the branch head" means a workflow run whose head SHA matches the current branch head and whose conclusion is success for the affected workflow.
74
+ - A green `workflow_dispatch` run against the branch head also satisfies the rule, not only a PR-context run. This mitigates the chicken-and-egg case where a feature must land its CI gate before the gate can run in PR context (see spec.md Risks & Mitigations).
75
+ - When the rule fires and no qualifying green-run evidence is present, record a Blocking finding and route it through the standard remediation handoff. The supporting validator `scripts/feature-review/Test-ModifiedWorkflowNeedsGreenRun.ps1` implements the trigger-path and evidence-presence logic.
76
+
66
77
  ## Ordered Procedure
67
78
 
68
79
  1. **Resolve the base branch**
@@ -95,12 +106,12 @@ Always apply:
95
106
  5. coverage (mandatory for every language that has changed files)
96
107
  - TypeScript: `npm run test:unit:coverage` → artifact: `coverage/lcov.info`
97
108
  - Python: `poetry run pytest --cov` → artifact: `artifacts/python/lcov.info`
98
- - PowerShell: `mcp__drmCopilotExtension__run_poshqc_test` → artifact: `artifacts/pester/powershell-coverage.xml`
99
- - C#: `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage` → artifact: `artifacts/csharp/coverage.xml`
100
- - Coverage thresholds:
101
- - New code files (added in this feature): line coverage must be >= 90%. Flag as FAIL otherwise.
102
- - Modified files (changed but previously existing): line coverage must show no regression relative to baseline and must remain >= 80%. Flag as FAIL otherwise.
103
- - Repo-wide line coverage must remain >= 80% per language. Flag as FAIL otherwise.
109
+ - PowerShell: `mcp__drm-copilot__run_poshqc_test` → artifact: `artifacts/pester/powershell-coverage.xml`
110
+ - C#: `dotnet test --collect:"XPlat Code Coverage"` → artifact: `artifacts/csharp/coverage.xml`
111
+ - Coverage thresholds (uniform tier rule per quality-tiers.md):
112
+ - New code files (added in this feature): line coverage >= 85% and branch coverage >= 75%. Flag as FAIL otherwise.
113
+ - Modified files (changed but previously existing): line coverage >= 85%, branch coverage >= 75%, and no regression on changed lines relative to baseline. Flag as FAIL otherwise.
114
+ - Repo-wide per language: line coverage >= 85% and branch coverage >= 75%. Flag as FAIL otherwise.
104
115
  - If coverage artifacts already exist from the executor run, inspect them instead of re-running.
105
116
  - If no coverage artifact exists for a language that has changed files, flag as FAIL — coverage verification is mandatory for all languages with changed files.
106
117
  - Run the smallest relevant subset first when the repo policy permits it.
@@ -0,0 +1,52 @@
1
+ # Human-Exception Runbook
2
+
3
+ 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 `.claude/skills/orchestrate/SKILL.md`).
4
+
5
+ ## When to Use This Skill
6
+
7
+ Use this skill when:
8
+
9
+ - The orchestrator detects an unautomatable (human-interaction) requirement and resolves it with the `exception` response rather than `scope_change` or `halt`.
10
+ - 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).
11
+ - Authoring or reviewing a runbook that a human will follow to complete a step the workflow cannot automate.
12
+
13
+ ## Canonical Path
14
+
15
+ A human-exception runbook is stored per-feature at:
16
+
17
+ ```
18
+ <FEATURE>/runbooks/<name>.runbook.md
19
+ ```
20
+
21
+ 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).
22
+
23
+ ## Required Sections
24
+
25
+ Every human-exception runbook MUST contain these five sections, in this order:
26
+
27
+ 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").
28
+ 2. **Prerequisites** — what must be true before the human starts: accounts, roles, devices, tools, and any prior state.
29
+ 3. **Step-by-step Instructions** — numbered steps, including detailed third-party UI navigation where applicable. Each step is concrete and verifiable.
30
+ 4. **Verification** — how the human confirms success: the observable state, confirmation dialog, or command output that proves the step completed.
31
+ 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.
32
+
33
+ ## Sourcing Rule (MCP-first / web-second)
34
+
35
+ 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**:
36
+
37
+ 1. Prefer an MCP documentation source (for example a Microsoft Learn MCP query) as the primary source.
38
+ 2. Use a web source (the vendor's current published documentation) only when no MCP source is available.
39
+ 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.
40
+
41
+ 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.
42
+
43
+ ## Conformance
44
+
45
+ A runbook is contract-conformant when:
46
+
47
+ - it lives at `<FEATURE>/runbooks/<name>.runbook.md`,
48
+ - it contains all five required sections (Cue, Prerequisites, Step-by-step Instructions, Verification, Source and Citation),
49
+ - its Source-and-Citation section records at least one source URL and a capture date,
50
+ - third-party UI steps were sourced MCP-first / web-second.
51
+
52
+ A self-contained, conformant example is provided at `.claude/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 `.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:
@@ -51,6 +81,10 @@ Permitted `artifacts/`-rooted sub-paths (non-evidence orchestration use only):
51
81
 
52
82
  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
83
 
84
+ ## GitHub Actions Reusable Workflows
85
+
86
+ 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.
87
+
54
88
  ## Completion Requirements
55
89
 
56
90
  The orchestrator must not report completion until:
@@ -101,16 +135,75 @@ Every delegation prompt to `atomic-planner`, `atomic-executor`, and `feature-rev
101
135
 
102
136
  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
137
 
138
+ ## Step S9 — CI Green Gate
139
+
140
+ `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.
141
+
142
+ S9 procedure:
143
+
144
+ 1. Resolve the live PR head SHA for the feature branch (`gh pr view --json headRefOid` or equivalent).
145
+ 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.
146
+ 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.
147
+ 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.
148
+ 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.
149
+
150
+ DONE is not written while `step9_status` is anything other than `passed`.
151
+
152
+ ## Checkpoint Schema — CI Gate Fields
153
+
154
+ The orchestrator checkpoint (`artifacts/orchestration/orchestrator-state.json`) is extended with:
155
+
156
+ - a top-level `ci_gate` object containing:
157
+ - `head_sha` — the PR head SHA that the required checks were observed against.
158
+ - `pr_pipeline_run_id` — the GitHub Actions run id for the PR Pipeline.
159
+ - `pr_pipeline_run_url` — the URL of that run.
160
+ - `conclusion` — one of `success`, `failure`, `pending`.
161
+ - `verified_at` — ISO-8601 timestamp of when S9 recorded the result.
162
+ - a top-level `last_verified_ci_sha` — the most recent head SHA for which S9 recorded a result.
163
+ - a top-level `step9_status` — an enumeration with at minimum the values `pending`, `passed`, `failed_remediation_required`, and `blocked_ci_loop_limit`.
164
+
165
+ Illustrative shape:
166
+
167
+ ```jsonc
168
+ {
169
+ "completed_steps": ["...", "S8_create_pr", "S9_ci_green"],
170
+ "step9_status": "pending|passed|failed_remediation_required|blocked_ci_loop_limit",
171
+ "ci_gate": {
172
+ "head_sha": "<sha>",
173
+ "pr_pipeline_run_id": "<id>",
174
+ "pr_pipeline_run_url": "<url>",
175
+ "conclusion": "success",
176
+ "verified_at": "<iso8601>"
177
+ },
178
+ "last_verified_ci_sha": "<sha>"
179
+ }
180
+ ```
181
+
182
+ ### Backward compatibility
183
+
184
+ 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.
185
+
186
+ ## Remediation Loop — CI-Failure Handling
187
+
188
+ When S9 records `step9_status: "failed_remediation_required"` (a failed required check or an exhausted poll timeout):
189
+
190
+ 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.
191
+ 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.
192
+ 3. The existing R1-R5 remediation loop processes that finding exactly as it processes a local blocking finding. No new loop is introduced.
193
+ 4. The `remediation_pass` counter is shared with local-finding passes; the cap is 3.
194
+ 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.
195
+
104
196
  ## PR Creation Gate
105
197
 
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:
198
+ 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
199
 
108
200
  1. `blocking_findings_resolved: true` — the most recent `feature-review` produced zero blocking findings.
109
201
  2. The AC verification artifact (`p14-acceptance-criteria-checkoff.md` or equivalent) confirms all acceptance criteria pass.
110
202
  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`.
203
+ 4. The checkpoint `next_step` is `S8_create_pr` (precondition to entering S9).
204
+ 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
205
 
113
- This gate is non-negotiable. Each condition is independently verified before PR creation proceeds.
206
+ 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
207
 
115
208
  ## Step 6 Delegation — Prohibited Prompt Language
116
209