specweave 1.0.235 → 1.0.239

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 (196) hide show
  1. package/README.md +89 -193
  2. package/dist/plugins/specweave-github/lib/github-ac-comment-poster.d.ts +37 -0
  3. package/dist/plugins/specweave-github/lib/github-ac-comment-poster.d.ts.map +1 -0
  4. package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js +176 -0
  5. package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js.map +1 -0
  6. package/dist/plugins/specweave-github/lib/github-batch-sync.d.ts +36 -0
  7. package/dist/plugins/specweave-github/lib/github-batch-sync.d.ts.map +1 -0
  8. package/dist/plugins/specweave-github/lib/github-batch-sync.js +115 -0
  9. package/dist/plugins/specweave-github/lib/github-batch-sync.js.map +1 -0
  10. package/dist/plugins/specweave-github/lib/github-board-resolver-v2.d.ts +37 -0
  11. package/dist/plugins/specweave-github/lib/github-board-resolver-v2.d.ts.map +1 -0
  12. package/dist/plugins/specweave-github/lib/github-board-resolver-v2.js +56 -0
  13. package/dist/plugins/specweave-github/lib/github-board-resolver-v2.js.map +1 -0
  14. package/dist/plugins/specweave-github/lib/github-conflict-resolver.d.ts +68 -0
  15. package/dist/plugins/specweave-github/lib/github-conflict-resolver.d.ts.map +1 -0
  16. package/dist/plugins/specweave-github/lib/github-conflict-resolver.js +102 -0
  17. package/dist/plugins/specweave-github/lib/github-conflict-resolver.js.map +1 -0
  18. package/dist/plugins/specweave-github/lib/github-cross-repo-sync.d.ts +64 -0
  19. package/dist/plugins/specweave-github/lib/github-cross-repo-sync.d.ts.map +1 -0
  20. package/dist/plugins/specweave-github/lib/github-cross-repo-sync.js +162 -0
  21. package/dist/plugins/specweave-github/lib/github-cross-repo-sync.js.map +1 -0
  22. package/dist/plugins/specweave-github/lib/github-field-sync.d.ts +50 -0
  23. package/dist/plugins/specweave-github/lib/github-field-sync.d.ts.map +1 -0
  24. package/dist/plugins/specweave-github/lib/github-field-sync.js +107 -0
  25. package/dist/plugins/specweave-github/lib/github-field-sync.js.map +1 -0
  26. package/dist/plugins/specweave-github/lib/github-graphql-client.d.ts +53 -0
  27. package/dist/plugins/specweave-github/lib/github-graphql-client.d.ts.map +1 -0
  28. package/dist/plugins/specweave-github/lib/github-graphql-client.js +138 -0
  29. package/dist/plugins/specweave-github/lib/github-graphql-client.js.map +1 -0
  30. package/dist/plugins/specweave-github/lib/github-issue-body-generator.d.ts +40 -0
  31. package/dist/plugins/specweave-github/lib/github-issue-body-generator.d.ts.map +1 -0
  32. package/dist/plugins/specweave-github/lib/github-issue-body-generator.js +50 -0
  33. package/dist/plugins/specweave-github/lib/github-issue-body-generator.js.map +1 -0
  34. package/dist/plugins/specweave-github/lib/github-issue-body-parser.d.ts +30 -0
  35. package/dist/plugins/specweave-github/lib/github-issue-body-parser.d.ts.map +1 -0
  36. package/dist/plugins/specweave-github/lib/github-issue-body-parser.js +75 -0
  37. package/dist/plugins/specweave-github/lib/github-issue-body-parser.js.map +1 -0
  38. package/dist/plugins/specweave-github/lib/github-pull-sync.d.ts +94 -0
  39. package/dist/plugins/specweave-github/lib/github-pull-sync.d.ts.map +1 -0
  40. package/dist/plugins/specweave-github/lib/github-pull-sync.js +232 -0
  41. package/dist/plugins/specweave-github/lib/github-pull-sync.js.map +1 -0
  42. package/dist/plugins/specweave-github/lib/github-push-sync.d.ts +50 -0
  43. package/dist/plugins/specweave-github/lib/github-push-sync.d.ts.map +1 -0
  44. package/dist/plugins/specweave-github/lib/github-push-sync.js +114 -0
  45. package/dist/plugins/specweave-github/lib/github-push-sync.js.map +1 -0
  46. package/dist/plugins/specweave-github/lib/github-rate-limiter.d.ts +53 -0
  47. package/dist/plugins/specweave-github/lib/github-rate-limiter.d.ts.map +1 -0
  48. package/dist/plugins/specweave-github/lib/github-rate-limiter.js +109 -0
  49. package/dist/plugins/specweave-github/lib/github-rate-limiter.js.map +1 -0
  50. package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.d.ts +21 -0
  51. package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.d.ts.map +1 -0
  52. package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.js +161 -0
  53. package/dist/plugins/specweave-github/lib/github-spec-frontmatter-updater.js.map +1 -0
  54. package/dist/plugins/specweave-github/lib/github-sync-orchestrator.d.ts +46 -0
  55. package/dist/plugins/specweave-github/lib/github-sync-orchestrator.d.ts.map +1 -0
  56. package/dist/plugins/specweave-github/lib/github-sync-orchestrator.js +99 -0
  57. package/dist/plugins/specweave-github/lib/github-sync-orchestrator.js.map +1 -0
  58. package/dist/plugins/specweave-github/lib/github-us-auto-closer.d.ts +43 -0
  59. package/dist/plugins/specweave-github/lib/github-us-auto-closer.d.ts.map +1 -0
  60. package/dist/plugins/specweave-github/lib/github-us-auto-closer.js +153 -0
  61. package/dist/plugins/specweave-github/lib/github-us-auto-closer.js.map +1 -0
  62. package/dist/plugins/specweave-github/lib/index.d.ts +1 -4
  63. package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -1
  64. package/dist/plugins/specweave-github/lib/index.js +1 -4
  65. package/dist/plugins/specweave-github/lib/index.js.map +1 -1
  66. package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts +7 -0
  67. package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts.map +1 -0
  68. package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.js +15 -0
  69. package/dist/plugins/specweave-testing/lib/playwright-ci-defaults.js.map +1 -0
  70. package/dist/plugins/specweave-testing/lib/playwright-cli-detector.d.ts +10 -0
  71. package/dist/plugins/specweave-testing/lib/playwright-cli-detector.d.ts.map +1 -0
  72. package/dist/plugins/specweave-testing/lib/playwright-cli-detector.js +36 -0
  73. package/dist/plugins/specweave-testing/lib/playwright-cli-detector.js.map +1 -0
  74. package/dist/plugins/specweave-testing/lib/playwright-cli-runner.d.ts +25 -0
  75. package/dist/plugins/specweave-testing/lib/playwright-cli-runner.d.ts.map +1 -0
  76. package/dist/plugins/specweave-testing/lib/playwright-cli-runner.js +57 -0
  77. package/dist/plugins/specweave-testing/lib/playwright-cli-runner.js.map +1 -0
  78. package/dist/plugins/specweave-testing/lib/playwright-routing.d.ts +7 -0
  79. package/dist/plugins/specweave-testing/lib/playwright-routing.d.ts.map +1 -0
  80. package/dist/plugins/specweave-testing/lib/playwright-routing.js +17 -0
  81. package/dist/plugins/specweave-testing/lib/playwright-routing.js.map +1 -0
  82. package/dist/src/cli/commands/auto.d.ts.map +1 -1
  83. package/dist/src/cli/commands/auto.js +1 -2
  84. package/dist/src/cli/commands/auto.js.map +1 -1
  85. package/dist/src/cli/commands/cancel-auto.js +1 -2
  86. package/dist/src/cli/commands/cancel-auto.js.map +1 -1
  87. package/dist/src/cli/commands/living-docs.js +2 -2
  88. package/dist/src/cli/commands/living-docs.js.map +1 -1
  89. package/dist/src/cli/commands/update.d.ts.map +1 -1
  90. package/dist/src/cli/commands/update.js +1 -2
  91. package/dist/src/cli/commands/update.js.map +1 -1
  92. package/dist/src/core/config/types.d.ts +8 -0
  93. package/dist/src/core/config/types.d.ts.map +1 -1
  94. package/dist/src/core/config/types.js +3 -0
  95. package/dist/src/core/config/types.js.map +1 -1
  96. package/dist/src/core/types/sync-profile.d.ts +72 -0
  97. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  98. package/dist/src/core/types/sync-profile.js +6 -0
  99. package/dist/src/core/types/sync-profile.js.map +1 -1
  100. package/package.json +2 -2
  101. package/plugins/specweave/hooks/hooks.json +2 -2
  102. package/plugins/specweave/hooks/startup-health-check.sh +1 -1
  103. package/plugins/specweave/hooks/stop-auto-v5.sh +166 -0
  104. package/plugins/specweave/hooks/user-prompt-submit.sh +10 -0
  105. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +21 -1
  106. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +1 -1
  107. package/plugins/specweave/skills/auto/SKILL.md +71 -251
  108. package/plugins/specweave/skills/team-build/SKILL.md +370 -0
  109. package/plugins/specweave/skills/team-merge/SKILL.md +123 -0
  110. package/plugins/specweave/skills/team-orchestrate/SKILL.md +800 -0
  111. package/plugins/specweave/skills/team-status/SKILL.md +89 -0
  112. package/plugins/specweave-github/MULTI-PROJECT-SYNC-ARCHITECTURE.md +94 -8
  113. package/plugins/specweave-github/commands/sync.md +17 -3
  114. package/plugins/specweave-github/hooks/github-ac-sync-handler.sh +255 -0
  115. package/plugins/specweave-github/hooks/github-auto-create-handler.sh +455 -0
  116. package/plugins/specweave-github/lib/github-ac-comment-poster.js +150 -0
  117. package/plugins/specweave-github/lib/github-ac-comment-poster.ts +245 -0
  118. package/plugins/specweave-github/lib/github-batch-sync.js +93 -0
  119. package/plugins/specweave-github/lib/github-batch-sync.ts +152 -0
  120. package/plugins/specweave-github/lib/github-board-resolver-v2.js +47 -0
  121. package/plugins/specweave-github/lib/github-board-resolver-v2.ts +73 -0
  122. package/plugins/specweave-github/lib/github-conflict-resolver.js +90 -0
  123. package/plugins/specweave-github/lib/github-conflict-resolver.ts +154 -0
  124. package/plugins/specweave-github/lib/github-cross-repo-sync.js +168 -0
  125. package/plugins/specweave-github/lib/github-cross-repo-sync.ts +252 -0
  126. package/plugins/specweave-github/lib/github-field-sync.js +116 -0
  127. package/plugins/specweave-github/lib/github-field-sync.ts +165 -0
  128. package/plugins/specweave-github/lib/github-graphql-client.js +129 -0
  129. package/plugins/specweave-github/lib/github-graphql-client.ts +181 -0
  130. package/plugins/specweave-github/lib/github-issue-body-generator.js +30 -0
  131. package/plugins/specweave-github/lib/github-issue-body-generator.ts +76 -0
  132. package/plugins/specweave-github/lib/github-issue-body-parser.js +55 -0
  133. package/plugins/specweave-github/lib/github-issue-body-parser.ts +92 -0
  134. package/plugins/specweave-github/lib/github-pull-sync.js +185 -0
  135. package/plugins/specweave-github/lib/github-pull-sync.ts +343 -0
  136. package/plugins/specweave-github/lib/github-push-sync.js +119 -0
  137. package/plugins/specweave-github/lib/github-push-sync.ts +174 -0
  138. package/plugins/specweave-github/lib/github-rate-limiter.js +96 -0
  139. package/plugins/specweave-github/lib/github-rate-limiter.ts +143 -0
  140. package/plugins/specweave-github/lib/github-spec-frontmatter-updater.js +117 -0
  141. package/plugins/specweave-github/lib/github-spec-frontmatter-updater.ts +180 -0
  142. package/plugins/specweave-github/lib/github-sync-orchestrator.js +84 -0
  143. package/plugins/specweave-github/lib/github-sync-orchestrator.ts +156 -0
  144. package/plugins/specweave-github/lib/github-us-auto-closer.js +134 -0
  145. package/plugins/specweave-github/lib/github-us-auto-closer.ts +226 -0
  146. package/plugins/specweave-github/lib/index.js +1 -7
  147. package/plugins/specweave-github/lib/index.ts +1 -4
  148. package/plugins/specweave-github/skills/github-sync/SKILL.md +76 -4
  149. package/plugins/specweave-testing/commands/e2e-setup.md +18 -0
  150. package/plugins/specweave-testing/commands/ui-automate.md +2 -0
  151. package/plugins/specweave-testing/commands/ui-inspect.md +8 -0
  152. package/plugins/specweave-testing/lib/playwright-ci-defaults.d.ts +6 -0
  153. package/plugins/specweave-testing/lib/playwright-ci-defaults.js +14 -0
  154. package/plugins/specweave-testing/lib/playwright-ci-defaults.ts +24 -0
  155. package/plugins/specweave-testing/lib/playwright-cli-detector.js +33 -0
  156. package/plugins/specweave-testing/lib/playwright-cli-detector.ts +48 -0
  157. package/plugins/specweave-testing/lib/playwright-cli-runner.js +58 -0
  158. package/plugins/specweave-testing/lib/playwright-cli-runner.ts +80 -0
  159. package/plugins/specweave-testing/lib/playwright-routing.js +16 -0
  160. package/plugins/specweave-testing/lib/playwright-routing.ts +38 -0
  161. package/plugins/specweave-testing/skills/e2e-testing/SKILL.md +38 -0
  162. package/src/templates/CLAUDE.md.template +7 -0
  163. package/src/templates/config.json.template +9 -1
  164. package/dist/plugins/specweave-github/lib/subtask-sync.d.ts +0 -51
  165. package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +0 -1
  166. package/dist/plugins/specweave-github/lib/subtask-sync.js +0 -147
  167. package/dist/plugins/specweave-github/lib/subtask-sync.js.map +0 -1
  168. package/dist/plugins/specweave-github/lib/task-parser.d.ts +0 -37
  169. package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +0 -1
  170. package/dist/plugins/specweave-github/lib/task-parser.js +0 -211
  171. package/dist/plugins/specweave-github/lib/task-parser.js.map +0 -1
  172. package/dist/plugins/specweave-github/lib/task-sync.d.ts +0 -56
  173. package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +0 -1
  174. package/dist/plugins/specweave-github/lib/task-sync.js +0 -375
  175. package/dist/plugins/specweave-github/lib/task-sync.js.map +0 -1
  176. package/plugins/specweave/hooks/validate-completion-conditions.sh +0 -474
  177. package/plugins/specweave-github/lib/subtask-sync.d.ts +0 -51
  178. package/plugins/specweave-github/lib/subtask-sync.d.ts.map +0 -1
  179. package/plugins/specweave-github/lib/subtask-sync.js +0 -154
  180. package/plugins/specweave-github/lib/subtask-sync.js.map +0 -1
  181. package/plugins/specweave-github/lib/subtask-sync.ts +0 -225
  182. package/plugins/specweave-github/lib/task-parser.d.js +0 -0
  183. package/plugins/specweave-github/lib/task-parser.d.ts +0 -37
  184. package/plugins/specweave-github/lib/task-parser.d.ts.map +0 -1
  185. package/plugins/specweave-github/lib/task-parser.js +0 -195
  186. package/plugins/specweave-github/lib/task-parser.js.map +0 -1
  187. package/plugins/specweave-github/lib/task-parser.ts +0 -246
  188. package/plugins/specweave-github/lib/task-sync.d.js +0 -0
  189. package/plugins/specweave-github/lib/task-sync.d.ts +0 -51
  190. package/plugins/specweave-github/lib/task-sync.d.ts.map +0 -1
  191. package/plugins/specweave-github/lib/task-sync.js +0 -415
  192. package/plugins/specweave-github/lib/task-sync.js.map +0 -1
  193. package/plugins/specweave-github/lib/task-sync.ts +0 -451
  194. package/plugins/specweave-github/skills/github-issue-tracker/SKILL.md +0 -496
  195. /package/plugins/specweave/hooks/{stop-auto.sh → _archive/stop-auto-v4-legacy.sh} +0 -0
  196. /package/plugins/{specweave-github/lib/subtask-sync.d.js → specweave-testing/lib/playwright-ci-defaults.d.js} +0 -0
