@danmoisan/drm-copilot-mcp 1.0.11 → 1.0.14

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 (21) hide show
  1. package/out/mcp-server.js +585 -123
  2. package/package.json +1 -1
  3. package/resources/claude-customizations/.claude/agents/epic-orchestrator.md +28 -3
  4. package/resources/claude-customizations/.claude/agents/epic-planner.md +121 -0
  5. package/resources/claude-customizations/.claude/agents/orchestrator.md +2 -2
  6. package/resources/claude-customizations/.claude/hooks/enforce-epic-invocation-origin.ps1 +246 -0
  7. package/resources/claude-customizations/.claude/hooks/persist-session-id.ps1 +153 -0
  8. package/resources/claude-customizations/.claude/settings.json +22 -2
  9. package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +58 -24
  10. package/resources/claude-customizations/.claude/skills/epic-plan/SKILL.md +189 -0
  11. package/resources/claude-customizations/.claude/skills/epic-run/SKILL.md +38 -0
  12. package/resources/claude-customizations/.claude/skills/identify-session-id/SKILL.md +44 -0
  13. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +21 -2
  14. package/resources/claude-customizations/.claude/skills/show-my-agent-tree/SKILL.md +39 -0
  15. package/resources/claude-customizations/pack-manifests/core.json +7 -0
  16. package/resources/config/orchestration-routing.json +21 -0
  17. package/resources/feature-templates/epic/epic-status.md +20 -0
  18. package/resources/feature-templates/epic/epic.md +79 -0
  19. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +4 -0
  20. package/resources/templates/new-claude-worktree-session.ps1 +58 -9
  21. package/resources/feature-templates/epic/initiative.md +0 -43
