@sk8metal/michi-cli 0.10.1 → 0.11.0

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 (104) hide show
  1. package/README.md +77 -847
  2. package/dist/scripts/phase-runner.js +1 -1
  3. package/dist/scripts/phase-runner.js.map +1 -1
  4. package/dist/scripts/utils/multi-repo-validator.d.ts +18 -0
  5. package/dist/scripts/utils/multi-repo-validator.d.ts.map +1 -1
  6. package/dist/scripts/utils/multi-repo-validator.js +42 -0
  7. package/dist/scripts/utils/multi-repo-validator.js.map +1 -1
  8. package/dist/scripts/utils/tasks-format-validator.js +3 -3
  9. package/dist/scripts/utils/tasks-format-validator.js.map +1 -1
  10. package/docs/README.md +20 -83
  11. package/docs/getting-started/configuration.md +379 -0
  12. package/docs/getting-started/installation.md +59 -0
  13. package/docs/getting-started/quick-start.md +76 -0
  14. package/docs/guides/ai-tools.md +311 -0
  15. package/docs/guides/atlassian-integration.md +116 -0
  16. package/docs/guides/claude-code.md +155 -0
  17. package/docs/guides/multi-repo.md +117 -0
  18. package/docs/guides/workflow.md +382 -0
  19. package/docs/reference/ai-commands.md +92 -0
  20. package/docs/reference/cli.md +756 -0
  21. package/docs/reference/environment-variables.md +192 -0
  22. package/docs/troubleshooting.md +543 -0
  23. package/package.json +1 -1
  24. package/scripts/phase-runner.ts +1 -1
  25. package/scripts/utils/__tests__/multi-repo-validator.test.ts +159 -1
  26. package/scripts/utils/multi-repo-validator.ts +50 -0
  27. package/scripts/utils/tasks-format-validator.ts +3 -3
  28. package/templates/claude/agents/e2e-first-planner/AGENT.md +1 -1
  29. package/templates/claude/agents/pr-resolver/AGENT.md +15 -3
  30. package/templates/claude/commands/michi/e2e-plan.md +1 -1
  31. package/templates/claude/commands/michi/spec-design.md +2 -2
  32. package/templates/claude/commands/michi/spec-tasks.md +156 -0
  33. package/templates/claude/commands/michi/test-planning.md +1 -1
  34. package/templates/claude/commands/michi/validate-design.md +3 -3
  35. package/templates/claude/commands/michi-multi-repo/impl-all.md +30 -1
  36. package/templates/claude/commands/michi-multi-repo/propagate-specs.md +14 -1
  37. package/templates/claude/commands/michi-multi-repo/spec-review.md +16 -2
  38. package/templates/claude-agent/agents/repo-spec-executor.md +1 -1
  39. package/templates/claude-agent/commands/michi/spec-tasks.md +117 -0
  40. package/templates/claude-agent/rules/code-size-monitor.md +26 -0
  41. package/templates/claude-agent/rules/code-size-rules.md +32 -0
  42. package/templates/codex/AGENTS.override.md +1 -1
  43. package/templates/codex/rules/README.md +2 -2
  44. package/templates/cursor/commands/michi/spec-tasks.md +117 -0
  45. package/templates/michi/cc-sdd-overrides/settings/rules/design-review-michi.md +1 -1
  46. package/docs/context.md +0 -59
  47. package/docs/michi-development/contributing/development.md +0 -341
  48. package/docs/michi-development/contributing/release.md +0 -365
  49. package/docs/michi-development/design/config-unification.md +0 -733
  50. package/docs/michi-development/design/design-config-current-state.md +0 -330
  51. package/docs/michi-development/design/design-config-implementation.md +0 -628
  52. package/docs/michi-development/design/design-config-migration.md +0 -952
  53. package/docs/michi-development/design/design-config-security.md +0 -771
  54. package/docs/michi-development/design/design-config-solution.md +0 -583
  55. package/docs/michi-development/design/design-config-testing.md +0 -892
  56. package/docs/michi-development/testing/manual-verification-flow.md +0 -871
  57. package/docs/michi-development/testing/manual-verification-other-tools.md +0 -1279
  58. package/docs/michi-development/testing/manual-verification-troubleshooting.md +0 -122
  59. package/docs/michi-development/testing/pre-publish-checklist.md +0 -560
  60. package/docs/michi-development/testing-strategy.md +0 -87
  61. package/docs/plan.md +0 -275
  62. package/docs/user-guide/getting-started/github-token-setup.md +0 -510
  63. package/docs/user-guide/getting-started/new-repository-setup.md +0 -704
  64. package/docs/user-guide/getting-started/quick-start.md +0 -212
  65. package/docs/user-guide/getting-started/setup.md +0 -819
  66. package/docs/user-guide/guides/agent-skills-integration.md +0 -222
  67. package/docs/user-guide/guides/customization.md +0 -537
  68. package/docs/user-guide/guides/internationalization.md +0 -540
  69. package/docs/user-guide/guides/migration-guide.md +0 -138
  70. package/docs/user-guide/guides/multi-project.md +0 -368
  71. package/docs/user-guide/guides/multi-repo-guide.md +0 -1590
  72. package/docs/user-guide/guides/phase-automation.md +0 -419
  73. package/docs/user-guide/guides/workflow.md +0 -574
  74. package/docs/user-guide/hands-on/README.md +0 -142
  75. package/docs/user-guide/hands-on/claude-agent-setup.md +0 -597
  76. package/docs/user-guide/hands-on/claude-setup.md +0 -452
  77. package/docs/user-guide/hands-on/cursor-setup.md +0 -353
  78. package/docs/user-guide/hands-on/troubleshooting.md +0 -964
  79. package/docs/user-guide/hands-on/verification-checklist.md +0 -439
  80. package/docs/user-guide/hands-on/workflow-walkthrough.md +0 -1078
  81. package/docs/user-guide/reference/config.md +0 -589
  82. package/docs/user-guide/reference/multi-repo-api.md +0 -771
  83. package/docs/user-guide/reference/quick-reference.md +0 -297
  84. package/docs/user-guide/reference/security-test-payloads.md +0 -50
  85. package/docs/user-guide/reference/tasks-template.md +0 -550
  86. package/docs/user-guide/release/ci-setup-java.md +0 -114
  87. package/docs/user-guide/release/ci-setup-nodejs.md +0 -94
  88. package/docs/user-guide/release/ci-setup-php.md +0 -102
  89. package/docs/user-guide/release/ci-setup-troubleshooting.md +0 -94
  90. package/docs/user-guide/release/ci-setup.md +0 -188
  91. package/docs/user-guide/release/release-flow.md +0 -476
  92. package/docs/user-guide/templates/test-specs/README.md +0 -173
  93. package/docs/user-guide/templates/test-specs/e2e-test-spec-template.md +0 -553
  94. package/docs/user-guide/templates/test-specs/integration-test-spec-template.md +0 -435
  95. package/docs/user-guide/templates/test-specs/performance-test-spec-template.md +0 -454
  96. package/docs/user-guide/templates/test-specs/security-test-spec-template.md +0 -625
  97. package/docs/user-guide/templates/test-specs/unit-test-spec-template.md +0 -328
  98. package/docs/user-guide/testing/integration-tests.md +0 -312
  99. package/docs/user-guide/testing/tdd-cycle.md +0 -349
  100. package/docs/user-guide/testing/test-execution-flow.md +0 -396
  101. package/docs/user-guide/testing/test-failure-handling.md +0 -521
  102. package/docs/user-guide/testing/test-planning-flow.md +0 -185
  103. package/docs/user-guide/testing-strategy.md +0 -185
  104. package/docs/verification-guide.md +0 -518
