Skip to content

Commit 063b536

Browse files
authored
Merge pull request #58 from shinpr/feat/project-context-update-command
feat: add project-inject command for streamlined project context setup
2 parents a0f9b26 + deee097 commit 063b536

File tree

6 files changed

+191
-23
lines changed

6 files changed

+191
-23
lines changed

.claude/commands-en/project-inject.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
description: Inject project-specific context into project-context.md
3+
---
4+
5+
**Command Context**: When using the boilerplate, collect project-specific context and update project-context.md.
6+
7+
## Execution Process
8+
9+
### 1. Current State Verification
10+
! ls -la docs/rules/project-context.md
11+
! cat package.json | grep -E '"name":|"description":'
12+
13+
### 2. Project Context Collection
14+
15+
Interact with the user to collect the following information:
16+
17+
```
18+
【Core Project Information】
19+
1. What problem does your project solve?
20+
Examples: "Manual time tracking is inefficient" "Inventory management is person-dependent"
21+
22+
2. Who is the system for?
23+
Examples: "50-member sales team" "E-commerce site operators"
24+
25+
3. In what situations will it be used?
26+
Examples: "Field staff entering daily reports" "Month-end aggregation tasks"
27+
28+
【Development Structure】
29+
- Individual development / Team development (number of members)
30+
- Development phase (Prototype / Production development / In operation)
31+
32+
【Critical Business Constraints】(Maximum 3)
33+
Examples: "7-year audit log retention" "Mandatory approval workflow" "Real-time synchronization"
34+
```
35+
36+
**Think deeply** From the collected information, understand the project's essence and construct context focused on single responsibility.
37+
38+
### 3. Generate project-context.md
39+
40+
## AI Execution Accuracy Maximization Criteria
41+
42+
Generated project-context.md must follow these criteria:
43+
44+
### Principles of Description
45+
1. **Minimal yet maximally efficient**: Essential information only, eliminate redundancy
46+
2. **AI-decidable**: Use only measurable and verifiable criteria ("quickly" → "within 5 seconds")
47+
3. **Eliminate ambiguity**: Include specific numbers, conditions, and examples
48+
4. **Preferred format**: Describe in "do this" form rather than "don't do that"
49+
50+
### Responsibility Boundaries
51+
project-context.md's single responsibility is "project-specific contextual information" only:
52+
- ✅ Include: Project objectives, target users, business constraints
53+
- ❌ Exclude: Tech stack (→technical-spec.md), implementation principles (→typescript.md), architecture (→technical-spec.md)
54+
55+
### Structure
56+
```markdown
57+
# Project Context
58+
59+
## Project Overview
60+
- **Problem being solved**: [Specific challenge]
61+
- **Target users**: [Include number and attributes]
62+
- **Usage scenarios**: [Specific situations]
63+
64+
## Development Structure
65+
- **Team composition**: [Number and roles]
66+
- **Development phase**: [Current stage]
67+
68+
## Business Constraints
69+
1. [Measurable constraint]
70+
2. [Verifiable requirement]
71+
```
72+
73+
### 4. Update rules-index.yaml
74+
Update the typical-use in the project-context section to match the project.
75+
76+
**Scope**: Update project-context.md only. Technology choices are the responsibility of other rule files.