@@ -1,246 +0,0 @@
1
- /**
2
- * Parser for tasks.md files
3
- * Extracts task information for GitHub sync
4
- */
5
-
6
- import * as fs from 'fs';
7
- import * as path from 'path';
8
- import { Task, Subtask } from './types';
9
-
10
- export class TaskParser {
11
- /**
12
- * Parse tasks.md file and extract all tasks
13
- */
14
- static parseTasksFile(incrementPath: string): Task[] {
15
- const tasksPath = path.join(incrementPath, 'tasks.md');
16
-
17
- if (!fs.existsSync(tasksPath)) {
18
- throw new Error(`tasks.md not found at ${tasksPath}`);
19
- }
20
-
21
- const content = fs.readFileSync(tasksPath, 'utf-8');
22
- return this.parseTasks(content);
23
- }
24
-
25
- /**
26
- * Parse task content into structured Task objects
27
- */
28
- static parseTasks(content: string): Task[] {
29
- const tasks: Task[] = [];
30
-
31
- // Split by task headers (### T-XXX:)
32
- const taskPattern = /###\s+(T-\d+(?:-[A-Z])?):\s+(.+?)$/gm;
33
- const matches = [...content.matchAll(taskPattern)];
34
-
35
- for (let i = 0; i < matches.length; i++) {
36
- const match = matches[i];
37
- const taskId = match[1];
38
- const taskTitle = match[2].trim();
39
- const startIndex = match.index!;
40
- const endIndex = i < matches.length - 1 ? matches[i + 1].index! : content.length;
41
- const taskContent = content.substring(startIndex, endIndex);
42
-
43
- const task = this.parseTask(taskId, taskTitle, taskContent);
44
- if (task) {
45
- tasks.push(task);
46
- }
47
- }
48
-
49
- return tasks;
50
- }
51
-
52
- /**
53
- * Parse individual task section
54
- */
55
- private static parseTask(taskId: string, taskTitle: string, content: string): Task | null {
56
- try {
57
- const task: Task = {
58
- id: taskId,
59
- title: taskTitle,
60
- priority: this.extractPriority(content),
61
- estimate: this.extractEstimate(content),
62
- status: this.extractStatus(content),
63
- description: this.extractDescription(content),
64
- };
65
-
66
- // Optional fields
67
- task.githubIssue = this.extractGitHubIssue(content);
68
- task.assignee = this.extractAssignee(content);
69
- task.subtasks = this.extractSubtasks(content);
70
- task.filesToCreate = this.extractFiles(content, 'Files to Create');
71
- task.filesToModify = this.extractFiles(content, 'Files to Modify');
72
- task.implementation = this.extractImplementation(content);
73
- task.acceptanceCriteria = this.extractAcceptanceCriteria(content);
74
- task.dependencies = this.extractDependencies(content);
75
- task.blocks = this.extractBlocks(content);
76
- task.phase = this.extractPhase(content);
77
-
78
- return task;
79
- } catch (error) {
80
- console.error(`Error parsing task ${taskId}:`, error);
81
- return null;
82
- }
83
- }
84
-
85
- private static extractPriority(content: string): 'P0' | 'P1' | 'P2' | 'P3' {
86
- const match = content.match(/\*\*Priority\*\*:\s+(P[0-3])/);
87
- return (match?.[1] as 'P0' | 'P1' | 'P2' | 'P3') || 'P1';
88
- }
89
-
90
- private static extractEstimate(content: string): string {
91
- const match = content.match(/\*\*Estimate\*\*:\s+(.+?)$/m);
92
- return match?.[1]?.trim() || 'Unknown';
93
- }
94
-
95
- private static extractStatus(content: string): 'pending' | 'in_progress' | 'completed' | 'blocked' {
96
- const match = content.match(/\*\*Status\*\*:\s+(\w+)/);
97
- const status = match?.[1];
98
- if (status === 'pending' || status === 'in_progress' || status === 'completed' || status === 'blocked') {
99
- return status;
100
- }
101
- return 'pending';
102
- }
103
-
104
- private static extractDescription(content: string): string {
105
- const match = content.match(/\*\*Description\*\*:\s*\n(.+?)(?=\n\*\*|$)/s);
106
- return match?.[1]?.trim() || '';
107
- }
108
-
109
- private static extractGitHubIssue(content: string): number | undefined {
110
- const match = content.match(/\*\*GitHub Issue\*\*:\s+#(\d+)/);
111
- return match ? parseInt(match[1], 10) : undefined;
112
- }
113
-
114
- private static extractAssignee(content: string): string | undefined {
115
- const match = content.match(/\*\*Assignee\*\*:\s+@?(\w+)/);
116
- return match?.[1];
117
- }
118
-
119
- private static extractSubtasks(content: string): Subtask[] | undefined {
120
- const subtaskSection = content.match(/\*\*Subtasks\*\*:?\s*\n((?:- \[.\] .+\n?)+)/);
121
- if (!subtaskSection) return undefined;
122
-
123
- const subtaskLines = subtaskSection[1].match(/- \[(x| )\] (.+?)(?:\((.+?)\))?$/gm);
124
- if (!subtaskLines) return undefined;
125
-
126
- return subtaskLines.map(line => {
127
- const match = line.match(/- \[(x| )\] (.+?)(?:\((.+?)\))?$/);
128
- if (!match) return null;
129
-
130
- const completed = match[1] === 'x';
131
- const description = match[2].trim();
132
- const estimate = match[3]?.trim() || 'Unknown';
133
-
134
- // Extract subtask ID if present (S-XXX-XX format)
135
- const idMatch = description.match(/^(S-\d+-\d+):\s*(.+)/);
136
- const id = idMatch ? idMatch[1] : `S-${Date.now()}`; // Fallback ID
137
- const cleanDescription = idMatch ? idMatch[2] : description;
138
-
139
- return {
140
- id,
141
- description: cleanDescription,
142
- estimate,
143
- completed
144
- };
145
- }).filter((st): st is Subtask => st !== null);
146
- }
147
-
148
- private static extractFiles(content: string, section: string): string[] | undefined {
149
- const pattern = new RegExp(`\\*\\*${section}\\*\\*:?\\s*\\n((?:- \`.+?\`\\n?)+)`, 's');
150
- const match = content.match(pattern);
151
- if (!match) return undefined;
152
-
153
- const files = match[1].match(/- `(.+?)`/g);
154
- return files?.map(f => f.replace(/- `(.+?)`/, '$1'));
155
- }
156
-
157
- private static extractImplementation(content: string): string | undefined {
158
- const match = content.match(/\*\*Implementation\*\*:?\s*\n```[\w]*\n([\s\S]+?)\n```/);
159
- return match?.[1]?.trim();
160
- }
161
-
162
- private static extractAcceptanceCriteria(content: string): string[] | undefined {
163
- const match = content.match(/\*\*Acceptance Criteria\*\*:?\s*\n((?:- .+\n?)+)/);
164
- if (!match) return undefined;
165
-
166
- const criteria = match[1].match(/- (.+)/g);
167
- return criteria?.map(c => c.replace(/^- /, '').replace(/^✅\s*/, ''));
168
- }
169
-
170
- private static extractDependencies(content: string): string[] | undefined {
171
- const match = content.match(/\*\*Dependencies\*\*:?\s*\n((?:- .+\n?)+)/);
172
- if (!match) return undefined;
173
-
174
- const deps = match[1].match(/- (T-\d+(?:-[A-Z])?)/g);
175
- return deps?.map(d => d.replace(/^- /, '').match(/(T-\d+(?:-[A-Z])?)/)?.[1]).filter((d): d is string => !!d);
176
- }
177
-
178
- private static extractBlocks(content: string): string[] | undefined {
179
- const match = content.match(/\*\*Blocks\*\*:?\s*\n((?:- .+\n?)+)/);
180
- if (!match) return undefined;
181
-
182
- const blocks = match[1].match(/- (T-\d+(?:-[A-Z])?)/g);
183
- return blocks?.map(b => b.replace(/^- /, '').match(/(T-\d+(?:-[A-Z])?)/)?.[1]).filter((b): b is string => !!b);
184
- }
185
-
186
- private static extractPhase(content: string): string | undefined {
187
- // Look backwards in content to find phase header
188
- const lines = content.split('\n');
189
- for (let i = 0; i < lines.length; i++) {
190
- const line = lines[i];
191
- if (line.startsWith('##') && !line.startsWith('###')) {
192
- const phaseMatch = line.match(/##\s+(.+?)(?:\s+-\s+\d+\s+tasks)?$/);
193
- if (phaseMatch) {
194
- return phaseMatch[1].trim();
195
- }
196
- }
197
- }
198
- return undefined;
199
- }
200
-
201
- /**
202
- * Update tasks.md file with GitHub issue numbers
203
- */
204
- static updateTasksWithGitHubIssues(
205
- incrementPath: string,
206
- taskIssueMap: Record<string, number>
207
- ): void {
208
- const tasksPath = path.join(incrementPath, 'tasks.md');
209
- let content = fs.readFileSync(tasksPath, 'utf-8');
210
-
211
- for (const [taskId, issueNumber] of Object.entries(taskIssueMap)) {
212
- // Find task section
213
- const taskHeaderPattern = new RegExp(`(###\\s+${taskId}:.+?$)`, 'm');
214
- const match = content.match(taskHeaderPattern);
215
- if (!match) continue;
216
-
217
- const taskStart = match.index!;
218
- const nextTaskPattern = /###\s+T-\d+(?:-[A-Z])?:/g;
219
- nextTaskPattern.lastIndex = taskStart + match[0].length;
220
- const nextMatch = nextTaskPattern.exec(content);
221
- const taskEnd = nextMatch ? nextMatch.index : content.length;
222
- const taskSection = content.substring(taskStart, taskEnd);
223
-
224
- // Check if GitHub Issue field already exists
225
- if (taskSection.includes('**GitHub Issue**:')) {
226
- // Update existing
227
- const updatedSection = taskSection.replace(
228
- /\*\*GitHub Issue\*\*:.+$/m,
229
- `**GitHub Issue**: #${issueNumber}`
230
- );
231
- content = content.substring(0, taskStart) + updatedSection + content.substring(taskEnd);
232
- } else {
233
- // Add after Status line
234
- const statusLinePattern = /(\*\*Status\*\*:.+?$)/m;
235
- const statusMatch = taskSection.match(statusLinePattern);
236
- if (statusMatch) {
237
- const insertPoint = taskStart + taskSection.indexOf(statusMatch[0]) + statusMatch[0].length;
238
- const insertion = `\n**GitHub Issue**: #${issueNumber}`;
239
- content = content.substring(0, insertPoint) + insertion + content.substring(insertPoint);
240
- }
241
- }
242
- }
243
-
244
- fs.writeFileSync(tasksPath, content, 'utf-8');
245
- }
246
- }
File without changes
@@ -1,51 +0,0 @@
1
- /**
2
- * Task-level GitHub synchronization
3
- * Orchestrates syncing tasks.md to GitHub issues
4
- */
5
- import { SyncResult, GitHubSyncOptions } from './types';
6
- export declare class TaskSync {
7
- private client;
8
- private incrementPath;
9
- constructor(incrementPath: string, repo?: string);
10
- /**
11
- * Sync all tasks to GitHub (main entry point)
12
- */
13
- syncTasks(options?: GitHubSyncOptions): Promise<SyncResult>;
14
- /**
15
- * Generate epic issue body
16
- */
17
- private generateEpicBody;
18
- /**
19
- * Generate task issue body
20
- */
21
- private generateTaskBody;
22
- /**
23
- * Load increment metadata
24
- */
25
- private loadIncrementMetadata;
26
- /**
27
- * Save increment metadata
28
- */
29
- private saveIncrementMetadata;
30
- /**
31
- * Save sync mapping
32
- */
33
- private saveSyncMapping;
34
- /**
35
- * Get milestone title from metadata
36
- */
37
- private getMilestoneTitle;
38
- /**
39
- * Get GitHub file URL
40
- */
41
- private getGitHubFileURL;
42
- /**
43
- * Convert string to slug
44
- */
45
- private slugify;
46
- /**
47
- * Print dry run summary
48
- */
49
- private printDryRunSummary;
50
- }
51
- //# sourceMappingURL=task-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-sync.d.ts","sourceRoot":"","sources":["task-sync.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAA2B,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjF,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,aAAa,CAAS;gBAElB,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAKhD;;OAEG;IACG,SAAS,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAkKrE;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA+DxB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAK7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;IACH,OAAO,CAAC,OAAO;IAOf;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAU3B"}