anchi-kit 2.0.3 → 2.2.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.
Potentially problematic release.
This version of anchi-kit might be problematic. Click here for more details.
- package/.cursor/anchi-kit.config.yaml +32 -0
- package/.cursor/commands/context.md +76 -0
- package/.cursor/commands/cook/auto.md +80 -10
- package/.cursor/commands/generate/api.md +79 -0
- package/.cursor/commands/generate/component.md +80 -0
- package/.cursor/commands/generate/page.md +71 -0
- package/.cursor/commands/plan/auto.md +77 -0
- package/.cursor/commands/suggest.md +65 -0
- package/.cursor/custom-commands/example.md +30 -0
- package/.cursor/hooks.yaml +28 -0
- package/.cursor/team.yaml +63 -0
- package/.cursor/workflows/feature.yaml +51 -0
- package/.cursor/workflows/hotfix.yaml +35 -0
- package/.cursor/workflows/release.yaml +61 -0
- package/CURSOR.md +5 -5
- package/README.md +10 -5
- package/docs/{codebase-summary.md → CODEBASE.md} +2 -2
- package/docs/{code-standards.md → CODE_STYLE.md} +1 -1
- package/docs/FAQ.md +1 -1
- package/docs/{ONBOARDING_CHECKLIST.md → ONBOARDING.md} +4 -4
- package/docs/{project-overview-pdr.md → PROJECT.md} +2 -2
- package/docs/{TEAM_PIPELINE.md → WORKFLOW.md} +1 -1
- package/package.json +1 -1
- package/scripts/check-setup.ps1 +1 -1
- package/scripts/install-hooks.ps1 +60 -0
- package/scripts/install-hooks.sh +54 -0
- package/scripts/new-project.ps1 +1 -1
- package/scripts/new-project.sh +61 -61
- package/src/cli.js +6 -0
- package/src/commands/doctor.js +106 -0
- package/src/lib/configManager.js +200 -0
- package/docs/PROJECT_SUMMARY.md +0 -86
- /package/docs/{system-architecture.md → ARCHITECTURE.md} +0 -0
- /package/docs/{project-roadmap.md → ROADMAP.md} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Feature Workflow
|
|
2
|
+
# Standard flow for new features
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
name: Feature Development
|
|
6
|
+
description: Standard workflow for new features
|
|
7
|
+
|
|
8
|
+
# Steps to follow
|
|
9
|
+
steps:
|
|
10
|
+
1_plan:
|
|
11
|
+
command: /plan
|
|
12
|
+
required: true
|
|
13
|
+
auto_proceed: false
|
|
14
|
+
description: Create detailed plan
|
|
15
|
+
|
|
16
|
+
2_approve:
|
|
17
|
+
type: approval
|
|
18
|
+
required: true
|
|
19
|
+
approvers: [lead]
|
|
20
|
+
description: Get plan approval
|
|
21
|
+
|
|
22
|
+
3_implement:
|
|
23
|
+
command: /cook
|
|
24
|
+
required: true
|
|
25
|
+
auto_proceed: false
|
|
26
|
+
description: Implement feature
|
|
27
|
+
|
|
28
|
+
4_test:
|
|
29
|
+
command: /test
|
|
30
|
+
required: true
|
|
31
|
+
auto_proceed: true
|
|
32
|
+
description: Run tests
|
|
33
|
+
|
|
34
|
+
5_review:
|
|
35
|
+
command: /review
|
|
36
|
+
required: true
|
|
37
|
+
auto_proceed: false
|
|
38
|
+
description: Code review
|
|
39
|
+
|
|
40
|
+
6_commit:
|
|
41
|
+
command: git commit
|
|
42
|
+
required: true
|
|
43
|
+
auto_proceed: false
|
|
44
|
+
description: Commit changes
|
|
45
|
+
|
|
46
|
+
# Checklist before completion
|
|
47
|
+
checklist:
|
|
48
|
+
- Tests passing
|
|
49
|
+
- Code reviewed
|
|
50
|
+
- Docs updated
|
|
51
|
+
- No console.log
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Hotfix Workflow
|
|
2
|
+
# Fast track for critical fixes
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
name: Hotfix
|
|
6
|
+
description: Fast workflow for critical bug fixes
|
|
7
|
+
|
|
8
|
+
# Steps - minimal for speed
|
|
9
|
+
steps:
|
|
10
|
+
1_fix:
|
|
11
|
+
command: /fix:fast
|
|
12
|
+
required: true
|
|
13
|
+
auto_proceed: true
|
|
14
|
+
description: Quick fix
|
|
15
|
+
|
|
16
|
+
2_test:
|
|
17
|
+
command: /test
|
|
18
|
+
required: true
|
|
19
|
+
auto_proceed: true
|
|
20
|
+
description: Verify fix
|
|
21
|
+
|
|
22
|
+
3_commit:
|
|
23
|
+
command: git commit
|
|
24
|
+
required: true
|
|
25
|
+
auto_proceed: false
|
|
26
|
+
description: Commit with hotfix tag
|
|
27
|
+
|
|
28
|
+
# No approval needed for hotfixes
|
|
29
|
+
approval:
|
|
30
|
+
required: false
|
|
31
|
+
|
|
32
|
+
# Quick checklist
|
|
33
|
+
checklist:
|
|
34
|
+
- Fix verified
|
|
35
|
+
- No regressions
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Release Workflow
|
|
2
|
+
# Structured flow for releases
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
name: Release
|
|
6
|
+
description: Workflow for version releases
|
|
7
|
+
|
|
8
|
+
# Steps
|
|
9
|
+
steps:
|
|
10
|
+
1_summary:
|
|
11
|
+
command: /summary
|
|
12
|
+
required: true
|
|
13
|
+
auto_proceed: true
|
|
14
|
+
description: Update project summary
|
|
15
|
+
|
|
16
|
+
2_changelog:
|
|
17
|
+
command: /docs:update
|
|
18
|
+
required: true
|
|
19
|
+
auto_proceed: true
|
|
20
|
+
description: Update changelog
|
|
21
|
+
|
|
22
|
+
3_test:
|
|
23
|
+
command: /test:all
|
|
24
|
+
required: true
|
|
25
|
+
auto_proceed: false
|
|
26
|
+
description: Full test suite
|
|
27
|
+
|
|
28
|
+
4_review:
|
|
29
|
+
command: /review:codebase
|
|
30
|
+
required: true
|
|
31
|
+
auto_proceed: false
|
|
32
|
+
description: Final review
|
|
33
|
+
|
|
34
|
+
5_version:
|
|
35
|
+
type: manual
|
|
36
|
+
required: true
|
|
37
|
+
description: Bump version number
|
|
38
|
+
|
|
39
|
+
6_tag:
|
|
40
|
+
command: git tag
|
|
41
|
+
required: true
|
|
42
|
+
auto_proceed: false
|
|
43
|
+
description: Create release tag
|
|
44
|
+
|
|
45
|
+
7_publish:
|
|
46
|
+
type: manual
|
|
47
|
+
required: true
|
|
48
|
+
description: Publish/deploy
|
|
49
|
+
|
|
50
|
+
# Approval required
|
|
51
|
+
approval:
|
|
52
|
+
required: true
|
|
53
|
+
approvers: [lead]
|
|
54
|
+
|
|
55
|
+
# Release checklist
|
|
56
|
+
checklist:
|
|
57
|
+
- All tests passing
|
|
58
|
+
- Changelog updated
|
|
59
|
+
- Version bumped
|
|
60
|
+
- Tag created
|
|
61
|
+
- Docs updated
|
package/CURSOR.md
CHANGED
|
@@ -21,7 +21,7 @@ Hướng dẫn cho Cursor AI khi làm việc trong repository này.
|
|
|
21
21
|
### Bắt buộc đọc:
|
|
22
22
|
|
|
23
23
|
1. ✅ Đọc `.cursorrules` để biết preset đang dùng
|
|
24
|
-
2. ✅ Đọc `docs/
|
|
24
|
+
2. ✅ Đọc `docs/PROJECT.md` để hiểu context
|
|
25
25
|
3. ✅ Đọc command definition trong `.cursor/commands/`
|
|
26
26
|
4. ✅ Activate skills phù hợp từ `.cursor/skills/`
|
|
27
27
|
|
|
@@ -66,7 +66,7 @@ User: /plan "Add authentication"
|
|
|
66
66
|
|
|
67
67
|
AI steps:
|
|
68
68
|
1. Đọc .cursorrules → Biết đang dùng Professional preset
|
|
69
|
-
2. Đọc docs/
|
|
69
|
+
2. Đọc docs/PROJECT.md → Hiểu context
|
|
70
70
|
3. Đọc .cursor/commands/plan.md → Biết format output
|
|
71
71
|
4. Đọc .cursor/agents/planner.md → Đóng vai planner
|
|
72
72
|
5. Activate skill: .cursor/skills/better-auth/
|
|
@@ -139,10 +139,10 @@ Activate skills khi cần kiến thức chuyên sâu:
|
|
|
139
139
|
## 📖 Documentation Management
|
|
140
140
|
|
|
141
141
|
Locations:
|
|
142
|
-
- `docs/
|
|
142
|
+
- `docs/PROJECT.md` - Project description
|
|
143
143
|
- `docs/code-standards.md` - Coding standards
|
|
144
144
|
- `docs/system-architecture.md` - Architecture
|
|
145
|
-
- `docs/
|
|
145
|
+
- `docs/CODEBASE.md` - Codebase overview
|
|
146
146
|
|
|
147
147
|
**Khi cần context → Đọc docs/ trước khi trả lời.**
|
|
148
148
|
|
|
@@ -156,4 +156,4 @@ Cho complex tasks, tham khảo:
|
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
159
|
-
**CRITICAL:** Đây là file AI PHẢI ĐỌC. Mọi command PHẢI follow rules này.
|
|
159
|
+
**CRITICAL:** Đây là file AI PHẢI ĐỌC. Mọi command PHẢI follow rules này.
|
package/README.md
CHANGED
|
@@ -82,12 +82,17 @@ AI sẽ hỏi:
|
|
|
82
82
|
|---------|-------|
|
|
83
83
|
| `/start` | **🔥 Entry point** - Bắt đầu mọi dự án |
|
|
84
84
|
| `/use-preset [name]` | Chọn architecture (rapid/professional/enterprise) |
|
|
85
|
-
| `/summary` | Tổng hợp thông tin dự án vào docs |
|
|
86
85
|
| `/plan "..."` | Lập kế hoạch feature |
|
|
86
|
+
| `/plan:auto "..."` | Auto-pilot planning |
|
|
87
87
|
| `/cook "..."` | Implement theo plan |
|
|
88
|
+
| `/cook:auto "..."` | Auto-pilot implementation |
|
|
88
89
|
| `/scout "..."` | Tìm hiểu codebase |
|
|
89
90
|
| `/fix "..."` | Sửa bug |
|
|
90
|
-
| `/
|
|
91
|
+
| `/generate:page` | **NEW** Tạo page boilerplate |
|
|
92
|
+
| `/generate:api` | **NEW** Tạo API route |
|
|
93
|
+
| `/generate:component` | **NEW** Tạo component |
|
|
94
|
+
| `/context` | **NEW** Xem AI context |
|
|
95
|
+
| `/suggest` | **NEW** AI gợi ý action |
|
|
91
96
|
|
|
92
97
|
---
|
|
93
98
|
|
|
@@ -156,7 +161,7 @@ Xem chi tiết: [MIGRATION_GUIDE.md](./presets/MIGRATION_GUIDE.md)
|
|
|
156
161
|
|------|-------|
|
|
157
162
|
| [BEGINNER_GUIDE_VI.md](./BEGINNER_GUIDE_VI.md) | Hướng dẫn người mới |
|
|
158
163
|
| [CONTRIBUTING.md](./CONTRIBUTING.md) | Hướng dẫn đóng góp |
|
|
159
|
-
| [docs/
|
|
164
|
+
| [docs/WORKFLOW.md](./docs/WORKFLOW.md) | **🔥 Pipeline + Git workflow** |
|
|
160
165
|
| [docs/FAQ.md](./docs/FAQ.md) | Câu hỏi thường gặp |
|
|
161
166
|
| [CURSOR.md](./CURSOR.md) | AI instructions |
|
|
162
167
|
| [CHANGELOG.md](./CHANGELOG.md) | Version history |
|
|
@@ -190,7 +195,7 @@ Xem chi tiết: [MIGRATION_GUIDE.md](./presets/MIGRATION_GUIDE.md)
|
|
|
190
195
|
| Vấn đề | Giải pháp |
|
|
191
196
|
|--------|-----------|
|
|
192
197
|
| Commands không hoạt động | Dùng trong Chat Panel (`Ctrl+L`), restart Cursor |
|
|
193
|
-
| AI không hiểu dự án | Tag files: `@.cursorrules @docs/
|
|
198
|
+
| AI không hiểu dự án | Tag files: `@.cursorrules @docs/PROJECT.md` |
|
|
194
199
|
| Không biết chọn preset | Hỏi Team Lead hoặc dùng `professional` |
|
|
195
200
|
|
|
196
201
|
---
|
|
@@ -201,4 +206,4 @@ MIT License
|
|
|
201
206
|
|
|
202
207
|
---
|
|
203
208
|
|
|
204
|
-
**Built with ❤️ by Anchi Team**
|
|
209
|
+
**Built with ❤️ by Anchi Team**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 💻 **Purpose:** TECHNICAL document - HOW the code is structured
|
|
4
4
|
>
|
|
5
|
-
> **For planning/requirements:** See [
|
|
5
|
+
> **For planning/requirements:** See [PROJECT.md](./PROJECT.md)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -175,4 +175,4 @@ Run `npm list --depth=0` for full list.
|
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
178
|
-
> 💡 **Note:** File này focus vào TECHNICAL. Xem [
|
|
178
|
+
> 💡 **Note:** File này focus vào TECHNICAL. Xem [PROJECT.md](./PROJECT.md) cho planning/requirements.
|
package/docs/FAQ.md
CHANGED
|
@@ -28,14 +28,14 @@ Checklist cho member mới vào team. Đánh dấu `[x]` khi hoàn thành.
|
|
|
28
28
|
|
|
29
29
|
### Required Reading
|
|
30
30
|
- [ ] `.cursorrules` - Biết preset và conventions
|
|
31
|
-
- [ ] `docs/
|
|
32
|
-
- [ ] `docs/
|
|
31
|
+
- [ ] `docs/PROJECT.md` - Hiểu dự án
|
|
32
|
+
- [ ] `docs/WORKFLOW.md` - Workflow chuẩn
|
|
33
33
|
- [ ] `BEGINNER_GUIDE_VI.md` - Hướng dẫn sử dụng
|
|
34
34
|
|
|
35
35
|
### Optional Reading
|
|
36
36
|
- [ ] `docs/code-standards.md` - Chi tiết coding standards
|
|
37
37
|
- [ ] `docs/system-architecture.md` - Kiến trúc hệ thống
|
|
38
|
-
- [ ] `docs/
|
|
38
|
+
- [ ] `docs/WORKFLOW.md` - Git workflow (đã merged)
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
@@ -71,7 +71,7 @@ Checklist cho member mới vào team. Đánh dấu `[x]` khi hoàn thành.
|
|
|
71
71
|
|
|
72
72
|
### Codebase Understanding
|
|
73
73
|
- [ ] Dùng `/scout` để tìm hiểu modules chính
|
|
74
|
-
- [ ] Đọc `docs/
|
|
74
|
+
- [ ] Đọc `docs/CODEBASE.md`
|
|
75
75
|
- [ ] Hiểu folder structure
|
|
76
76
|
|
|
77
77
|
### Team Integration
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 📋 **Purpose:** PLANNING document - WHY & WHAT we're building
|
|
4
4
|
>
|
|
5
|
-
> **For technical details (HOW):** See [
|
|
5
|
+
> **For technical details (HOW):** See [CODEBASE.md](./CODEBASE.md)
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -137,4 +137,4 @@
|
|
|
137
137
|
|
|
138
138
|
---
|
|
139
139
|
|
|
140
|
-
> 💡 **Note:** File này focus vào PLANNING. Xem [
|
|
140
|
+
> 💡 **Note:** File này focus vào PLANNING. Xem [CODEBASE.md](./CODEBASE.md) cho technical details.
|
|
@@ -54,7 +54,7 @@ cursor .
|
|
|
54
54
|
|
|
55
55
|
| File | Việc cần làm |
|
|
56
56
|
|------|-------------|
|
|
57
|
-
| `docs/
|
|
57
|
+
| `docs/PROJECT.md` | Mô tả dự án, features, goals |
|
|
58
58
|
| `docs/system-architecture.md` | Đánh dấu preset, tech stack |
|
|
59
59
|
| `docs/code-standards.md` | Review conventions |
|
|
60
60
|
|
package/package.json
CHANGED
package/scripts/check-setup.ps1
CHANGED
|
@@ -15,7 +15,7 @@ $checks = @(
|
|
|
15
15
|
@{Name = "CURSOR.md"; Path = "CURSOR.md"; Required = $true; Description = "AI instructions" },
|
|
16
16
|
@{Name = "ANTIGRAVITY.md"; Path = "ANTIGRAVITY.md"; Required = $false; Description = "Orchestration guide" },
|
|
17
17
|
@{Name = "docs/"; Path = "docs"; Required = $true; Description = "Documentation folder" },
|
|
18
|
-
@{Name = "docs/
|
|
18
|
+
@{Name = "docs/PROJECT.md"; Path = "docs/PROJECT.md"; Required = $true; Description = "Project description" },
|
|
19
19
|
@{Name = "docs/code-standards.md"; Path = "docs/code-standards.md"; Required = $true; Description = "Coding standards" },
|
|
20
20
|
@{Name = "package.json"; Path = "package.json"; Required = $true; Description = "Package config" }
|
|
21
21
|
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════
|
|
2
|
+
# anchi-kit Git Hooks Installer (Windows)
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
Write-Host ""
|
|
6
|
+
Write-Host "🔗 anchi-kit Git Hooks Installer" -ForegroundColor Cyan
|
|
7
|
+
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Gray
|
|
8
|
+
Write-Host ""
|
|
9
|
+
|
|
10
|
+
$gitDir = ".git"
|
|
11
|
+
$hooksDir = "$gitDir\hooks"
|
|
12
|
+
$configFile = ".cursor\hooks.yaml"
|
|
13
|
+
|
|
14
|
+
# Check if git repository
|
|
15
|
+
if (-not (Test-Path $gitDir)) {
|
|
16
|
+
Write-Host "❌ Not a git repository" -ForegroundColor Red
|
|
17
|
+
exit 1
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# Create hooks directory
|
|
21
|
+
if (-not (Test-Path $hooksDir)) {
|
|
22
|
+
New-Item -ItemType Directory -Path $hooksDir -Force | Out-Null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Create pre-commit hook
|
|
26
|
+
$preCommitHook = @"
|
|
27
|
+
#!/bin/sh
|
|
28
|
+
# anchi-kit pre-commit hook
|
|
29
|
+
# Reminder: Run /review:fast before committing
|
|
30
|
+
|
|
31
|
+
echo "💡 anchi-kit reminder: Consider running /review:fast"
|
|
32
|
+
echo " To skip: git commit --no-verify"
|
|
33
|
+
exit 0
|
|
34
|
+
"@
|
|
35
|
+
|
|
36
|
+
$preCommitPath = "$hooksDir\pre-commit"
|
|
37
|
+
Set-Content -Path $preCommitPath -Value $preCommitHook -NoNewline
|
|
38
|
+
Write-Host "✅ Installed: pre-commit hook" -ForegroundColor Green
|
|
39
|
+
|
|
40
|
+
# Create post-merge hook
|
|
41
|
+
$postMergeHook = @"
|
|
42
|
+
#!/bin/sh
|
|
43
|
+
# anchi-kit post-merge hook
|
|
44
|
+
# Reminder: Update docs after merge
|
|
45
|
+
|
|
46
|
+
echo "💡 anchi-kit reminder: Consider running /docs:update"
|
|
47
|
+
exit 0
|
|
48
|
+
"@
|
|
49
|
+
|
|
50
|
+
$postMergePath = "$hooksDir\post-merge"
|
|
51
|
+
Set-Content -Path $postMergePath -Value $postMergeHook -NoNewline
|
|
52
|
+
Write-Host "✅ Installed: post-merge hook" -ForegroundColor Green
|
|
53
|
+
|
|
54
|
+
Write-Host ""
|
|
55
|
+
Write-Host "═══════════════════════════════════════════════════════════════" -ForegroundColor Gray
|
|
56
|
+
Write-Host "✅ Git hooks installed successfully!" -ForegroundColor Green
|
|
57
|
+
Write-Host ""
|
|
58
|
+
Write-Host "📌 Hooks will show reminders for anchi-kit commands." -ForegroundColor Yellow
|
|
59
|
+
Write-Host " To skip: use --no-verify flag" -ForegroundColor Gray
|
|
60
|
+
Write-Host ""
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ═══════════════════════════════════════════════════════════════
|
|
3
|
+
# anchi-kit Git Hooks Installer (macOS/Linux)
|
|
4
|
+
# ═══════════════════════════════════════════════════════════════
|
|
5
|
+
|
|
6
|
+
echo ""
|
|
7
|
+
echo "🔗 anchi-kit Git Hooks Installer"
|
|
8
|
+
echo "═══════════════════════════════════════════════════════════════"
|
|
9
|
+
echo ""
|
|
10
|
+
|
|
11
|
+
GIT_DIR=".git"
|
|
12
|
+
HOOKS_DIR="$GIT_DIR/hooks"
|
|
13
|
+
|
|
14
|
+
# Check if git repository
|
|
15
|
+
if [ ! -d "$GIT_DIR" ]; then
|
|
16
|
+
echo "❌ Not a git repository"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Create hooks directory
|
|
21
|
+
mkdir -p "$HOOKS_DIR"
|
|
22
|
+
|
|
23
|
+
# Create pre-commit hook
|
|
24
|
+
cat > "$HOOKS_DIR/pre-commit" << 'EOF'
|
|
25
|
+
#!/bin/sh
|
|
26
|
+
# anchi-kit pre-commit hook
|
|
27
|
+
# Reminder: Run /review:fast before committing
|
|
28
|
+
|
|
29
|
+
echo "💡 anchi-kit reminder: Consider running /review:fast"
|
|
30
|
+
echo " To skip: git commit --no-verify"
|
|
31
|
+
exit 0
|
|
32
|
+
EOF
|
|
33
|
+
chmod +x "$HOOKS_DIR/pre-commit"
|
|
34
|
+
echo "✅ Installed: pre-commit hook"
|
|
35
|
+
|
|
36
|
+
# Create post-merge hook
|
|
37
|
+
cat > "$HOOKS_DIR/post-merge" << 'EOF'
|
|
38
|
+
#!/bin/sh
|
|
39
|
+
# anchi-kit post-merge hook
|
|
40
|
+
# Reminder: Update docs after merge
|
|
41
|
+
|
|
42
|
+
echo "💡 anchi-kit reminder: Consider running /docs:update"
|
|
43
|
+
exit 0
|
|
44
|
+
EOF
|
|
45
|
+
chmod +x "$HOOKS_DIR/post-merge"
|
|
46
|
+
echo "✅ Installed: post-merge hook"
|
|
47
|
+
|
|
48
|
+
echo ""
|
|
49
|
+
echo "═══════════════════════════════════════════════════════════════"
|
|
50
|
+
echo "✅ Git hooks installed successfully!"
|
|
51
|
+
echo ""
|
|
52
|
+
echo "📌 Hooks will show reminders for anchi-kit commands."
|
|
53
|
+
echo " To skip: use --no-verify flag"
|
|
54
|
+
echo ""
|
package/scripts/new-project.ps1
CHANGED
|
@@ -92,7 +92,7 @@ Write-Host " 2. Edit .cursorrules:" -ForegroundColor White
|
|
|
92
92
|
Write-Host " - Thay đổi Tech Stack phù hợp dự án" -ForegroundColor Gray
|
|
93
93
|
Write-Host " - Thêm coding conventions" -ForegroundColor Gray
|
|
94
94
|
Write-Host ""
|
|
95
|
-
Write-Host " 3. Edit docs/
|
|
95
|
+
Write-Host " 3. Edit docs/PROJECT.md:" -ForegroundColor White
|
|
96
96
|
Write-Host " - Mô tả dự án" -ForegroundColor Gray
|
|
97
97
|
Write-Host " - Liệt kê features" -ForegroundColor Gray
|
|
98
98
|
Write-Host ""
|
package/scripts/new-project.sh
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Script: Tạo Dự Án Mới Từ Template
|
|
3
|
-
# Cách dùng: ./new-project.sh my-webapp
|
|
4
|
-
|
|
5
|
-
PROJECT_NAME=$1
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
-
TEMPLATE_PATH="$(dirname "$SCRIPT_DIR")"
|
|
8
|
-
TARGET_PATH="$(pwd)/$PROJECT_NAME"
|
|
9
|
-
|
|
10
|
-
if [ -z "$PROJECT_NAME" ]; then
|
|
11
|
-
echo "❌ Vui lòng cung cấp tên dự án"
|
|
12
|
-
echo "Cách dùng: ./new-project.sh my-webapp"
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
echo ""
|
|
17
|
-
echo "🚀 Tạo dự án: $PROJECT_NAME"
|
|
18
|
-
echo "📁 Template: $TEMPLATE_PATH"
|
|
19
|
-
echo "📂 Target: $TARGET_PATH"
|
|
20
|
-
echo ""
|
|
21
|
-
|
|
22
|
-
# Tạo folder và copy
|
|
23
|
-
echo "📋 Copying template files..."
|
|
24
|
-
mkdir -p "$TARGET_PATH"
|
|
25
|
-
cp -r "$TEMPLATE_PATH"/* "$TARGET_PATH/"
|
|
26
|
-
|
|
27
|
-
cd "$TARGET_PATH"
|
|
28
|
-
|
|
29
|
-
# Xóa files không cần
|
|
30
|
-
echo "🧹 Cleaning up unnecessary files..."
|
|
31
|
-
rm -f CHANGELOG.md PROJECT_EXPLANATION_VI.md USAGE_GUIDE_VI.md
|
|
32
|
-
rm -f .releaserc* .coverage .repomixignore .commitlintrc.json
|
|
33
|
-
rm -rf guide tests
|
|
34
|
-
|
|
35
|
-
# Init git
|
|
36
|
-
echo "📦 Initializing git repository..."
|
|
37
|
-
rm -rf .git
|
|
38
|
-
git init > /dev/null 2>&1
|
|
39
|
-
git add . > /dev/null 2>&1
|
|
40
|
-
git commit -m "chore: init project with anchi-cursorkit-antigravity template" > /dev/null 2>&1
|
|
41
|
-
|
|
42
|
-
# Cập nhật package.json
|
|
43
|
-
echo "📝 Updating package.json..."
|
|
44
|
-
if command -v jq &> /dev/null; then
|
|
45
|
-
jq ".name = \"$PROJECT_NAME\" | .version = \"1.0.0\" | .description = \"Project created with anchi-cursorkit-antigravity template\" | .author = \"$USER\"" package.json > temp.json && mv temp.json package.json
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
echo ""
|
|
49
|
-
echo "========================================"
|
|
50
|
-
echo " ✅ Dự án '$PROJECT_NAME' đã sẵn sàng!"
|
|
51
|
-
echo "========================================"
|
|
52
|
-
echo ""
|
|
53
|
-
echo "📌 Bước tiếp theo:"
|
|
54
|
-
echo ""
|
|
55
|
-
echo " 1. Mở Cursor IDE:"
|
|
56
|
-
echo " cursor ."
|
|
57
|
-
echo ""
|
|
58
|
-
echo " 2. Edit .cursorrules"
|
|
59
|
-
echo " 3. Edit docs/
|
|
60
|
-
echo " 4. Bắt đầu code với: /plan \"Feature description\""
|
|
61
|
-
echo ""
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Script: Tạo Dự Án Mới Từ Template
|
|
3
|
+
# Cách dùng: ./new-project.sh my-webapp
|
|
4
|
+
|
|
5
|
+
PROJECT_NAME=$1
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
TEMPLATE_PATH="$(dirname "$SCRIPT_DIR")"
|
|
8
|
+
TARGET_PATH="$(pwd)/$PROJECT_NAME"
|
|
9
|
+
|
|
10
|
+
if [ -z "$PROJECT_NAME" ]; then
|
|
11
|
+
echo "❌ Vui lòng cung cấp tên dự án"
|
|
12
|
+
echo "Cách dùng: ./new-project.sh my-webapp"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
echo ""
|
|
17
|
+
echo "🚀 Tạo dự án: $PROJECT_NAME"
|
|
18
|
+
echo "📁 Template: $TEMPLATE_PATH"
|
|
19
|
+
echo "📂 Target: $TARGET_PATH"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
# Tạo folder và copy
|
|
23
|
+
echo "📋 Copying template files..."
|
|
24
|
+
mkdir -p "$TARGET_PATH"
|
|
25
|
+
cp -r "$TEMPLATE_PATH"/* "$TARGET_PATH/"
|
|
26
|
+
|
|
27
|
+
cd "$TARGET_PATH"
|
|
28
|
+
|
|
29
|
+
# Xóa files không cần
|
|
30
|
+
echo "🧹 Cleaning up unnecessary files..."
|
|
31
|
+
rm -f CHANGELOG.md PROJECT_EXPLANATION_VI.md USAGE_GUIDE_VI.md
|
|
32
|
+
rm -f .releaserc* .coverage .repomixignore .commitlintrc.json
|
|
33
|
+
rm -rf guide tests
|
|
34
|
+
|
|
35
|
+
# Init git
|
|
36
|
+
echo "📦 Initializing git repository..."
|
|
37
|
+
rm -rf .git
|
|
38
|
+
git init > /dev/null 2>&1
|
|
39
|
+
git add . > /dev/null 2>&1
|
|
40
|
+
git commit -m "chore: init project with anchi-cursorkit-antigravity template" > /dev/null 2>&1
|
|
41
|
+
|
|
42
|
+
# Cập nhật package.json
|
|
43
|
+
echo "📝 Updating package.json..."
|
|
44
|
+
if command -v jq &> /dev/null; then
|
|
45
|
+
jq ".name = \"$PROJECT_NAME\" | .version = \"1.0.0\" | .description = \"Project created with anchi-cursorkit-antigravity template\" | .author = \"$USER\"" package.json > temp.json && mv temp.json package.json
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo ""
|
|
49
|
+
echo "========================================"
|
|
50
|
+
echo " ✅ Dự án '$PROJECT_NAME' đã sẵn sàng!"
|
|
51
|
+
echo "========================================"
|
|
52
|
+
echo ""
|
|
53
|
+
echo "📌 Bước tiếp theo:"
|
|
54
|
+
echo ""
|
|
55
|
+
echo " 1. Mở Cursor IDE:"
|
|
56
|
+
echo " cursor ."
|
|
57
|
+
echo ""
|
|
58
|
+
echo " 2. Edit .cursorrules"
|
|
59
|
+
echo " 3. Edit docs/PROJECT.md"
|
|
60
|
+
echo " 4. Bắt đầu code với: /plan \"Feature description\""
|
|
61
|
+
echo ""
|
package/src/cli.js
CHANGED
|
@@ -264,6 +264,11 @@ async function main() {
|
|
|
264
264
|
await uninstall();
|
|
265
265
|
break;
|
|
266
266
|
|
|
267
|
+
case 'doctor':
|
|
268
|
+
const { doctor } = require('./commands/doctor');
|
|
269
|
+
await doctor();
|
|
270
|
+
break;
|
|
271
|
+
|
|
267
272
|
default:
|
|
268
273
|
showHelp();
|
|
269
274
|
break;
|
|
@@ -279,6 +284,7 @@ function showHelp() {
|
|
|
279
284
|
log.success(' npx anchi-kit init Cài đặt thông minh (chọn profile)');
|
|
280
285
|
log.success(' npx anchi-kit update Kiểm tra cập nhật');
|
|
281
286
|
log.success(' npx anchi-kit uninstall Gỡ cài đặt');
|
|
287
|
+
log.success(' npx anchi-kit doctor Kiểm tra setup health');
|
|
282
288
|
console.log('');
|
|
283
289
|
console.log('Documentation:');
|
|
284
290
|
console.log(' https://github.com/ANCHI-STE/anchi-webkit-dev');
|