.claude/commands-ja/project-inject.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
description: プロジェクト固有のコンテキストをproject-context.mdに注入
3+
---
4+
5+
**コマンドコンテキスト**: ボイラープレート利用時にプロジェクト固有のコンテキストを収集し、project-context.mdを更新します。
6+
7+
## 実行プロセス
8+
9+
### 1. 現状確認
10+
! ls -la docs/rules/project-context.md
11+
! cat package.json | grep -E '"name":|"description":'
12+
13+
### 2. プロジェクトコンテキストの収集
14+
15+
ユーザーと対話し、以下の情報を収集:
16+
17+
```
18+
【プロジェクトの本質】
19+
1. プロジェクトが解決する問題は何ですか?
20+
例: "社内の勤怠管理が煩雑" "在庫管理が属人化している"
21+
22+
2. 誰のためのシステムですか?
23+
例: "社内営業チーム50名" "ECサイト運営者"
24+
25+
3. どのような状況で使用されますか?
26+
例: "外出先から日報入力" "月末の集計作業時"
27+
28+
【開発体制】
29+
- 個人開発 / チーム開発(人数)
30+
- 開発フェーズ(プロトタイプ / 本番開発 / 運用中)
31+
32+
【ビジネス上の重要な制約】(最大3つ)
33+
例: "監査ログ7年保存" "承認フロー必須" "リアルタイム反映"
34+
```
35+
36+
**Think deeply** 収集した情報から、プロジェクトの本質を理解し、単一責務に集中したコンテキストを構築します。
37+
38+
### 3. project-context.md生成
39+
40+
## AI実行精度最大化の基準
41+
42+
生成するproject-context.mdは以下の基準に従う:
43+
44+
### 記述の原則
45+
1. **最小で最大効率**: 本質的な情報のみ、冗長性を排除
46+
2. **AI判断可能**: 測定・検証可能な基準のみ使用(「迅速に」→「5秒以内」)
47+
3. **曖昧さの排除**: 具体的な数値・条件・例示を含める
48+
4. **推奨形式**: 「〜しない」より「〜する」の形で記述
49+
50+
### 責務の境界
51+
project-context.mdの単一責務は「プロジェクト固有の文脈情報」のみ:
52+
- ✅ 含める: プロジェクトの目的、ターゲット、ビジネス制約
53+
- ❌ 含めない: 技術スタック(→technical-spec.md)、実装原則(→typescript.md)、アーキテクチャ(→technical-spec.md)
54+
55+
### 構造化
56+
```markdown
57+
# プロジェクトコンテキスト
58+
59+
## プロジェクト概要
60+
- **解決する問題**: [具体的な課題]
61+
- **ターゲットユーザー**: [人数・属性を含む]
62+
- **利用シーン**: [具体的な状況]
63+
64+
## 開発体制
65+
- **チーム構成**: [人数と役割]
66+
- **開発フェーズ**: [現在の段階]
67+
68+
## ビジネス制約
69+
1. [測定可能な制約]
70+
2. [検証可能な要件]
71+
```
72+
73+
### 4. rules-index.yaml更新
74+
project-contextセクションのtypical-useをプロジェクトに合わせて更新。
75+
76+
**スコープ**: project-context.mdの更新のみ。技術選択は他のルールファイルの責務。

README.ja.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Claude Codeで使える便利なコマンド一覧
153153
| `/task` | ルールベース実行 | 単一タスク実行時 |
154154
| `/review` | Design Doc準拠検証 | 実装完了後の検証 |
155155
| `/rule-maintenance` | ルール管理 | ルール追加・更新時 |
156+
| `/project-inject` | プロジェクトコンテキスト注入 | ボイラープレート利用開始時 |
156157
| `/onboard` | ルール読み込み | プロジェクト開始時 |
157158

158159
詳細は `.claude/commands/` 内の各定義ファイルを参照してください。
@@ -170,22 +171,28 @@ npm install
170171

171172
### プロジェクト固有の設定
172173

174+
プロジェクトに合わせたコンテキスト設定を行います:
175+
176+
```bash
177+
# 1. Claude Codeでプロジェクトコンテキストを注入
178+
/project-inject
179+
180+
# このコマンドが対話的に以下を収集・設定します:
181+
# - プロジェクトが解決する問題
182+
# - ターゲットユーザーと利用シーン
183+
# - ビジネス制約と開発体制
184+
# → docs/rules/project-context.md を自動更新
185+
```
186+
173187
```json
174-
// package.json
188+
// 2. package.json の基本情報を更新(必要に応じて)
175189
{
176190
"name": "your-project-name",
177191
"description": "プロジェクトの説明",
178192
"author": "あなたの名前"
179193
}
180194
```
181195

