Skip to content

Conversation

@shinpr
Copy link
Owner

@shinpr shinpr commented Nov 6, 2025

Summary

This PR eliminates 90% duplication between Frontend and Backend documentation by
consolidating common coding principles into a universal coding-standards.md file.
The refactoring implements Approach 4: Linter-like common rules + domain-specific
rules
.

Changes

Main Refactoring (9743daf)

English version:

  • ✨ Create docs/rules-en/coding-standards.md with universal coding principles
  • ♻️ Slim down Backend typescript.md and typescript-testing.md to Backend-specific
    content only
  • ♻️ Slim down Frontend typescript.md and typescript-testing.md to
    Frontend-specific content only
  • 🗑️ Delete docs/rules-en/ai-development-guide.md (moved to coding-standards.md)
  • 🗑️ 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:

  • ✨ Create docs/rules-ja/coding-standards.md with same structure as English version
  • ♻️ Apply same refactoring to all Japanese rule files
  • 🔄 Update 7 agents-ja files to reference coding-standards.md
  • 📝 Update docs/rules-ja/rules-index.yaml section names to match actual file
    structure

Follow-up Fixes (455195b)

Fixed inconsistencies discovered after the main refactoring:

  1. Agent reference update: Fixed .claude/agents-en/quality-fixer.md which still
    referenced the deleted ai-development-guide.md
  2. Metadata cleanup: Removed ai-development-guide entry from
    docs/rules-en/rules-index.yaml (file no longer exists)

Impact

  • Before: Duplicated content across Frontend/Backend docs (~90% overlap)
  • After: Shared principles in coding-standards.md + domain-specific rules in
    separate files
  • Result: Easier maintenance, single source of truth for common coding standards

Files Changed

  • 33 files changed
  • 429 insertions(+), 1,188 deletions(-)
  • Net reduction: ~760 lines of duplicated content

shinpr and others added 5 commits November 6, 2025 21:03
…tion

Fixed single-responsibility principle violations where command references
were duplicated across files:

Documentation changes:
- Remove "Quality Check Command Reference" from ai-development-guide.md
- Remove "Quality Check Command Reference" from frontend/ai-development-guide.md
- Enhance technical-spec.md with detailed Build and Testing sections
- Update rules-index.yaml to reflect new section ownership

Agent changes:
- Update quality-fixer.md to reference technical-spec.md for commands
- Update quality-fixer-frontend.md to reference frontend/technical-spec.md

Benefits:
- Restore single-responsibility: ai-development-guide focuses on decision
  criteria and anti-patterns, technical-spec owns build/test commands
- Eliminate duplication: commands now exist in one authoritative location
- Improve AI accuracy: clear file responsibilities reduce confusion
- Better maintainability: command updates only need one location

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…documentation

Fixed single-responsibility principle violations where command references
were duplicated across files (Japanese version):

Documentation changes:
- Remove "品質チェックコマンドリファレンス" from ai-development-guide.md
- Remove "品質チェックコマンドリファレンス" from frontend/ai-development-guide.md
- Enhance technical-spec.md with detailed Build and Testing sections
- Update rules-index.yaml to reflect new section ownership

Agent changes:
- Update quality-fixer.md to reference technical-spec.md for commands
- Update quality-fixer-frontend.md to reference frontend/technical-spec.md

This commit mirrors the English documentation refactoring to maintain
consistency across both language versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
rules-index.yaml sections should only contain h2 (##) headings, not h3 (###).

Fixed:
- Removed "Build Commands", "Testing Commands", etc. (h3) from sections
- Kept only "Build and Testing" (h2) in both EN and JA versions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
…l 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]>
…andards

Fixes two inconsistencies found after commit 9743daf:

1. Update quality-fixer agent reference:
   - Replace @docs/rules/ai-development-guide.md with coding-standards.md
   - This was the only remaining agent with old reference

2. Remove deleted ai-development-guide entry from rules-index.yaml:
   - English version still had metadata for non-existent file
   - Entry is now consolidated into coding-standards.md

These fixes ensure complete consistency between:
- Agent files and their rule references
- rules-index.yaml metadata and actual file content
- English and Japanese documentation structures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@shinpr shinpr self-assigned this Nov 6, 2025
@shinpr shinpr marked this pull request as ready for review November 7, 2025 01:12
@shinpr shinpr merged commit d00da2b into main Nov 7, 2025
1 check passed
@shinpr shinpr deleted the refactor/rule-optimization branch November 7, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants