@sk8metal/michi-cli 0.0.7 → 0.0.9

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 (175) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +205 -11
  3. package/dist/scripts/__tests__/create-project.test.d.ts +2 -0
  4. package/dist/scripts/__tests__/create-project.test.d.ts.map +1 -0
  5. package/dist/scripts/__tests__/create-project.test.js +247 -0
  6. package/dist/scripts/__tests__/create-project.test.js.map +1 -0
  7. package/dist/scripts/__tests__/multi-project-estimate.test.d.ts +2 -0
  8. package/dist/scripts/__tests__/multi-project-estimate.test.d.ts.map +1 -0
  9. package/dist/scripts/__tests__/multi-project-estimate.test.js +119 -0
  10. package/dist/scripts/__tests__/multi-project-estimate.test.js.map +1 -0
  11. package/dist/scripts/__tests__/setup-existing-project.test.d.ts +2 -0
  12. package/dist/scripts/__tests__/setup-existing-project.test.d.ts.map +1 -0
  13. package/dist/scripts/__tests__/setup-existing-project.test.js +129 -0
  14. package/dist/scripts/__tests__/setup-existing-project.test.js.map +1 -0
  15. package/dist/scripts/__tests__/setup-interactive.test.d.ts +2 -0
  16. package/dist/scripts/__tests__/setup-interactive.test.d.ts.map +1 -0
  17. package/dist/scripts/__tests__/setup-interactive.test.js +160 -0
  18. package/dist/scripts/__tests__/setup-interactive.test.js.map +1 -0
  19. package/dist/scripts/config/default-config.json +57 -0
  20. package/dist/scripts/confluence-sync.d.ts +4 -0
  21. package/dist/scripts/confluence-sync.d.ts.map +1 -1
  22. package/dist/scripts/confluence-sync.js +12 -23
  23. package/dist/scripts/confluence-sync.js.map +1 -1
  24. package/dist/scripts/constants/__tests__/environments.test.d.ts +2 -0
  25. package/dist/scripts/constants/__tests__/environments.test.d.ts.map +1 -0
  26. package/dist/scripts/constants/__tests__/environments.test.js +91 -0
  27. package/dist/scripts/constants/__tests__/environments.test.js.map +1 -0
  28. package/dist/scripts/constants/__tests__/languages.test.d.ts +2 -0
  29. package/dist/scripts/constants/__tests__/languages.test.d.ts.map +1 -0
  30. package/dist/scripts/constants/__tests__/languages.test.js +82 -0
  31. package/dist/scripts/constants/__tests__/languages.test.js.map +1 -0
  32. package/dist/scripts/constants/environments.d.ts +33 -0
  33. package/dist/scripts/constants/environments.d.ts.map +1 -0
  34. package/dist/scripts/constants/environments.js +49 -0
  35. package/dist/scripts/constants/environments.js.map +1 -0
  36. package/dist/scripts/constants/languages.d.ts +23 -0
  37. package/dist/scripts/constants/languages.d.ts.map +1 -0
  38. package/dist/scripts/constants/languages.js +53 -0
  39. package/dist/scripts/constants/languages.js.map +1 -0
  40. package/dist/scripts/create-project.d.ts +4 -0
  41. package/dist/scripts/create-project.d.ts.map +1 -1
  42. package/dist/scripts/create-project.js +227 -137
  43. package/dist/scripts/create-project.js.map +1 -1
  44. package/dist/scripts/jira-sync.d.ts.map +1 -1
  45. package/dist/scripts/jira-sync.js +15 -0
  46. package/dist/scripts/jira-sync.js.map +1 -1
  47. package/dist/scripts/list-projects.d.ts.map +1 -1
  48. package/dist/scripts/list-projects.js +42 -15
  49. package/dist/scripts/list-projects.js.map +1 -1
  50. package/dist/scripts/multi-project-estimate.d.ts.map +1 -1
  51. package/dist/scripts/multi-project-estimate.js +56 -21
  52. package/dist/scripts/multi-project-estimate.js.map +1 -1
  53. package/dist/scripts/resource-dashboard.d.ts.map +1 -1
  54. package/dist/scripts/resource-dashboard.js +74 -17
  55. package/dist/scripts/resource-dashboard.js.map +1 -1
  56. package/dist/scripts/setup-existing-project.d.ts +3 -1
  57. package/dist/scripts/setup-existing-project.d.ts.map +1 -1
  58. package/dist/scripts/setup-existing-project.js +306 -217
  59. package/dist/scripts/setup-existing-project.js.map +1 -1
  60. package/dist/scripts/setup-interactive.d.ts +10 -0
  61. package/dist/scripts/setup-interactive.d.ts.map +1 -0
  62. package/dist/scripts/setup-interactive.js +413 -0
  63. package/dist/scripts/setup-interactive.js.map +1 -0
  64. package/dist/scripts/template/__tests__/renderer.test.d.ts +2 -0
  65. package/dist/scripts/template/__tests__/renderer.test.d.ts.map +1 -0
  66. package/dist/scripts/template/__tests__/renderer.test.js +165 -0
  67. package/dist/scripts/template/__tests__/renderer.test.js.map +1 -0
  68. package/dist/scripts/template/renderer.d.ts +70 -0
  69. package/dist/scripts/template/renderer.d.ts.map +1 -0
  70. package/dist/scripts/template/renderer.js +99 -0
  71. package/dist/scripts/template/renderer.js.map +1 -0
  72. package/dist/scripts/utils/__tests__/config-validator.test.js +5 -0
  73. package/dist/scripts/utils/__tests__/config-validator.test.js.map +1 -1
  74. package/dist/scripts/utils/__tests__/spec-updater.test.d.ts +5 -0
  75. package/dist/scripts/utils/__tests__/spec-updater.test.d.ts.map +1 -0
  76. package/dist/scripts/utils/__tests__/spec-updater.test.js +158 -0
  77. package/dist/scripts/utils/__tests__/spec-updater.test.js.map +1 -0
  78. package/dist/scripts/utils/confluence-hierarchy.d.ts +2 -1
  79. package/dist/scripts/utils/confluence-hierarchy.d.ts.map +1 -1
  80. package/dist/scripts/utils/confluence-hierarchy.js +5 -0
  81. package/dist/scripts/utils/confluence-hierarchy.js.map +1 -1
  82. package/dist/scripts/utils/project-finder.d.ts +30 -0
  83. package/dist/scripts/utils/project-finder.d.ts.map +1 -0
  84. package/dist/scripts/utils/project-finder.js +147 -0
  85. package/dist/scripts/utils/project-finder.js.map +1 -0
  86. package/dist/scripts/utils/spec-updater.d.ts +72 -0
  87. package/dist/scripts/utils/spec-updater.d.ts.map +1 -0
  88. package/dist/scripts/utils/spec-updater.js +141 -0
  89. package/dist/scripts/utils/spec-updater.js.map +1 -0
  90. package/dist/scripts/utils/template-finder.d.ts +37 -0
  91. package/dist/scripts/utils/template-finder.d.ts.map +1 -0
  92. package/dist/scripts/utils/template-finder.js +63 -0
  93. package/dist/scripts/utils/template-finder.js.map +1 -0
  94. package/dist/src/__tests__/integration/setup/claude-agent.test.d.ts +5 -0
  95. package/dist/src/__tests__/integration/setup/claude-agent.test.d.ts.map +1 -0
  96. package/dist/src/__tests__/integration/setup/claude-agent.test.js +125 -0
  97. package/dist/src/__tests__/integration/setup/claude-agent.test.js.map +1 -0
  98. package/dist/src/__tests__/integration/setup/claude.test.d.ts +5 -0
  99. package/dist/src/__tests__/integration/setup/claude.test.d.ts.map +1 -0
  100. package/dist/src/__tests__/integration/setup/claude.test.js +111 -0
  101. package/dist/src/__tests__/integration/setup/claude.test.js.map +1 -0
  102. package/dist/src/__tests__/integration/setup/cursor.test.d.ts +5 -0
  103. package/dist/src/__tests__/integration/setup/cursor.test.d.ts.map +1 -0
  104. package/dist/src/__tests__/integration/setup/cursor.test.js +162 -0
  105. package/dist/src/__tests__/integration/setup/cursor.test.js.map +1 -0
  106. package/dist/src/__tests__/integration/setup/helpers/fs-assertions.d.ts +32 -0
  107. package/dist/src/__tests__/integration/setup/helpers/fs-assertions.d.ts.map +1 -0
  108. package/dist/src/__tests__/integration/setup/helpers/fs-assertions.js +72 -0
  109. package/dist/src/__tests__/integration/setup/helpers/fs-assertions.js.map +1 -0
  110. package/dist/src/__tests__/integration/setup/helpers/test-project.d.ts +38 -0
  111. package/dist/src/__tests__/integration/setup/helpers/test-project.d.ts.map +1 -0
  112. package/dist/src/__tests__/integration/setup/helpers/test-project.js +83 -0
  113. package/dist/src/__tests__/integration/setup/helpers/test-project.js.map +1 -0
  114. package/dist/src/__tests__/integration/setup/validation.test.d.ts +5 -0
  115. package/dist/src/__tests__/integration/setup/validation.test.d.ts.map +1 -0
  116. package/dist/src/__tests__/integration/setup/validation.test.js +318 -0
  117. package/dist/src/__tests__/integration/setup/validation.test.js.map +1 -0
  118. package/dist/src/cli.d.ts.map +1 -1
  119. package/dist/src/cli.js +20 -0
  120. package/dist/src/cli.js.map +1 -1
  121. package/dist/src/commands/setup-existing.d.ts +22 -0
  122. package/dist/src/commands/setup-existing.d.ts.map +1 -0
  123. package/dist/src/commands/setup-existing.js +408 -0
  124. package/dist/src/commands/setup-existing.js.map +1 -0
  125. package/dist/vitest.config.d.ts.map +1 -1
  126. package/dist/vitest.config.js +9 -6
  127. package/dist/vitest.config.js.map +1 -1
  128. package/docs/README.md +2 -2
  129. package/docs/contributing/development.md +37 -0
  130. package/docs/getting-started/{new-project-setup.md → new-repository-setup.md} +165 -38
  131. package/docs/getting-started/quick-start.md +57 -6
  132. package/docs/getting-started/setup.md +551 -180
  133. package/docs/guides/customization.md +4 -4
  134. package/docs/guides/multi-project.md +12 -9
  135. package/docs/reference/quick-reference.md +27 -18
  136. package/docs/testing/integration-tests.md +297 -0
  137. package/docs/testing-strategy.md +87 -0
  138. package/package.json +23 -6
  139. package/scripts/__tests__/create-project.test.ts +292 -0
  140. package/scripts/__tests__/multi-project-estimate.test.ts +145 -0
  141. package/scripts/__tests__/setup-existing-project.test.ts +147 -0
  142. package/scripts/__tests__/setup-interactive.test.ts +199 -0
  143. package/scripts/confluence-sync.ts +17 -29
  144. package/scripts/constants/__tests__/environments.test.ts +110 -0
  145. package/scripts/constants/__tests__/languages.test.ts +100 -0
  146. package/scripts/constants/environments.ts +61 -0
  147. package/scripts/constants/languages.ts +70 -0
  148. package/scripts/copy-static-assets.js +50 -0
  149. package/scripts/create-project.ts +251 -158
  150. package/scripts/jira-sync.ts +16 -1
  151. package/scripts/list-projects.ts +51 -24
  152. package/scripts/multi-project-estimate.ts +58 -22
  153. package/scripts/resource-dashboard.ts +91 -26
  154. package/scripts/setup-existing-project.ts +350 -230
  155. package/scripts/setup-existing.sh +159 -25
  156. package/scripts/setup-interactive.ts +565 -0
  157. package/scripts/template/__tests__/renderer.test.ts +207 -0
  158. package/scripts/template/renderer.ts +133 -0
  159. package/scripts/utils/__tests__/config-validator.test.ts +6 -0
  160. package/scripts/utils/__tests__/spec-updater.test.ts +220 -0
  161. package/scripts/utils/confluence-hierarchy.ts +7 -1
  162. package/scripts/utils/project-finder.ts +184 -0
  163. package/scripts/utils/spec-updater.ts +212 -0
  164. package/scripts/utils/template-finder.ts +75 -0
  165. package/templates/claude/commands/michi/confluence-sync.md +38 -0
  166. package/templates/claude/commands/michi/project-switch.md +36 -0
  167. package/templates/claude/rules/atlassian-integration.md +35 -0
  168. package/templates/claude/rules/michi-core.md +54 -0
  169. package/templates/claude-agent/README.md +25 -0
  170. package/templates/cursor/commands/michi/confluence-sync.md +76 -0
  171. package/templates/cursor/commands/michi/project-switch.md +69 -0
  172. package/templates/cursor/rules/atlassian-mcp.mdc +188 -0
  173. package/templates/cursor/rules/github-ssot.mdc +151 -0
  174. package/templates/cursor/rules/multi-project.mdc +81 -0
  175. package/scripts/setup-env.sh +0 -52
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: /michi:confluence-sync
3
+ description: GitHub の Markdown を Confluence に同期
4
+ ---
5
+
6
+ # Confluence同期コマンド
7
+
8
+ {{DEV_GUIDELINES}}
9
+
10
+ このコマンドは、GitHubで管理されている仕様書(requirements, design, tasks)をConfluenceに同期します。
11
+
12
+ ## 使い方
13
+
14
+ ```
15
+ /michi:confluence-sync <feature_name> [doc_type]
16
+ ```
17
+
18
+ **パラメータ**:
19
+ - `feature_name`: 機能名(例: user-auth)
20
+ - `doc_type`: ドキュメントタイプ(requirements / design / tasks)省略時は requirements
21
+
22
+ **例**:
23
+ ```
24
+ /michi:confluence-sync user-auth
25
+ /michi:confluence-sync user-auth design
26
+ /michi:confluence-sync user-auth tasks
27
+ ```
28
+
29
+ ## 実行内容
30
+
31
+ 1. `{{KIRO_DIR}}/project.json` からプロジェクトメタデータを読み込み
32
+ 2. `{{KIRO_DIR}}/specs/<feature>/<doc_type>.md` を読み込み
33
+ 3. Markdown → Confluence Storage Format に変換
34
+ 4. GitHub URLを埋め込み
35
+ 5. Confluenceページを作成または更新
36
+ 6. ラベル付与(プロジェクトラベル + doc_type)
37
+ 7. ステークホルダーにメンション通知
38
+
39
+ ## 生成されるConfluenceページ
40
+
41
+ **タイトル**: `[プロジェクト名] <feature> <doc_type>`
42
+ **スペース**: PRD(要件・設計)/ QA(テスト)
43
+ **ラベル**: project:<project_id>, <doc_type>, <feature_name>, github-sync
44
+
45
+ **ページ構成**:
46
+ - GitHub連携情報(最新版へのリンク)
47
+ - 変換されたMarkdownコンテンツ
48
+ - 承認マクロ(企画・部長への承認依頼)
49
+
50
+ ## 実装
51
+
52
+ スクリプトを直接実行:
53
+
54
+ ```bash
55
+ npm run confluence:sync <feature_name> [doc_type]
56
+ ```
57
+
58
+ 内部的に `scripts/confluence-sync.ts` を実行します。
59
+
60
+ ## 前提条件
61
+
62
+ - `.env` ファイルに Atlassian 認証情報が設定されている
63
+ - `{{KIRO_DIR}}/project.json` が存在する
64
+ - 同期する Markdown ファイルが存在する
65
+
66
+ ## トラブルシューティング
67
+
68
+ ### 認証エラー
69
+ `.env` の `ATLASSIAN_API_TOKEN` を確認してください。
70
+
71
+ ### ページが見つからない
72
+ Confluence スペースキー(PRD)が正しいか確認してください。
73
+
74
+ ### Markdown変換エラー
75
+ Markdown形式が正しいか確認してください。
76
+
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: /michi:project-switch
3
+ description: プロジェクトを切り替える
4
+ ---
5
+
6
+ # プロジェクト切り替えコマンド
7
+
8
+ {{DEV_GUIDELINES}}
9
+
10
+ 複数プロジェクトを管理している場合、プロジェクトを切り替えるコマンドです。
11
+
12
+ ## 使い方
13
+
14
+ ```
15
+ /michi:project-switch <project_id>
16
+ ```
17
+
18
+ **パラメータ**:
19
+ - `project_id`: プロジェクトID(例: customer-a-service-1, michi)
20
+
21
+ **例**:
22
+ ```
23
+ /michi:project-switch michi
24
+ /michi:project-switch customer-a-service-1
25
+ ```
26
+
27
+ ## 実行内容
28
+
29
+ 1. プロジェクトIDに対応するGitHubリポジトリを特定
30
+ 2. ローカルにクローン(未クローンの場合)またはチェックアウト
31
+ 3. `{{KIRO_DIR}}/project.json` を読み込んで表示
32
+ 4. 対応するConfluenceプロジェクトページのURLを表示
33
+ 5. JIRAプロジェクトダッシュボードのURLを表示
34
+
35
+ ## 出力例
36
+
37
+ ```
38
+ ✅ プロジェクト切り替え: michi
39
+
40
+ プロジェクト情報:
41
+ 名前: Michi - Managed Intelligent Comprehensive Hub for Integration
42
+ JIRA: MICHI
43
+ Confluence Labels: project:michi, service:hub
44
+ ステータス: active
45
+ チーム: @arigatatsuya
46
+
47
+ リンク:
48
+ 📄 Confluence: https://your-domain.atlassian.net/wiki/spaces/PRD/pages/
49
+ 🎯 JIRA Dashboard: https://your-domain.atlassian.net/jira/projects/MICHI
50
+ 🐙 GitHub: https://github.com/sk8metalme/michi
51
+ ```
52
+
53
+ ## ターミナル実行
54
+
55
+ ```bash
56
+ # リポジトリをクローン/チェックアウト
57
+ cd ~/work/projects
58
+ jj git clone https://github.com/org/<project_id>
59
+ cd <project_id>
60
+
61
+ # プロジェクト情報を表示
62
+ cat {{KIRO_DIR}}/project.json
63
+ ```
64
+
65
+ ## 関連コマンド
66
+
67
+ - `/michi:project-list`: すべてのプロジェクトを一覧表示
68
+ - `/kiro:spec-status`: 現在のプロジェクトの仕様ステータスを表示(cc-sdd標準コマンド)
69
+
@@ -0,0 +1,188 @@
1
+ ---
2
+ title: Atlassian MCP Integration Rules
3
+ description: {{DEV_GUIDELINES}} for MCP integration with Confluence/JIRA
4
+ ---
5
+
6
+ # Atlassian MCP Integration Rules
7
+
8
+ ## Prerequisites
9
+
10
+ Atlassian MCP server must be configured in Cursor:
11
+ - Credentials set in `~/.cursor/mcp.json`
12
+
13
+ Reference: [Atlassian MCP](https://www.atlassian.com/ja/platform/remote-mcp-server)
14
+
15
+ ## Available MCP Tools
16
+
17
+ Cursor AI can use the following tools:
18
+
19
+ ### Confluence
20
+ - `confluence_create_page`: Create page
21
+ - `confluence_update_page`: Update page
22
+ - `confluence_search`: Search pages
23
+ - `confluence_get_page`: Get page
24
+
25
+ ### JIRA
26
+ - `jira_create_issue`: Create issue
27
+ - `jira_update_issue`: Update issue
28
+ - `jira_search`: Search issues
29
+ - `jira_get_issue`: Get issue
30
+
31
+ ## Workflow Integration
32
+
33
+ ⚠️ **Important**: **Always use REST API scripts** for page/issue creation and updates. Use MCP tools only for reference and search operations.
34
+
35
+ ### Requirements Phase
36
+
37
+ After generating `.kiro/specs/<feature>/requirements.md`:
38
+
39
+ ```
40
+ Run script (required):
41
+ npm run phase:run <feature> requirements
42
+
43
+ Execution:
44
+ 1. Load project metadata (.kiro/project.json)
45
+ 2. Convert Markdown (markdown-to-confluence.ts)
46
+ 3. Create page via REST API (confluence-sync.ts)
47
+ 4. Auto-update spec.json
48
+ 5. Run validation
49
+ ```
50
+
51
+ ### Design Phase
52
+
53
+ After generating `.kiro/specs/<feature>/design.md`:
54
+
55
+ ```
56
+ Run script (required):
57
+ npm run phase:run <feature> design
58
+
59
+ Execution:
60
+ 1. Create Confluence page via REST API (confluence-sync.ts)
61
+ 2. Auto-update spec.json
62
+ 3. Run validation
63
+ ```
64
+
65
+ ### Task Breakdown Phase
66
+
67
+ After generating `.kiro/specs/<feature>/tasks.md`:
68
+
69
+ ```
70
+ Run script (required):
71
+ npm run phase:run <feature> tasks
72
+
73
+ Execution:
74
+ 1. Create Epic via REST API (jira-sync.ts)
75
+ 2. Create Stories via REST API (all stories, jira-sync.ts)
76
+ 3. Set story points
77
+ 4. Auto-update spec.json
78
+ 5. Run validation
79
+ ```
80
+
81
+ ### Implementation Phase
82
+
83
+ Update JIRA when starting and completing implementation (MCP for single reference operations, scripts recommended for multiple updates):
84
+
85
+ ```
86
+ Option 1: MCP tool (for single update)
87
+ jira_update_issue({
88
+ issue_key: "{{JIRA_PROJECT_KEY}}-123",
89
+ status: "In Progress"
90
+ })
91
+
92
+ Option 2: REST API script (for bulk updates)
93
+ npm run jira:sync <feature>
94
+ ```
95
+
96
+ ## MCP Usage Guidelines
97
+
98
+ ### When to Use MCP
99
+
100
+ ✅ **Recommended (reference/search only)**:
101
+ - Search/get Confluence pages (reference purpose)
102
+ - Search/get JIRA issues (reference purpose)
103
+ - Single operation information retrieval
104
+ - Interactive information checking within Cursor AI
105
+
106
+ ❌ **Prohibited (creation/update)**:
107
+ - Confluence page creation/update → **Scripts required**
108
+ - JIRA issue creation/update → **Scripts required**
109
+ - Bulk operations (10+ pages/issues) → **Scripts required**
110
+ - Complex workflows → **Scripts required**
111
+
112
+ ### MCP vs REST API Scripts
113
+
114
+ | Use Case | Method | Reason |
115
+ |----------|--------|--------|
116
+ | Page/Issue creation | **REST API Script** | Rate limit handling, error handling, bulk processing |
117
+ | Page/Issue update | **REST API Script** | Rate limit handling, error handling |
118
+ | Page/Issue search (reference) | MCP | Simple, AI integration |
119
+ | Page/Issue get (reference) | MCP | Simple, AI integration |
120
+
121
+ ## Rate Limiting
122
+
123
+ Atlassian rate limits vary by product (Confluence/JIRA), tenant, app context, and plan, controlled via quota/burst mode or per-minute windows.
124
+
125
+ **Confluence Cloud**:
126
+ - Migration: 6,000-12,000 requests/minute
127
+ - General use: Quota + burst mode (~10s burst window, 1h quota window)
128
+
129
+ **JIRA Cloud**:
130
+ - Cost/quota-based limits (per app, per user, app+user)
131
+ - Issue write limits: 20 ops/2s, 100 ops/30s
132
+
133
+ Rate limit violations return `429` response with `Retry-After` and `X-RateLimit-*` headers for retry guidance.
134
+
135
+ **Recommended Mitigation**:
136
+ - Detect and honor response headers (`Retry-After`, `X-RateLimit-*`)
137
+ - Implement exponential backoff + jitter retry
138
+ - Use caching and batch processing
139
+ - For frequent operations, use REST API (fine-grained control)
140
+
141
+ **Official Documentation**:
142
+ - [Confluence API Rate Limiting](https://developer.atlassian.com/cloud/confluence/rate-limiting/)
143
+ - [JIRA API Rate Limiting](https://developer.atlassian.com/cloud/jira/platform/rate-limiting/)
144
+ - [App Migration Rate Limiting](https://developer.atlassian.com/platform/app-migration/rate-limiting/)
145
+
146
+ ## Using Project Metadata
147
+
148
+ ### When Calling MCP Tools
149
+
150
+ ```typescript
151
+ // Load project metadata
152
+ const projectMeta = JSON.parse(
153
+ fs.readFileSync('.kiro/project.json', 'utf-8')
154
+ );
155
+
156
+ // Use with MCP tools
157
+ confluence_create_page({
158
+ space: "PRD",
159
+ title: `[${projectMeta.projectName}] ...`,
160
+ labels: [...projectMeta.confluenceLabels, ...additionalLabels]
161
+ });
162
+ ```
163
+
164
+ ## Troubleshooting
165
+
166
+ ### MCP Connection Error
167
+
168
+ 1. Restart Cursor
169
+ 2. Verify credentials in `~/.cursor/mcp.json`
170
+ 3. Check Atlassian API Token validity
171
+
172
+ ### Rate Limit Error
173
+
174
+ Use rate-limit-ready scripts:
175
+ ```bash
176
+ # Rate limit handling (500ms wait) implemented
177
+ npm run confluence:sync <feature>
178
+ npm run jira:sync <feature>
179
+
180
+ # Adjust wait time (default: 500ms, in milliseconds)
181
+ ATLASSIAN_REQUEST_DELAY=1000 npm run jira:sync <feature>
182
+ ```
183
+
184
+ ### Page Creation Error
185
+
186
+ - Verify Confluence space exists
187
+ - Check for duplicate page titles
188
+ - Verify permissions
@@ -0,0 +1,151 @@
1
+ ---
2
+ title: GitHub Single Source of Truth Rules
3
+ description: {{DEV_GUIDELINES}} for using GitHub as SSoT and syncing with Confluence
4
+ ---
5
+
6
+ # GitHub Single Source of Truth (SSoT) Rules
7
+
8
+ ## Basic Principles
9
+
10
+ ### Single Source of Truth
11
+ - **All specifications managed in GitHub** (.kiro/specs/)
12
+ - Confluence is **for reference and approval only** (edit only in GitHub)
13
+ - Avoid dual management
14
+
15
+ ### Data Flow
16
+ ```
17
+ GitHub (.kiro/specs/) ← Source of Truth (editable)
18
+ ↓ sync
19
+ Confluence ← View & Approval only (read-only)
20
+ ```
21
+
22
+ ## File Structure
23
+
24
+ ### GitHub Repository
25
+ ```
26
+ .kiro/
27
+ ├── project.json # Project metadata
28
+ ├── specs/
29
+ │ └── <feature>/
30
+ │ ├── requirements.md # Requirements definition
31
+ │ ├── design.md # Design
32
+ │ ├── tasks.md # Task breakdown
33
+ │ └── test-report.md # Test results
34
+ └── settings/
35
+ └── templates/ # Templates
36
+ ```
37
+
38
+ ## Workflow
39
+
40
+ ### 1. Generate Markdown → GitHub
41
+ ```
42
+ Cursor: /michi:spec-requirements <feature>
43
+ ↓ Generate: .kiro/specs/<feature>/requirements.md
44
+
45
+ jj commit -m "docs: Add requirements"
46
+ jj git push
47
+ ```
48
+
49
+ ### 2. GitHub → Confluence Sync
50
+ ```
51
+ Cursor AI (using MCP):
52
+ 1. Get GitHub URL
53
+ 2. Convert Markdown → Confluence Storage Format
54
+ 3. Create page with confluence_create_page()
55
+ 4. Embed GitHub link
56
+ ```
57
+
58
+ ### 3. Approval in Confluence
59
+ - Planners/Managers review in Confluence
60
+ - Approve via Page Properties
61
+ - After approval → Proceed to next phase
62
+
63
+ ### 4. Technical Review in GitHub
64
+ - Engineers review Markdown in GitHub
65
+ - Comment/suggest changes in PR format (optional)
66
+ - After merge, auto-update Confluence
67
+
68
+ ## Confluence Page Structure
69
+
70
+ ### Template Structure
71
+ ```markdown
72
+ ## GitHub Integration
73
+ 📄 Latest version managed in [GitHub](URL)
74
+ Edit in GitHub, auto-synced to Confluence
75
+
76
+ ---
77
+
78
+ {Converted Markdown}
79
+
80
+ ---
81
+
82
+ ## Approval
83
+ {approval macro}
84
+ Approvers: @Planner, @Manager
85
+ {/approval}
86
+ ```
87
+
88
+ ## Review Flow Separation
89
+
90
+ ### Engineer Review (GitHub)
91
+ - Target: requirements.md, design.md, tasks.md
92
+ - Method: GitHub PR, comments
93
+ - Focus: Technical accuracy, feasibility
94
+
95
+ ### Planner/Manager Review (Confluence)
96
+ - Target: Requirements, design, estimates
97
+ - Method: Confluence comments, approval macro
98
+ - Focus: Business requirements, priority, budget
99
+
100
+ ## Update Synchronization
101
+
102
+ ### On GitHub Update
103
+ ```
104
+ GitHub push
105
+ ↓ Webhook (optional)
106
+ Confluence auto-update
107
+ ```
108
+
109
+ ### Manual Sync
110
+ ```bash
111
+ # Run command
112
+ /michi:confluence-sync <feature>
113
+
114
+ # Or npm script
115
+ npm run confluence:sync <feature>
116
+ ```
117
+
118
+ ## Benefits
119
+
120
+ ✅ **Version Control**: All change history in GitHub
121
+ ✅ **Zero Dual Management**: Confluence for reference only
122
+ ✅ **Engineer-Friendly**: Markdown, Git, PR
123
+ ✅ **Planner/Manager-Friendly**: Confluence's user-friendly UI
124
+ ✅ **Auto Sync**: Push = Confluence update
125
+ ✅ **Audit Trail**: GitHub as official record
126
+
127
+ ## Prohibited Actions
128
+
129
+ ❌ Direct editing in Confluence
130
+ ❌ Managing in both GitHub and Confluence
131
+ ❌ Reverse sync from Confluence to GitHub
132
+
133
+ ## Exception Cases
134
+
135
+ Direct creation in Confluence allowed only for:
136
+ - Meeting minutes
137
+ - Temporary notes
138
+ - Documents outside the project
139
+
140
+ ## Troubleshooting
141
+
142
+ ### If Confluence is outdated
143
+ ```bash
144
+ # Manually re-sync
145
+ /michi:confluence-sync <feature>
146
+ ```
147
+
148
+ ### On sync error
149
+ 1. Verify GitHub Markdown is correct
150
+ 2. Check Confluence API authentication
151
+ 3. Verify page ID is correct
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: Multi-Project Management Rules
3
+ description: {{DEV_GUIDELINES}} for managing multiple concurrent projects with naming conventions and workflows
4
+ ---
5
+
6
+ # Multi-Project Management Rules
7
+
8
+ ## Project Identification
9
+
10
+ ### Loading Project Metadata
11
+ - Reference `.kiro/project.json` in all operations
12
+ - Retrieve project ID, JIRA key, and Confluence labels
13
+ - Use project information dynamically
14
+
15
+ ### Example
16
+ ```typescript
17
+ const projectMeta = JSON.parse(fs.readFileSync('.kiro/project.json', 'utf8'));
18
+ // projectMeta.projectId
19
+ // projectMeta.jiraProjectKey
20
+ // projectMeta.confluenceLabels
21
+ ```
22
+
23
+ ## Naming Conventions
24
+
25
+ ### Confluence Pages
26
+ - Format: `[{projectName}] {document_type}`
27
+ - Example: `[Company-A-Service1] Requirements`
28
+ - Example: `[{{PROJECT_ID}}] User Auth Design`
29
+
30
+ ### JIRA Epic/Story
31
+ - Epic: `[{projectName}] {feature_name}`
32
+ - Story: `[{projectName}] {task_name}`
33
+ - Example: `[{{PROJECT_ID}}] User Authentication Feature`
34
+
35
+ ### GitHub Branches
36
+ - Format: `{projectId}/feature/{feature_name}`
37
+ - Example: `{{PROJECT_ID}}/feature/user-auth`
38
+ - Example: `customer-a-service-1/feature/payment`
39
+
40
+ ### Label Assignment
41
+ - Confluence: `projectMeta.confluenceLabels` + `requirements|design|tasks`
42
+ - JIRA: `projectMeta.confluenceLabels` + feature name
43
+
44
+ ## Cross-Project Views
45
+
46
+ ### Confluence Dashboard
47
+ - Display requirements, design, tasks across all projects
48
+ - Filter by labels
49
+ - Filter by status (Pending Review, Approved)
50
+
51
+ ### JIRA Dashboard
52
+ - Track progress by project key
53
+ - Filter: `project IN ({{JIRA_PROJECT_KEY}}, PRJA, PRJB)`
54
+ - Aggregate story points
55
+
56
+ ## Unified Workflow
57
+
58
+ Use the same workflow across all projects:
59
+
60
+ 1. `/michi:spec-init` → Specification initialization
61
+ 2. `/michi:spec-requirements` → Requirements definition (Confluence sync)
62
+ 3. `/michi:spec-design` → Design (Confluence sync + estimation)
63
+ 4. `/michi:spec-tasks` → Task breakdown (JIRA integration)
64
+ 5. `/michi:spec-impl` → TDD implementation
65
+ 6. GitHub PR → Review
66
+ 7. Release preparation
67
+
68
+ ## Project Switching
69
+
70
+ When switching between multiple projects:
71
+
72
+ 1. Check out repository
73
+ 2. Verify `.kiro/project.json`
74
+ 3. Open corresponding Confluence/JIRA pages
75
+
76
+ ## Important Notes
77
+
78
+ - Maintain independent `.kiro/project.json` for each project
79
+ - Ensure JIRA project keys are unique
80
+ - Identify projects by Confluence labels
81
+ - Include project ID in GitHub branch names
@@ -1,52 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 環境変数設定スクリプト
4
- # このスクリプトは.envファイルのテンプレートを作成します
5
-
6
- # 既存の.envファイルがある場合は確認
7
- if [ -f .env ]; then
8
- echo "⚠️ .env ファイルが既に存在します"
9
- read -p "上書きしますか? (y/N): " -n 1 -r
10
- echo
11
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
12
- echo "キャンセルしました"
13
- exit 0
14
- fi
15
- fi
16
-
17
- cat > .env << 'EOF'
18
- # Atlassian設定(MCP + REST API共通)
19
- ATLASSIAN_URL=https://your-domain.atlassian.net
20
- ATLASSIAN_EMAIL=your-email@company.com
21
- ATLASSIAN_API_TOKEN=your-token-here
22
-
23
- # GitHub設定
24
- GITHUB_ORG=your-org
25
- GITHUB_TOKEN=ghp_xxx
26
- GITHUB_REPO=sk8metalme/michi
27
-
28
- # Confluence共有スペース
29
- CONFLUENCE_PRD_SPACE=PRD
30
- CONFLUENCE_QA_SPACE=QA
31
- CONFLUENCE_RELEASE_SPACE=RELEASE
32
-
33
- # JIRAプロジェクトキー(カンマ区切り)
34
- JIRA_PROJECT_KEYS=MICHI,PRJA,PRJB
35
-
36
- # Slack通知用(オプション)
37
- SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx
38
- EOF
39
-
40
- # セキュアなパーミッション設定(所有者のみ読み取り/書き込み可能)
41
- chmod 600 .env
42
-
43
- echo "✅ .env ファイルが作成されました"
44
- echo "✅ パーミッション 600 を設定しました(所有者のみ読み取り/書き込み可能)"
45
- echo ""
46
- echo "⚠️ 重要: .env ファイルをGitにコミットしないでください"
47
- echo " .gitignore で除外されていることを確認してください"
48
- echo ""
49
- echo "📝 次のステップ:"
50
- echo " 1. 実際の認証情報で .env の値を更新してください"
51
- echo " 2. セットアップ手順に従ってください"
52
-