@@ -3,12 +3,19 @@
3
3
  * Task 1.2: バリデーション関数の実装
4
4
  */
5
5
 
6
- import { describe, it, expect } from 'vitest';
6
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
7
7
  import {
8
8
  validateProjectName,
9
9
  validateJiraKey,
10
10
  validateRepositoryUrl,
11
+ hasMichiSetup,
12
+ getMichiSetupCommand,
13
+ validateLocalPath,
11
14
  } from '../multi-repo-validator';
15
+ import * as fs from 'fs';
16
+ import * as path from 'path';
17
+ import * as os from 'os';
18
+ import type { Repository } from '../../config/config-schema';
12
19
 
13
20
  describe('validateProjectName', () => {
14
21
  describe('正常ケース', () => {
@@ -333,3 +340,154 @@ describe('validateRepositoryUrl', () => {
333
340
  });
334
341
  });
335
342
  });
343
+
344
+ describe('hasMichiSetup', () => {
345
+ let tempDir: string;
346
+
347
+ beforeEach(() => {
348
+ // 一時ディレクトリを作成
349
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'michi-test-'));
350
+ });
351
+
352
+ afterEach(() => {
353
+ // 一時ディレクトリを削除
354
+ fs.rmSync(tempDir, { recursive: true, force: true });
355
+ });
356
+
357
+ describe('Michi導入済みの場合', () => {
358
+ it('.kiro/project.json が存在する場合はtrueを返す', () => {
359
+ // .kiro ディレクトリを作成
360
+ const kiroDir = path.join(tempDir, '.kiro');
361
+ fs.mkdirSync(kiroDir);
362
+
363
+ // project.json を作成
364
+ const projectJson = path.join(kiroDir, 'project.json');
365
+ fs.writeFileSync(projectJson, '{}');
366
+
367
+ const result = hasMichiSetup(tempDir);
368
+ expect(result).toBe(true);
369
+ });
370
+ });
371
+
372
+ describe('Michi未導入の場合', () => {
373
+ it('.kiro/project.json が存在しない場合はfalseを返す', () => {
374
+ // .kiro ディレクトリのみ作成(project.jsonなし)
375
+ const kiroDir = path.join(tempDir, '.kiro');
376
+ fs.mkdirSync(kiroDir);
377
+
378
+ const result = hasMichiSetup(tempDir);
379
+ expect(result).toBe(false);
380
+ });
381
+
382
+ it('.kiro ディレクトリ自体が存在しない場合はfalseを返す', () => {
383
+ // .kiro ディレクトリを作成しない
384
+ const result = hasMichiSetup(tempDir);
385
+ expect(result).toBe(false);
386
+ });
387
+ });
388
+ });
389
+
390
+ describe('getMichiSetupCommand', () => {
391
+ it('正しいセットアップコマンドを生成する(シングルクォートでラップ)', () => {
392
+ const localPath = '/path/to/repo';
393
+ const command = getMichiSetupCommand(localPath);
394
+ expect(command).toBe(
395
+ "cd '/path/to/repo' && npx @sk8metal/michi-cli@latest init",
396
+ );
397
+ });
398
+
399
+ it('スペースを含むパスを正しくエスケープする', () => {
400
+ const localPath = '/path/to/my repo';
401
+ const command = getMichiSetupCommand(localPath);
402
+ expect(command).toBe(
403
+ "cd '/path/to/my repo' && npx @sk8metal/michi-cli@latest init",
404
+ );
405
+ });
406
+
407
+ it('シングルクォートを含むパスを正しくエスケープする', () => {
408
+ const localPath = "/path/to/user's repo";
409
+ const command = getMichiSetupCommand(localPath);
410
+ expect(command).toBe(
411
+ "cd '/path/to/user'\\''s repo' && npx @sk8metal/michi-cli@latest init",
412
+ );
413
+ });
414
+
415
+ it('複数のシングルクォートを含むパスを正しくエスケープする', () => {
416
+ const localPath = "/path/to/'test'/repo's/dir";
417
+ const command = getMichiSetupCommand(localPath);
418
+ expect(command).toBe(
419
+ "cd '/path/to/'\\''test'\\''/repo'\\''s/dir' && npx @sk8metal/michi-cli@latest init",
420
+ );
421
+ });
422
+
423
+ it('スペースとシングルクォート両方を含むパスを正しくエスケープする', () => {
424
+ const localPath = "/path/to/user's test repo";
425
+ const command = getMichiSetupCommand(localPath);
426
+ expect(command).toBe(
427
+ "cd '/path/to/user'\\''s test repo' && npx @sk8metal/michi-cli@latest init",
428
+ );
429
+ });
430
+ });
431
+
432
+ describe('validateLocalPath - Michi導入チェック', () => {
433
+ let tempDir: string;
434
+ let repository: Repository;
435
+
436
+ beforeEach(() => {
437
+ // 一時ディレクトリを作成
438
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'michi-test-'));
439
+
440
+ // リポジトリオブジェクトを作成
441
+ repository = {
442
+ name: 'test-repo',
443
+ url: 'https://github.com/test/repo',
444
+ branch: 'main',
445
+ localPath: tempDir,
446
+ };
447
+ });
448
+
449
+ afterEach(() => {
450
+ // 一時ディレクトリを削除
451
+ fs.rmSync(tempDir, { recursive: true, force: true });
452
+ });
453
+
454
+ it('Michi導入済みリポジトリの場合、hasMichiSetupがtrueになる', () => {
455
+ // .git ディレクトリを作成(Gitリポジトリとして認識させる)
456
+ fs.mkdirSync(path.join(tempDir, '.git'));
457
+
458
+ // .kiro/project.json を作成(Michi導入済み)
459
+ const kiroDir = path.join(tempDir, '.kiro');
460
+ fs.mkdirSync(kiroDir);
461
+ fs.writeFileSync(path.join(kiroDir, 'project.json'), '{}');
462
+
463
+ const result = validateLocalPath(repository);
464
+ expect(result.hasMichiSetup).toBe(true);
465
+ expect(result.michiSetupCommand).toBeNull();
466
+ });
467
+
468
+ it('Michi未導入リポジトリの場合、hasMichiSetupがfalseになり警告が追加される', () => {
469
+ // .git ディレクトリを作成(Gitリポジトリとして認識させる)
470
+ fs.mkdirSync(path.join(tempDir, '.git'));
471
+
472
+ // .kiro/project.json は作成しない(Michi未導入)
473
+
474
+ const result = validateLocalPath(repository);
475
+ expect(result.hasMichiSetup).toBe(false);
476
+ expect(result.michiSetupCommand).not.toBeNull();
477
+ expect(result.warnings).toContain(
478
+ `Repository 'test-repo' does not have Michi setup (.kiro/project.json not found)`,
479
+ );
480
+ });
481
+
482
+ it('Gitリポジトリでない場合、hasMichiSetupはfalseでmichiSetupCommandはnull', () => {
483
+ // .git ディレクトリを作成しない(Gitリポジトリでない)
484
+
485
+ const result = validateLocalPath(repository);
486
+ expect(result.isValid).toBe(false);
487
+ expect(result.hasMichiSetup).toBe(false);
488
+ expect(result.michiSetupCommand).toBeNull();
489
+ expect(result.errors).toContain(
490
+ `localPath '${tempDir}' is not a Git repository (no .git directory)`,
491
+ );
492
+ });
493
+ });
@@ -28,6 +28,8 @@ export interface LocalPathValidationResult extends ValidationResult {
28
28
  currentBranch: string | null;
29
29
  branchMatches: boolean;
30
30
  hasUncommittedChanges: boolean;
31
+ hasMichiSetup: boolean;
32
+ michiSetupCommand: string | null;
31
33
  }
