@aramassa/ai-rules 0.4.2 → 0.5.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.
@@ -5,6 +5,7 @@ chatmode: planning
5
5
  tools:
6
6
  - "changes"
7
7
  - "searchResults"
8
+ - "createFile"
8
9
  - "editFiles"
9
10
  - "search"
10
11
  - "add_sub_issue"
@@ -0,0 +1,358 @@
1
+ ---
2
+ type: package-management
3
+ category: workspace
4
+ language: nodejs
5
+ applyTo: "**/package.json"
6
+ human-instruction: |-
7
+ ## npm Workspaces の特性
8
+
9
+ npm workspaces は npm 7.0+ で利用可能な、単一リポジトリ内で複数のパッケージを管理する仕組みです。
10
+
11
+ 特に注意すべき点:
12
+ - npm 7.0 以降が必須
13
+ - ワークスペース間の依存関係は自動的にシンボリックリンクされる
14
+ - `--workspace` フラグで特定のパッケージに対してコマンドを実行可能
15
+ ---
16
+
17
+ # Node.js (npm) Workspace Management Rules
18
+
19
+ ## 目次
20
+
21
+ - [Overview](#overview)
22
+ - [Workspace Configuration](#workspace-configuration)
23
+ - [Package Structure Rules](#package-structure-rules)
24
+ - [Package Management Commands](#package-management-commands)
25
+ - [Build and Development Workflow](#build-and-development-workflow)
26
+ - [Local CLI Execution](#local-cli-execution)
27
+ - [Package Distribution Check(必須)](#package-distribution-check必須)
28
+ - [Common Issues](#common-issues)
29
+ - [Best Practices](#best-practices)
30
+ - [Example Project Structure](#example-project-structure)
31
+
32
+ ## Overview
33
+
34
+ このルールでは **npm のみ** を使用します(yarn/pnpm は使用禁止)。
35
+
36
+ npm workspaces(npm 7.0+)で単一リポジトリ内の複数パッケージを管理します。
37
+
38
+ ## Workspace Configuration
39
+
40
+ ルートの `package.json`:
41
+
42
+ ```json
43
+ {
44
+ "name": "my-monorepo",
45
+ "private": true,
46
+ "workspaces": ["packages/*"]
47
+ }
48
+ ```
49
+
50
+ ## Package Structure Rules
51
+
52
+ ### 必須パッケージ
53
+
54
+ | パッケージ名 | 説明 | 依存関係ルール |
55
+ |:-----------|:-----|:-------------|
56
+ | `core` | プロジェクトの主機能 | `common` に依存可能 |
57
+ | `common` | 共有機能 | 他パッケージに依存不可 |
58
+
59
+ ### オプションパッケージ
60
+
61
+ - `cli` - CLI(`core` に依存)
62
+ - `types` - 型定義(依存なし)
63
+ - `utils` - ユーティリティ(`common` に依存可能)
64
+
65
+ ### 依存関係のルール
66
+
67
+ ```
68
+ common (依存なし)
69
+
70
+ core (common に依存可能)
71
+
72
+ cli, その他 (core, common に依存可能)
73
+ ```
74
+
75
+ **禁止**: `core` が `cli` などに依存、`common` が他の内部パッケージに依存
76
+
77
+ ### テストのルール
78
+
79
+ **重要**: 各パッケージのテストは、そのパッケージ内で完結する必要があります。
80
+
81
+ - ✅ **許可される**: 自パッケージ内のコードのみをテスト
82
+ - ✅ **許可される**: 依存しているパッケージ(`common`、`core`)の公開APIを使用
83
+ - ❌ **禁止**: 他パッケージの内部実装に依存したテスト
84
+ - ❌ **禁止**: テストのために他パッケージのテストヘルパーをインポート
85
+
86
+ ```bash
87
+ # 各パッケージで独立してテスト実行可能
88
+ cd packages/common && npm test # common のテストのみ
89
+ cd packages/core && npm test # core のテストのみ
90
+ cd packages/cli && npm test # cli のテストのみ
91
+
92
+ # 全体テストも実行可能
93
+ npm test --workspaces
94
+ ```
95
+
96
+ **ベストプラクティス**:
97
+ - テストヘルパーやモックが必要な場合は、各パッケージ内に配置
98
+ - 共通のテストユーティリティが必要な場合は、`common` または専用の `test-utils` パッケージを作成
99
+
100
+ ## Package Management Commands
101
+
102
+ ```bash
103
+ # インストール
104
+ npm install
105
+
106
+ # パッケージ追加
107
+ npm install <package> --workspace=packages/core
108
+ npm install <package> --workspaces # 全ワークスペース
109
+
110
+ # ワークスペース間依存
111
+ cd packages/core
112
+ npm install @scope/common
113
+ # → node_modules/@scope/common は packages/common へのシンボリックリンク
114
+ ```
115
+
116
+ ## Build and Development Workflow
117
+
118
+ ```bash
119
+ # ビルド(依存順に手動実行推奨)
120
+ cd packages/common && npm run build
121
+ cd ../core && npm run build
122
+ cd ../cli && npm run build
123
+
124
+ # または全体ビルド
125
+ npm run build --workspaces
126
+
127
+ # 開発時 watch
128
+ npm run dev --workspaces
129
+ npm run dev --workspace=packages/core
130
+
131
+ # テスト
132
+ npm test --workspaces
133
+ npm test --workspace=packages/core
134
+ npm test --workspaces --if-present # スクリプトがない場合スキップ
135
+ ```
136
+
137
+ ## Local CLI Execution
138
+
139
+ ```bash
140
+ # 1. ビルド実行(必須)
141
+ npm run build --workspaces
142
+
143
+ # 2. CLI 実行
144
+ node packages/cli/dist/index.js
145
+ npx @scope/cli # bin フィールドがある場合
146
+
147
+ # 開発時リンク
148
+ npm link --workspace=packages/cli
149
+ my-cli --version
150
+ npm unlink --workspace=packages/cli -g # 解除
151
+
152
+ # TypeScript 直接実行(開発時)
153
+ npx tsx packages/cli/src/index.ts
154
+ ```
155
+
156
+ ## Package Distribution Check(必須)
157
+
158
+ ### コミット前・リリース前の確認
159
+
160
+ ```bash
161
+ cd packages/core
162
+ npm pack --dry-run
163
+
164
+ # 出力例:
165
+ # npm notice 📦 @scope/core@1.0.0
166
+ # npm notice === Tarball Contents ===
167
+ # npm notice 1.2kB dist/index.js
168
+ # npm notice 256B package.json
169
+ ```
170
+
171
+ ### 除外設定
172
+
173
+ `package.json` の `files` フィールド(推奨):
174
+
175
+ ```json
176
+ {
177
+ "files": ["dist", "README.md", "LICENSE"]
178
+ }
179
+ ```
180
+
181
+ または `.npmignore`:
182
+
183
+ ```
184
+ src/
185
+ *.test.ts
186
+ *.spec.ts
187
+ tsconfig.json
188
+ ```
189
+
190
+ ### 確認タイミング
191
+
192
+ - ✅ 新機能追加時
193
+ - ✅ リファクタリング後
194
+ - ✅ コミット前(必須)
195
+ - ✅ リリース前(必須)
196
+
197
+ ## Common Issues
198
+
199
+ ### 型定義が認識されない
200
+
201
+ ```json
202
+ // packages/core/tsconfig.json
203
+ {
204
+ "references": [{ "path": "../common" }]
205
+ }
206
+ ```
207
+
208
+ ```bash
209
+ npx tsc --build
210
+ ```
211
+
212
+ ### ローカル変更が反映されない
213
+
214
+ ```bash
215
+ npm run build --workspaces
216
+ # または watch モード
217
+ npm run dev --workspaces
218
+ ```
219
+
220
+ ### 循環依存エラー
221
+
222
+ ```
223
+ ERROR: Circular dependency detected:
224
+ @scope/core -> @scope/cli -> @scope/core
225
+ ```
226
+
227
+ 解決策:
228
+ 1. 依存関係ルールを確認
229
+ 2. 共通機能を `common` に移動
230
+
231
+ ### npm install が遅い
232
+
233
+ ```bash
234
+ rm -rf node_modules packages/*/node_modules
235
+ npm install
236
+ # または CI 環境で
237
+ npm ci
238
+ ```
239
+
240
+ ## Best Practices
241
+
242
+ 1. **ビルド前提**: CLI/スクリプト実行前に必ずビルド
243
+ 2. **依存管理**: `core` → `common` の一方向を守る
244
+ 3. **配布物確認**: `npm pack --dry-run` を徹底
245
+ 4. **private 設定**: ルートの package.json に `"private": true"`
246
+ 5. **TypeScript**: プロジェクト参照で型定義を共有
247
+
248
+ ## Example Project Structure
249
+
250
+ ```
251
+ my-monorepo/
252
+ ├── package.json # workspaces 定義、private: true
253
+ ├── package-lock.json
254
+ ├── node_modules/
255
+ ├── packages/
256
+ │ ├── common/
257
+ │ │ ├── package.json # @scope/common
258
+ │ │ ├── src/
259
+ │ │ └── dist/
260
+ │ ├── core/
261
+ │ │ ├── package.json # @scope/core
262
+ │ │ ├── src/
263
+ │ │ └── dist/
264
+ │ └── cli/
265
+ │ ├── package.json # @scope/cli
266
+ │ ├── src/
267
+ │ └── dist/
268
+ └── tsconfig.json
269
+ ```
270
+
271
+ ### 除外確認のタイミング
272
+
273
+ - ✅ 新機能追加時
274
+ - ✅ リファクタリング後
275
+ - ✅ コミット前(必須)
276
+ - ✅ リリース前(必須)
277
+
278
+ ## Common Issues and Solutions
279
+
280
+ ### Issue: ワークスペース間の型定義が認識されない
281
+
282
+ ```bash
283
+ # 解決方法: TypeScript のプロジェクト参照を設定
284
+ # packages/core/tsconfig.json
285
+ {
286
+ "references": [
287
+ { "path": "../common" }
288
+ ]
289
+ }
290
+
291
+ # ビルド時に --build フラグを使用
292
+ npx tsc --build
293
+ ```
294
+
295
+ ### Issue: ローカルパッケージの変更が反映されない
296
+
297
+ ```bash
298
+ # 解決方法: ビルドを再実行
299
+ npm run build --workspaces
300
+
301
+ # または watch モードで開発
302
+ npm run dev --workspaces
303
+ ```
304
+
305
+ ### Issue: パッケージの循環依存
306
+
307
+ ```
308
+ ERROR: Circular dependency detected:
309
+ @scope/core -> @scope/cli -> @scope/core
310
+ ```
311
+
312
+ 解決方法:
313
+ 1. 依存関係ルールを確認(`core` は `cli` に依存してはいけない)
314
+ 2. 共通機能を `common` に移動
315
+ 3. アーキテクチャを見直し
316
+
317
+ ### Issue: npm install が遅い
318
+
319
+ ```bash
320
+ # node_modules をクリーンアップ
321
+ rm -rf node_modules packages/*/node_modules
322
+ npm install
323
+
324
+ # または npm ci を使用(CI環境推奨)
325
+ npm ci
326
+ ```
327
+
328
+ ## Best Practices
329
+
330
+ 1. **ビルド前提の実行**: CLI やスクリプトを実行する前に必ずビルドを実行
331
+ 2. **厳格な依存関係管理**: `core` → `common` の一方向依存を守る
332
+ 3. **型定義の共有**: TypeScript プロジェクト参照を活用
333
+ 4. **配布物の確認**: `npm pack --dry-run` でリリース前確認を徹底
334
+ 5. **private フラグ**: ルートの package.json には `"private": true` を設定
335
+ 6. **バージョン管理**: 各パッケージのバージョンを適切に管理
336
+
337
+ ## Example Project Structure
338
+
339
+ ```
340
+ my-monorepo/
341
+ ├── package.json # ルート設定(workspaces 定義、private: true)
342
+ ├── package-lock.json # ロックファイル
343
+ ├── node_modules/ # すべてのパッケージの依存関係
344
+ ├── packages/
345
+ │ ├── common/
346
+ │ │ ├── package.json # @scope/common
347
+ │ │ ├── src/
348
+ │ │ └── dist/ # ビルド成果物
349
+ │ ├── core/
350
+ │ │ ├── package.json # @scope/core(common に依存)
351
+ │ │ ├── src/
352
+ │ │ └── dist/
353
+ │ └── cli/
354
+ │ ├── package.json # @scope/cli(core, common に依存)
355
+ │ ├── src/
356
+ │ └── dist/
357
+ └── tsconfig.json # ルート TypeScript 設定
358
+ ```
@@ -184,7 +184,7 @@ if ! command -v uv &> /dev/null; then
184
184
  echo "📦 Installing uv..."
185
185
  curl -LsSf https://astral.sh/uv/install.sh | sh
186
186
  source $HOME/.cargo/env
187
-
187
+
188
188
  # Verify installation
189
189
  if ! command -v uv &> /dev/null; then
190
190
  echo "❌ Failed to install uv. Please install manually."
@@ -547,21 +547,21 @@ jobs:
547
547
 
548
548
  steps:
549
549
  - uses: actions/checkout@v4
550
-
550
+
551
551
  - name: Install uv
552
552
  uses: astral-sh/setup-uv@v1
553
553
  with:
554
554
  version: "latest"
555
-
555
+
556
556
  - name: Set up Python ${{ matrix.python-version }}
557
557
  run: uv python install ${{ matrix.python-version }}
558
-
558
+
559
559
  - name: Install dependencies
560
560
  run: uv sync --dev
561
-
561
+
562
562
  - name: Run quality checks
563
563
  run: ./scripts/check-quality.sh
564
-
564
+
565
565
  - name: Upload coverage reports
566
566
  uses: codecov/codecov-action@v3
567
567
  if: matrix.python-version == '3.11'
@@ -575,16 +575,16 @@ jobs:
575
575
  ```bash
576
576
  # 1. 開発環境更新
577
577
  uv sync --dev
578
-
578
+
579
579
  # 2. 品質チェック
580
580
  ./scripts/check-quality.sh
581
-
581
+
582
582
  # 3. 実装
583
583
  # ... コード変更 ...
584
-
584
+
585
585
  # 4. テスト実行
586
586
  uv run pytest packages/target-package/tests/
587
-
587
+
588
588
  # 5. 最終品質チェック
589
589
  ./scripts/check-quality.sh
590
590
  ```
@@ -649,7 +649,7 @@ uv run mypy packages/target-package/ --show-error-codes
649
649
  ```bash
650
650
  # poetry.lock から requirements.txt 生成
651
651
  poetry export --output requirements.txt
652
-
652
+
653
653
  # UV での依存関係インストール
654
654
  uv add $(cat requirements.txt | cut -d'=' -f1)
655
655
  ```
@@ -670,4 +670,4 @@ uv run mypy packages/target-package/ --show-error-codes
670
670
  - [ ] 品質チェックがパス
671
671
  - [ ] CI/CD パイプラインが動作
672
672
 
673
- このガイドラインに従うことで、保守性が高く、開発効率の良い Python プロジェクトを UV workspace で管理できます。
673
+ このガイドラインに従うことで、保守性が高く、開発効率の良い Python プロジェクトを UV workspace で管理できます。
@@ -0,0 +1,337 @@
1
+ ---
2
+ type: package-management
3
+ category: workspace
4
+ language: typescript
5
+ applyTo: "**/tsconfig.json"
6
+ human-instruction: |-
7
+ ## TypeScript Project References の特性
8
+
9
+ TypeScript のプロジェクト参照(Project References)は、複数のパッケージ間での型情報共有とビルド最適化を実現する仕組みです。
10
+
11
+ 特に注意すべき点:
12
+ - `references` フィールドでパッケージ間の依存関係を明示する
13
+ - `composite: true` を設定することで、プロジェクト参照が有効になる
14
+ - `tsc --build` コマンドで依存関係を考慮した段階的ビルドが可能
15
+ ---
16
+
17
+ # TypeScript Workspace Management Rules
18
+
19
+ ## 目次
20
+
21
+ - [Overview](#overview)
22
+ - [TypeScript Configuration](#typescript-configuration)
23
+ - [Project References](#project-references)
24
+ - [Build Strategy](#build-strategy)
25
+ - [Type Definition Management](#type-definition-management)
26
+ - [Common Issues](#common-issues)
27
+ - [Best Practices](#best-practices)
28
+
29
+ ## Overview
30
+
31
+ このドキュメントは **TypeScript Project References** に特化したルールです。
32
+
33
+ 基本的なワークスペース管理については [nodejs.md](./nodejs.md) を参照してください。
34
+
35
+ ## TypeScript Configuration
36
+
37
+ ### Root tsconfig.json
38
+
39
+ ルートの `tsconfig.json` は共通設定を定義します:
40
+
41
+ ```json
42
+ {
43
+ "compilerOptions": {
44
+ "target": "ES2020",
45
+ "module": "commonjs",
46
+ "lib": ["ES2020"],
47
+ "declaration": true,
48
+ "declarationMap": true,
49
+ "sourceMap": true,
50
+ "outDir": "./dist",
51
+ "rootDir": "./src",
52
+ "composite": true,
53
+ "strict": true,
54
+ "esModuleInterop": true,
55
+ "skipLibCheck": true,
56
+ "forceConsistentCasingInFileNames": true
57
+ },
58
+ "exclude": ["node_modules", "dist"]
59
+ }
60
+ ```
61
+
62
+ ### Package-level tsconfig.json
63
+
64
+ 各パッケージの `tsconfig.json`:
65
+
66
+ ```json
67
+ {
68
+ "extends": "../../tsconfig.json",
69
+ "compilerOptions": {
70
+ "outDir": "./dist",
71
+ "rootDir": "./src"
72
+ },
73
+ "references": [
74
+ { "path": "../common" }
75
+ ],
76
+ "include": ["src/**/*"],
77
+ "exclude": ["node_modules", "dist", "**/*.test.ts"]
78
+ }
79
+ ```
80
+
81
+ ## Project References
82
+
83
+ ### 依存関係の定義
84
+
85
+ パッケージ間の依存関係は `references` フィールドで明示します:
86
+
87
+ ```json
88
+ // packages/core/tsconfig.json
89
+ {
90
+ "references": [
91
+ { "path": "../common" }
92
+ ]
93
+ }
94
+ ```
95
+
96
+ ```json
97
+ // packages/cli/tsconfig.json
98
+ {
99
+ "references": [
100
+ { "path": "../common" },
101
+ { "path": "../core" }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ ### composite フラグ(必須)
107
+
108
+ プロジェクト参照を有効にするため、各パッケージで `composite: true` を設定:
109
+
110
+ ```json
111
+ {
112
+ "compilerOptions": {
113
+ "composite": true,
114
+ "declaration": true
115
+ }
116
+ }
117
+ ```
118
+
119
+ **composite: true の効果**:
120
+ - `.d.ts` ファイル(型定義)の生成を強制
121
+ - `tsconfig.tsbuildinfo` ファイルによる段階的ビルドの有効化
122
+ - プロジェクト参照による高速な型チェック
123
+
124
+ ## Build Strategy
125
+
126
+ ### 推奨ビルドコマンド
127
+
128
+ ```bash
129
+ # TypeScript の段階的ビルド(推奨)
130
+ npx tsc --build
131
+
132
+ # watch モード(開発時)
133
+ npx tsc --build --watch
134
+
135
+ # クリーンビルド
136
+ npx tsc --build --clean
137
+ npx tsc --build
138
+ ```
139
+
140
+ ### package.json の scripts
141
+
142
+ ```json
143
+ {
144
+ "scripts": {
145
+ "build": "tsc --build",
146
+ "build:clean": "tsc --build --clean",
147
+ "build:watch": "tsc --build --watch"
148
+ }
149
+ }
150
+ ```
151
+
152
+ ## Type Definition Management
153
+
154
+ ### 型定義の export
155
+
156
+ 各パッケージで型定義を適切に export します:
157
+
158
+ ```typescript
159
+ // packages/common/src/index.ts
160
+ export type { CommonConfig } from './types';
161
+ export { createCommon } from './common';
162
+ ```
163
+
164
+ ```json
165
+ // packages/common/package.json
166
+ {
167
+ "main": "./dist/index.js",
168
+ "types": "./dist/index.d.ts",
169
+ "files": ["dist"]
170
+ }
171
+ ```
172
+
173
+ ### 型定義の import
174
+
175
+ ```typescript
176
+ // packages/core/src/index.ts
177
+ import type { CommonConfig } from '@scope/common';
178
+ import { createCommon } from '@scope/common';
179
+
180
+ export function createCore(config: CommonConfig) {
181
+ const common = createCommon(config);
182
+ // ...
183
+ }
184
+ ```
185
+
186
+ ### 共有型定義パッケージ
187
+
188
+ プロジェクト全体で使用する型定義は `types` パッケージに集約:
189
+
190
+ ```typescript
191
+ // packages/types/src/index.ts
192
+ export type ProjectConfig = {
193
+ name: string;
194
+ version: string;
195
+ };
196
+
197
+ export type Result<T, E = Error> =
198
+ | { success: true; data: T }
199
+ | { success: false; error: E };
200
+ ```
201
+
202
+ ## Common Issues
203
+
204
+ ### 型定義が認識されない
205
+
206
+ **原因**: プロジェクト参照の設定漏れ
207
+
208
+ ```json
209
+ // packages/core/tsconfig.json
210
+ {
211
+ "references": [{ "path": "../common" }],
212
+ "compilerOptions": {
213
+ "composite": true
214
+ }
215
+ }
216
+ ```
217
+
218
+ ```bash
219
+ npx tsc --build
220
+ ```
221
+
222
+ ### ビルドエラー: "Project references may not form a circular chain"
223
+
224
+ **原因**: 循環参照(`core` → `cli` → `core`)
225
+
226
+ 解決策: 依存関係を見直し、共通機能を `common` に移動
227
+
228
+ ### import の型解決ができない
229
+
230
+ **原因**: `declaration: true` の設定漏れ
231
+
232
+ ```json
233
+ {
234
+ "compilerOptions": {
235
+ "composite": true,
236
+ "declaration": true,
237
+ "declarationMap": true
238
+ }
239
+ }
240
+ ```
241
+
242
+ ## Best Practices
243
+
244
+ 1. **composite フラグの徹底**: 全パッケージで `composite: true` を設定
245
+ 2. **型定義の明示的 export**: 公開する型は必ず `export type` で export
246
+ 3. **段階的ビルドの活用**: `tsc --build` でビルド時間を短縮
247
+ 4. **declarationMap の活用**: デバッグ時にソースコードにジャンプ可能
248
+ 5. **tsconfig の継承**: 共通設定はルートで定義して `extends` で継承
249
+
250
+ ### tsconfig.json テンプレート
251
+
252
+ ```json
253
+ {
254
+ "extends": "../../tsconfig.json",
255
+ "compilerOptions": {
256
+ "composite": true,
257
+ "declaration": true,
258
+ "declarationMap": true,
259
+ "outDir": "./dist",
260
+ "rootDir": "./src"
261
+ },
262
+ "references": [
263
+ // 依存するパッケージのパスを記載
264
+ ],
265
+ "include": ["src/**/*"],
266
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
267
+ }
268
+ ```
269
+
270
+ ### Example Project Structure
271
+
272
+ ```
273
+ my-monorepo/
274
+ ├── tsconfig.json # ルート設定
275
+ ├── packages/
276
+ │ ├── types/
277
+ │ │ ├── tsconfig.json # composite: true
278
+ │ │ └── src/index.ts
279
+ │ ├── common/
280
+ │ │ ├── tsconfig.json # references: [types]
281
+ │ │ └── src/index.ts
282
+ │ ├── core/
283
+ │ │ ├── tsconfig.json # references: [types, common]
284
+ │ │ └── src/index.ts
285
+ │ └── cli/
286
+ │ ├── tsconfig.json # references: [types, common, core]
287
+ │ └── src/index.ts
288
+ └── tsconfig.tsbuildinfo # ビルドキャッシュ(.gitignore)
289
+ ```
290
+
291
+ ## Related Documentation
292
+
293
+ - [Node.js Workspace Management](./nodejs.md) - npm workspaces の基本ルール
294
+ "compilerOptions": {
295
+ "composite": true,
296
+ "declaration": true,
297
+ "declarationMap": true,
298
+ "outDir": "./dist",
299
+ "rootDir": "./src"
300
+ },
301
+ "references": [
302
+ // 依存するパッケージを記載
303
+ ],
304
+ "include": ["src/**/*"],
305
+ "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
306
+ }
307
+ ```
308
+
309
+ ### Example Project Structure
310
+
311
+ ```
312
+ my-monorepo/
313
+ ├── tsconfig.json # ルート設定
314
+ ├── package.json
315
+ ├── packages/
316
+ │ ├── types/
317
+ │ │ ├── tsconfig.json # composite: true
318
+ │ │ ├── package.json
319
+ │ │ └── src/
320
+ │ │ └── index.ts
321
+ │ ├── common/
322
+ │ │ ├── tsconfig.json # references: [types]
323
+ │ │ ├── package.json
324
+ │ │ └── src/
325
+ │ │ └── index.ts
326
+ │ ├── core/
327
+ │ │ ├── tsconfig.json # references: [types, common]
328
+ │ │ ├── package.json
329
+ │ │ └── src/
330
+ │ │ └── index.ts
331
+ │ └── cli/
332
+ │ ├── tsconfig.json # references: [types, common, core]
333
+ │ ├── package.json
334
+ │ └── src/
335
+ │ └── index.ts
336
+ └── tsconfig.tsbuildinfo # ビルドキャッシュ(gitignore)
337
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aramassa/ai-rules",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "This repository collects guidelines and instructions for developing AI agents. It contains documents covering communication rules, coding standards, testing strategies, and general operational practices.",
5
5
  "workspaces": [
6
6
  "packages/extract",
@@ -0,0 +1,14 @@
1
+ config:
2
+ baseDir: .github/instructions
3
+
4
+ recipe:
5
+ - title: Node.js Workspace Management Rules
6
+ frontmatter:
7
+ description: |
8
+ Rules for managing npm workspaces in a monorepo environment.
9
+ This includes package structure, dependency management, and build workflows.
10
+ applyTo: "**/package.json"
11
+ out: nodejs-workspace.instructions.md
12
+ type: package-management
13
+ category: workspace
14
+ language: nodejs
@@ -0,0 +1,25 @@
1
+ config:
2
+ baseDir: .github/instructions
3
+
4
+ recipe:
5
+ - title: Node.js Workspace Management Rules
6
+ frontmatter:
7
+ description: |
8
+ Rules for managing npm workspaces in a monorepo environment.
9
+ This includes package structure, dependency management, and build workflows.
10
+ applyTo: "**/package.json"
11
+ out: typescript-workspace.instructions.md
12
+ type: package-management
13
+ category: workspace
14
+ language: nodejs
15
+ - title: TypeScript Workspace Management Rules
16
+ mode: append
17
+ frontmatter:
18
+ description: |
19
+ Rules for managing TypeScript project references in a monorepo environment.
20
+ This includes tsconfig configuration, project references, and type definition management.
21
+ applyTo: "**/tsconfig.json"
22
+ out: typescript-workspace.instructions.md
23
+ type: package-management
24
+ category: workspace
25
+ language: typescript