@haposoft/cafekit 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +866 -0
- package/bin/install.js +773 -0
- package/package.json +40 -0
- package/src/antigravity/GEMINI.md +162 -0
- package/src/antigravity/workflows/code.md +16 -0
- package/src/antigravity/workflows/docs-init.md +432 -0
- package/src/antigravity/workflows/docs-update.md +245 -0
- package/src/antigravity/workflows/review.md +15 -0
- package/src/antigravity/workflows/spec-design.md +220 -0
- package/src/antigravity/workflows/spec-init.md +78 -0
- package/src/antigravity/workflows/spec-requirements.md +122 -0
- package/src/antigravity/workflows/spec-status.md +95 -0
- package/src/antigravity/workflows/spec-tasks.md +156 -0
- package/src/antigravity/workflows/spec-validate.md +106 -0
- package/src/antigravity/workflows/test.md +13 -0
- package/src/claude/ROUTING.md +101 -0
- package/src/claude/agents/code-reviewer.md +131 -0
- package/src/claude/agents/debugger.md +137 -0
- package/src/claude/agents/fullstack-developer.md +95 -0
- package/src/claude/agents/tester.md +105 -0
- package/src/claude/commands/code.md +17 -0
- package/src/claude/commands/docs.md +609 -0
- package/src/claude/commands/review/codebase/parallel.md +122 -0
- package/src/claude/commands/review/codebase.md +49 -0
- package/src/claude/commands/review.md +16 -0
- package/src/claude/commands/spec-design.md +247 -0
- package/src/claude/commands/spec-init.md +118 -0
- package/src/claude/commands/spec-requirements.md +138 -0
- package/src/claude/commands/spec-status.md +98 -0
- package/src/claude/commands/spec-tasks.md +173 -0
- package/src/claude/commands/spec-validate.md +118 -0
- package/src/claude/commands/test.md +8 -0
- package/src/claude/migration-manifest.json +39 -0
- package/src/common/skills/specs/SKILL.md +101 -0
- package/src/common/skills/specs/rules/design-discovery-full.md +93 -0
- package/src/common/skills/specs/rules/design-discovery-light.md +49 -0
- package/src/common/skills/specs/rules/design-principles.md +182 -0
- package/src/common/skills/specs/rules/design-review.md +110 -0
- package/src/common/skills/specs/rules/ears-format.md +49 -0
- package/src/common/skills/specs/rules/gap-analysis.md +144 -0
- package/src/common/skills/specs/rules/steering-principles.md +90 -0
- package/src/common/skills/specs/rules/tasks-generation.md +131 -0
- package/src/common/skills/specs/rules/tasks-parallel-analysis.md +34 -0
- package/src/common/skills/specs/templates/design.md +276 -0
- package/src/common/skills/specs/templates/init.json +41 -0
- package/src/common/skills/specs/templates/requirements-init.md +9 -0
- package/src/common/skills/specs/templates/requirements.md +26 -0
- package/src/common/skills/specs/templates/research.md +61 -0
- package/src/common/skills/specs/templates/tasks.md +21 -0
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@haposoft/cafekit",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first and code-test-review workflows.",
|
|
5
|
+
"author": "Haposoft <nghialt@haposoft.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"bin": {
|
|
9
|
+
"cafekit": "./bin/install.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin",
|
|
13
|
+
"src",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/haposoft/cafekit.git",
|
|
19
|
+
"directory": "packages/spec"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/haposoft/cafekit#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/haposoft/cafekit/issues"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"haposoft",
|
|
27
|
+
"cafekit",
|
|
28
|
+
"spec-driven",
|
|
29
|
+
"workflow",
|
|
30
|
+
"claude-code",
|
|
31
|
+
"antigravity",
|
|
32
|
+
"ai-coding",
|
|
33
|
+
"specification",
|
|
34
|
+
"requirements",
|
|
35
|
+
"sdd"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GEMINI.md - Antigravity Kit
|
|
6
|
+
|
|
7
|
+
> This file defines how the AI behaves in this workspace.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
12
|
+
|
|
13
|
+
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
14
|
+
|
|
15
|
+
### 1. Modular Skill Loading Protocol
|
|
16
|
+
|
|
17
|
+
Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
|
|
18
|
+
|
|
19
|
+
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
|
20
|
+
- **Rule Priority:** P0 (GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
|
|
21
|
+
|
|
22
|
+
### 2. Enforcement Protocol
|
|
23
|
+
|
|
24
|
+
1. **When agent is activated:**
|
|
25
|
+
- ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
|
|
26
|
+
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
|
|
27
|
+
3. **Artifact Ban:** DO NOT create "Implementation Plan" artifacts (sidebar artifacts) unless the user EXPLICITLY asks for them. Use standard markdown files in `docs/` or text responses instead.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 📥 REQUEST CLASSIFIER (STEP 1)
|
|
32
|
+
|
|
33
|
+
**Before ANY action, classify the request:**
|
|
34
|
+
|
|
35
|
+
| Request Type | Trigger Keywords | Active Tiers | Result |
|
|
36
|
+
| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
|
|
37
|
+
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
38
|
+
| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
39
|
+
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
40
|
+
| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
41
|
+
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
42
|
+
| **SLASH CMD** | /spec-init, /spec-requirements, /spec-design, /spec-tasks, /spec-status, /code, /test, /review, /docs-init, /docs-update | Command-specific flow | Variable |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## TIER 0: UNIVERSAL RULES (Always Active)
|
|
47
|
+
|
|
48
|
+
### 💬 Response Format
|
|
49
|
+
|
|
50
|
+
All responses must generally follow this structure:
|
|
51
|
+
1. **Explanation**: Brief context/problem/solution.
|
|
52
|
+
2. **Implementation**: Code/Action with clear comments.
|
|
53
|
+
3. **Usage/Caveats**: (If applicable)
|
|
54
|
+
4. **Next Action:** (MANDATORY) Specific proposed next step.
|
|
55
|
+
- Example: "Use `/spec-init` to start", "Review `docs/PLAN-x.md`", "Run `pytest`".
|
|
56
|
+
|
|
57
|
+
### 🌐 Language Handling
|
|
58
|
+
|
|
59
|
+
When user's prompt is NOT in English:
|
|
60
|
+
|
|
61
|
+
1. **Internally translate** for better comprehension
|
|
62
|
+
2. **Respond in user's language** - match their communication
|
|
63
|
+
3. **Code comments/variables** remain in English
|
|
64
|
+
|
|
65
|
+
### 🧹 Clean Code (Global Mandatory)
|
|
66
|
+
|
|
67
|
+
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
|
68
|
+
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
|
69
|
+
- **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).
|
|
70
|
+
- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
|
|
71
|
+
- Concise, direct, solution-focused
|
|
72
|
+
- No verbose explanations
|
|
73
|
+
- No over-commenting
|
|
74
|
+
- No over-engineering
|
|
75
|
+
- **Artifact Control:** DO NOT create "Implementation Plan" artifacts (sidebar artifacts) unless the user EXPLICITLY asks for them. Use standard markdown files in `docs/` or text responses instead.
|
|
76
|
+
- **Self-Documentation:** Every agent is responsible for documenting their own changes in relevant `.md` files.
|
|
77
|
+
|
|
78
|
+
### 🗺️ System Map Read
|
|
79
|
+
|
|
80
|
+
**Path Awareness:**
|
|
81
|
+
|
|
82
|
+
- Skills: `.agent/skills/` (Project)
|
|
83
|
+
- Workflows: `.agent/workflows/` (Project)
|
|
84
|
+
- Models: `.agent/models/` (Project)
|
|
85
|
+
- Specs: `.specs/` (Project)
|
|
86
|
+
|
|
87
|
+
### 🧠 Read → Understand → Apply
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
❌ WRONG: Read agent file → Start coding
|
|
91
|
+
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Before coding, answer:**
|
|
95
|
+
|
|
96
|
+
1. What is the GOAL of this agent/skill?
|
|
97
|
+
2. What PRINCIPLES must I apply?
|
|
98
|
+
3. How does this DIFFER from generic output?
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## TIER 1: CODE RULES (When Writing Code)
|
|
103
|
+
|
|
104
|
+
### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
|
|
105
|
+
|
|
106
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
107
|
+
|
|
108
|
+
| Request Type | Strategy | Required Action |
|
|
109
|
+
| ----------------------- | -------------- | ----------------------------------------------------------------- |
|
|
110
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
111
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
112
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
113
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
114
|
+
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
115
|
+
|
|
116
|
+
**Protocol:**
|
|
117
|
+
|
|
118
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
119
|
+
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
|
120
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 📁 AVAILABLE WORKFLOWS
|
|
125
|
+
|
|
126
|
+
### Spec-Driven Development
|
|
127
|
+
|
|
128
|
+
| Command | Mô tả |
|
|
129
|
+
|---------|-------|
|
|
130
|
+
| `/spec-init <mô tả>` | Khởi tạo spec mới từ ý tưởng |
|
|
131
|
+
| `/spec-requirements <feature>` | Sinh requirements (EARS format) |
|
|
132
|
+
| `/spec-design <feature>` | Sinh design doc + research |
|
|
133
|
+
| `/spec-tasks <feature>` | Sinh task list |
|
|
134
|
+
| `/code <feature>` | Implement task từ spec và chuyển qua test/review |
|
|
135
|
+
| `/spec-status <feature>` | Xem trạng thái hiện tại |
|
|
136
|
+
|
|
137
|
+
### Documentation
|
|
138
|
+
|
|
139
|
+
| Command | Mô tả |
|
|
140
|
+
|---------|-------|
|
|
141
|
+
| `/docs-init` | Initialize project documentation |
|
|
142
|
+
| `/docs-update` | Update existing documentation |
|
|
143
|
+
|
|
144
|
+
**Usage:**
|
|
145
|
+
- Read `.agent/skills/specs/SKILL.md` for detailed workflow information
|
|
146
|
+
- Each workflow has its own file in `.agent/workflows/` with specific instructions
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 📁 QUICK REFERENCE
|
|
151
|
+
|
|
152
|
+
### Skills
|
|
153
|
+
|
|
154
|
+
- **specs**: Complete SDD workflow from idea to implementation
|
|
155
|
+
|
|
156
|
+
### Workflows Location
|
|
157
|
+
|
|
158
|
+
- Workflows: `.agent/workflows/`
|
|
159
|
+
- Skill definitions: `.agent/skills/`
|
|
160
|
+
- Spec data: `.specs/<feature-name>/`
|
|
161
|
+
|
|
162
|
+
---
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implement approved work from specification tasks and then hand off to test and review.
|
|
3
|
+
allowed-tools: Read, Glob, Grep, Edit, Write, Bash
|
|
4
|
+
argument-hint: <feature-name>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /code - Implement from spec tasks
|
|
8
|
+
|
|
9
|
+
Use this workflow after `/spec-tasks`.
|
|
10
|
+
|
|
11
|
+
1. Read `.specs/$ARGUMENTS/tasks.md` and identify the next pending task.
|
|
12
|
+
2. Implement only that task following project standards.
|
|
13
|
+
3. Run `/test`.
|
|
14
|
+
4. Run `/review`.
|
|
15
|
+
|
|
16
|
+
Preferred flow: `/spec-init` - `/spec-requirements` - `/spec-design` - `/spec-tasks` - `/code` - `/test` - `/review`
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize comprehensive documentation for the project. Use when setting up docs for the first time or creating documentation skeleton from existing codebase.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /docs-init - Initialize Project Documentation
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This workflow creates comprehensive documentation structure for your project:
|
|
10
|
+
- Generates 7 core documentation files
|
|
11
|
+
- Creates project context file (.agent/rules/AGENTS.md)
|
|
12
|
+
- Uses repomix for codebase analysis
|
|
13
|
+
|
|
14
|
+
## ⚠️ IMPORTANT: Execute Immediately
|
|
15
|
+
|
|
16
|
+
**DO NOT create an implementation plan.** This workflow should be executed directly without planning mode.
|
|
17
|
+
- Run all steps sequentially
|
|
18
|
+
- Create files immediately as described
|
|
19
|
+
- No approval needed between steps
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Step 1: Check Prerequisites
|
|
24
|
+
|
|
25
|
+
**Check if docs/ already exists:**
|
|
26
|
+
```bash
|
|
27
|
+
ls -la docs/ 2>/dev/null && echo "EXISTS" || echo "NOT_FOUND"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**If docs/ exists:**
|
|
31
|
+
- Ask user: "docs/ already exists. Overwrite / Merge / Skip?"
|
|
32
|
+
- Default: "Merge" (preserve existing, add missing)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 2: Install Repomix
|
|
37
|
+
|
|
38
|
+
**Check if repomix is installed:**
|
|
39
|
+
```bash
|
|
40
|
+
which repomix 2>/dev/null || npm list -g repomix 2>/dev/null
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**If repomix not found:**
|
|
44
|
+
- Detect package manager:
|
|
45
|
+
```bash
|
|
46
|
+
test -f pnpm-lock.yaml && PM="pnpm"
|
|
47
|
+
test -f yarn.lock && PM="yarn"
|
|
48
|
+
test -f bun.lockb && PM="bun"
|
|
49
|
+
PM="${PM:-npm}"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
// turbo
|
|
53
|
+
- Run `$PM install -g repomix`
|
|
54
|
+
- Verify: `which repomix`
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Step 3: Run Repomix Analysis
|
|
59
|
+
|
|
60
|
+
// turbo
|
|
61
|
+
```bash
|
|
62
|
+
repomix
|
|
63
|
+
ls -la ./repomix-output.xml
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 4: Auto-Detect Project Information
|
|
69
|
+
|
|
70
|
+
**Detect Package Manager & Tech Stack:**
|
|
71
|
+
```bash
|
|
72
|
+
test -f pnpm-lock.yaml && echo "PNPM"
|
|
73
|
+
test -f yarn.lock && echo "YARN"
|
|
74
|
+
test -f package-lock.json && echo "NPM"
|
|
75
|
+
test -f bun.lockb && echo "BUN"
|
|
76
|
+
test -f requirements.txt && echo "PIP"
|
|
77
|
+
test -f poetry.lock && echo "POETRY"
|
|
78
|
+
test -f go.mod && echo "GO"
|
|
79
|
+
test -f Cargo.toml && echo "CARGO"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Read Config Files:**
|
|
83
|
+
- Read `package.json` for name, version, scripts, dependencies
|
|
84
|
+
- Read `pyproject.toml` if Python project
|
|
85
|
+
- Read `go.mod` if Go project
|
|
86
|
+
- Read `README.md` for description
|
|
87
|
+
|
|
88
|
+
**Extract:**
|
|
89
|
+
- Project name, version, description
|
|
90
|
+
- Tech stack with versions
|
|
91
|
+
- Available scripts/commands
|
|
92
|
+
- Key dependencies
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 5: Detect Project Structure
|
|
97
|
+
|
|
98
|
+
**Get directory structure:**
|
|
99
|
+
```bash
|
|
100
|
+
find . -maxdepth 3 -type d ! -path './node_modules/*' ! -path './.git/*' ! -path './.*' 2>/dev/null | sort | head -40
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Detect Platforms & Tools:**
|
|
104
|
+
- **Deployment**: `vercel.json`, `netlify.toml`, `Dockerfile`, `fly.toml`, `.github/workflows`
|
|
105
|
+
- **Database**: `prisma/schema.prisma`, `drizzle.config.ts`
|
|
106
|
+
- **API**: `src/app/api`, `src/routes`, `pages/api`
|
|
107
|
+
- **Testing**: Check package.json for `vitest`, `jest`, `playwright`, `cypress`
|
|
108
|
+
- **UI**: Check for `tailwind`, `@base-ui`, `shadcn`, etc.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 6: Create docs/ Directory
|
|
113
|
+
|
|
114
|
+
// turbo
|
|
115
|
+
```bash
|
|
116
|
+
mkdir -p docs/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Step 7: Generate Documentation Files
|
|
122
|
+
|
|
123
|
+
### 7.1 Create docs/codebase-summary.md
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
# Codebase Summary
|
|
127
|
+
|
|
128
|
+
> Auto-generated project overview
|
|
129
|
+
|
|
130
|
+
## Project Info
|
|
131
|
+
| Property | Value |
|
|
132
|
+
|----------|-------|
|
|
133
|
+
| **Name** | {from package.json} |
|
|
134
|
+
| **Version** | {from package.json} |
|
|
135
|
+
| **Type** | {detected} |
|
|
136
|
+
| **Package Manager** | {detected} |
|
|
137
|
+
|
|
138
|
+
## Statistics
|
|
139
|
+
| Metric | Value |
|
|
140
|
+
|--------|-------|
|
|
141
|
+
| Files | {from repomix} |
|
|
142
|
+
| Tokens | {from repomix} |
|
|
143
|
+
| Generated | {timestamp} |
|
|
144
|
+
|
|
145
|
+
## Tech Stack
|
|
146
|
+
| Layer | Technology |
|
|
147
|
+
|-------|------------|
|
|
148
|
+
| Framework | {detected with version} |
|
|
149
|
+
| Language | {detected} |
|
|
150
|
+
| Styling | {detected} |
|
|
151
|
+
| UI Library | {detected} |
|
|
152
|
+
| Database | {if detected} |
|
|
153
|
+
| Testing | {if detected} |
|
|
154
|
+
|
|
155
|
+
## Project Structure
|
|
156
|
+
```
|
|
157
|
+
{directory tree from analysis}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Key Directories
|
|
161
|
+
| Directory | Purpose |
|
|
162
|
+
|-----------|---------|
|
|
163
|
+
| {detected} | {inferred purpose} |
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 7.2 Create docs/project-overview-pdr.md
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
# Project Overview (PDR)
|
|
170
|
+
|
|
171
|
+
## Identity
|
|
172
|
+
- **Name:** {name}
|
|
173
|
+
- **Type:** {type}
|
|
174
|
+
- **Status:** Active
|
|
175
|
+
|
|
176
|
+
## Description
|
|
177
|
+
{from package.json description or README}
|
|
178
|
+
|
|
179
|
+
## Features
|
|
180
|
+
{extract from codebase}
|
|
181
|
+
|
|
182
|
+
## Roadmap
|
|
183
|
+
- [ ] Current sprint
|
|
184
|
+
- [ ] Next milestones
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 7.3 Create docs/code-standards.md
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
# Code Standards
|
|
191
|
+
|
|
192
|
+
## Stack
|
|
193
|
+
- Language: {detected}
|
|
194
|
+
- Framework: {detected}
|
|
195
|
+
- Linting: {detected}
|
|
196
|
+
|
|
197
|
+
## Conventions
|
|
198
|
+
{inferred from codebase patterns}
|
|
199
|
+
|
|
200
|
+
## Patterns
|
|
201
|
+
{common patterns detected}
|
|
202
|
+
|
|
203
|
+
## File Organization
|
|
204
|
+
{detected structure}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 7.4 Create docs/system-architecture.md
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
# System Architecture
|
|
211
|
+
|
|
212
|
+
## Overview
|
|
213
|
+
{architecture type: monolith, microservices, serverless, etc.}
|
|
214
|
+
|
|
215
|
+
## Components
|
|
216
|
+
| Component | Tech | Purpose |
|
|
217
|
+
|-----------|------|---------|
|
|
218
|
+
| Frontend | {detected} | UI layer |
|
|
219
|
+
| Backend | {detected} | API layer |
|
|
220
|
+
| Database | {detected} | Data persistence |
|
|
221
|
+
|
|
222
|
+
## Data Flow
|
|
223
|
+
{simple description}
|
|
224
|
+
|
|
225
|
+
## API Structure
|
|
226
|
+
{if detected}
|
|
227
|
+
|
|
228
|
+
## Database Schema
|
|
229
|
+
{if detected}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 7.5 Create docs/design-guidelines.md
|
|
233
|
+
|
|
234
|
+
```markdown
|
|
235
|
+
# Design Guidelines
|
|
236
|
+
|
|
237
|
+
## System
|
|
238
|
+
- CSS Framework: {Tailwind/Styled/etc}
|
|
239
|
+
- UI Library: {detected}
|
|
240
|
+
- Icons: {detected}
|
|
241
|
+
|
|
242
|
+
## Patterns
|
|
243
|
+
{detected patterns}
|
|
244
|
+
|
|
245
|
+
## Responsive
|
|
246
|
+
{breakpoints if Tailwind}
|
|
247
|
+
|
|
248
|
+
## Theme
|
|
249
|
+
{dark/light mode setup}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 7.6 Create docs/deployment-guide.md
|
|
253
|
+
|
|
254
|
+
```markdown
|
|
255
|
+
# Deployment Guide
|
|
256
|
+
|
|
257
|
+
## Platform
|
|
258
|
+
{detected platform}
|
|
259
|
+
|
|
260
|
+
## Quick Deploy
|
|
261
|
+
```bash
|
|
262
|
+
{platform-specific commands}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Environment Variables
|
|
266
|
+
{from .env.example if exists}
|
|
267
|
+
|
|
268
|
+
## Available Commands
|
|
269
|
+
| Command | Purpose |
|
|
270
|
+
|---------|---------|
|
|
271
|
+
| {from package.json} | {description} |
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### 7.7 Create docs/project-roadmap.md
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
# Project Roadmap
|
|
278
|
+
|
|
279
|
+
## Current
|
|
280
|
+
{detected state}
|
|
281
|
+
|
|
282
|
+
## Short Term (30 days)
|
|
283
|
+
- [ ] Tasks
|
|
284
|
+
|
|
285
|
+
## Medium Term (90 days)
|
|
286
|
+
- [ ] Enhancements
|
|
287
|
+
|
|
288
|
+
## Long Term (6 months)
|
|
289
|
+
- [ ] Scale
|
|
290
|
+
|
|
291
|
+
## Technical Debt
|
|
292
|
+
{detected issues}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Step 8: Create .agent/rules/AGENTS.md (Optional)
|
|
298
|
+
|
|
299
|
+
**Check if .agent/rules/ exists:**
|
|
300
|
+
```bash
|
|
301
|
+
test -d .agent/rules && echo "EXISTS" || echo "NOT_FOUND"
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**If not exists, create it:**
|
|
305
|
+
// turbo
|
|
306
|
+
```bash
|
|
307
|
+
mkdir -p .agent/rules
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Create .agent/rules/AGENTS.md:**
|
|
311
|
+
|
|
312
|
+
```markdown
|
|
313
|
+
---
|
|
314
|
+
activation: always_on
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
# {Project Name}
|
|
318
|
+
|
|
319
|
+
> Project-specific context for AI agents (Antigravity, Claude Code, etc.). See `.agent/` for workflows and skills.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Project Overview
|
|
324
|
+
|
|
325
|
+
{description from package.json or README}
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Tech Stack
|
|
330
|
+
|
|
331
|
+
| Layer | Technology |
|
|
332
|
+
|-------|------------|
|
|
333
|
+
| {detected} | {with versions} |
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Key Directories
|
|
338
|
+
|
|
339
|
+
| Directory | Purpose |
|
|
340
|
+
|-----------|---------|
|
|
341
|
+
| {detected} | {description} |
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## Quick Commands
|
|
346
|
+
|
|
347
|
+
| Task | Command |
|
|
348
|
+
|------|---------|
|
|
349
|
+
| {from package.json scripts} | `{pm} run {script}` |
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Project Docs (On-demand)
|
|
354
|
+
|
|
355
|
+
| Doc | Purpose | Load when |
|
|
356
|
+
|-----|---------|-----------|
|
|
357
|
+
| `docs/codebase-summary.md` | Project overview | "summary", "overview" |
|
|
358
|
+
| `docs/project-overview-pdr.md` | Product requirements | "requirements", "pdr" |
|
|
359
|
+
| `docs/code-standards.md` | Coding conventions | "standards", "conventions" |
|
|
360
|
+
| `docs/system-architecture.md` | Architecture | "architecture", "design" |
|
|
361
|
+
| `docs/design-guidelines.md` | UI/UX standards | "design", "ui", "ux" |
|
|
362
|
+
| `docs/deployment-guide.md` | Deployment | "deploy", "production" |
|
|
363
|
+
| `docs/project-roadmap.md` | Roadmap | "roadmap", "future" |
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Agent Workflows
|
|
368
|
+
|
|
369
|
+
Available workflows in `.agent/workflows/`:
|
|
370
|
+
- `/docs-init` - Initialize documentation
|
|
371
|
+
- `/docs-update` - Update documentation
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
**Last Updated:** {timestamp}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Note:**
|
|
379
|
+
- File `.agent/rules/AGENTS.md` với `activation: always_on` sẽ được **always active** trong Antigravity
|
|
380
|
+
- Đặt trong `.agent/rules/` để Antigravity tự động nhận diện và load
|
|
381
|
+
- Có thể đồng thờI tạo symlink `AGENTS.md` ở root để dùng cho Claude Code
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Step 9: Generate Report
|
|
386
|
+
|
|
387
|
+
**Output success message:**
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
✅ Documentation initialized!
|
|
391
|
+
|
|
392
|
+
📊 Detected:
|
|
393
|
+
- Project: {name}
|
|
394
|
+
- Type: {type}
|
|
395
|
+
- Stack: {summary}
|
|
396
|
+
- Files: {count} | Tokens: {count}
|
|
397
|
+
|
|
398
|
+
📁 Generated (docs/):
|
|
399
|
+
✓ codebase-summary.md
|
|
400
|
+
✓ project-overview-pdr.md
|
|
401
|
+
✓ code-standards.md
|
|
402
|
+
✓ system-architecture.md
|
|
403
|
+
✓ design-guidelines.md
|
|
404
|
+
✓ deployment-guide.md
|
|
405
|
+
✓ project-roadmap.md
|
|
406
|
+
|
|
407
|
+
📝 Also created:
|
|
408
|
+
✓ repomix-output.xml (AI context)
|
|
409
|
+
✓ .agent/rules/AGENTS.md (always-active project context)
|
|
410
|
+
|
|
411
|
+
🚀 Next: Run `/docs-update` after code changes
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Error Handling
|
|
417
|
+
|
|
418
|
+
| Scenario | Action |
|
|
419
|
+
|----------|--------|
|
|
420
|
+
| repomix not found | Warn, continue with manual analysis |
|
|
421
|
+
| No package.json | Ask user for project type |
|
|
422
|
+
| docs/ exists | Ask: Overwrite/Merge/Skip |
|
|
423
|
+
| Permission denied | Report path, suggest fix |
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Notes
|
|
428
|
+
|
|
429
|
+
- Always use detected values, never placeholders
|
|
430
|
+
- Include versions: "Next.js 14.1.0" not "Next.js"
|
|
431
|
+
- repomix-output.xml helps AI understand full context
|
|
432
|
+
- 7 docs files = comprehensive coverage
|