Skip to content

Commit 9743daf

Browse files
shinprclaude
andcommitted
refactor(rules): eliminate Frontend/Backend duplication with universal coding-standards
**English version:** - Create docs/rules-en/coding-standards.md with universal coding principles - Slim down Backend typescript.md to Backend-specific content only - Slim down Backend typescript-testing.md to Backend-specific content only - Delete docs/rules-en/ai-development-guide.md (moved to coding-standards.md) - Slim down Frontend typescript.md to Frontend-specific content only - Slim down Frontend typescript-testing.md to Frontend-specific content only - Delete docs/rules-en/frontend/ai-development-guide.md (moved to coding-standards.md) - Update 8 agent files to reference coding-standards.md instead of ai-development-guide.md **Japanese version:** - Apply same refactoring to docs/rules-ja/coding-standards.md - Migrate common sections from typescript.md to coding-standards.md - Migrate common sections from typescript-testing.md to coding-standards.md - Migrate common sections from frontend/typescript.md to coding-standards.md - Migrate common sections from frontend/typescript-testing.md to coding-standards.md - Update docs/rules-ja/rules-index.yaml section names to match actual file structure - Update 7 agents-ja files to reference coding-standards.md instead of ai-development-guide.md This refactoring implements Approach 4: Linter-like common rules + domain-specific rules to eliminate 90% duplication between Frontend and Backend documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8b7943e commit 9743daf

33 files changed

+429
-1188
lines changed

.claude/agents-en/code-reviewer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
1111
## Initial Required Tasks
1212

1313
Load and follow these rule files before starting:
14-
- @docs/rules/ai-development-guide.md - AI Development Guide, pre-implementation existing code investigation process
14+
- @docs/rules/coding-standards.md - Universal Coding Standards, pre-implementation existing code investigation process
1515
- @docs/rules/technical-spec.md - Technical Specifications
1616
- @docs/rules/typescript.md - TypeScript Development Rules
1717
- @docs/rules/project-context.md - Project Context
@@ -96,7 +96,7 @@ Load and follow these rule files before starting:
9696
- [ ] Component dependencies correct
9797
- [ ] Responsibilities properly separated
9898
- [ ] Existing codebase analysis section includes similar functionality investigation results
99-
- [ ] No unnecessary duplicate implementations (Pattern 5 from @docs/rules/ai-development-guide.md)
99+
- [ ] No unnecessary duplicate implementations (Pattern 5 from @docs/rules/coding-standards.md)
100100

101101
### Quality Validation
102102
- [ ] Comprehensive error handling

.claude/agents-en/quality-fixer-frontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Executes quality checks and provides a state where all checks complete with zero
2727
## Initial Required Tasks
2828

2929
Load and follow these rule files before starting:
30+
- @docs/rules/coding-standards.md - Universal Coding Standards (Anti-patterns, Rule of Three, Debugging, Type Safety)
3031
- @docs/rules/frontend/typescript.md - Frontend TypeScript Development Rules (React function components, Props-driven design)
3132
- @docs/rules/frontend/typescript-testing.md - Frontend Testing Rules (React Testing Library, MSW, 60% coverage)
3233
- @docs/rules/frontend/technical-spec.md - Frontend Quality Check Commands and Build/Test Configuration
33-
- @docs/rules/frontend/ai-development-guide.md - Frontend Technical Decision Criteria and Anti-patterns
3434
- @docs/rules/project-context.md - Project Context
3535
- @docs/rules/architecture/ files (if present)
3636
- Load project-specific architecture rules when defined

.claude/agents-en/requirement-analyzer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
1313
Before starting work, be sure to read and follow these rule files:
1414
- @docs/rules/project-context.md - Project context
1515
- @docs/rules/technical-spec.md - Technical specifications (refer to documentation process)
16-
- @docs/rules/ai-development-guide.md - AI development guide (refer to escalation criteria)
16+
- @docs/rules/coding-standards.md - Universal Coding Standards (refer to escalation criteria and anti-patterns)
1717
- @docs/rules/documentation-criteria.md - Documentation creation criteria (scale determination and ADR conditions)
1818

1919
## Responsibilities

.claude/agents-en/task-decomposer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
1111
## Initial Mandatory Tasks
1212

1313
Before starting work, be sure to read and follow these rule files:
14-
- @docs/rules/ai-development-guide.md - Task management principles
14+
- @docs/rules/coding-standards.md - Universal Coding Standards (task management principles, implementation completeness)
1515
- @docs/rules/documentation-criteria.md - Documentation creation criteria
1616
- @docs/rules/typescript-testing.md - TDD process (Red-Green-Refactor)
1717
- @docs/rules/project-context.md - Generic design guidelines considering future extensions

.claude/agents-en/task-executor-frontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Load and follow these rule files before starting:
2121
- Component hierarchy, feature-based structure, etc.
2222
- **@docs/rules/frontend/typescript.md** - Frontend TypeScript development rules (React function components, Props-driven design, type safety)
2323
- **@docs/rules/frontend/typescript-testing.md** - Frontend testing rules (React Testing Library, MSW, 60% coverage, Co-location principle)
24-
- **@docs/rules/frontend/ai-development-guide.md** - Frontend AI development guide, pre-implementation existing code investigation process
24+
- **@docs/rules/coding-standards.md** - Universal Coding Standards, pre-implementation existing code investigation process
2525
**Follow**: All rules for implementation, testing, and code quality
2626
**Exception**: Quality assurance process and commits are out of scope
2727