32
34
 
33
35
  /**
@@ -156,6 +158,32 @@ export function validateRepositoryUrl(url: string): ValidationResult {
156
158
  };
157
159
  }
158
160
 
161
+ /**
162
+ * Michi導入状況をチェック
163
+ * .kiro/project.json の存在でMichi導入済みと判定
164
+ *
165
+ * @param localPath - 子リポジトリのlocalPath
166
+ * @returns Michi導入済みかどうか
167
+ */
168
+ export function hasMichiSetup(localPath: string): boolean {
169
+ const projectJsonPath = path.join(localPath, '.kiro', 'project.json');
170
+ return fs.existsSync(projectJsonPath);
171
+ }
172
+
173
+ /**
174
+ * Michi導入コマンドを生成
175
+ * パスに空白やシングルクォートが含まれる場合に対応
176
+ *
177
+ * @param localPath - 子リポジトリのlocalPath
178
+ * @returns セットアップコマンド文字列
179
+ */
180
+ export function getMichiSetupCommand(localPath: string): string {
181
+ // シングルクォートをエスケープ: ' → '\''
182
+ // eslint-disable-next-line quotes
183
+ const escapedPath = localPath.replace(/'/g, "'\\''");
184
+ return `cd '${escapedPath}' && npx @sk8metal/michi-cli@latest init`;
185
+ }
186
+
159
187
  /**
160
188
  * LocalPathのバリデーション
161
189
  * ディレクトリ存在、Gitリポジトリ、ブランチ、未コミット変更をチェック
@@ -175,6 +203,8 @@ export function validateLocalPath(
175
203
  let currentBranch: string | null = null;
176
204
  let branchMatches = false;
177
205
  let hasUncommittedChanges = false;
206
+ let hasMichiSetupResult = false;
207
+ let michiSetupCommand: string | null = null;
178
208
 
179
209
  // 1. localPath設定確認
180
210
  if (!repository.localPath) {
@@ -190,6 +220,8 @@ export function validateLocalPath(
190
220
  currentBranch,
191
221
  branchMatches,
192
222
  hasUncommittedChanges,
223
+ hasMichiSetup: hasMichiSetupResult,
224
+ michiSetupCommand,
193
225
  };
194
226
  }
195
227
 
@@ -211,6 +243,8 @@ export function validateLocalPath(
211
243
  currentBranch,
212
244
  branchMatches,
213
245
  hasUncommittedChanges,
246
+ hasMichiSetup: hasMichiSetupResult,
247
+ michiSetupCommand,
214
248
  };
215
249
  }
216
250
  exists = true;
@@ -225,6 +259,8 @@ export function validateLocalPath(
225
259
  currentBranch,
226
260
  branchMatches,
227
261
  hasUncommittedChanges,
262
+ hasMichiSetup: hasMichiSetupResult,
263
+ michiSetupCommand,
228
264
  };
229
265
  }
230
266
 
@@ -243,6 +279,8 @@ export function validateLocalPath(
243
279
  currentBranch,
244
280
  branchMatches,
245
281
  hasUncommittedChanges,
282
+ hasMichiSetup: hasMichiSetupResult,
283
+ michiSetupCommand,
246
284
  };
247
285
  }
248
286
  isGitRepository = true;
@@ -287,6 +325,16 @@ export function validateLocalPath(
287
325
  );
288
326
  }
289
327
 
328
+ // 6. Michi導入状況確認
329
+ hasMichiSetupResult = hasMichiSetup(localPath);
330
+
331
+ if (!hasMichiSetupResult) {
332
+ michiSetupCommand = getMichiSetupCommand(localPath);
333
+ warnings.push(
334
+ `Repository '${repository.name}' does not have Michi setup (.kiro/project.json not found)`,
335
+ );
336
+ }
337
+
290
338
  return {
291
339
  isValid: errors.length === 0,
292
340
  errors,
@@ -296,5 +344,7 @@ export function validateLocalPath(
296
344
  currentBranch,
297
345
  branchMatches,
298
346
  hasUncommittedChanges,
347
+ hasMichiSetup: hasMichiSetupResult,
348
+ michiSetupCommand,
299
349
  };
300
350
  }
@@ -35,7 +35,7 @@ export function validateTasksFormat(tasksPath: string): void {
35
35
  throw new Error(
36
36
  'tasks.md appears to be in AI-DLC format instead of Michi workflow format.\n' +
37
37
  'Detected "- [ ] 1." pattern without Phase structure.\n' +
38
- 'Please regenerate tasks.md using /kiro:spec-tasks command with correct template.',
38
+ 'Please regenerate tasks.md using /michi:spec-tasks command with correct template.',
39
39
  );
40
40
  }
41
41
 
@@ -72,7 +72,7 @@ export function validateTasksFormat(tasksPath: string): void {
72
72
  'tasks.md does not match either workflow structure.\n\n' +
73
73
  `Missing required phases (new workflow):\n${missingNewPhases.map((p) => ` - ${p}`).join('\n')}\n\n` +
74
74
  `Missing phases (legacy workflow):\n${missingLegacyPhases.map((p) => ` - ${p}`).join('\n')}\n\n` +
75
- 'Please regenerate tasks.md using /kiro:spec-tasks command with the latest template.',
75
+ 'Please regenerate tasks.md using /michi:spec-tasks command with the latest template.',
76
76
  );
77
77
  }
78
78
 
@@ -100,7 +100,7 @@ export function validateTasksFormat(tasksPath: string): void {
100
100
  throw new Error(
101
101
  'tasks.md does not contain valid Story headers.\n' +
102
102
  'Expected format: "### Story X.Y: Title"\n' +
103
- 'Please regenerate tasks.md using /kiro:spec-tasks command.',
103
+ 'Please regenerate tasks.md using /michi:spec-tasks command.',
104
104
  );
105
105
  }
106
106
 
@@ -3,7 +3,7 @@ name: e2e-first-planner
3
3
  description: |
4
4
  E2Eファースト開発計画を自動生成する実行エージェント。
5
5
  Walking Skeleton、MVP計画、縦割りタスク分割を提案。
6
- タスク分割フェーズ(/kiro:spec-tasks実行時)に PROACTIVELY 使用してください。
6
+ タスク分割フェーズ(/michi:spec-tasks実行時)に PROACTIVELY 使用してください。
7
7
  allowed-tools: Bash, Read, Grep, Glob
8
8
  ---
9
9
 
@@ -30,15 +30,27 @@ gh pr view <PR番号> --json number,title,state
30
30
 
31
31
  GitHub GraphQL APIでreviewThreadsを取得(`isResolved: false`)
32
32
 
33
- ### 3. ユーザー確認
33
+ ### 3. CI/CDステータス確認
34
+
35
+ CI/CDステータスを確認し、失敗しているjobがあれば、原因調査
36
+
37
+ ### 4. 未resolveスレッドについて対応するかどうか判断する
38
+
39
+ tasks.mdを参考に、今後のタスクとして対応予定のものなのか、それとも、今すぐに対応すべき課題なのかを判断する
40
+
41
+ ### 5. CI/CDステータスが失敗だった時の対応
42
+
43
+ 失敗しているjobについてログを確認し、事実ベースで解決策を検討
44
+
45
+ ###  6. ユーザー確認
34
46
 
35
47
  resolveするスレッドを提示し、確認を得る。
36
48
 
37
- ### 4. resolve実行
49
+ ### 7. resolve実行
38
50
 
39
51
  `resolveReviewThread` mutationを実行。
40
52
 
41
- ### 5. 結果報告
53
+ ### 8. 結果報告
42
54
 
43
55
  resolve済みスレッド数とステータスを報告。
44
56
 
@@ -110,7 +110,7 @@ E2Eプランニング結果は以下の形式で出力されます:
110
110
  ## Phase 0.5統合
111
111
 
112
112
  このコマンドはPhase 0.5(タスク分割)で実行することを推奨します。
113
- `/kiro:spec-tasks` コマンドから呼び出すことも可能です。
113
+ `/michi:spec-tasks` コマンドから呼び出すことも可能です。
114
114
 
115
115
  ## 言語設定
116
116
 
@@ -66,10 +66,10 @@ Phase 0.3-0.4 完了後、以下のステップに進んでください:
66
66
 
67
67
  **推奨フロー**:
68
68
  1. `/michi:validate-design {feature}` で設計レビューを実施(任意)
69
- 2. `/kiro:spec-tasks {feature}` でタスク生成
69
+ 2. `/michi:spec-tasks {feature}` でタスク生成
70
70
 
71
71
  **クイックフロー**:
72
- - `/kiro:spec-tasks {feature} -y` で自動承認してタスク生成
72
+ - `/michi:spec-tasks {feature} -y` で自動承認してタスク生成
73
73
 
74
74
  **重要**: テスト計画(Phase 0.3-0.4)を完了してからタスク生成することで、実装タスクにテスト実装が適切に含まれます。
75
75
 
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: /michi:spec-tasks
3
+ description: Generate implementation tasks with JIRA sync option (Michi version)
4
+ allowed-tools: Read, Write, Edit, MultiEdit, Glob, Grep, Bash
5
+ argument-hint: <feature-name> [-y] [--sequential]
6
+ ---
7
+
8
+ # Michi: Spec Tasks with JIRA Sync Option
9
+
10
+ ## Base Command Reference
11
+ @.claude/commands/kiro/spec-tasks.md
12
+
13
+ ## Development Guidelines
14
+ {{DEV_GUIDELINES}}
15
+
16
+ ---
17
+
18
+ ## Michi Extension: JIRA Sync Prompt
19
+
20
+ このコマンドは cc-sdd 標準の `/kiro:spec-tasks` を拡張し、タスク生成完了後にJIRA同期オプションを提示します。
21
+
22
+ ### 機能追加内容
23
+
24
+ 1. **タスク生成完了後の次ステップ案内**:
25
+ - JIRA連携が設定されている場合: JIRA同期の選択肢(A/B/C形式)を表示
26
+ - JIRA連携が未設定の場合: 実装フェーズへの案内 + JIRA設定ヒントを表示
27
+
28
+ 2. **環境変数による条件分岐**:
29
+ - 以下の環境変数がすべて設定されている場合のみ、JIRA同期の選択肢を表示
30
+ - `ATLASSIAN_URL`
31
+ - `ATLASSIAN_EMAIL`
32
+ - `ATLASSIAN_API_TOKEN`
33
+
34
+ ---
35
+
36
+ ## タスク生成完了後のフロー
37
+
38
+ 基底コマンド `/kiro:spec-tasks` によるタスク生成が完了した後、以下のフローを実行してください:
39
+
40
+ ### Step 1: 環境変数チェック
41
+
42
+ ```bash
43
+ # JIRA連携の環境変数をチェック
44
+ if [ -n "$ATLASSIAN_URL" ] && [ -n "$ATLASSIAN_EMAIL" ] && [ -n "$ATLASSIAN_API_TOKEN" ]; then
45
+ JIRA_CONFIGURED=true
46
+ else
47
+ JIRA_CONFIGURED=false
48
+ fi
49
+ ```
50
+
51
+ ### Step 2a: JIRA連携が設定されている場合の表示
52
+
53
+ `JIRA_CONFIGURED=true` の場合、以下のメッセージと選択肢を表示:
54
+
55
+ ```
56
+ ============================================
57
+ タスク生成完了 - JIRA同期オプション
58
+ ============================================
59
+
60
+ 次のアクション:
61
+ A) JIRAにタスクを同期する(推奨: タスク管理を一元化)
62
+ → `michi jira:sync {{FEATURE_NAME}}` を実行
63
+
64
+ B) JIRAへの同期をスキップして実装に進む
65
+ → `/michi:spec-impl {{FEATURE_NAME}}` を実行
66
+
67
+ C) 何もせずにこのまま終了する
68
+
69
+ 選択 (A/B/C): _
70
+ ```
71
+
72
+ **選択肢の説明**:
73
+ - **A**: Epic/Story/Subtaskを自動作成し、タスクをJIRAに同期します
74
+ - **B**: JIRA同期をスキップして直接TDD実装フェーズに進みます
75
+ - **C**: タスク生成のみで終了し、ユーザーが手動で次のステップを選択します
76
+
77
+ ### Step 2b: JIRA連携が未設定の場合の表示
78
+
79
+ `JIRA_CONFIGURED=false` の場合、以下のメッセージを表示:
80
+
81
+ ```
82
+ ============================================
83
+ タスク生成完了
84
+ ============================================
85
+
86
+ 次のステップ:
87
+ → `/michi:spec-impl {{FEATURE_NAME}}` で実装を開始
88
+
89
+ ---
90
+ ℹ️ ヒント: JIRA連携を使用すると、タスクを自動的にJIRAに同期できます。
91
+
92
+ 設定方法: 以下の環境変数を .env に追加してください:
93
+ - ATLASSIAN_URL=https://your-domain.atlassian.net
94
+ - ATLASSIAN_EMAIL=your-email@company.com
95
+ - ATLASSIAN_API_TOKEN=your-api-token
96
+
97
+ 詳細はドキュメントを参照: docs/guides/atlassian-integration.md
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Michi Extension: Task Diff Size Guidelines
103
+
104
+ タスク分割時に、各サブタスクの git diff サイズを考慮してください。
105
+
106
+ ### 推奨サイズ
107
+ - **目標**: 各サブタスクで 200-400 行の diff
108
+ - **最大**: 500 行まで(超過時は分割を検討)
109
+ - **警告**: 400行超過時は分割を推奨
110
+
111
+ ### 除外対象ファイル(行数カウント対象外)
112
+ - **ロックファイル**: package-lock.json, yarn.lock, pnpm-lock.yaml, composer.lock, Gemfile.lock, poetry.lock, Pipfile.lock, Cargo.lock, go.sum
113
+ - **自動生成ファイル**: *.min.js, *.min.css, *.map, dist/*, build/*, coverage/*, .next/*, *.d.ts, *.generated.ts, __snapshots__/*
114
+
115
+ ### 分割戦略
116
+
117
+ タスクが大きすぎる場合の分割方法:
118
+
119
+ 1. **水平分割(レイヤー別)**
120
+ - model/repository → service/logic → controller/handler
121
+ - 例: 「User CRUD」→「User model作成」「User service作成」「User controller作成」
122
+
123
+ 2. **垂直分割(機能スライス別)**
124
+ - core機能 → validation → error handling → edge cases
125
+ - 例: 「認証機能」→「ログインcore」「バリデーション追加」「エラーハンドリング」
126
+
127
+ 3. **フェーズ分割(段階別)**
128
+ - 基本実装 → テスト追加 → 最適化
129
+ - 例: 「検索機能」→「基本検索」「フィルター追加」「パフォーマンス最適化」
130
+
131
+ ### タスク生成時の確認事項
132
+
133
+ タスク分割完了後、以下を確認してください:
134
+
135
+ - [ ] 各サブタスクの予想diff行数が500行以内か
136
+ - [ ] 大きなサブタスクは適切に分割されているか
137
+ - [ ] ロックファイルや自動生成ファイルを含むタスクはその旨が明記されているか
138
+
139
+ ---
140
+
141
+ ## 実装上の注意点
142
+
143
+ 1. **基底コマンドの実行結果を維持**:
144
+ - `/kiro:spec-tasks` の「Output Description」セクションで出力されるタスクサマリーは維持してください
145
+ - Michi Extensionの選択肢はその**後**に追加で表示します
146
+
147
+ 2. **言語設定の考慮**:
148
+ - メッセージは日本語固定(将来的にspec.jsonの言語設定に対応する可能性あり)
149
+
150
+ 3. **ユーザーインタラクション**:
151
+ - 選択肢を表示した後、ユーザーの入力を待ちます
152
+ - 選択に応じて適切なコマンド/処理を案内または実行してください
153
+
154
+ ---
155
+
156
+ **Michi 固有機能**: このコマンドは cc-sdd 標準の `/kiro:spec-tasks` を拡張し、Phase 0.6(JIRA同期)への誘導を Next Phase として案内します。また、タスク粒度ガイドライン(git diff 500行制限)を提供し、適切なタスク分割を支援します。
@@ -153,7 +153,7 @@ This command will:
153
153
  ### Or: Proceed to Task Generation
154
154
 
155
155
  ```bash
156
- /kiro:spec-tasks {feature-name} [-y]
156
+ /michi:spec-tasks {feature-name} [-y]
157
157
  ```
158
158
 
159
159
  This will generate implementation tasks based on requirements, design, and test specifications.
@@ -42,15 +42,15 @@ Phase 0.3-0.4 が未完了の場合は、タスク生成前に完了すること
42
42
  - 統合テスト: `docs/user-guide/templates/test-specs/integration-test-spec-template.md`
43
43
  - 出力先: `.kiro/specs/$1/test-specs/`
44
44
 
45
- 3. **完了後**: `/kiro:spec-tasks $1` でタスク生成に進む
45
+ 3. **完了後**: `/michi:spec-tasks $1` でタスク生成に進む
46
46
 
47
47
  ### Next Phase Guidance
48
48
 
49
49
  **テスト計画完了済みの場合**:
50
- - `/kiro:spec-tasks $1` でタスク生成
50
+ - `/michi:spec-tasks $1` でタスク生成
51
51
 
52
52
  **テスト計画未完了の場合**:
53
- - Phase 0.3-0.4 を実施してから `/kiro:spec-tasks $1`
53
+ - Phase 0.3-0.4 を実施してから `/michi:spec-tasks $1`
54
54
  - または `/michi:spec-design $1` を再実行して Next Phase ガイダンスを確認
55
55
 
56
56
  ---
@@ -75,6 +75,24 @@ Multi-Repoプロジェクト **$1** の全リポジトリで `/michi:spec-impl`
75
75
  4. 各リポジトリのタスクファイル確認
76
76
  - `{localPath}/.kiro/specs/{feature}/tasks.md`
77
77
 
78
+ ### Step 2.5: localPath 検証
79
+
80
+ 各リポジトリについて以下を確認:
81
+
82
+ - ✅ localPathが設定されているか
83
+ - ✅ ディレクトリが存在するか
84
+ - ✅ Gitリポジトリか (`.git/`ディレクトリ確認)
85
+ - ✅ Michiがセットアップ済みか (`.kiro/project.json`確認)
86
+ - ⚠️ 設定されたブランチと現在のブランチが一致するか
87
+ - ⚠️ 未コミット変更がないか
88
+
89
+ **検証失敗時の対応**:
90
+ - localPath未設定: 警告を出力し、該当リポジトリをスキップ
91
+ - ディレクトリ不存在: エラーを出力し、該当リポジトリをスキップ
92
+ - Michi未セットアップ: 警告を出力し、該当リポジトリをスキップ
93
+ - ブランチ不一致: 警告を出力(続行可能)
94
+ - 未コミット変更: 警告を出力(続行可能)
95
+
78
96
  ### Step 3: チェックポイント確認
79
97
 
80
98
  `docs/michi/$1/.checkpoint-impl.json` の存在を確認
@@ -248,7 +266,7 @@ repo-spec-executorサブエージェントを使用して、以下のリポジ
248
266
 
249
267
  タスクを生成してください:
250
268
  cd {localPath}
251
- /kiro:spec-tasks {feature}
269
+ /michi:spec-tasks {feature}
252
270
  ```
253
271
 
254
272
  - **localPath未設定**:
@@ -256,8 +274,19 @@ repo-spec-executorサブエージェントを使用して、以下のリポジ
256
274
  警告: リポジトリ '{name}' の localPath が未設定です。スキップします。
257
275
  ```
258
276
 
277
+ - **Michi未セットアップ**:
278
+ ```
279
+ ⚠️ リポジトリ '{name}' にMichiがセットアップされていません。スキップします。
280
+
281
+ セットアップコマンド:
282
+ cd {localPath} && npx @sk8metal/michi-cli@latest init
283
+
284
+ セットアップ完了後、このコマンドを再実行してください。
285
+ ```
286
+
259
287
  ### Fallback Strategy
260
288
  - localPath未設定: 該当リポジトリをスキップし、他のリポジトリで処理続行
289
+ - Michi未セットアップ: 該当リポジトリをスキップし、他のリポジトリで処理続行
261
290
  - サブエージェント失敗: チェックポイント保存し、リトライ可能にする
262
291
  - テスト失敗: 自動修正を試行(最大3回)、失敗時はチェックポイント保存
263
292
 
@@ -57,12 +57,14 @@ Multi-Repoプロジェクト **$1** の全リポジトリに対して、仕様
57
57
  - ✅ localPathが設定されているか
58
58
  - ✅ ディレクトリが存在するか
59
59
  - ✅ Gitリポジトリか (`.git/`ディレクトリ確認)
60
+ - ✅ Michiがセットアップ済みか (`.kiro/project.json`確認)
60
61
  - ⚠️ 設定されたブランチと現在のブランチが一致するか
61
62
  - ⚠️ 未コミット変更がないか
62
63
 
63
64
  **検証失敗時の対応**:
64
65
  - localPath未設定: 警告を出力し、該当リポジトリをスキップ
65
66
  - ディレクトリ不存在: エラーを出力し、該当リポジトリをスキップ
67
+ - Michi未セットアップ: 警告を出力し、該当リポジトリをスキップ
66
68
  - ブランチ不一致: 警告を出力(続行可能)
67
69
  - 未コミット変更: 警告を出力(続行可能)
68
70
 
@@ -182,7 +184,7 @@ C) キャンセル
182
184
  `/michi-multi-repo:spec-review $1`
183
185
 
184
186
  2. 合格後、各リポジトリでタスク生成:
185
- 各リポジトリで `/kiro:spec-tasks {feature}` を実行
187
+ 各リポジトリで `/michi:spec-tasks {feature}` を実行
186
188
 
187
189
  3. 実装を開始:
188
190
  `/michi-multi-repo:impl-all $1`
@@ -255,6 +257,16 @@ C) キャンセル
255
257
  michi multi-repo:add-repo $1 --name {name} --localPath /path/to/repo
256
258
  ```
257
259
 
260
+ - **Michi未セットアップ**:
261
+ ```
262
+ ⚠️ リポジトリ '{name}' にMichiがセットアップされていません。スキップします。
263
+
264
+ セットアップコマンド:
265
+ cd {localPath} && npx @sk8metal/michi-cli@latest init
266
+
267
+ セットアップ完了後、このコマンドを再実行してください。
268
+ ```
269
+
258
270
  - **親プロジェクト仕様未作成(OPERATION=design以降)**:
259
271
  ```
260
272
  エラー: 親プロジェクトの設計書が見つかりません: docs/michi/$1/overview/architecture.md
@@ -265,6 +277,7 @@ C) キャンセル
265
277
 
266
278
  ### Fallback Strategy
267
279
  - localPath未設定: 該当リポジトリをスキップし、他のリポジトリで処理続行
280
+ - Michi未セットアップ: 該当リポジトリをスキップし、他のリポジトリで処理続行
268
281
  - サブエージェント失敗: チェックポイント保存し、リトライ可能にする
269
282
  - 全リポジトリ失敗: エラーレポート出力し、ユーザーに対処方法を案内
270
283