Luồng Dữ Liệu — DocKit Master
Luồng Dữ Liệu
Phần tiêu đề “Luồng Dữ Liệu”Tham Khảo Nhanh
- Pattern: Sequential Pipeline (6 bước)
- Input: Câu trả lời cấu hình + source code
- Output: Astro Starlight site hoặc Markdown files
- Serialization: Markdown + YAML frontmatter
Pipeline Tổng Quan
Phần tiêu đề “Pipeline Tổng Quan”DocKit Master xử lý dữ liệu theo pipeline 6 bước tuần tự. Mỗi bước nhận output của bước trước làm input.
graph TB style S1 fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style S2 fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style S3 fill:#2d333b,stroke:#8b949e,color:#e6edf3 style S4 fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style S5 fill:#2d333b,stroke:#3fb950,color:#e6edf3 style S6 fill:#2d333b,stroke:#3fb950,color:#e6edf3
S1["📥 Step 1<br/>Gather Input"] --> S2["🔍 Step 2<br/>Analyze Codebase"] S2 --> S3["📝 Step 3<br/>Apply Guidelines"] S3 --> S4["⚙️ Step 4<br/>Generate Documents"] S4 --> S5["📤 Step 5<br/>Export + Sitemap"] S5 --> S6["✅ Step 6<br/>Summary"]Step 1: Gather Input
Phần tiêu đề “Step 1: Gather Input”Orchestrator (SKILL.md:41-118) hiển thị form 10 câu hỏi cho người dùng. Output là execution config.
sequenceDiagram participant U as 👤 User participant O as 📋 SKILL.md
O->>U: Hiển thị form cấu hình Note over U: Trả lời: "all, astro, full, yes, yes" U->>O: Cấu hình
Note over O: Auto-detect language<br/>từ ngôn ngữ chat Note over O: Generate execution plan<br/>DOC_TYPE=all, FORMAT=astro...
O->>U: Hiển thị kế hoạch triển khai Note over O: Proceed to Step 2Input: Câu trả lời người dùng (text) Output: Execution config object (10 fields)
Step 2: Analyze Codebase
Phần tiêu đề “Step 2: Analyze Codebase”Analyzer (skills/analyze-codebase.md) quét toàn bộ codebase và tạo metadata.
graph LR style SCAN fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style DETECT fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style MAP fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style OUTPUT fill:#2d333b,stroke:#3fb950,color:#e6edf3
SCAN["📂 Scan Files<br/>root, dirs, extensions"] --> DETECT["🔎 Detect Stack<br/>frameworks, languages"] DETECT --> MAP["🗺️ Map Architecture<br/>layers, entry points"] MAP --> OUTPUT["📄 analysis.md<br/>structured metadata"]Quy trình quét:
- Đọc
README.md,package.json, config files - Đếm files theo extension → detect languages
- Detect frameworks từ signal files
- Map 6 architecture layers (presentation, business, data, infra, integrations, testing)
- Extract routes, database schema, dependencies
Input: Source code files
Output: docs/analysis.md với Quick Reference, Architecture diagram, tables
Step 3: Apply Content Guidelines
Phần tiêu đề “Step 3: Apply Content Guidelines”Content engine áp dụng 3 bộ quy tắc song song:
| Bộ quy tắc | File | Mục đích |
|---|---|---|
| Content Guidelines | skills/content-guidelines.md | UX laws, Markdown rules, frontmatter schema |
| SEO Writing | skills/content-writing.md | Keyword placement, inverted pyramid, active voice |
| LLM Optimization | skills/llm-optimization.md | AI-readable heading, self-contained sections |
Các quy tắc này không tạo output file — chúng là constraints cho Step 4.
Step 4: Generate Documents
Phần tiêu đề “Step 4: Generate Documents”3 generators chạy tuần tự, mỗi generator đọc analysis.md + source code:
graph TB style ANALYSIS fill:#2d333b,stroke:#8b949e,color:#e6edf3 style TECH fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style SOP fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style API fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style OUT1 fill:#2d333b,stroke:#3fb950,color:#e6edf3 style OUT2 fill:#2d333b,stroke:#3fb950,color:#e6edf3 style OUT3 fill:#2d333b,stroke:#3fb950,color:#e6edf3
ANALYSIS["📄 analysis.md"] --> TECH["📐 tech-docs.md"] ANALYSIS --> SOP["📋 sop-guide.md"] ANALYSIS --> API["🔌 api-reference.md"]
TECH --> OUT1["architecture.md<br/>database.md<br/>deployment.md<br/>data-flow.md"] SOP --> OUT2["sop/index.md<br/>sop/[feature].md"] API --> OUT3["api/index.md<br/>api/[resource].md"]Tech Docs Generator
Phần tiêu đề “Tech Docs Generator”Sinh 4 file kỹ thuật với ≥2 Mermaid diagrams mỗi file:
architecture.md— Sơ đồ kiến trúc, ADRdatabase.md— Schema, ER diagram, indexesdeployment.md— Cài đặt, cấu hình, CI/CDdata-flow.md— Pipeline, sequence diagrams
SOP Generator
Phần tiêu đề “SOP Generator”Quét UI routes/components → nhóm theo module → sinh 1 file SOP per feature:
- Quick Reference card
- Step-by-step numbered guide
- Form field tables
- Troubleshooting (progressive disclosure)
- FAQ (schema-ready)
API Generator
Phần tiêu đề “API Generator”Quét route files → nhóm theo resource → sinh 1 file per resource:
- Endpoints overview table
- Parameters + response schemas
- Multi-language examples (cURL, Python, JS, Go)
- Error codes + rate limiting
Step 5: Export
Phần tiêu đề “Step 5: Export”Tuỳ theo FORMAT, exporter scaffold output:
Astro Path
Phần tiêu đề “Astro Path”graph LR style DOCS fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style SCAFFOLD fill:#2d333b,stroke:#6d5dfc,color:#e6edf3 style TEMPLATE fill:#2d333b,stroke:#8b949e,color:#e6edf3 style BUILD fill:#2d333b,stroke:#3fb950,color:#e6edf3 style SEO fill:#2d333b,stroke:#d29922,color:#e6edf3
DOCS["📄 docs/*.md"] --> SCAFFOLD["🚀 npm create astro"] TEMPLATE["🎯 templates/<br/>config + CSS"] --> SCAFFOLD SCAFFOLD --> BUILD["📦 npm run build<br/>→ dist/"] BUILD --> SEO["🔍 SEO Audit<br/>+ Sitemap"]npm create astro@latest— scaffold Starlight project- Copy premium template (config + CSS)
- Copy docs into
src/content/docs/ npm install && npm run build- Generate
sitemap-urls.txt+robots.txt - Run SEO checklist trên mọi trang
Markdown Path
Phần tiêu đề “Markdown Path”Copy docs trực tiếp, tạo docs/README.md làm index.
Step 6: Summary
Phần tiêu đề “Step 6: Summary”Orchestrator hiển thị cho người dùng:
- Danh sách file đã tạo + kích thước
- Hướng dẫn xem/serve docs
- Next steps (customize, deploy)
Tích Hợp Bên Ngoài
Phần tiêu đề “Tích Hợp Bên Ngoài”| Dịch vụ | Protocol | Hướng | Dữ liệu |
|---|---|---|---|
| Google Antigravity | Prompt/Response | Bidirectional | Markdown text |
| Clipboard (macOS) | pbcopy | Output only | Prompt text |
| npm Registry | HTTP | Download | Astro packages |
| NotebookLM | URL paste | Output only | sitemap-urls.txt |
Xem thêm: Kiến trúc hệ thống · Phân tích mã nguồn