@sk8metal/michi-cli 0.11.0 → 0.12.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.
- package/README.md +3 -10
- package/dist/scripts/constants/environments.d.ts +1 -1
- package/dist/scripts/constants/environments.d.ts.map +1 -1
- package/dist/scripts/constants/environments.js +0 -20
- package/dist/scripts/constants/environments.js.map +1 -1
- package/dist/scripts/utils/template-finder.d.ts +2 -2
- package/dist/scripts/utils/template-finder.d.ts.map +1 -1
- package/dist/scripts/utils/template-finder.js +3 -8
- package/dist/scripts/utils/template-finder.js.map +1 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +0 -8
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/init.d.ts +0 -4
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +6 -30
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/setup-existing.d.ts +2 -6
- package/dist/src/commands/setup-existing.d.ts.map +1 -1
- package/dist/src/commands/setup-existing.js +8 -142
- package/dist/src/commands/setup-existing.js.map +1 -1
- package/docs/getting-started/configuration.md +0 -29
- package/docs/getting-started/quick-start.md +2 -2
- package/docs/guides/workflow.md +1 -1
- package/docs/reference/cli.md +0 -4
- package/docs/troubleshooting.md +0 -45
- package/package.json +1 -3
- package/scripts/__tests__/create-project.test.ts +12 -12
- package/scripts/__tests__/setup-existing-project.test.ts +22 -22
- package/scripts/constants/__tests__/environments.test.ts +7 -50
- package/scripts/constants/environments.ts +1 -27
- package/scripts/template/__tests__/renderer.test.ts +21 -21
- package/scripts/utils/template-finder.ts +5 -11
- package/docs/guides/ai-tools.md +0 -311
- package/templates/cline/rules/atlassian-integration.md +0 -36
- package/templates/cline/rules/michi-core.md +0 -56
- package/templates/codex/AGENTS.override.md +0 -277
- package/templates/codex/prompts/confluence-sync.md +0 -177
- package/templates/codex/rules/README.md +0 -210
- package/templates/cursor/commands/kiro/kiro-spec-impl.md +0 -244
- package/templates/cursor/commands/kiro/kiro-spec-tasks.md +0 -354
- package/templates/cursor/commands/michi/confluence-sync.md +0 -76
- package/templates/cursor/commands/michi/project-switch.md +0 -69
- package/templates/cursor/commands/michi/spec-tasks.md +0 -117
- package/templates/cursor/rules/atlassian-mcp.mdc +0 -188
- package/templates/cursor/rules/github-ssot.mdc +0 -151
- package/templates/cursor/rules/multi-project.mdc +0 -81
- package/templates/gemini/commands/README.md +0 -41
- package/templates/gemini/rules/GEMINI.md +0 -80
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Michi Core Principles
|
|
2
|
-
|
|
3
|
-
## Development Guidelines
|
|
4
|
-
{{DEV_GUIDELINES}}
|
|
5
|
-
|
|
6
|
-
## Language
|
|
7
|
-
All generated documents should be in: **{{LANG_CODE}}**
|
|
8
|
-
|
|
9
|
-
Reference the language field in {{KIRO_DIR}}/project.json.
|
|
10
|
-
|
|
11
|
-
## Single Source of Truth (SSoT)
|
|
12
|
-
|
|
13
|
-
### GitHub as SSoT
|
|
14
|
-
- **All specifications are managed in GitHub** ({{KIRO_DIR}}/specs/)
|
|
15
|
-
- Confluence is **reference and approval only** (editing is GitHub only)
|
|
16
|
-
- Avoid duplicate management
|
|
17
|
-
|
|
18
|
-
### Data Flow
|
|
19
|
-
```
|
|
20
|
-
GitHub ({{KIRO_DIR}}/specs/) ← Source of truth (editable)
|
|
21
|
-
↓ sync
|
|
22
|
-
Confluence ← Display and approval (read-only)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Multi-Project Management
|
|
26
|
-
|
|
27
|
-
### Project Identification
|
|
28
|
-
- All operations reference {{KIRO_DIR}}/project.json
|
|
29
|
-
- Dynamically use project ID, JIRA key, Confluence labels
|
|
30
|
-
- Project ID: {{PROJECT_ID}}
|
|
31
|
-
|
|
32
|
-
### Naming Conventions
|
|
33
|
-
|
|
34
|
-
#### Confluence Pages
|
|
35
|
-
- Format: `[{projectName}] {document_type}`
|
|
36
|
-
- Example: `[{{PROJECT_ID}}] Requirements`
|
|
37
|
-
|
|
38
|
-
#### JIRA Epic/Story
|
|
39
|
-
- Format: `[{JIRA_KEY}] {title}`
|
|
40
|
-
- Use project metadata from {{KIRO_DIR}}/project.json
|
|
41
|
-
|
|
42
|
-
## Project Structure
|
|
43
|
-
|
|
44
|
-
- Project metadata: {{KIRO_DIR}}/project.json
|
|
45
|
-
- Specifications: {{KIRO_DIR}}/specs/
|
|
46
|
-
- Templates: {{KIRO_DIR}}/settings/templates/
|
|
47
|
-
- Steering: {{KIRO_DIR}}/steering/
|
|
48
|
-
- Rules: {{AGENT_DIR}}/rules/
|
|
49
|
-
|
|
50
|
-
## Best Practices
|
|
51
|
-
|
|
52
|
-
1. **Always reference project.json** for project-specific metadata
|
|
53
|
-
2. **Use SSoT principle** - Edit in GitHub, reference in Confluence
|
|
54
|
-
3. **Follow naming conventions** for consistency
|
|
55
|
-
4. **Generate specs incrementally** - Requirements → Design → Tasks
|
|
56
|
-
5. **Commit frequently** to GitHub
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
# AGENTS.override.md - Michi Project Extensions
|
|
2
|
-
|
|
3
|
-
このファイルはcc-sddのAGENTS.mdを拡張し、Michi固有のワークフローとルールを追加します。
|
|
4
|
-
|
|
5
|
-
## Michi Overview
|
|
6
|
-
|
|
7
|
-
**Michi**は、AI駆動開発を支援するプロジェクト管理・ドキュメント管理フレームワークです。Claude Code、Cursor、Codex CLI、Claude Agent SDKと統合し、効率的な開発フローを実現します。
|
|
8
|
-
|
|
9
|
-
- **Repository**: https://github.com/sk8metalme/michi
|
|
10
|
-
- **Documentation**: `docs/user-guide/`
|
|
11
|
-
- **License**: MIT
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Michi-Specific Workflows
|
|
16
|
-
|
|
17
|
-
### 1. Confluence Integration
|
|
18
|
-
|
|
19
|
-
#### Confluence同期コマンド
|
|
20
|
-
```bash
|
|
21
|
-
/prompts:confluence-sync FEATURE=<機能名>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
#### 必要な環境変数
|
|
25
|
-
```bash
|
|
26
|
-
ATLASSIAN_URL=https://your-domain.atlassian.net
|
|
27
|
-
ATLASSIAN_EMAIL=your-email@example.com
|
|
28
|
-
ATLASSIAN_API_TOKEN=your-api-token
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
#### プロジェクト設定
|
|
32
|
-
`.kiro/project.json`に以下を設定:
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"confluenceSpaceKey": "YOUR_SPACE",
|
|
36
|
-
"confluenceLabels": ["ai-development", "michi"]
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
#### 同期対象
|
|
41
|
-
- 要件定義書(requirements.md)→ Confluenceページ
|
|
42
|
-
- 設計書(design.md)→ Confluenceページ
|
|
43
|
-
- タスク一覧(tasks.md)→ Confluenceページ(オプション)
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
### 2. JIRA Integration
|
|
48
|
-
|
|
49
|
-
#### プロジェクトキー設定
|
|
50
|
-
`.kiro/project.json`の`jiraProjectKey`を使用してJIRAチケットを管理:
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"jiraProjectKey": "MYPROJ"
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### リリース管理
|
|
58
|
-
- JIRAでリリースバージョンを作成
|
|
59
|
-
- Confluenceでリリース手順書を管理
|
|
60
|
-
- GitHub Releasesと連携
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
### 3. Multi-Language Support
|
|
65
|
-
|
|
66
|
-
Michiは以下の言語とビルドツールをサポート:
|
|
67
|
-
|
|
68
|
-
| 言語 | ビルドツール | テストコマンド |
|
|
69
|
-
|------|------------|---------------|
|
|
70
|
-
| Node.js/TypeScript | npm | `npm test` |
|
|
71
|
-
| Java | **Gradle のみ** | `./gradlew test` |
|
|
72
|
-
| PHP | Composer | `composer test` |
|
|
73
|
-
|
|
74
|
-
**重要:** Javaプロジェクトでは**Gradleのみ**を使用してください。Mavenは使用しません。
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
### 4. Test Strategy - Master Test Approach
|
|
79
|
-
|
|
80
|
-
Michiは**マスタテスト方式**を採用しています:
|
|
81
|
-
|
|
82
|
-
#### 基本原則
|
|
83
|
-
- テストは常に最新の仕様を反映(phase-0、phase-1のような履歴管理はしない)
|
|
84
|
-
- 仕様変更時は既存のテストファイルを更新
|
|
85
|
-
- テスト実行時間を一定に保つ
|
|
86
|
-
|
|
87
|
-
#### Phase構成
|
|
88
|
-
- **Phase A**: PR時に自動実行
|
|
89
|
-
- Unit tests
|
|
90
|
-
- Lint
|
|
91
|
-
- Build
|
|
92
|
-
- **Phase B**: リリース前に手動実行
|
|
93
|
-
- Integration tests
|
|
94
|
-
- E2E tests
|
|
95
|
-
- Performance tests
|
|
96
|
-
- Security tests
|
|
97
|
-
|
|
98
|
-
#### テストカバレッジ
|
|
99
|
-
- 目標: **95%以上**
|
|
100
|
-
- テストは仕様として扱う
|
|
101
|
-
- 実装に合わせてテストを変更しない(仕様通りでない場合のみ修正)
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
### 5. CI/CD Integration
|
|
106
|
-
|
|
107
|
-
#### サポート対象
|
|
108
|
-
- **GitHub Actions**
|
|
109
|
-
- **Screwdriver**
|
|
110
|
-
|
|
111
|
-
#### 推奨ワークフロー
|
|
112
|
-
```yaml
|
|
113
|
-
# .github/workflows/ci.yml
|
|
114
|
-
name: CI
|
|
115
|
-
on: [pull_request]
|
|
116
|
-
jobs:
|
|
117
|
-
test:
|
|
118
|
-
runs-on: ubuntu-latest
|
|
119
|
-
steps:
|
|
120
|
-
- uses: actions/checkout@v3
|
|
121
|
-
- name: Run Phase A Tests
|
|
122
|
-
run: |
|
|
123
|
-
npm install
|
|
124
|
-
npm run test:unit
|
|
125
|
-
npm run lint
|
|
126
|
-
npm run build
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
### 6. Release Flow
|
|
132
|
-
|
|
133
|
-
#### セマンティックバージョニング
|
|
134
|
-
```
|
|
135
|
-
v<major>.<minor>.<patch>
|
|
136
|
-
例: v1.2.3
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
#### リリース手順
|
|
140
|
-
1. **Confluenceでリリース手順書作成**
|
|
141
|
-
- テンプレート: `.kiro/templates/release-procedure.md`
|
|
142
|
-
2. **JIRAでリリースチケット起票**
|
|
143
|
-
- チケットタイプ: Release
|
|
144
|
-
- バージョン: 自動生成
|
|
145
|
-
3. **GitHub Releaseの作成**
|
|
146
|
-
- リリースノート自動生成
|
|
147
|
-
- タグ付け
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Coding Standards
|
|
152
|
-
|
|
153
|
-
### TypeScript/Node.js
|
|
154
|
-
- **Style Guide**: Airbnb JavaScript Style Guide準拠
|
|
155
|
-
- **Linter**: ESLint
|
|
156
|
-
- **Formatter**: Prettier
|
|
157
|
-
- **Type Checking**: `tsc --noEmit`
|
|
158
|
-
|
|
159
|
-
### Java (Gradle)
|
|
160
|
-
- **Style Guide**: Google Java Style Guide
|
|
161
|
-
- **Build Tool**: Gradle 8.x
|
|
162
|
-
- **Test Framework**: JUnit 5
|
|
163
|
-
- **Coverage**: JaCoCo
|
|
164
|
-
|
|
165
|
-
### PHP
|
|
166
|
-
- **Style Guide**: PSR-12
|
|
167
|
-
- **Build Tool**: Composer
|
|
168
|
-
- **Test Framework**: PHPUnit
|
|
169
|
-
- **Static Analysis**: PHPStan
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## File Structure Standards
|
|
174
|
-
|
|
175
|
-
### .kiro/ Directory
|
|
176
|
-
```
|
|
177
|
-
.kiro/
|
|
178
|
-
├── project.json # プロジェクトメタデータ
|
|
179
|
-
├── specs/ # 機能仕様(cc-sdd管理)
|
|
180
|
-
│ └── {feature}/
|
|
181
|
-
│ ├── requirements.md
|
|
182
|
-
│ ├── design.md
|
|
183
|
-
│ ├── tasks.md
|
|
184
|
-
│ └── spec.json
|
|
185
|
-
├── steering/ # AI指導ルール(cc-sdd管理)
|
|
186
|
-
│ ├── structure.md
|
|
187
|
-
│ ├── tech.md
|
|
188
|
-
│ └── product.md
|
|
189
|
-
└── settings/ # 共通ルール(cc-sdd管理)
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Michi Extensions
|
|
193
|
-
```
|
|
194
|
-
.kiro/
|
|
195
|
-
├── project.json # ⭐ Michi固有
|
|
196
|
-
└── templates/ # ⭐ Michi固有
|
|
197
|
-
├── confluence-page.md
|
|
198
|
-
├── jira-ticket.md
|
|
199
|
-
└── release-procedure.md
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## Security Policy
|
|
205
|
-
|
|
206
|
-
### 環境変数管理
|
|
207
|
-
- **絶対禁止**: APIキー、トークンのハードコード
|
|
208
|
-
- **推奨**: `.env`ファイル + `.gitignore`
|
|
209
|
-
- **CI/CD**: GitHub Secrets / Screwdriver Secrets
|
|
210
|
-
|
|
211
|
-
### 依存関係管理
|
|
212
|
-
- 定期的な脆弱性スキャン(`npm audit`, `snyk`)
|
|
213
|
-
- 依存ライブラリの最小化
|
|
214
|
-
- 信頼できるソースからのみダウンロード
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## Workflow Integration
|
|
219
|
-
|
|
220
|
-
### cc-sdd + Michi 連携フロー
|
|
221
|
-
|
|
222
|
-
1. **プロジェクト初期化**
|
|
223
|
-
```bash
|
|
224
|
-
# cc-sddインストール
|
|
225
|
-
npx cc-sdd@latest --codex --lang ja
|
|
226
|
-
|
|
227
|
-
# Michi拡張インストール
|
|
228
|
-
npx michi setup --codex
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
2. **仕様作成(cc-sdd)**
|
|
232
|
-
```bash
|
|
233
|
-
/kiro:spec-init FEATURE=user-auth
|
|
234
|
-
/kiro:spec-requirements FEATURE=user-auth
|
|
235
|
-
/kiro:spec-design FEATURE=user-auth
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
3. **Confluence同期(Michi)**
|
|
239
|
-
```bash
|
|
240
|
-
/prompts:confluence-sync FEATURE=user-auth
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
4. **実装とテスト(cc-sdd + TDD)**
|
|
244
|
-
```bash
|
|
245
|
-
/michi:spec-tasks FEATURE=user-auth
|
|
246
|
-
/kiro:spec-impl FEATURE=user-auth
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
5. **検証(cc-sdd)**
|
|
250
|
-
```bash
|
|
251
|
-
/kiro:validate-impl FEATURE=user-auth
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## Communication Guidelines
|
|
257
|
-
|
|
258
|
-
### 日本語優先
|
|
259
|
-
- コミュニケーションは日本語を基本とする
|
|
260
|
-
- 技術用語は適切に英語/日本語を使い分ける
|
|
261
|
-
|
|
262
|
-
### 質問と確認
|
|
263
|
-
- 不明な点は必ず質問し精度を高めることを最優先する
|
|
264
|
-
- AskUserQuestionツールを積極的に活用
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
|
|
268
|
-
## Reference Links
|
|
269
|
-
|
|
270
|
-
- [Michi Documentation](https://github.com/sk8metalme/michi/tree/main/docs)
|
|
271
|
-
- [cc-sdd Documentation](https://github.com/gotalab/cc-sdd)
|
|
272
|
-
- [Confluence API](https://developer.atlassian.com/cloud/confluence/rest/v2/)
|
|
273
|
-
- [JIRA API](https://developer.atlassian.com/cloud/jira/platform/rest/v3/)
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
**Note**: このファイルはCodex CLIの`AGENTS.md`を上書き(override)するものではなく、cc-sddの基本ルールに**追加**される形で適用されます。
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Confluenceへのドキュメント同期 - Michi仕様書をConfluenceに連携
|
|
3
|
-
argument-hint: [FEATURE=<機能名>]
|
|
4
|
-
---
|
|
5
|
-
# Michi Confluence Sync
|
|
6
|
-
|
|
7
|
-
機能「$1」の仕様ドキュメントをConfluenceに同期します。
|
|
8
|
-
|
|
9
|
-
## 前提条件
|
|
10
|
-
|
|
11
|
-
### 環境変数の設定
|
|
12
|
-
以下の環境変数が必要です:
|
|
13
|
-
```bash
|
|
14
|
-
ATLASSIAN_URL=https://your-domain.atlassian.net
|
|
15
|
-
ATLASSIAN_EMAIL=your-email@example.com
|
|
16
|
-
ATLASSIAN_API_TOKEN=your-api-token
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### プロジェクトメタデータ
|
|
20
|
-
`.kiro/project.json`に以下が設定されていること:
|
|
21
|
-
- `confluenceSpaceKey`: Confluenceスペースキー
|
|
22
|
-
- `confluenceLabels`: 自動付与するラベル
|
|
23
|
-
|
|
24
|
-
## 同期対象ファイル
|
|
25
|
-
|
|
26
|
-
以下のファイルをConfluenceページに変換して同期します:
|
|
27
|
-
|
|
28
|
-
1. **要件定義書**
|
|
29
|
-
- ソース: `.kiro/specs/$1/requirements.md`
|
|
30
|
-
- タイトル: `[$1] 要件定義`
|
|
31
|
-
|
|
32
|
-
2. **設計ドキュメント**
|
|
33
|
-
- ソース: `.kiro/specs/$1/design.md`
|
|
34
|
-
- タイトル: `[$1] 設計書`
|
|
35
|
-
|
|
36
|
-
3. **タスク一覧**(オプション)
|
|
37
|
-
- ソース: `.kiro/specs/$1/tasks.md`
|
|
38
|
-
- タイトル: `[$1] タスク管理`
|
|
39
|
-
|
|
40
|
-
## 実行手順
|
|
41
|
-
|
|
42
|
-
### 1. 環境変数の確認
|
|
43
|
-
```typescript
|
|
44
|
-
// 必要な環境変数をチェック
|
|
45
|
-
const requiredEnvVars = [
|
|
46
|
-
'ATLASSIAN_URL',
|
|
47
|
-
'ATLASSIAN_EMAIL',
|
|
48
|
-
'ATLASSIAN_API_TOKEN'
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
for (const envVar of requiredEnvVars) {
|
|
52
|
-
if (!process.env[envVar]) {
|
|
53
|
-
console.error(`❌ ${envVar} が設定されていません`);
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 2. プロジェクトメタデータの読み込み
|
|
60
|
-
```typescript
|
|
61
|
-
import { readFileSync } from 'fs';
|
|
62
|
-
|
|
63
|
-
const projectMeta = JSON.parse(
|
|
64
|
-
readFileSync('.kiro/project.json', 'utf-8')
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const spaceKey = projectMeta.confluenceSpaceKey;
|
|
68
|
-
const labels = projectMeta.confluenceLabels || [];
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 3. Confluence APIクライアントの初期化
|
|
72
|
-
```typescript
|
|
73
|
-
import { ConfluenceClient } from '../path/to/confluence-client';
|
|
74
|
-
|
|
75
|
-
const confluence = new ConfluenceClient({
|
|
76
|
-
url: process.env.ATLASSIAN_URL!,
|
|
77
|
-
email: process.env.ATLASSIAN_EMAIL!,
|
|
78
|
-
apiToken: process.env.ATLASSIAN_API_TOKEN!
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 4. Markdownファイルの読み込みと変換
|
|
83
|
-
```typescript
|
|
84
|
-
const requirements = readFileSync(
|
|
85
|
-
`.kiro/specs/$1/requirements.md`,
|
|
86
|
-
'utf-8'
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
// Markdown → Confluence Storage Format変換
|
|
90
|
-
const confluenceHtml = convertMarkdownToConfluence(requirements);
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### 5. ページの作成または更新
|
|
94
|
-
```typescript
|
|
95
|
-
// 既存ページの検索
|
|
96
|
-
const existingPage = await confluence.findPageByTitle(
|
|
97
|
-
spaceKey,
|
|
98
|
-
`[$1] 要件定義`
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
if (existingPage) {
|
|
102
|
-
// 更新
|
|
103
|
-
await confluence.updatePage(existingPage.id, {
|
|
104
|
-
title: `[$1] 要件定義`,
|
|
105
|
-
body: confluenceHtml,
|
|
106
|
-
version: existingPage.version + 1
|
|
107
|
-
});
|
|
108
|
-
console.log('✅ ページを更新しました');
|
|
109
|
-
} else {
|
|
110
|
-
// 新規作成
|
|
111
|
-
const newPage = await confluence.createPage({
|
|
112
|
-
spaceKey,
|
|
113
|
-
title: `[$1] 要件定義`,
|
|
114
|
-
body: confluenceHtml,
|
|
115
|
-
labels
|
|
116
|
-
});
|
|
117
|
-
console.log('✅ ページを作成しました:', newPage.url);
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 6. 同期結果の報告
|
|
122
|
-
```typescript
|
|
123
|
-
console.log('\n📊 Confluence同期結果:');
|
|
124
|
-
console.log(` 機能: $1`);
|
|
125
|
-
console.log(` スペース: ${spaceKey}`);
|
|
126
|
-
console.log(` 同期ファイル数: 2`);
|
|
127
|
-
console.log(` ラベル: ${labels.join(', ')}`);
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## エラーハンドリング
|
|
131
|
-
|
|
132
|
-
### 認証エラー
|
|
133
|
-
```
|
|
134
|
-
❌ Confluence API認証失敗
|
|
135
|
-
- ATLASSIAN_URLが正しいか確認
|
|
136
|
-
- API Tokenが有効か確認
|
|
137
|
-
- メールアドレスが正しいか確認
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### スペースが見つからない
|
|
141
|
-
```
|
|
142
|
-
❌ Confluenceスペースが見つかりません
|
|
143
|
-
- .kiro/project.jsonのconfluenceSpaceKeyを確認
|
|
144
|
-
- スペースへのアクセス権限を確認
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### ページ作成失敗
|
|
148
|
-
```
|
|
149
|
-
❌ ページ作成に失敗しました
|
|
150
|
-
- スペースへの書き込み権限を確認
|
|
151
|
-
- タイトルの重複がないか確認
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Markdown変換の注意点
|
|
155
|
-
|
|
156
|
-
Confluenceは独自のStorage Format(XHTML)を使用するため、以下に注意:
|
|
157
|
-
|
|
158
|
-
- **コードブロック**: \`\`\`言語 → `<ac:structured-macro ac:name="code">`
|
|
159
|
-
- **表**: GitHub Markdown → Confluence Table
|
|
160
|
-
- **画像**: 相対パス → Confluence添付ファイル
|
|
161
|
-
- **リンク**: 他の.mdファイル → Confluenceページリンク
|
|
162
|
-
|
|
163
|
-
## 参考リソース
|
|
164
|
-
|
|
165
|
-
- [Confluence REST API ドキュメント](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/)
|
|
166
|
-
- [Storage Format仕様](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
|
|
167
|
-
- Michiの`scripts/utils/confluence-client.ts`実装を参照
|
|
168
|
-
|
|
169
|
-
## 使用例
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
# Codex CLIから実行
|
|
173
|
-
/prompts:confluence-sync FEATURE=user-authentication
|
|
174
|
-
|
|
175
|
-
# 複数ファイルを一括同期(カスタムスクリプト)
|
|
176
|
-
node scripts/sync-all-specs-to-confluence.js
|
|
177
|
-
```
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
# Codex CLI + Michi Integration Guide
|
|
2
|
-
|
|
3
|
-
## 🎉 Updated Integration with cc-sdd
|
|
4
|
-
|
|
5
|
-
**Good News!** Codex CLIは[cc-sdd](https://github.com/gotalab/cc-sdd)と統合することで、Michiワークフローを完全にサポートできるようになりました。
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
### Step 1: Install cc-sdd (Required)
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npx cc-sdd@latest --codex --lang ja
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
**cc-sddがインストールするもの:**
|
|
16
|
-
- ✅ 11個の `/kiro:*` コマンド(`.codex/commands/`)
|
|
17
|
-
- ✅ `AGENTS.md`(`.codex/docs/`)
|
|
18
|
-
- ✅ `.kiro/` ディレクトリ構造
|
|
19
|
-
- ✅ Spec-Driven Development (SDD) ワークフロー
|
|
20
|
-
|
|
21
|
-
### Step 2: Install Michi Extensions (Automatic)
|
|
22
|
-
|
|
23
|
-
Michiのセットアップ時に自動的にインストールされます:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx @sk8metal/michi-cli setup-existing --codex --lang ja
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
**Michi拡張がインストールするもの:**
|
|
30
|
-
- ✅ `/prompts:confluence-sync` コマンド(Confluence連携)
|
|
31
|
-
- ✅ `AGENTS.override.md`(Michi固有ルール)
|
|
32
|
-
- ✅ `.kiro/project.json`(プロジェクトメタデータ)
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Available Commands
|
|
37
|
-
|
|
38
|
-
### cc-sdd Commands (11 total)
|
|
39
|
-
|
|
40
|
-
| Command | Description |
|
|
41
|
-
|---------|-------------|
|
|
42
|
-
| `/kiro:steering` | プロジェクトメモリの生成・更新 |
|
|
43
|
-
| `/kiro:steering-custom` | ドメイン固有ステアリングファイル作成 |
|
|
44
|
-
| `/kiro:spec-init` | 新規仕様フォルダ初期化 |
|
|
45
|
-
| `/kiro:spec-requirements` | 要件定義書作成(EARS形式) |
|
|
46
|
-
| `/kiro:spec-design` | 設計ドキュメント作成 |
|
|
47
|
-
| `/michi:spec-tasks` | タスク分割(並列実行可能) |
|
|
48
|
-
| `/kiro:spec-impl` | TDDベース実装 |
|
|
49
|
-
| `/kiro:spec-status` | ワークフロー進捗確認 |
|
|
50
|
-
| `/kiro:validate-gap` | 既存コードとのギャップ分析 |
|
|
51
|
-
| `/kiro:validate-design` | 設計レビュー |
|
|
52
|
-
| `/kiro:validate-impl` | 実装品質検証 |
|
|
53
|
-
|
|
54
|
-
### Michi Commands (1 total)
|
|
55
|
-
|
|
56
|
-
| Command | Description |
|
|
57
|
-
|---------|-------------|
|
|
58
|
-
| `/prompts:confluence-sync` | 仕様ドキュメントをConfluenceに同期 |
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Workflow Example
|
|
63
|
-
|
|
64
|
-
### 1. 初期化
|
|
65
|
-
```bash
|
|
66
|
-
/kiro:steering
|
|
67
|
-
```
|
|
68
|
-
→ プロジェクトメモリ(structure.md、tech.md、product.md)を生成
|
|
69
|
-
|
|
70
|
-
### 2. 仕様作成
|
|
71
|
-
```bash
|
|
72
|
-
/kiro:spec-init FEATURE=user-authentication
|
|
73
|
-
/kiro:spec-requirements FEATURE=user-authentication
|
|
74
|
-
/kiro:spec-design FEATURE=user-authentication
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### 3. Confluence同期 (Michi拡張)
|
|
78
|
-
```bash
|
|
79
|
-
/prompts:confluence-sync FEATURE=user-authentication
|
|
80
|
-
```
|
|
81
|
-
→ requirements.mdとdesign.mdをConfluenceページに変換
|
|
82
|
-
|
|
83
|
-
### 4. 実装
|
|
84
|
-
```bash
|
|
85
|
-
/michi:spec-tasks FEATURE=user-authentication
|
|
86
|
-
/kiro:spec-impl FEATURE=user-authentication
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### 5. 検証
|
|
90
|
-
```bash
|
|
91
|
-
/kiro:validate-impl FEATURE=user-authentication
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Confluence Integration Setup
|
|
97
|
-
|
|
98
|
-
### 環境変数設定
|
|
99
|
-
`.env`ファイルに以下を追加:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
ATLASSIAN_URL=https://your-domain.atlassian.net
|
|
103
|
-
ATLASSIAN_EMAIL=your-email@example.com
|
|
104
|
-
ATLASSIAN_API_TOKEN=your-api-token
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### プロジェクトメタデータ設定
|
|
108
|
-
`.kiro/project.json`に以下を追加:
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
"confluenceSpaceKey": "YOUR_SPACE",
|
|
113
|
-
"confluenceLabels": ["ai-development", "michi"]
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## File Structure
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
project/
|
|
123
|
-
├── .codex/
|
|
124
|
-
│ ├── commands/ # cc-sdd: /kiro:* commands
|
|
125
|
-
│ ├── docs/
|
|
126
|
-
│ │ └── AGENTS.md # cc-sdd: Base project context
|
|
127
|
-
│ └── prompts/ # Michi: /prompts:* commands
|
|
128
|
-
│ └── confluence-sync.md
|
|
129
|
-
├── .kiro/
|
|
130
|
-
│ ├── project.json # Michi: Project metadata
|
|
131
|
-
│ ├── specs/ # cc-sdd: Feature specifications
|
|
132
|
-
│ │ └── {feature}/
|
|
133
|
-
│ │ ├── requirements.md
|
|
134
|
-
│ │ ├── design.md
|
|
135
|
-
│ │ ├── tasks.md
|
|
136
|
-
│ │ └── spec.json
|
|
137
|
-
│ ├── steering/ # cc-sdd: AI guidance documents
|
|
138
|
-
│ │ ├── structure.md
|
|
139
|
-
│ │ ├── tech.md
|
|
140
|
-
│ │ └── product.md
|
|
141
|
-
│ └── settings/ # cc-sdd: Templates and rules
|
|
142
|
-
└── AGENTS.override.md # Michi: Project-specific rules
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Project Metadata
|
|
148
|
-
|
|
149
|
-
Reference `.kiro/project.json` for project information:
|
|
150
|
-
|
|
151
|
-
- **Project ID**: {{PROJECT_ID}}
|
|
152
|
-
- **Language**: {{LANG_CODE}}
|
|
153
|
-
- **JIRA Key**: (from project.json)
|
|
154
|
-
- **Confluence Space**: (from project.json)
|
|
155
|
-
- **Confluence Labels**: (from project.json)
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## Michi-Specific Features
|
|
160
|
-
|
|
161
|
-
### 1. Multi-Language Support
|
|
162
|
-
- Node.js/TypeScript (npm)
|
|
163
|
-
- Java (Gradle only)
|
|
164
|
-
- PHP (Composer)
|
|
165
|
-
|
|
166
|
-
### 2. Master Test Approach
|
|
167
|
-
- 常に最新の仕様を反映(履歴管理なし)
|
|
168
|
-
- Phase A: Auto (unit, lint, build)
|
|
169
|
-
- Phase B: Manual (integration, e2e, performance, security)
|
|
170
|
-
|
|
171
|
-
### 3. CI/CD Integration
|
|
172
|
-
- GitHub Actions
|
|
173
|
-
- Screwdriver
|
|
174
|
-
|
|
175
|
-
### 4. Release Flow
|
|
176
|
-
- セマンティックバージョニング(v<major>.<minor>.<patch>)
|
|
177
|
-
- Confluence手順書
|
|
178
|
-
- JIRA Release管理
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Troubleshooting
|
|
183
|
-
|
|
184
|
-
### Q1: cc-sddコマンドが見つからない
|
|
185
|
-
```bash
|
|
186
|
-
# 再インストール
|
|
187
|
-
npx cc-sdd@latest --codex --lang ja
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Q2: Confluence同期が失敗する
|
|
191
|
-
```bash
|
|
192
|
-
# 環境変数を確認
|
|
193
|
-
cat .env | grep ATLASSIAN
|
|
194
|
-
|
|
195
|
-
# 接続テスト
|
|
196
|
-
curl -u "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
|
197
|
-
"$ATLASSIAN_URL/wiki/rest/api/content"
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Q3: AGENTS.override.mdが反映されない
|
|
201
|
-
Codex CLIは`AGENTS.md`と`AGENTS.override.md`を自動的にマージします。プロジェクトルートに配置されていることを確認してください。
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
## Learn More
|
|
206
|
-
|
|
207
|
-
- **cc-sdd**: https://github.com/gotalab/cc-sdd
|
|
208
|
-
- **Michi Documentation**: https://github.com/sk8metalme/michi
|
|
209
|
-
- **Codex CLI**: https://developers.openai.com/codex/cli
|
|
210
|
-
- **Confluence API**: https://developer.atlassian.com/cloud/confluence/rest/v2/
|