@haposoft/cafekit 0.8.16 → 0.9.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 +63 -67
- package/bin/install.js +141 -194
- package/bin/lib/copy-utils.js +61 -0
- package/bin/lib/opencode-install.js +866 -0
- package/package.json +4 -1
- package/src/claude/CLAUDE.md +2 -2
- package/src/claude/migration-manifest.json +1 -0
- package/src/claude/rules/skill-domain-routing.md +2 -0
- package/src/claude/rules/skill-workflow-routing.md +3 -1
- package/src/claude/skills/qs/SKILL.md +177 -0
- package/src/claude/skills/qs/templates/qs.md +30 -0
- package/src/opencode/AGENTS.md +140 -0
- package/src/opencode/plugins/docs-sync.ts +181 -0
- package/src/opencode/plugins/inspect-block.ts +164 -0
- package/src/opencode/plugins/privacy-block.ts +182 -0
- package/src/opencode/plugins/rules.ts +163 -0
- package/src/opencode/plugins/session.ts +179 -0
- package/src/opencode/plugins/state.ts +253 -0
- package/src/opencode/plugins/usage.ts +178 -0
- package/src/antigravity/GEMINI.md +0 -162
- package/src/antigravity/workflows/code.md +0 -16
- package/src/antigravity/workflows/docs-init.md +0 -432
- package/src/antigravity/workflows/docs-update.md +0 -245
- package/src/antigravity/workflows/impact-analysis-output-example.md +0 -313
- package/src/antigravity/workflows/impact-analysis.md +0 -730
- package/src/antigravity/workflows/review.md +0 -15
- package/src/antigravity/workflows/spec-design.md +0 -220
- package/src/antigravity/workflows/spec-init.md +0 -78
- package/src/antigravity/workflows/spec-requirements.md +0 -122
- package/src/antigravity/workflows/spec-status.md +0 -95
- package/src/antigravity/workflows/spec-tasks.md +0 -156
- package/src/antigravity/workflows/spec-validate.md +0 -106
- package/src/antigravity/workflows/test.md +0 -13
|
@@ -1,432 +0,0 @@
|
|
|
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
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Update existing documentation to match current codebase. Use when code has changed and docs are out of sync, or after adding new features.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# /docs-update - Update Project Documentation
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This workflow updates all documentation to reflect the current state of the codebase:
|
|
10
|
-
- Re-analyzes project structure
|
|
11
|
-
- Updates all 7 documentation files
|
|
12
|
-
- Syncs AGENTS.md with latest changes
|
|
13
|
-
- Creates backup before updating
|
|
14
|
-
|
|
15
|
-
## ⚠️ IMPORTANT: Execute Immediately
|
|
16
|
-
|
|
17
|
-
**DO NOT create an implementation plan.** This workflow should be executed directly without planning mode.
|
|
18
|
-
- Run all steps sequentially
|
|
19
|
-
- Update files immediately as described
|
|
20
|
-
- No approval needed between steps
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Step 1: Verify Prerequisites
|
|
25
|
-
|
|
26
|
-
**Check if docs/ exists:**
|
|
27
|
-
```bash
|
|
28
|
-
ls docs/ 2>/dev/null || echo "ERROR: Run '/docs-init' first"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**If docs/ not found:**
|
|
32
|
-
- Stop and prompt: "❌ docs/ not found. Run `/docs-init` first to create documentation."
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Step 2: Create Backup
|
|
37
|
-
|
|
38
|
-
// turbo
|
|
39
|
-
```bash
|
|
40
|
-
cp -r docs docs.backup.$(date +%Y%m%d_%H%M%S)
|
|
41
|
-
echo "Backup created: docs.backup.{timestamp}"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Step 3: Ensure Repomix Available
|
|
47
|
-
|
|
48
|
-
**Check if repomix is installed:**
|
|
49
|
-
```bash
|
|
50
|
-
which repomix 2>/dev/null || npm list -g repomix 2>/dev/null
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**If repomix not found:**
|
|
54
|
-
- Detect package manager:
|
|
55
|
-
```bash
|
|
56
|
-
test -f pnpm-lock.yaml && PM="pnpm"
|
|
57
|
-
test -f yarn.lock && PM="yarn"
|
|
58
|
-
test -f bun.lockb && PM="bun"
|
|
59
|
-
PM="${PM:-npm}"
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
// turbo
|
|
63
|
-
- Run `$PM install -g repomix`
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Step 4: Re-analyze Codebase
|
|
68
|
-
|
|
69
|
-
// turbo
|
|
70
|
-
```bash
|
|
71
|
-
repomix
|
|
72
|
-
ls -la ./repomix-output.xml
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Detect recent changes:**
|
|
76
|
-
```bash
|
|
77
|
-
git diff --stat HEAD~5..HEAD 2>/dev/null || echo "No git history"
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Step 5: Read Current Documentation
|
|
83
|
-
|
|
84
|
-
Read all existing docs to understand what needs updating:
|
|
85
|
-
- `docs/codebase-summary.md`
|
|
86
|
-
- `docs/project-overview-pdr.md`
|
|
87
|
-
- `docs/code-standards.md`
|
|
88
|
-
- `docs/system-architecture.md`
|
|
89
|
-
- `docs/design-guidelines.md`
|
|
90
|
-
- `docs/deployment-guide.md`
|
|
91
|
-
- `docs/project-roadmap.md`
|
|
92
|
-
- `.agent/rules/AGENTS.md` (if exists)
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Step 6: Detect Updated Project Info
|
|
97
|
-
|
|
98
|
-
**Re-read config files:**
|
|
99
|
-
- `package.json` - check for new scripts, dependencies, version changes
|
|
100
|
-
- `pyproject.toml`, `go.mod`, etc. - based on project type
|
|
101
|
-
- Check for new directories or removed ones
|
|
102
|
-
|
|
103
|
-
**Detect changes:**
|
|
104
|
-
- New frameworks/libraries added
|
|
105
|
-
- Version updates
|
|
106
|
-
- New scripts
|
|
107
|
-
- Structure changes
|
|
108
|
-
- New deployment configs
|
|
109
|
-
- New database schemas
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## Step 7: Update Documentation Files
|
|
114
|
-
|
|
115
|
-
### 7.1 Update docs/codebase-summary.md
|
|
116
|
-
|
|
117
|
-
**Refresh:**
|
|
118
|
-
- File count and token count from repomix
|
|
119
|
-
- Tech stack versions (from package.json)
|
|
120
|
-
- Directory structure if changed
|
|
121
|
-
- Timestamp
|
|
122
|
-
|
|
123
|
-
### 7.2 Update docs/project-overview-pdr.md
|
|
124
|
-
|
|
125
|
-
**Add:**
|
|
126
|
-
- New features detected in codebase
|
|
127
|
-
- Updated description if changed
|
|
128
|
-
- Any new capabilities
|
|
129
|
-
|
|
130
|
-
### 7.3 Update docs/code-standards.md
|
|
131
|
-
|
|
132
|
-
**Sync:**
|
|
133
|
-
- New patterns detected in code
|
|
134
|
-
- Updated conventions
|
|
135
|
-
- New linting rules if config changed
|
|
136
|
-
|
|
137
|
-
### 7.4 Update docs/system-architecture.md
|
|
138
|
-
|
|
139
|
-
**Update:**
|
|
140
|
-
- New components or services
|
|
141
|
-
- Changed data flows
|
|
142
|
-
- New API endpoints
|
|
143
|
-
- Database schema changes
|
|
144
|
-
|
|
145
|
-
### 7.5 Update docs/design-guidelines.md
|
|
146
|
-
|
|
147
|
-
**Refresh:**
|
|
148
|
-
- New UI components
|
|
149
|
-
- Updated styling patterns
|
|
150
|
-
- Theme changes
|
|
151
|
-
|
|
152
|
-
### 7.6 Update docs/deployment-guide.md
|
|
153
|
-
|
|
154
|
-
**Update:**
|
|
155
|
-
- New environment variables
|
|
156
|
-
- Changed deployment commands
|
|
157
|
-
- Platform updates
|
|
158
|
-
|
|
159
|
-
### 7.7 Update docs/project-roadmap.md
|
|
160
|
-
|
|
161
|
-
**Progress tracking:**
|
|
162
|
-
- Mark completed items
|
|
163
|
-
- Add new tasks based on TODOs found
|
|
164
|
-
- Update technical debt section
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Step 8: Update .agent/rules/AGENTS.md
|
|
169
|
-
|
|
170
|
-
**Check if .agent/rules/AGENTS.md exists:**
|
|
171
|
-
```bash
|
|
172
|
-
test -f .agent/rules/AGENTS.md && cat .agent/rules/AGENTS.md || echo "NOT_FOUND"
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**If exists - Update sections:**
|
|
176
|
-
- **Tech Stack** - Update versions, add new dependencies
|
|
177
|
-
- **Key Directories** - Add new directories
|
|
178
|
-
- **Quick Commands** - Sync with package.json scripts
|
|
179
|
-
- **Last Updated** - Refresh timestamp
|
|
180
|
-
|
|
181
|
-
**If not exists - Create new:**
|
|
182
|
-
- Use same template as in `/docs-init`
|
|
183
|
-
- Or skip if user không muốn tạo
|
|
184
|
-
|
|
185
|
-
**Note:** `.agent/rules/AGENTS.md` với `activation: always_on` sẽ luôn active trong Antigravity.
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Step 9: Clean Up
|
|
190
|
-
|
|
191
|
-
// turbo
|
|
192
|
-
**Remove old repomix if needed:**
|
|
193
|
-
```bash
|
|
194
|
-
# Keep repomix-output.xml for AI context
|
|
195
|
-
ls -la repomix-output.xml
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Step 10: Generate Report
|
|
201
|
-
|
|
202
|
-
**Output success message:**
|
|
203
|
-
|
|
204
|
-
```
|
|
205
|
-
🔄 Documentation updated!
|
|
206
|
-
|
|
207
|
-
💾 Backup: docs.backup.{timestamp}/
|
|
208
|
-
|
|
209
|
-
📊 Changes:
|
|
210
|
-
- Files: {old_count} → {new_count}
|
|
211
|
-
- Tokens: {old_tokens} → {new_tokens}
|
|
212
|
-
|
|
213
|
-
📝 Updated:
|
|
214
|
-
✓ codebase-summary.md
|
|
215
|
-
✓ project-overview-pdr.md
|
|
216
|
-
✓ code-standards.md
|
|
217
|
-
✓ system-architecture.md
|
|
218
|
-
✓ design-guidelines.md
|
|
219
|
-
✓ deployment-guide.md
|
|
220
|
-
✓ project-roadmap.md
|
|
221
|
-
✓ .agent/rules/AGENTS.md (if exists)
|
|
222
|
-
|
|
223
|
-
💡 Review docs/ for any manual adjustments needed
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Error Handling
|
|
229
|
-
|
|
230
|
-
| Scenario | Action |
|
|
231
|
-
|----------|--------|
|
|
232
|
-
| docs/ not found | Prompt to run `/docs-init` |
|
|
233
|
-
| repomix fails | Continue with manual analysis |
|
|
234
|
-
| Permission denied | Report path, suggest sudo/fix |
|
|
235
|
-
| Conflicts detected | Ask user which version to keep |
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
## Notes
|
|
240
|
-
|
|
241
|
-
- Always create backup before updating
|
|
242
|
-
- Merge existing content with new analysis
|
|
243
|
-
- Preserve manual edits when possible
|
|
244
|
-
- Update timestamp on all modified files
|
|
245
|
-
- Keep repomix-output.xml for AI context
|