jpskill.com
✍️ ライティング コミュニティ

document-project

既存のコードを分析し、システム全体の構成図や設計書などのドキュメントを自動で作成することで、古いシステムやドキュメントの更新作業を効率化するSkill。

📜 元の英語説明(参考)

Generate comprehensive architecture documentation automatically from existing codebase analysis. This skill should be used when working with brownfield projects or updating outdated documentation.

🇯🇵 日本人クリエイター向け解説

一言でいうと

既存のコードを分析し、システム全体の構成図や設計書などのドキュメントを自動で作成することで、古いシステムやドキュメントの更新作業を効率化するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o document-project.zip https://jpskill.com/download/9705.zip && unzip -o document-project.zip && rm document-project.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9705.zip -OutFile "$d\document-project.zip"; Expand-Archive "$d\document-project.zip" -DestinationPath $d -Force; ri "$d\document-project.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して document-project.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → document-project フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Brownfield Project Documentation Generator (ブラウンフィールドプロジェクトドキュメントジェネレーター)

既存のコードベースの構造、パターン、および規約を分析することにより、包括的なアーキテクチャドキュメントを自動的に生成します。

Purpose (目的)

既存のコードベースを分析し、3つの包括的なドキュメントファイルを生成します。

  1. architecture.md - プロジェクト構造、技術スタック、データモデル、API仕様
  2. standards.md - コーディング標準、ベストプラクティス、発見された規約
  3. patterns.md - デザインパターン、アーキテクチャパターン、一般的な規約

これにより、BMAD Enhanced はコードからアーキテクチャをリバースエンジニアリングすることで、ブラウンフィールドプロジェクトで動作できます。

When to Use This Skill (このスキルを使用するタイミング)

このスキルは、以下の場合に使用する必要があります。

  • 既存のプロジェクトで BMAD Enhanced を開始する場合 (ブラウンフィールドのオンボーディング)
  • アーキテクチャドキュメントが古くなっているか、欠落している場合
  • 暗黙的なパターンと規約を発見する必要がある場合
  • 不慣れなコードベースへのオンボーディング

このスキルは、以下の場合には使用しないでください。

  • グリーンフィールドプロジェクト (代わりにドキュメントを最初から作成する)
  • プロジェクトに最新の包括的なドキュメントがすでに存在する場合
  • コードベースが500K行を超える場合 (自動分析には複雑すぎる)
  • プロジェクトに明確な構造がない場合

Project Type Support (プロジェクトタイプのサポート)

Well-Supported Languages (十分にサポートされている言語):

  • ✅ Node.js/TypeScript (優れたサポート)
  • ✅ Python (良好なサポート)
  • ✅ Go (良好なサポート)
  • ✅ Java/Kotlin (良好なサポート)
  • ✅ Rust (良好なサポート)

Basic Support (基本的なサポート):

  • ⚠️ PHP, Ruby, C#/.NET (基本的なサポート)

Optimal Codebase Size (最適なコードベースサイズ): 10K-100K lines

  • Smaller (小さい): 分析するのに十分なパターンがない可能性がある
  • Larger (大きい): 分析が遅すぎるか、複雑すぎる可能性がある

Sequential Documentation Generation (シーケンシャルなドキュメント生成)

ステップを順番に実行します。それぞれが前の分析に基づいて構築されます。

Step 0: Configuration and Validation (ステップ0:構成と検証)

Purpose (目的): プロジェクトが自動ドキュメントに適していることを確認します。

Actions (アクション):

  1. .claude/config.yaml から Load config (構成をロード) します (codebasePath, existingDocs, includeTests, maxFiles)。
  2. Validate structure (構造を検証) します。パスが存在することを確認し、言語を識別し、ファイル/行をカウントし、サイズを確認します (10K-100Kを推奨)。
  3. Check existing docs (既存のドキュメントを確認) します。処理方法 (マージ/置換/補足) を尋ねます。
  4. Get confirmation (確認を取得) します。サマリー (パス、言語、ファイル数、行数、推定時間) を表示し、続行するかどうかを尋ねます。

See (参照): 完全な形式については、references/templates.md#step-0-configuration-and-validation-output を参照してください。

