c4-architecture-c4-architecture
Fungsinya
Tool ini membuat peta arsitektur kode Anda secara detail, yang menunjukkan bagaimana berbagai bagian program saling terhubung. Tool ini menganalisis kode dari bawah ke atas (bottom-up), dimulai dari detail terkecil lalu membangun gambaran besarnya.
Kapan dipakai
- ✓Saat memulai proyek perangkat lunak baru dan ingin mendokumentasikan strukturnya.
- ✓Saat perlu memahami bagaimana sistem perangkat lunak yang sudah ada diorganisasi.
- ✓Saat ingin menjelaskan arsitektur kode Anda kepada orang lain.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/c4-architecture-c4-architecture/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Buatkan dokumentasi arsitektur C4 untuk repositori kode saya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Tool ini memeriksa setiap bagian kode Anda, lalu mendokumentasikan fungsi dan class. Bagian-bagian tersebut kemudian dikelompokkan menjadi komponen logis, lalu menjadi container (seperti aplikasi atau database), dan akhirnya menjadi konteks sistem secara keseluruhan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
C4 Architecture Documentation Workflow
Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]
Use this skill when
- Working on c4 architecture documentation workflow tasks or workflows
- Needing guidance, best practices, or checklists for c4 architecture documentation workflow
Do not use this skill when
- The task is unrelated to c4 architecture documentation workflow
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Overview
This workflow creates comprehensive C4 architecture documentation following the official C4 model by:
- Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
- Component Level: Synthesizing code documentation into logical components within containers
- Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
- Context Level: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)
Note: According to the C4 model, you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.
All documentation is written to a new C4-Documentation/ directory in the repository root.
Phase 1: Code-Level Documentation (Bottom-Up Analysis)
1.1 Discover All Subdirectories
- Use codebase search to identify all subdirectories in the repository
- Sort directories by depth (deepest first) for bottom-up processing
- Filter out common non-code directories (node_modules, .git, build, dist, etc.)
- Create list of directories to process
1.2 Process Each Directory (Bottom-Up)
For each directory, starting from the deepest:
Use Task tool with subagent_type="c4-architecture::c4-code"
Prompt: | Analyze the code in directory: [directory_path]
Create comprehensive C4 Code-level documentation following this structure:
- Overview Section:
- Name: [Descriptive name for this code directory]
- Description: [Short description of what this code does]
- Location: [Link to actual directory path relative to repo root]
- Language: [Primary programming language(s) used]
- Purpose: [What this code accomplishes]
- Code Elements Section:
- Document all functions/methods with complete signatures:
- Function name, parameters (with types), return type
- Description of what each function does
- Location (file path and line numbers)
- Dependencies (what this function depends on)
- Document all classes/modules:
- Class name, description, location
- Methods and their signatures
- Dependencies
- Document all functions/methods with complete signatures:
- Dependencies Section:
- Internal dependencies (other code in this repo)
- External dependencies (libraries, frameworks, services)
- Relationships Section:
- Optional Mermaid diagram if relationships are complex
Save the output as: C4-Documentation/c4-code-[directory-name].md Use a sanitized directory name (replace / with -, remove special chars) for the filename.
Ensure the documentation includes:
- Complete function signatures with all parameters and types
- Links to actual source code locations
- All dependencies (internal and external)
- Clear, descriptive names and descriptions
- Overview Section:
Expected output: c4-code-<directory-name>.md file in C4-Documentation/
Context: All files in the directory and its subdirectories
…
Pertanyaan umum
Apa itu model C4?
Model C4 adalah cara untuk menggambarkan arsitektur perangkat lunak dalam empat level detail: Context, Container, Component, dan Code. Model ini membantu memvisualisasikan dan mengomunikasikan struktur perangkat lunak.
Mengapa analisis dilakukan 'bottom-up'?
Analisis 'bottom-up' berarti dimulai dari detail paling kecil (kode) lalu bergerak naik ke level yang lebih tinggi. Dengan cara ini, tidak ada yang terlewat dan dokumentasi dibangun di atas dasar informasi yang detail.
Di mana dokumentasinya akan disimpan?
Dokumentasi yang dihasilkan akan disimpan dalam folder baru bernama `C4-Documentation/` di root repositori Anda.
Detail
Deskripsi asli dari pembuat
Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #4097
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- …
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
technical-documentation
394kMembantu agent Anda menulis dan meninjau dokumentasi teknis serta file instruksi agent yang jelas, agar orang dan alat AI dapat mengikutinya dengan mudah.
architecture-decision-records
280kMembuat agent Anda mencatat keputusan penting terkait struktur proyek. Membantu memahami alasan di balik pilihan dan menjaga riwayat perubahan yang jelas.
code-tour
280kMembuat agent Anda menyusun panduan kode langkah demi langkah dengan referensi file dan nomor baris yang tepat. Berguna untuk pengenalan, penjelasan, dan review.