182-
```bash
183-
# docs/rules-ja/project-context.md のプレースホルダーを置き換え
184-
# [プロジェクト名] → 実際のプロジェクト名
185-
# [プロダクト名をここに記載] → 実際のプロダクト名
186-
# [ターゲットユーザーの職種をここに記載] → 実際のターゲット
187-
```
188-
189196
## 💻 開発コマンド
190197

191198
### 基本コマンド
@@ -288,10 +295,11 @@ A: quality-fixerが修正を試みます。自動修正できない場合は、
288295
A: `npm run lang:ja`(日本語)または`npm run lang:en`(英語)で切り替え。
289296

290297
### Q: カスタマイズ方法は?
291-
A: `docs/rules/project-context.md`のプレースホルダーを置き換えるだけ
298+
A: `/project-inject`コマンドを実行して、対話的にプロジェクトコンテキストを設定
292299

293300
### Q: Claude Codeでの開発手順は?
294-
A: 1) ルールファイルを読み込み → 2) 計画立案・承認 → 3) 実装 → 4) 品質チェック → 5) コミット
301+
A: 【初回】1) `/project-inject`でコンテキスト設定 → 2) `/onboard`でルール読み込み
302+
【開発】3) `/implement`または`/task`で実装 → 4) 品質チェック → 5) コミット
295303

296304
## 📄 ライセンス
297305

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Powerful commands available in Claude Code
132132
| `/task` | Rule-based execution | Single task execution |
133133
| `/review` | Design Doc compliance check | Post-implementation validation |
134134
| `/rule-maintenance` | Rule management | Adding/updating rules |
135+
| `/project-inject` | Inject project context | When starting with boilerplate |
135136
| `/onboard` | Load project rules | Project initialization |
136137

137138
See individual definition files in `.claude/commands/` for details.
@@ -149,22 +150,28 @@ npm install
149150

150151
### Project Configuration
151152

153+
Configure project-specific context for your project:
154+
155+
```bash
156+
# 1. Inject project context using Claude Code
157+
/project-inject
158+
159+
# This command interactively collects and configures:
160+
# - The problem your project solves
161+
# - Target users and usage scenarios
162+
# - Business constraints and development structure
163+
# → Automatically updates docs/rules/project-context.md
164+
```
165+
152166
```json
153-
// package.json
167+
// 2. Update package.json basics (if needed)
154168
{
155169
"name": "your-project-name",
156170
"description": "Your project description",
157171
"author": "Your name"
158172
}
159173
```
160174

161-
```bash
162-
# Replace placeholders in docs/rules/project-context.md
163-
# [Project Name] → Your actual project name
164-
# [Product Name Here] → Your actual product name
165-
# [Target User Role Here] → Your actual target users
166-
```
167-
168175
## 💻 Development Commands
169176

170177
### Essential Commands
@@ -290,10 +297,11 @@ A: quality-fixer attempts automatic fixes. If it can't resolve them, it provides
290297
A: Run `npm run lang:ja` (Japanese) or `npm run lang:en` (English).
291298

292299
### Q: How do I customize the boilerplate?
293-
A: Replace placeholders in `docs/rules/project-context.md`.
300+
A: Run `/project-inject` to interactively configure project context.
294301

295302
### Q: What's the Claude Code development workflow?
296-
A: 1) Load rules → 2) Plan & approve → 3) Implement → 4) Quality check → 5) Commit
303+
A: [Initial] 1) `/project-inject` for context setup → 2) `/onboard` to load rules
304+
[Development] 3) `/implement` or `/task` to build → 4) Quality check → 5) Commit
297305

298306
## 📄 License
299307

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-coding-project-boilerplate",
3-
"version": "1.7.1",
3+
"version": "1.7.2",
44
"description": "TypeScript project boilerplate optimized for Claude Code development with comprehensive development rules, architecture patterns, and quality assurance tools",
55
"main": "dist/index.js",
66
"keywords": [

0 commit comments

Comments
 (0)