.claude/agents-en/task-executor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Load and follow these rule files before starting:
2121
- Layered architecture, clean architecture, hexagonal, etc.
2222
- **@docs/rules/typescript.md** - TypeScript development rules (type definitions, any prohibition, error handling)
2323
- **@docs/rules/typescript-testing.md** - Testing rules (TDD methodology, test structure, assertion approach)
24-
- **@docs/rules/ai-development-guide.md** - AI development guide, pre-implementation existing code investigation process
24+
- **@docs/rules/coding-standards.md** - Universal Coding Standards, pre-implementation existing code investigation process
2525
**Follow**: All rules for implementation, testing, and code quality
2626
**Exception**: Quality assurance process (Phase 1-6) and commits are out of scope
2727

.claude/agents-en/technical-designer-frontend.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before starting work, be sure to read and follow these rule files:
1414
- @docs/rules/documentation-criteria.md - Documentation creation criteria
1515
- @docs/rules/frontend/technical-spec.md - Frontend technical specifications (React, build tool, environment variables)
1616
- @docs/rules/frontend/typescript.md - Frontend TypeScript development rules (function components, Props-driven design)
17-
- @docs/rules/frontend/ai-development-guide.md - Frontend AI development guide, pre-implementation existing code investigation process
17+
- @docs/rules/coding-standards.md - Universal Coding Standards, pre-implementation existing code investigation process
1818
- @docs/rules/project-context.md - Project context
1919
- @docs/rules/architecture/implementation-approach.md - Metacognitive strategy selection process (used for implementation approach decisions)
2020
- @docs/rules/architecture/ architecture rule files (if exist)
@@ -61,7 +61,7 @@ Must be performed before Design Doc creation:
6161
- List major public Props of target component (about 5 important ones if over 10)
6262
- Identify usage sites with `Grep: "<ComponentName" --type tsx`
6363

64-
3. **Similar Component Search and Decision** (Pattern 5 prevention from @docs/rules/frontend/ai-development-guide.md)
64+
3. **Similar Component Search and Decision** (Pattern 5 prevention from @docs/rules/coding-standards.md)
6565
- Search existing code for keywords related to planned component
6666
- Look for components with same domain, responsibilities, or UI patterns
6767
- Decision and action:

.claude/agents-en/technical-designer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before starting work, be sure to read and follow these rule files:
1414
- @docs/rules/documentation-criteria.md - Documentation creation criteria
1515
- @docs/rules/technical-spec.md - Project technical specifications
1616
- @docs/rules/typescript.md - TypeScript development rules
17-
- @docs/rules/ai-development-guide.md - AI development guide, pre-implementation existing code investigation process
17+
- @docs/rules/coding-standards.md - Universal Coding Standards, pre-implementation existing code investigation process
1818
- @docs/rules/project-context.md - Project context
1919
- @docs/rules/architecture/implementation-approach.md - Metacognitive strategy selection process (used for implementation approach decisions)
2020
- @docs/rules/architecture/ architecture rule files (if exist)
@@ -61,7 +61,7 @@ Must be performed before Design Doc creation:
6161
- List major public methods of target service (about 5 important ones if over 10)
6262
- Identify call sites with `Grep: "ServiceName\." --type ts`
6363

64-
3. **Similar Functionality Search and Decision** (Pattern 5 prevention from @docs/rules/ai-development-guide.md)
64+
3. **Similar Functionality Search and Decision** (Pattern 5 prevention from @docs/rules/coding-standards.md)
6565
- Search existing code for keywords related to planned functionality
6666
- Look for implementations with same domain, responsibilities, or configuration patterns
6767
- Decision and action:

.claude/agents-en/work-planner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
1111
## Initial Mandatory Tasks
1212

1313
Before starting work, be sure to read and follow these rule files:
14-
- @docs/rules/ai-development-guide.md - AI development guide, pre-implementation existing code investigation process, task management principles
14+
- @docs/rules/coding-standards.md - Universal Coding Standards, pre-implementation existing code investigation process, task management principles
1515
- @docs/rules/documentation-criteria.md - Documentation creation criteria
1616
- @docs/rules/technical-spec.md - Technical specifications
1717
- @docs/rules/typescript-testing.md - Testing rules

.claude/agents-ja/code-reviewer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
1111
## 初回必須タスク
1212

1313
作業開始前に以下のルールファイルを必ず読み込み、厳守してください:
14-
- @docs/rules/ai-development-guide.md - AI開発ガイド、実装前の既存コード調査プロセス
14+
- @docs/rules/coding-standards.md - 普遍的コーディング規約、実装前の既存コード調査プロセス
1515
- @docs/rules/technical-spec.md - 技術仕様
1616
- @docs/rules/typescript.md - TypeScript開発ルール
1717
- @docs/rules/project-context.md - プロジェクトコンテキスト
@@ -96,7 +96,7 @@ CLAUDE.mdの原則を適用しない独立したコンテキストを持ち、
9696
- [ ] コンポーネント間の依存関係が正しいか
9797
- [ ] 責務の分離が適切か
9898
- [ ] 既存コードベース分析セクションに類似機能調査結果が記載されているか
99-
- [ ] 不必要な重複実装がないか(@docs/rules/ai-development-guide.md パターン5)
99+
- [ ] 不必要な重複実装がないか(@docs/rules/coding-standards.md パターン5)
100100

101101
### 品質検証
102102
- [ ] エラーハンドリングが網羅的か

0 commit comments

Comments
 (0)