Halt if (停止条件):

  • Codebase path not found (コードベースパスが見つからない)
  • No recognizable project structure (認識可能なプロジェクト構造がない)
  • Codebase too large (>500K lines) (コードベースが大きすぎる (>500K行))
  • Unsupported language (サポートされていない言語)
  • User declines to proceed (ユーザーが続行を拒否する)

Output (出力): 検証の確認 (プロジェクトタイプ、行数、既存のドキュメントモード、スコープ、準備完了ステータス)

Reference (参考): 詳細な検証ルールについては、validation-criteria.md を参照してください。


Step 1: Analyze Project Structure (ステップ1:プロジェクト構造の分析)

Purpose (目的): ファイル構成とモジュール構造をマッピングします。

Actions (アクション):

  1. Scan directory structure (ディレクトリ構造をスキャン) します。メインディレクトリを識別し、パターン (機能 vs タイプ) を検出し、ネストをメモします。
  2. Analyze file organization (ファイル構成を分析) します。ディレクトリごとのファイル数、命名規則、サイズ分布、コロケーションパターン。
  3. Detect project type (プロジェクトタイプを検出) します。Backend API / Frontend App / Full-Stack / Library / Monorepo (ディレクトリ構造に基づく)。
  4. Map relationships (関係をマッピング) します。インポートを分析し、依存関係グラフを構築し、コアモジュールを識別し、循環依存関係を検出します。

Output (出力): タイプ、構成、ディレクトリ構造 (ディレクトリ + ファイル数 + 行数)、キーパターンを含むプロジェクト構造分析

See (参照): 完全な形式については、references/templates.md#step-1-codebase-analysis-output を参照してください。

Reference (参考): 詳細な分析方法については、analysis-techniques.md を参照してください。


Step 2: Analyze Technology Stack (ステップ2:技術スタックの分析)

Purpose (目的): 言語、フレームワーク、および依存関係を識別します。

Actions (アクション):

  1. Read package configuration (パッケージ構成を読み取ります):

    • Node.js: package.json
    • Python: requirements.txt, pyproject.toml
    • Go: go.mod
    • Java: pom.xml, build.gradle
    • Rust: Cargo.toml
  2. Extract dependencies and identify frameworks (依存関係を抽出し、フレームワークを識別します):

    • Backend: Express, Django, Spring Boot, etc.
    • Frontend: React, Vue, Angular, etc.
    • Database: Prisma, TypeORM, SQLAlchemy, etc.
    • Testing: Jest, Pytest, JUnit, etc.
  3. Detect runtime/platform (ランタイム/プラットフォームを検出します):

    • Node.js/Python/JDK version
    • Database type (PostgreSQL, MySQL, MongoDB)

Output (出力): 技術スタックの概要 (ランタイム、バックエンド/フロントエンドフレームワーク、キーライブラリ、テストツール、バージョン、信頼度スコア)

See (参照): 完全な形式については、references/templates.md#step-2-technology-stack-analysis を参照してください。


Step 3: Extract Data Models and Schemas (ステップ3:データモデルとスキーマの抽出)

Purpose (目的): データ構造と検証ルールをドキュメント化します。

Actions (アクション):

  1. Locate data model files (データモデルファイルを特定します):

    • Prisma schema: prisma/schema.prisma
    • TypeScript interfaces: src/types/*.ts, src/models/*.ts
    • Database migrations: prisma/migrations/, migrations/
    • Validation schemas: Zod, Yup, Joi schemas
  2. Parse data models and extract validation rules (データモデルを解析し、検証ルールを抽出します)

  3. Analyze relationships (関係を分析します):

    • One-to-many, many-to-many
    • Foreign keys and constraints
  4. Detect data flow (データフローを検出します):

    • Request → Validation → Service → Repository → Database
    • Response transformation (DTOs)

Output (出力): データモデルの概要 (フィールド/タイプ/制約を持つモデル、検証ルール、関係、信頼度スコア)

See (参照): データモデルの形式については、references/templates.md#complete-architecture-md-template を参照してください。

Reference (参考): モデル抽出パターンについては、analysis-techniques.md を参照してください。


Step 4: Analyze API Patterns (ステップ4:APIパターンの分析)

Purpose (目的): API構造と規約をドキュメント化します。

Actions (アクション):

  1. Locate API definitions (API定義を特定します):

    • Express routes: src/routes/**/*.ts
    • Controllers: src/controllers/**/*.ts
    • OpenAPI/Swagger spec (if exists)
    • GraphQL schemas (if exists)
  2. Extract endpoints and analyze request/response patterns (エンドポイントを抽出し、リクエスト/レスポンスパターンを分析します):

    • Request validation (middleware)
    • Error response format
    • Success response format
    • Status codes used
  3. Identify authentication (認証を識別します):

    • JWT tokens, session-based, API keys, OAuth
  4. Detect rate limiting and other middleware (レート制限およびその他のミドルウェアを検出します)

