anchi-toolkit 1.0.0 → 1.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.
- package/.ai-audit/README.md +53 -0
- package/.ai-memory/README.md +137 -0
- package/.ai-memory/context.json +26 -0
- package/.ai-memory/decisions.json +3 -0
- package/.antigravity/agent-skill-index.yaml +24 -0
- package/.antigravity/anchi-toolkit.config.yaml +12 -0
- package/.antigravity/docs/README.md +9 -0
- package/.antigravity/skills/_template.md +30 -0
- package/.antigravity/team.yaml +154 -0
- package/.antigravity/workflows/config.md +144 -0
- package/.antigravity/workflows/demo.md +50 -0
- package/.antigravity/workflows/help.md +11 -4
- package/.antigravity/workflows/skill-learn.md +48 -0
- package/.antigravity/workflows/start.md +38 -117
- package/.antigravity/workflows/status.md +8 -8
- package/.antigravity/workflows/undo.md +7 -7
- package/.cursor/agent-skill-index.yaml +39 -0
- package/.cursor/agents/graph-architect.md +30 -0
- package/.cursor/agents/trend-watcher.md +24 -0
- package/.cursor/commands/config.md +144 -0
- package/.cursor/commands/demo.md +50 -0
- package/.cursor/commands/do.md +127 -90
- package/.cursor/commands/help.md +23 -16
- package/.cursor/commands/skill-learn.md +48 -0
- package/.cursor/commands/start.md +38 -117
- package/.cursor/commands/status.md +19 -19
- package/.cursor/commands/undo.md +19 -19
- package/.cursor/orchestration.yaml +18 -0
- package/.cursor/skills/_template.md +30 -0
- package/ANTIGRAVITY.md +84 -0
- package/CURSOR.md +50 -157
- package/LICENSE +17 -14
- package/README.md +64 -89
- package/docs/ALL_COMMANDS.md +31 -73
- package/docs/CI_CD.md +44 -0
- package/docs/COMPARISON.md +65 -0
- package/docs/ROADMAP.md +45 -161
- package/docs/WORKFLOW.md +56 -317
- package/package.json +9 -2
- package/presets/ci-cd/ai-review.yml +49 -0
- package/scripts/install-hooks.ps1 +21 -7
- package/scripts/install-hooks.sh +18 -3
- package/src/cli.js +111 -59
- package/src/commands/clean.js +87 -0
- package/src/commands/doctor.js +88 -21
- package/src/commands/init.js +22 -2
- package/src/commands/uninstall.js +17 -2
- package/src/lib/configManager.js +20 -5
- package/src/lib/memoryManager.js +7 -4
- package/docs/CODEBASE.md +0 -178
- package/docs/COMMAND_MAPPING.md +0 -217
- package/docs/FAQ.md +0 -174
- package/docs/ONBOARDING.md +0 -111
- package/docs/ORCHESTRATION_RUNTIME.md +0 -173
- package/docs/WALKTHROUGH.md +0 -192
- /package/.cursor/{anchi-kit.config.yaml → anchi-toolkit.config.yaml} +0 -0
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# Dynamic Orchestration Runtime
|
|
2
|
-
|
|
3
|
-
> **Quy trình AI tự động điều phối agents/skills khi thực thi command**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🔄 Execution Flow
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
11
|
-
│ USER INPUT: /do "Add payment with Stripe" │
|
|
12
|
-
└─────────────────────────────────────────────────────────────┘
|
|
13
|
-
↓
|
|
14
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
15
|
-
│ STEP 1: LOAD ORCHESTRATION CONFIG │
|
|
16
|
-
│ │
|
|
17
|
-
│ Read: .cursor/agent-skill-index.yaml │
|
|
18
|
-
│ Read: .cursor/orchestration.yaml │
|
|
19
|
-
│ Read: .cursor/failure-modes.yaml │
|
|
20
|
-
└─────────────────────────────────────────────────────────────┘
|
|
21
|
-
↓
|
|
22
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
23
|
-
│ STEP 2: ANALYZE USER REQUEST │
|
|
24
|
-
│ │
|
|
25
|
-
│ Keywords detected: ["payment", "stripe"] │
|
|
26
|
-
│ Files affected: [*.ts, prisma/schema.prisma] │
|
|
27
|
-
│ Complexity: medium │
|
|
28
|
-
└─────────────────────────────────────────────────────────────┘
|
|
29
|
-
↓
|
|
30
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
31
|
-
│ STEP 3: DYNAMIC AGENT SELECTION │
|
|
32
|
-
│ │
|
|
33
|
-
│ Check command_mapping: │
|
|
34
|
-
│ ├── /do → default: fullstack-developer │
|
|
35
|
-
│ └── conditionals: none matched │
|
|
36
|
-
│ │
|
|
37
|
-
│ Check agent boundaries: │
|
|
38
|
-
│ └── fullstack-developer.boundaries: │
|
|
39
|
-
│ └── NOT: security_audit → security-auditor │
|
|
40
|
-
│ │
|
|
41
|
-
│ Result: │
|
|
42
|
-
│ ├── PRIMARY: fullstack-developer (confidence: 0.85) │
|
|
43
|
-
│ └── SECONDARY: security-auditor (payment = sensitive) │
|
|
44
|
-
└─────────────────────────────────────────────────────────────┘
|
|
45
|
-
↓
|
|
46
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
47
|
-
│ STEP 4: DYNAMIC SKILL ACTIVATION │
|
|
48
|
-
│ │
|
|
49
|
-
│ Scan skills.activation rules: │
|
|
50
|
-
│ │
|
|
51
|
-
│ payment-integration: │
|
|
52
|
-
│ ├── keyword: ["payment", "stripe"] → MATCH ✓ │
|
|
53
|
-
│ ├── package: ["stripe"] → CHECK package.json │
|
|
54
|
-
│ └── requires_security_review: true → FLAG │
|
|
55
|
-
│ │
|
|
56
|
-
│ databases: │
|
|
57
|
-
│ └── file: prisma/schema.prisma → MATCH ✓ │
|
|
58
|
-
│ │
|
|
59
|
-
│ better-auth: │
|
|
60
|
-
│ └── keyword: ["auth", "login"] → NO MATCH │
|
|
61
|
-
│ │
|
|
62
|
-
│ Activated: [payment-integration, databases] │
|
|
63
|
-
└─────────────────────────────────────────────────────────────┘
|
|
64
|
-
↓
|
|
65
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
66
|
-
│ STEP 5: CHECK FAILURE MODES │
|
|
67
|
-
│ │
|
|
68
|
-
│ low_confidence: │
|
|
69
|
-
│ └── confidence 0.85 > 0.5 → OK │
|
|
70
|
-
│ │
|
|
71
|
-
│ security_concern: │
|
|
72
|
-
│ └── payment = sensitive → ESCALATE to security-auditor │
|
|
73
|
-
│ │
|
|
74
|
-
│ architecture_violation: │
|
|
75
|
-
│ └── Check preset contract → OK │
|
|
76
|
-
└─────────────────────────────────────────────────────────────┘
|
|
77
|
-
↓
|
|
78
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
79
|
-
│ STEP 6: DETERMINE RISK LEVEL │
|
|
80
|
-
│ │
|
|
81
|
-
│ Check orchestration.yaml risk_levels: │
|
|
82
|
-
│ ├── keywords: ["payment"] → HIGH risk │
|
|
83
|
-
│ └── chain: security_chain │
|
|
84
|
-
│ │
|
|
85
|
-
│ Required: │
|
|
86
|
-
│ ├── auto_approve: false │
|
|
87
|
-
│ ├── require_review: true │
|
|
88
|
-
│ └── require_lead_approval: true │
|
|
89
|
-
└─────────────────────────────────────────────────────────────┘
|
|
90
|
-
↓
|
|
91
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
92
|
-
│ STEP 7: BUILD EXECUTION CHAIN │
|
|
93
|
-
│ │
|
|
94
|
-
│ Chain: security_chain │
|
|
95
|
-
│ [1] planner → Create plan │
|
|
96
|
-
│ [2] fullstack-developer → Implement │
|
|
97
|
-
│ [3] security-auditor → Security review │
|
|
98
|
-
│ [4] code-reviewer → Final review │
|
|
99
|
-
└─────────────────────────────────────────────────────────────┘
|
|
100
|
-
↓
|
|
101
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
102
|
-
│ STEP 8: LOG TO AUDIT │
|
|
103
|
-
│ │
|
|
104
|
-
│ Write to .ai-audit/YYYY-MM-DD.jsonl: │
|
|
105
|
-
│ { │
|
|
106
|
-
│ "command": "/do 'Add payment'", │
|
|
107
|
-
│ "agents": ["fullstack-developer", "security-auditor"], │
|
|
108
|
-
│ "skills": ["payment-integration", "databases"], │
|
|
109
|
-
│ "risk_level": "high", │
|
|
110
|
-
│ "chain": "security_chain" │
|
|
111
|
-
│ } │
|
|
112
|
-
└─────────────────────────────────────────────────────────────┘
|
|
113
|
-
↓
|
|
114
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
115
|
-
│ STEP 9: EXECUTE WITH ORCHESTRATION │
|
|
116
|
-
│ │
|
|
117
|
-
│ Apply agents, skills, and chain to implementation │
|
|
118
|
-
└─────────────────────────────────────────────────────────────┘
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## 📋 Quy Tắc Điều Phối
|
|
124
|
-
|
|
125
|
-
### Rule 1: Agent Selection Priority
|
|
126
|
-
```
|
|
127
|
-
1. Check command_mapping.conditionals
|
|
128
|
-
2. If no match → Use command_mapping.default
|
|
129
|
-
3. Check agent.boundaries for escalation
|
|
130
|
-
4. Check skill.requires_security_review
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Rule 2: Skill Activation
|
|
134
|
-
```
|
|
135
|
-
FOR EACH skill IN agent-skill-index.yaml:
|
|
136
|
-
IF skill.activation.keyword MATCHES request:
|
|
137
|
-
ACTIVATE skill
|
|
138
|
-
IF skill.activation.file_pattern MATCHES affected_files:
|
|
139
|
-
ACTIVATE skill
|
|
140
|
-
IF skill.activation.package EXISTS IN package.json:
|
|
141
|
-
ACTIVATE skill
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Rule 3: Risk Assessment
|
|
145
|
-
```
|
|
146
|
-
Scan request for risk_levels keywords:
|
|
147
|
-
low: ["typo", "rename", "format"]
|
|
148
|
-
medium: ["feature", "component", "api"]
|
|
149
|
-
high: ["payment", "auth", "admin"]
|
|
150
|
-
critical: ["delete", "drop", "production"]
|
|
151
|
-
|
|
152
|
-
Apply corresponding chain and approvals.
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Rule 4: Failure Mode Check
|
|
156
|
-
```
|
|
157
|
-
BEFORE execution:
|
|
158
|
-
IF confidence < 0.5 → ASK user
|
|
159
|
-
IF security_concern → ESCALATE
|
|
160
|
-
IF architecture_violation → STOP
|
|
161
|
-
IF outside_expertise → ESCALATE to appropriate agent
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## 🔗 Config Files
|
|
167
|
-
|
|
168
|
-
| File | Purpose |
|
|
169
|
-
|------|---------|
|
|
170
|
-
| `.cursor/agent-skill-index.yaml` | Agent capabilities, skill activation |
|
|
171
|
-
| `.cursor/orchestration.yaml` | Chains, risk levels, escalation |
|
|
172
|
-
| `.cursor/failure-modes.yaml` | Stop conditions, restraints |
|
|
173
|
-
| `.ai-audit/` | Audit logs |
|
package/docs/WALKTHROUGH.md
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
# User Walkthrough: E-commerce Shop trong 5 Ngày
|
|
2
|
-
|
|
3
|
-
> Mô phỏng hành trình user mới sử dụng anchi-toolkit từ đầu đến deploy
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📋 Profile
|
|
8
|
-
|
|
9
|
-
| | |
|
|
10
|
-
|---|---|
|
|
11
|
-
| **User** | Minh (Junior Developer, 1 năm kinh nghiệm) |
|
|
12
|
-
| **Goal** | Tạo website bán hàng online |
|
|
13
|
-
| **Preset** | Rapid MVP |
|
|
14
|
-
| **Platform** | Cursor AI |
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 🗓️ Day 1: Setup & First Feature
|
|
19
|
-
|
|
20
|
-
### 1.1 Cài Đặt (2 phút)
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
mkdir my-shop && cd my-shop
|
|
24
|
-
npx anchi-toolkit install
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Output:
|
|
28
|
-
```
|
|
29
|
-
✅ .cursor/commands/ - 18 commands
|
|
30
|
-
✅ .cursor/agents/ - 19 agents
|
|
31
|
-
✅ .cursor/skills/ - 35 skills
|
|
32
|
-
✅ presets/ - 3 architecture presets
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 1.2 Khởi Tạo
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
/start
|
|
39
|
-
→ Chọn 2 (Dự án mới)
|
|
40
|
-
→ Chọn 1 (Rapid MVP)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
AI tự động:
|
|
44
|
-
- Tạo Next.js project
|
|
45
|
-
- Setup Prisma + SQLite
|
|
46
|
-
- Lưu context vào `.ai-memory/`
|
|
47
|
-
|
|
48
|
-
### 1.3 Homepage
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
/do "Add homepage with hero section and featured products"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
AI:
|
|
55
|
-
- Phân tích → fullstack-developer (0.9)
|
|
56
|
-
- Plan → 4 files
|
|
57
|
-
- Implement → 3-5 phút
|
|
58
|
-
- Assessment → confidence: 0.92, risk: low
|
|
59
|
-
|
|
60
|
-
**Files created:** `page.tsx`, `Hero.tsx`, `ProductCard.tsx`, `products.ts`
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## 🛒 Day 2: Shopping Cart
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
/do "Add shopping cart with add/remove functionality"
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
AI:
|
|
71
|
-
- Agent: fullstack-developer
|
|
72
|
-
- Skills: frontend-development, databases
|
|
73
|
-
- Risk: medium (state management)
|
|
74
|
-
|
|
75
|
-
**Files created:**
|
|
76
|
-
- `CartContext.tsx`
|
|
77
|
-
- `CartProvider.tsx`
|
|
78
|
-
- `CartButton.tsx`
|
|
79
|
-
- `CartSidebar.tsx`
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## 🔒 Day 3: Authentication
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
/do "Add user login with email and password"
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
AI:
|
|
90
|
-
```
|
|
91
|
-
⚠️ Security-Related Feature Detected
|
|
92
|
-
→ Auto-enabling code review
|
|
93
|
-
|
|
94
|
-
📜 Rules Applied:
|
|
95
|
-
├── Contract P2: Using service layer
|
|
96
|
-
├── Contract S1: No direct DB in routes
|
|
97
|
-
└── Risk Rule: Code review enabled
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Files created:**
|
|
101
|
-
- `AuthService.ts`
|
|
102
|
-
- `auth/route.ts`
|
|
103
|
-
- `LoginForm.tsx`
|
|
104
|
-
- `session.ts`
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## ❓ Day 4: Understand AI Decisions
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
/why
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Output:
|
|
115
|
-
```
|
|
116
|
-
🤖 AGENT SELECTION:
|
|
117
|
-
├── PRIMARY: fullstack-developer
|
|
118
|
-
│ └── WHY: Auth involves frontend + backend
|
|
119
|
-
├── SECONDARY: database-admin
|
|
120
|
-
│ └── WHY: User table schema changes
|
|
121
|
-
|
|
122
|
-
📚 SKILL ACTIVATION:
|
|
123
|
-
├── ✅ better-auth/ (keyword: "login")
|
|
124
|
-
├── ✅ databases/ (schema modification)
|
|
125
|
-
└── ❌ payment-integration/ (no payment keywords)
|
|
126
|
-
|
|
127
|
-
📜 RULES APPLIED:
|
|
128
|
-
├── P2: "Use service layer" → AuthService
|
|
129
|
-
└── Risk: "Auth = sensitive" → Enabled review
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## ✅ Day 5: Commit & Deploy
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
/commit
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
AI:
|
|
141
|
-
```
|
|
142
|
-
📝 Suggested commit message:
|
|
143
|
-
|
|
144
|
-
feat: add e-commerce shop with cart and auth
|
|
145
|
-
|
|
146
|
-
- Add homepage with hero and product grid
|
|
147
|
-
- Add shopping cart with add/remove
|
|
148
|
-
- Add user authentication
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
```
|
|
152
|
-
/review --security
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
AI reviews auth implementation → ✅ Passed
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## 📊 Summary
|
|
160
|
-
|
|
161
|
-
| Metric | Value |
|
|
162
|
-
|--------|-------|
|
|
163
|
-
| Commands used | 7 |
|
|
164
|
-
| Files created | 15+ |
|
|
165
|
-
| Features built | Homepage, Cart, Auth |
|
|
166
|
-
| Code written by hand | ~0 lines |
|
|
167
|
-
| Time spent | ~5 hours total |
|
|
168
|
-
| Reviews triggered | 1 (auto for auth) |
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## 🎓 Key Takeaways
|
|
173
|
-
|
|
174
|
-
1. **Describe, don't code** - Mô tả muốn gì, AI implement
|
|
175
|
-
2. **AI tự biết giới hạn** - Khi auth, tự enable review
|
|
176
|
-
3. **Explainable** - `/why` giải thích mọi quyết định
|
|
177
|
-
4. **Progressive** - Từ simple → complex tự nhiên
|
|
178
|
-
5. **Safe by default** - Security features auto-protected
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## 💬 User Feedback
|
|
183
|
-
|
|
184
|
-
> *"Mình chỉ cần mô tả muốn gì, AI tự plan, tự implement, tự biết khi nào cần review. Mình chỉ cần approve và test. Quá tiện!"*
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 🔗 Related
|
|
189
|
-
|
|
190
|
-
- [BEGINNER_GUIDE_VI.md](../BEGINNER_GUIDE_VI.md)
|
|
191
|
-
- [QUICK_REFERENCE.md](../QUICK_REFERENCE.md)
|
|
192
|
-
- [docs/ORCHESTRATION.md](./ORCHESTRATION.md)
|
|
File without changes
|