@@ -0,0 +1,79 @@
1
+ ---
2
+ # Epic manifest (source of truth).
3
+ #
4
+ # This YAML frontmatter is the machine-readable manifest for the epic: the
5
+ # dependency DAG (parsed deterministically by the epic-orchestrator agent) and an
6
+ # optional SAFe-style intent block. The Markdown body below the frontmatter is the
7
+ # single human-authored narrative and is not machine-parsed.
8
+ #
9
+ # The DAG is keyed by stable `issue_num`. `feature_folder` is a resolvable hint
10
+ # that may point into docs/features/active/<folder> OR docs/features/completed/<folder>;
11
+ # it is not a stable identifier and changes when a child is promoted.
12
+ epic: <epic-slug>
13
+ integration_branch: epic/<epic-slug>-integration
14
+ created_at: <iso8601>
15
+
16
+ # Optional additive SAFe-style intent block. Omit the whole `intent` block when
17
+ # not used; when present, `epic_type` and `business_outcome_hypothesis` are
18
+ # required, and `leading_indicators` / `nfrs` are optional lists of strings.
19
+ intent:
20
+ epic_type: <business | enabler>
21
+ business_outcome_hypothesis: <the measurable outcome this epic is expected to move>
22
+ leading_indicators:
23
+ - <early signal that the hypothesis is being validated>
24
+ nfrs:
25
+ - <non-functional requirement the epic must satisfy>
26
+
27
+ # Manifest DAG. Primary key is `issue_num`. `depends_on` lists the `issue_num`
28
+ # values of upstream siblings (each must be another entry in `features[]`).
29
+ features:
30
+ - issue_num: <int>
31
+ feature_folder: <resolvable-hint-basename>
32
+ depends_on: []
33
+ - issue_num: <int>
34
+ feature_folder: <resolvable-hint-basename>
35
+ depends_on: [<upstream-issue_num>]
36
+ ---
37
+
38
+ # <epic-name> - Epic
39
+
40
+ - Issue: #<tracking-issue>
41
+ - Owner: <name>
42
+ - Last Updated: YYYY-MM-DD
43
+
44
+ ## Goal
45
+
46
+ State the epic objective and the measurable outcomes. Keep it user/impact
47
+ oriented, not implementation detail. This is the source from which the epic
48
+ GitHub issue body is generated.
49
+
50
+ ## Scope
51
+
52
+ Enumerate what is in scope for this epic. Reference the child features by their
53
+ `issue_num` so the narrative and the manifest DAG stay aligned.
54
+
55
+ ## Non-Goals
56
+
57
+ List what is explicitly out of scope so child features and reviewers do not
58
+ scope-creep into adjacent work.
59
+
60
+ ## Shared Design
61
+
62
+ Capture the cross-cutting design decisions every child feature must honor:
63
+
64
+ - Shared behaviors/algorithms that must stay aligned across children.
65
+ - Determinism/performance/compatibility guarantees.
66
+ - Data/artifact locations, formats, or tooling expectations.
67
+ - Quality gates (tests/lint/type-checks) required across all children.
68
+
69
+ ## Decomposition
70
+
71
+ Describe the child features and their ordering. Each child keeps its own git
72
+ branch/worktree and its own independent active/ -> completed/ lifecycle; this
73
+ section is the human-readable projection of the `features[]` DAG above.
74
+
75
+ - <Child feature A> (Issue #<id>) - wave 0
76
+ - <Child feature B> (Issue #<id>) - depends on #<id>
77
+
78
+ `epic-status.md` in this same directory is a generated projection of the epic
79
+ checkpoint; it is never the source of the DAG and is never hand-authored.
@@ -44,6 +44,10 @@
44
44
  '.claude/hooks/enforce-pr-author-skill.ps1'
45
45
  '.claude/hooks/validate-orchestrator-output.ps1'
46
46
  '.claude/hooks/enforce-pr-author-skill.epic-base-branch.ps1'
47
+ # Issue #334 added this SessionStart hook that persists the current session id;
48
+ # measured here so the new production hook is not excluded from coverage. The
49
+ # test suite dot-sources the file (guarded body) so line attribution is valid.
50
+ '.claude/hooks/persist-session-id.ps1'
47
51
  )
48
52
  ExcludedPath = @(
49
53
  '.claude/hooks/validate-feature-review-coverage.ps1' # Feature-review wrapper around repository evidence; not deterministic in normal unit-test execution.
@@ -3,20 +3,25 @@
3
3
  Creates a git worktree and launches a Claude CLI session inside it as a background process.
4
4
 
5
5
  .DESCRIPTION
6
- Creates a new git worktree at a timestamped path derived from the destination
7
- repository's basename, branches it off the current HEAD, and starts the Claude CLI
8
- non-blocking via Start-Process.
6
+ Creates a new git worktree under a per-repository grouping directory and branches it
7
+ off the current HEAD, then starts the Claude CLI non-blocking via Start-Process.
8
+ The worktree is created at the nested path
9
+ <WorktreeParentPath>/<repoName>-wt/<yyyy-MM-ddTHH-mm>, where <repoName>-wt is a single
10
+ grouping directory that holds every timestamped worktree for the repository. The
11
+ grouping directory is created (idempotently) before 'git worktree add' runs.
9
12
  Writes WorktreePath, ProcessId, and LogFile to stdout before returning to the caller.
10
13
 
11
14
  .PARAMETER Objective
12
15
  Prompt text passed to the Claude CLI as its primary argument.
13
16
 
14
17
  .PARAMETER WorktreeParentPath
15
- Parent directory for the new worktree. Defaults to the parent of the repo root.
18
+ Parent directory for the new worktree. Defaults to the parent of the repo root. The
19
+ grouping directory <repoName>-wt is created beneath this path.
16
20
 
17
21
  .PARAMETER BranchName
18
- Explicit branch name for the new worktree. When omitted, defaults to
19
- <repoName>-wt-<timestamp>.
22
+ Explicit branch name for the new worktree. When omitted, defaults to the flat name
23
+ <repoName>-wt-<yyyy-MM-ddTHH-mm>. The branch name is never nested with a slash even
24
+ though the on-disk worktree path is nested.
20
25
  #>
21
26
  [CmdletBinding(SupportsShouldProcess)]
22
27
  param(
@@ -37,7 +42,21 @@ function Get-WorktreeTimestamp {
37
42
  )
38
43
 
39
44
  $now = & $GetDateTime
40
- return $now.ToString('yyyy-MM-dd-HH-mm')
45
+ return $now.ToString('yyyy-MM-ddTHH-mm')
46
+ }
47
+
48
+ function Get-WorktreeGroupDirectory {
49
+ [CmdletBinding()]
50
+ [OutputType([string])]
51
+ param(
52
+ [Parameter(Mandatory = $true)]
53
+ [string] $WorktreeParentPath,
54
+
55
+ [Parameter(Mandatory = $true)]
56
+ [string] $RepoName
57
+ )
58
+
59
+ return "$WorktreeParentPath/$RepoName-wt"
41
60
  }
42
61
 
43
62
  function Build-WorktreePath {
@@ -54,7 +73,8 @@ function Build-WorktreePath {
54
73
  [string] $RepoName
55
74
  )
56
75
 
57
- return "$WorktreeParentPath/$RepoName-wt-$Timestamp"
76
+ $groupDirectory = Get-WorktreeGroupDirectory -WorktreeParentPath $WorktreeParentPath -RepoName $RepoName
77
+ return "$groupDirectory/$Timestamp"
58
78
  }
59
79
 
60
80
  function Build-BranchName {
@@ -77,6 +97,23 @@ function Build-BranchName {
77
97
  return "$RepoName-wt-$Timestamp"
78
98
  }
79
99
 
100
+ function New-WorktreeParentDirectory {
101
+ [CmdletBinding(SupportsShouldProcess = $true)]
102
+ param(
103
+ [Parameter(Mandatory = $true)]
104
+ [string] $GroupDirectory,
105
+
106
+ [scriptblock] $NewDirectory = { param([string] $Path) New-Item -ItemType Directory -Force -Path $Path | Out-Null }
107
+ )
108
+
109
+ # -Force makes creation idempotent (a no-op when the directory already exists) and
110
+ # creates any missing leading directories. The filesystem action is isolated behind
111
+ # the injectable $NewDirectory seam so it can be mocked without touching disk.
112
+ if ($PSCmdlet.ShouldProcess($GroupDirectory, 'Create worktree grouping directory')) {
113
+ & $NewDirectory $GroupDirectory
114
+ }
115
+ }
116
+
80
117
  function Test-PreconditionsMet {
81
118
  [CmdletBinding()]
82
119
  param(
@@ -192,6 +229,14 @@ function Write-LaunchResult {
192
229
  Write-Output "StderrLog: $StderrLog"
193
230
  }
194
231
 
232
+ # When dot-sourced (for example by the Pester test suite, to resolve the functions
233
+ # above for coverage attribution), define the functions but do not execute the
234
+ # top-level script body. Direct invocation leaves $MyInvocation.InvocationName as the
235
+ # script name (not '.'), so the body runs unchanged and production behavior is preserved.
236
+ if ($MyInvocation.InvocationName -eq '.') {
237
+ return
238
+ }
239
+
195
240
  # ---------------------------------------------------------------------------
196
241
  # Script body
197
242
  # ---------------------------------------------------------------------------
@@ -215,6 +260,11 @@ catch {
215
260
  exit 1
216
261
  }
217
262
 
263
+ # Ensure the <repoName>-wt grouping directory exists before 'git worktree add' runs.
264
+ # Creation is idempotent, so re-running for an existing group directory is a no-op.
265
+ $groupDirectory = Get-WorktreeGroupDirectory -WorktreeParentPath $WorktreeParentPath -RepoName $repoName
266
+ New-WorktreeParentDirectory -GroupDirectory $groupDirectory
267
+
218
268
  if ($PSCmdlet.ShouldProcess($worktreePath, 'git worktree add')) {
219
269
  Invoke-GitWorktreeAdd -WorktreePath $worktreePath -BranchName $resolvedBranch
220
270
  }
@@ -229,4 +279,3 @@ $stdoutLog = "$worktreePath/claude-session.stdout.log"
229
279
  $stderrLog = "$worktreePath/claude-session.stderr.log"
230
280
 
231
281
  Write-LaunchResult -WorktreePath $worktreePath -ProcessId $processId -StdoutLog $stdoutLog -StderrLog $stderrLog
232
-
@@ -1,43 +0,0 @@
1
- # <epic-name> - Initiative Overview
2
-
3
- - Issue: #<tracking-issue>
4
- - Owner: <name>
5
- - Last Updated: YYYY-MM-DD
6
-
7
- ## Goal & Outcomes
8
-
9
- State the objective and the measurable outcomes for this initiative. Keep it user/impact oriented, not implementation detail.
10
-
11
- ## Decomposition (Child Features/Workstreams)
12
-
13
- - <Workstream A> (Issue #<id>) - `../<child-folder>/`
14
- - <Workstream B> (Issue #<id>) - `../<child-folder>/`
15
- - <Workstream C> (Issue #<id>) - `../<child-folder>/`
16
-
17
- Dependencies: Describe ordering or coupling between child items (e.g., A → B → C).
18
-
19
- ## Cross-Cutting Constraints & Assumptions
20
-
21
- - Shared behaviors/algorithms that must stay aligned
22
- - Determinism/performance/compatibility guarantees
23
- - Data/artifact locations, formats, or tooling expectations
24
- - Compliance/legal/licensing boundaries
25
- - Quality gates (tests/lint/type-checks) required across all children
26
-
27
- ## Milestones & Status
28
-
29
- - M1 <Name> - <Not started | In progress | Done> (criteria)
30
- - M2 <Name> - <Not started | In progress | Done>
31
- - M3 <Name> - <Not started | In progress | Done>
32
- - CLI/UX alignment or other cross-initiative milestones
33
-
34
- ## Initiative-Level Validation
35
-
36
- - End-to-end: <Describe end-to-end validation that proves the initiative outcome>
37
- - Integration: <Cross-layer checks to ensure child workstreams fit together>
38
- - Determinism/Regression: <What needs to remain stable; how to detect drift>
39
- - Error handling/Resilience: <Key failure modes and expected handling>
40
-
41
- ## Notes / Follow-Ups
42
-
43
- Capture decisions, risks, and future adjustments to decomposition/milestones.