Output (出力): API仕様の概要 (

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Brownfield Project Documentation Generator

Generate comprehensive architecture documentation automatically by analyzing existing codebase structure, patterns, and conventions.

Purpose

Analyze an existing codebase and generate three comprehensive documentation files:

  1. architecture.md - Project structure, tech stack, data models, API specifications
  2. standards.md - Coding standards, best practices, discovered conventions
  3. patterns.md - Design patterns, architectural patterns, common conventions

This enables BMAD Enhanced to work with brownfield projects by reverse-engineering architecture from code.

When to Use This Skill

This skill should be used when:

  • Starting BMAD Enhanced with existing project (brownfield onboarding)
  • Architecture documentation is outdated or missing
  • Need to discover implicit patterns and conventions
  • Onboarding to unfamiliar codebase

This skill should NOT be used when:

  • Greenfield projects (write docs from scratch instead)
  • Project already has current, comprehensive documentation
  • Codebase >500K lines (too complex for automated analysis)
  • Project has no clear structure

Project Type Support

Well-Supported Languages:

  • ✅ Node.js/TypeScript (excellent support)
  • ✅ Python (good support)
  • ✅ Go (good support)
  • ✅ Java/Kotlin (good support)
  • ✅ Rust (good support)

Basic Support:

  • ⚠️ PHP, Ruby, C#/.NET (basic support)

Optimal Codebase Size: 10K-100K lines

  • Smaller: May lack sufficient patterns to analyze
  • Larger: Analysis may be too slow or complex

Sequential Documentation Generation

Execute steps in order - each builds on previous analysis:

Step 0: Configuration and Validation

Purpose: Verify project is suitable for automated documentation.

Actions:

  1. Load config from .claude/config.yaml (codebasePath, existingDocs, includeTests, maxFiles)
  2. Validate structure: Check path exists, identify languages, count files/lines, verify size (10K-100K recommended)
  3. Check existing docs: Ask how to handle (merge/replace/supplement)
  4. Get confirmation: Show summary (path, language, file count, lines, estimated time), ask to proceed

See: references/templates.md#step-0-configuration-and-validation-output for complete formats

Halt if:

  • Codebase path not found
  • No recognizable project structure
  • Codebase too large (>500K lines)
  • Unsupported language
  • User declines to proceed

Output: Validation confirmation (project type, lines, existing docs mode, scope, ready status)

Reference: See validation-criteria.md for detailed validation rules.


Step 1: Analyze Project Structure

Purpose: Map file organization and module structure.

Actions:

  1. Scan directory structure: Identify main dirs, detect patterns (feature vs type), note nesting
  2. Analyze file organization: Files per dir, naming conventions, size distribution, co-location patterns
  3. Detect project type: Backend API / Frontend App / Full-Stack / Library / Monorepo (based on directory structure)
  4. Map relationships: Analyze imports, build dependency graph, identify core modules, detect circular dependencies

Output: Project structure analysis with type, organization, directory structure (dirs + file counts + line counts), key patterns

See: references/templates.md#step-1-codebase-analysis-output for complete format

Reference: See analysis-techniques.md for detailed analysis methods.


Step 2: Analyze Technology Stack

Purpose: Identify languages, frameworks, and dependencies.

Actions:

  1. Read package configuration:

    • Node.js: package.json
    • Python: requirements.txt, pyproject.toml
    • Go: go.mod
    • Java: pom.xml, build.gradle
    • Rust: Cargo.toml
  2. Extract dependencies and identify frameworks:

    • Backend: Express, Django, Spring Boot, etc.
    • Frontend: React, Vue, Angular, etc.
    • Database: Prisma, TypeORM, SQLAlchemy, etc.
    • Testing: Jest, Pytest, JUnit, etc.
  3. Detect runtime/platform:

    • Node.js/Python/JDK version
    • Database type (PostgreSQL, MySQL, MongoDB)

Output: Tech stack summary (runtime, backend/frontend frameworks, key libraries, testing tools, versions, confidence score)

See: references/templates.md#step-2-technology-stack-analysis for complete format


Step 3: Extract Data Models and Schemas

Purpose: Document data structures and validation rules.

Actions:

  1. Locate data model files:

    • Prisma schema: prisma/schema.prisma
    • TypeScript interfaces: src/types/*.ts, src/models/*.ts
    • Database migrations: prisma/migrations/, migrations/
    • Validation schemas: Zod, Yup, Joi schemas
  2. Parse data models and extract validation rules

  3. Analyze relationships:

    • One-to-many, many-to-many
    • Foreign keys and constraints
  4. Detect data flow:

    • Request → Validation → Service → Repository → Database
    • Response transformation (DTOs)

Output: Data models summary (models with fields/types/constraints, validation rules, relationships, confidence score)

See: references/templates.md#complete-architecture-md-template for data model format

Reference: See analysis-techniques.md for model extraction patterns.


Step 4: Analyze API Patterns

Purpose: Document API structure and conventions.

Actions:

  1. Locate API definitions:

    • Express routes: src/routes/**/*.ts
    • Controllers: src/controllers/**/*.ts
    • OpenAPI/Swagger spec (if exists)
    • GraphQL schemas (if exists)
  2. Extract endpoints and analyze request/response patterns:

    • Request validation (middleware)
    • Error response format
    • Success response format
    • Status codes used
  3. Identify authentication:

    • JWT tokens, session-based, API keys, OAuth
  4. Detect rate limiting and other middleware

Output: API specs summary (base URL, authentication type/headers/expiry, error/success response formats, confidence score)

See: references/templates.md#complete-architecture-md-template for API specification format


Step 5: Extract Coding Standards and Patterns

Purpose: Document implicit conventions and best practices.

Actions:

  1. Analyze code style:

    • Read .eslintrc, .prettierrc, tsconfig.json
    • Detect: indentation, quotes, semicolons
    • Naming conventions: variables, functions, classes, files
  2. Identify architectural patterns:

    • Design patterns: Repository, Factory, Strategy
    • Architectural style: Layered, Clean, Hexagonal
  3. Extract error handling patterns:

    • Error classes
    • Centralized error handling
    • Logging patterns
  4. Detect testing patterns:

    • Test organization
    • Mocking strategy
    • Test data management

Output:

Coding Standards:

Code Style:
- Indentation: 2 spaces
- Quotes: Single quotes
- Naming: camelCase (variables), PascalCase (classes), kebab-case (files)

Architectural Patterns:
1. Layered Architecture
   - Routes (presentation layer)
   - Services (business logic layer)
   - Repositories (data access layer)

2. Dependency Injection
3. Repository Pattern

Error Handling:
- Custom error classes (AppError, ValidationError)
- Centralized error handling middleware
- Never expose stack traces to clients

Confidence: High (90%)

Reference: See pattern-detection.md for pattern identification techniques.


Step 6: Generate Architecture Documentation

Purpose: Create comprehensive architecture.md from findings.

Actions:

  1. Load architecture template structure

  2. Populate sections with analyzed data from Steps 1-5:

    • Overview, tech stack, project structure
    • Data models, API specifications
    • Include confidence scores where applicable
    • Add source file references
  3. Generate diagrams (optional):

    • Mermaid diagrams for architecture layers
    • Data model ERD
    • API endpoint map
  4. Add human review notes for medium/low confidence sections

  5. Write documentation file:

    • Create docs/architecture.md
    • Or merge with existing docs if "merge" mode selected

Output:

✓ Architecture documentation generated
✓ File: docs/architecture.md (2,450 lines)
✓ Sections: 12
✓ Overall confidence: 85%
✓ Human review items: 5

Reference: See documentation-templates.md for template structures.


Step 7: Generate Standards Documentation

Purpose: Create standards.md from discovered patterns.

Actions:

  1. Extract standards from code analysis:

    • Security standards (from security practices)
    • Testing standards (from test patterns)
    • Code quality standards (from ESLint rules)
    • Performance standards (from observed patterns)
  2. Document best practices:

    • Observed consistently across codebase
    • Mark as "discovered" vs "recommended"
  3. Create standards document with examples and consistency scores

Output:

✓ Standards documentation generated
✓ File: docs/standards.md (850 lines)
✓ Standards extracted: 18
✓ Consistency scores: 75-100%

Step 8: Generate Patterns Documentation

Purpose: Document discovered design patterns and conventions.

Actions:

  1. Extract design patterns:

    • Repository, Factory, Strategy, Middleware patterns
  2. Document usage examples:

    • Show code examples of each pattern
    • Explain when to use
    • Link to existing implementations
  3. Identify anti-patterns:

    • Code smells detected
    • Inconsistencies
    • Technical debt
  4. Create patterns document

Output:

✓ Patterns documentation generated
✓ File: docs/patterns.md (620 lines)
✓ Patterns identified: 8
✓ Anti-patterns noted: 3

Reference: See pattern-detection.md for pattern documentation templates.


Step 9: Validation and Confidence Scoring

Purpose: Score accuracy and identify areas needing human review.

Actions:

  1. Calculate confidence: Score each section (tech stack, structure, data models, API, standards) and compute overall
  2. Identify low-confidence areas: Find sections <70%, conflicting patterns, missing info
  3. Generate review checklist: List high/medium priority items needing human verification
  4. Create validation report

Output: Validation summary (overall confidence %, high/medium priority review item counts)

See: references/templates.md#review-checklist-template and references/confidence-scoring.md for formats

Reference: See confidence-scoring.md for scoring guidelines.


Step 10: Summary and Next Steps

Purpose: Provide user with clear summary and action items.

Actions:

  1. Generate summary report: Project name, duration, files analyzed, confidence, generated docs (paths + line counts), key findings (type, arch, tech stack, test coverage), next steps
  2. Create review checklist file: docs/REVIEW_CHECKLIST.md
  3. Update config: Set brownfield flag, doc paths, documented=true
  4. Prompt next action: Review items, create task spec, run index-docs, or exit

Output: Summary confirmation (report generated, checklist created, config updated, ready status)

See: references/templates.md for complete summary formats


Confidence Scoring Guidelines

High (85-100%): Explicit in code/config, consistent patterns, no conflicts | Medium (70-84%): Inferred from patterns, some inconsistencies, needs validation | Low (<70%): Missing/unclear info, conflicts, high uncertainty, MUST review

See: references/confidence-scoring.md for detailed scoring methodology


Limitations

Cannot: Understand business logic without context, document deployment infrastructure, capture tribal knowledge, understand legacy decisions, document external integrations perfectly

Requires: Readable structured codebase, standard organization, supported language/framework, 10K-100K lines (optimal)

Best Practices

Run periodically (every 3-6 months) | Always review low-confidence sections | Supplement with manual docs (business context, deployment) | Use as starting point, enhance with team input

Integration with Planning Workflow

Brownfield: document-project → index-docs → create-task-spec (use generated docs) | Greenfield: Write docs manually first | Brownfield: Generate from code, then refine

References

Detailed documentation in references/:

  • templates.md: All output formats, complete architecture/standards/patterns templates, analysis summaries, review checklists, error templates
  • analysis-techniques.md: Analysis methods for structure, tech stack, models, APIs, patterns
  • pattern-detection.md: Pattern identification and documentation techniques
  • documentation-templates.md: Templates for architecture, standards, patterns docs
  • confidence-scoring.md: Confidence calculation methodology and validation criteria
  • validation-criteria.md: Project validation rules and sizing guidelines