@danmoisan/drm-copilot-mcp 1.0.0 → 1.0.7
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.
- package/out/mcp-server.js +814 -194
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/commit-message.md +42 -0
- package/resources/claude-customizations/.claude/agents/epic-orchestrator.md +127 -0
- package/resources/claude-customizations/.claude/agents/human-exception-runbook.md +48 -0
- package/resources/claude-customizations/.claude/agents/orchestrator.md +67 -2
- package/resources/claude-customizations/.claude/agents/pr-author.md +37 -21
- package/resources/claude-customizations/.claude/hooks/check-powershell-test-purity.ps1 +103 -65
- package/resources/claude-customizations/.claude/hooks/check-python-test-purity.ps1 +12 -9
- package/resources/claude-customizations/.claude/hooks/enforce-checkpoint-monotonic.ps1 +24 -16
- package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +19 -13
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +304 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-wave-barrier.ps1 +304 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate.ps1 +237 -0
- package/resources/claude-customizations/.claude/hooks/enforce-evidence-locations.ps1 +16 -12
- package/resources/claude-customizations/.claude/hooks/enforce-feature-folder-order.ps1 +14 -10
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +35 -8
- package/resources/claude-customizations/.claude/hooks/enforce-powershell-batch-budget.ps1 +17 -14
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.epic-base-branch.ps1 +104 -0
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.ps1 +268 -93
- package/resources/claude-customizations/.claude/hooks/enforce-prd-feature-before-planner.ps1 +19 -11
- package/resources/claude-customizations/.claude/hooks/enforce-promotion-mcp-only.ps1 +28 -6
- package/resources/claude-customizations/.claude/hooks/enforce-python-batch-budget.ps1 +17 -14
- package/resources/claude-customizations/.claude/hooks/validate-bash.ps1 +146 -36
- package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +19 -7
- package/resources/claude-customizations/.claude/rules/orchestrator-state.md +36 -0
- package/resources/claude-customizations/.claude/settings.json +34 -1
- package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +252 -0
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +42 -13
- package/resources/claude-customizations/.claude/skills/pr-author/SKILL.md +28 -0
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +22 -18
- package/resources/claude-customizations/pack-manifests/core.json +8 -0
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +6 -3
- package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp/SKILL.md +65 -0
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +79 -0
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +66 -0
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -25
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-pr-author-skill.ps1 +257 -93
- package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +98 -0
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +24 -0
- package/resources/codex-and-agents-customizations/pack-manifests/csharp-legacy.json +11 -0
- package/resources/codex-and-agents-customizations/pack-manifests/csharp-modern.json +10 -0
- package/resources/codex-and-agents-customizations/pack-manifests/powershell.json +15 -0
- package/resources/codex-and-agents-customizations/pack-manifests/python.json +15 -0
- package/resources/codex-and-agents-customizations/pack-manifests/typescript.json +9 -0
- package/resources/config/orchestration-routing.json +92 -0
- package/resources/customizations/.github/agents/pr-author.agent.md +24 -18
- package/resources/icon.png +0 -0
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +11 -0
- package/resources/codex-and-agents-customizations/.github/workflows/_validate-orchestrator-state.yml +0 -68
- package/resources/codex-and-agents-customizations/.github/workflows/validate-orchestrator-state.yml +0 -15
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: csharp
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.cs"
|
|
5
|
+
- "**/*.csproj"
|
|
6
|
+
description: C#-specific toolchain and coding standards.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# C# Code Standards
|
|
10
|
+
|
|
11
|
+
Legacy C# variant resource for Codex push-down.
|
|
12
|
+
|
|
13
|
+
This rule file summarizes the C#-specific policies for this repository.
|
|
14
|
+
|
|
15
|
+
## Toolchain
|
|
16
|
+
|
|
17
|
+
1. **Formatting — CSharpier**: All C# source files must be formatted with CSharpier. Do not use `dotnet format`. Command: `dotnet tool run csharpier .` or `csharpier .`
|
|
18
|
+
2. **Linting — .NET Analyzers**: C# code must pass Roslyn/.NET analyzer diagnostics. Command: `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true`
|
|
19
|
+
3. **Type Checking — Nullable Analysis**: Enable nullable reference types and fail on warnings. Command: `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:Nullable=enable /p:TreatWarningsAsErrors=true`
|
|
20
|
+
4. **Testing — MSTest + Moq + FluentAssertions**: Run tests with: `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage`
|
|
21
|
+
|
|
22
|
+
Run the toolchain in order: format → lint → type-check → test. Restart from step 1 if any step fails or changes files.
|
|
23
|
+
|
|
24
|
+
## Coding Standards
|
|
25
|
+
|
|
26
|
+
- **Naming**: `PascalCase` for types and public members. `camelCase` for locals and private fields/parameters.
|
|
27
|
+
- **Null safety**: Keep nullable reference types enabled. Model optional values with nullable annotations and guard clauses.
|
|
28
|
+
- **Composition over inheritance**: Keep classes cohesive and scoped to one responsibility. Favor composition unless polymorphism is a clear requirement.
|
|
29
|
+
- **Async/await**: Use `async`/`await` for I/O-bound operations. Prefer `using`/`await using` for disposable resources.
|
|
30
|
+
- **Exceptions**: Fail fast with explicit exceptions. Avoid broad `catch (Exception)` unless at a defined boundary with added context.
|
|
31
|
+
- **Public surface**: Keep public API surface intentional and minimal. Prefer `internal` for non-public APIs.
|
|
32
|
+
- **XML docs**: Public APIs should include XML documentation comments when behavior or contract is non-obvious.
|
|
33
|
+
|
|
34
|
+
## Testing Standards
|
|
35
|
+
|
|
36
|
+
- Use **MSTest** (`Microsoft.VisualStudio.TestTools.UnitTesting`) as the test framework.
|
|
37
|
+
- Use **Moq** for mocking.
|
|
38
|
+
- Prefer **FluentAssertions** for assertions; use MSTest `Assert` only when FluentAssertions is not practical.
|
|
39
|
+
- Use `[TestClass]` and `[TestMethod]` attributes.
|
|
40
|
+
- Follow Arrange–Act–Assert structure.
|
|
41
|
+
- No external dependencies in unit tests.
|
|
42
|
+
- Repository-wide line coverage must remain >= 80%.
|
|
43
|
+
- Any new module, class, or method must reach >= 90% coverage.
|
|
44
|
+
- Coverage regression on changed lines is a blocking finding.
|
|
45
|
+
|
|
46
|
+
## Deterministic Test Rules
|
|
47
|
+
|
|
48
|
+
Unit tests must not depend on network, mutable machine PATH or profile state, implicit working-directory assumptions, or external services. Use seam-based mocking for all external boundaries (processes, HTTP, filesystem, clocks). Tests must produce identical results in the IDE test runner and in CLI runs so local and CI behavior agree.
|
|
49
|
+
|
|
50
|
+
## DI Seams
|
|
51
|
+
|
|
52
|
+
Introduce the smallest seam that enables reliable unit testing. Apply in this order of preference:
|
|
53
|
+
|
|
54
|
+
1. **Interface seam (preferred)** — extract boundary calls into narrow purpose-specific interfaces (for example, `IProcessRunner`, `IFileSystem`, `IClock`). Keep interfaces minimal.
|
|
55
|
+
2. **Injectable delegate seam** — use a narrow `Func<>`/`Action<>` delegate for a single call path when a full interface is excessive. Default behavior must remain safe and deterministic.
|
|
56
|
+
3. **Adapter seam for static or third-party APIs** — wrap the static or third-party call behind a small adapter so tests can mock the adapter with Moq.
|
|
57
|
+
|
|
58
|
+
## Prohibited Behaviors
|
|
59
|
+
|
|
60
|
+
- Broad refactors across unrelated projects or files.
|
|
61
|
+
- Introducing heavy generic abstraction frameworks without need.
|
|
62
|
+
- Creating analyzer debt and deferring cleanup.
|
|
63
|
+
- Weakening assertions or relaxing test expectations to make tests pass.
|
|
64
|
+
- Adding sleeps, retries, or timing hacks to mask flaky behavior.
|
|
65
|
+
- Reporting success without running the required toolchain.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# C# QA Gate
|
|
7
|
+
|
|
8
|
+
Legacy C# variant resource for Codex push-down.
|
|
9
|
+
|
|
10
|
+
Canonical procedure for the Phase D final quality gate that every C# change must pass before completion is reported.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
Use this skill when:
|
|
15
|
+
|
|
16
|
+
- `csharp-typed-engineer` is about to declare a change complete.
|
|
17
|
+
- An executor has finished applying a planned batch and must verify zero regressions against the baseline captured in Phase A.
|
|
18
|
+
- A reviewer needs to confirm the toolchain was actually run and produced a clean pass.
|
|
19
|
+
|
|
20
|
+
## Required Inputs
|
|
21
|
+
|
|
22
|
+
Before invoking this gate, the agent must have:
|
|
23
|
+
|
|
24
|
+
- 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,
|
|
25
|
+
- the exact list of touched production and test files,
|
|
26
|
+
- a clean working tree (all planned edits committed to the working copy).
|
|
27
|
+
|
|
28
|
+
## Toolchain Execution Sequence
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
1. `dotnet tool run csharpier .`
|
|
33
|
+
2. `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true`
|
|
34
|
+
3. `msbuild TaskMaster.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:Nullable=enable /p:TreatWarningsAsErrors=true`
|
|
35
|
+
4. `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage`
|
|
36
|
+
|
|
37
|
+
If the environment prevents running any tool, stop and report the change as **unverified**. Do not declare completion.
|
|
38
|
+
|
|
39
|
+
## Delta Requirements (Zero-Regression Hard Gate)
|
|
40
|
+
|
|
41
|
+
Compare the final results to the Phase A baseline. All of the following must hold:
|
|
42
|
+
|
|
43
|
+
- **Analyzer delta**: 0 new findings across the repository.
|
|
44
|
+
- **Compiler / nullable delta**: 0 new diagnostics across the repository.
|
|
45
|
+
- **MSTest delta**: 0 new failing tests.
|
|
46
|
+
- **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.
|
|
47
|
+
- **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.
|
|
48
|
+
- **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
## Required Reporting Block
|
|
53
|
+
|
|
54
|
+
Every completion response must include the following sections:
|
|
55
|
+
|
|
56
|
+
1. **Scope** — exact file list touched in this change.
|
|
57
|
+
2. **Baseline** — analyzer, compiler/nullable, MSTest, and coverage status recorded in Phase A.
|
|
58
|
+
3. **Plan** — design and test-strategy summary, referencing the approved plan.
|
|
59
|
+
4. **Diffs** — patch-style or full-file replacements for scoped files only.
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
## Evidence Storage
|
|
63
|
+
|
|
64
|
+
Persist toolchain output according to `evidence-and-timestamp-conventions`:
|
|
65
|
+
|
|
66
|
+
- store baseline outputs under `<FEATURE>/evidence/baseline/<timestamp>/`,
|
|
67
|
+
- store post-change outputs under `<FEATURE>/evidence/qa-gates/<timestamp>/`,
|
|
68
|
+
- use ISO-8601 UTC timestamps in folder names.
|
|
69
|
+
|
|
70
|
+
This location is canonical per evidence-and-timestamp-conventions and is not overridable.
|
|
71
|
+
See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.
|
|
72
|
+
|
|
73
|
+
The evidence paths must be referenced in the agent's completion message to satisfy the `SubagentStop` completion-artifact gate.
|
|
74
|
+
|
|
75
|
+
## Prohibited Shortcuts
|
|
76
|
+
|
|
77
|
+
- Do not disable, skip, or narrow any step of the toolchain to reach a clean result.
|
|
78
|
+
- Do not add analyzer suppressions, `#pragma warning disable`, `#nullable disable`, or test `[Ignore]` attributes to suppress new findings introduced by the change.
|
|
79
|
+
- Do not report success based on partial or targeted runs alone. Targeted runs are allowed mid-batch, but the final gate requires a full-solution pass.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implement C# Skill
|
|
7
|
+
|
|
8
|
+
Legacy C# variant resource for Codex push-down.
|
|
9
|
+
|
|
10
|
+
This direct-use wrapper delegates C# implementation work to the `csharp-typed-engineer` worker. Use this entry point when a prompt needs a scoped C# change that must stay inside the typed engineer's guardrails.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
Use this skill when:
|
|
15
|
+
|
|
16
|
+
- The user requests a C# code change, bug fix, refactor, or test addition.
|
|
17
|
+
- Estimated scope fits the small path (1-3 production files plus corresponding tests).
|
|
18
|
+
- 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.
|
|
19
|
+
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
- Objective statement (what the change must accomplish).
|
|
25
|
+
- Files or entrypoints in scope.
|
|
26
|
+
- Constraints, including public APIs that must be preserved.
|
|
27
|
+
- Optional approved plan. If none is supplied, the worker delegates plan authoring to `atomic_planner` before any edits.
|
|
28
|
+
- Optional budget override in the form `budget: prod=<N>, test=<M>` subject to repo policy compliance.
|
|
29
|
+
|
|
30
|
+
## Output Paths
|
|
31
|
+
|
|
32
|
+
- C# source and test files within the approved scope.
|
|
33
|
+
- Baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and post-change evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
|
|
34
|
+
- This location is canonical per evidence-and-timestamp-conventions and is not overridable. See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.
|
|
35
|
+
- Plan artifacts under the active feature folder when the task is feature-scoped.
|
|
36
|
+
|
|
37
|
+
## Required Reporting Block
|
|
38
|
+
|
|
39
|
+
The worker must return the following reporting block:
|
|
40
|
+
|
|
41
|
+
1. Scope (exact file list).
|
|
42
|
+
2. Baseline (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, coverage status).
|
|
43
|
+
3. Plan (design and test strategy).
|
|
44
|
+
4. Diffs (patch-style or full-file replacements).
|
|
45
|
+
5. QA Gate Results (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, and coverage deltas, or clearly marked **unverified**).
|
|
46
|
+
|
|
47
|
+
## Worker Routing
|
|
48
|
+
|
|
49
|
+
- Worker: `csharp-typed-engineer`
|
|
50
|
+
|
|
51
|
+
## Preloaded Contracts
|
|
52
|
+
|
|
53
|
+
The worker operates under the following preloaded skills and rules:
|
|
54
|
+
|
|
55
|
+
- `policy-compliance-order`
|
|
56
|
+
- `csharp-change-budget-router`
|
|
57
|
+
- `atomic-plan-contract`
|
|
58
|
+
- `csharp-qa-gate`
|
|
59
|
+
- `acceptance-criteria-tracking`
|
|
60
|
+
- `feature-promotion-lifecycle`
|
|
61
|
+
- `remediation-handoff-atomic-planner`
|
|
62
|
+
- `evidence-and-timestamp-conventions`
|
|
63
|
+
- `.agents/skills/csharp/SKILL.md` (path-scoped for `**/*.cs` and `**/*.csproj`)
|
|
64
|
+
- `AGENTS.md`
|
|
65
|
+
- `AGENTS.md`
|
|
66
|
+
- `AGENTS.md`
|
|
@@ -84,28 +84,4 @@ command = "pwsh -NoProfile -File .codex/hooks/enforce-orchestration-preimplement
|
|
|
84
84
|
|
|
85
85
|
[[hooks.SubagentStop]]
|
|
86
86
|
matcher = "feature-review|feature-reviewer"
|
|
87
|
-
command = "pwsh -NoProfile -File .codex/hooks/validate-feature-review-coverage.ps1"
|
|
88
|
-
|
|
89
|
-
[permissions.orchestrator-workspace]
|
|
90
|
-
description = "Workspace editing for deterministic orchestration with secret-path deny rules."
|
|
91
|
-
extends = ":workspace"
|
|
92
|
-
|
|
93
|
-
[permissions.orchestrator-workspace.filesystem]
|
|
94
|
-
glob_scan_max_depth = 4
|
|
95
|
-
|
|
96
|
-
[permissions.orchestrator-workspace.filesystem.":workspace_roots"]
|
|
97
|
-
"**/.env" = "deny"
|
|
98
|
-
"**/.env.*" = "deny"
|
|
99
|
-
"secrets" = "deny"
|
|
100
|
-
"secrets/**" = "deny"
|
|
101
|
-
|
|
102
|
-
[permissions.orchestrator-workspace.network]
|
|
103
|
-
enabled = true
|
|
104
|
-
|
|
105
|
-
[permissions.orchestrator-workspace.network.domains]
|
|
106
|
-
"github.com" = "allow"
|
|
107
|
-
"api.github.com" = "allow"
|
|
108
|
-
"objects.githubusercontent.com" = "allow"
|
|
109
|
-
"registry.npmjs.org" = "allow"
|
|
110
|
-
"pypi.org" = "allow"
|
|
111
|
-
"files.pythonhosted.org" = "allow"
|
|
87
|
+
command = "pwsh -NoProfile -File .codex/hooks/validate-feature-review-coverage.ps1"
|