@mrtrinhvn/ag-kit 1.0.6 → 1.0.7
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/.agent/agents/backend-specialist.md +2 -2
- package/.agent/agents/frontend-specialist.md +37 -74
- package/.agent/agents/quant-architect.md +31 -0
- package/.agent/rules/GEMINI.md +8 -1
- package/.agent/skills/app-builder/SKILL.md +1 -1
- package/.agent/skills/app-builder/scaffolding.md +3 -3
- package/.agent/skills/app-builder/tech-stack.md +3 -4
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +39 -79
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +53 -75
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +56 -119
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +61 -94
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +56 -82
- package/.agent/skills/brainstorming/SKILL.md +13 -8
- package/.agent/skills/business-ops/SKILL.md +26 -0
- package/.agent/skills/clean-code/SKILL.md +4 -3
- package/.agent/skills/cli-generator/SKILL.md +48 -0
- package/.agent/skills/data-science/SKILL.md +28 -0
- package/.agent/skills/doc.md +36 -36
- package/.agent/skills/frontend-design/SKILL.md +0 -34
- package/.agent/skills/frontend-design/ux-psychology.md +10 -585
- package/.agent/skills/knowledge-management/SKILL.md +66 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +2 -14
- package/.agent/skills/memory-architecture/SKILL.md +107 -0
- package/.agent/skills/mini-antigravity-injection/SKILL.md +59 -0
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +1 -40
- package/.agent/skills/nextjs-react-expert/SKILL.md +21 -47
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +1 -1
- package/.agent/skills/plan-writing/SKILL.md +32 -31
- package/.agent/skills/product-management/SKILL.md +30 -0
- package/.agent/skills/systematic-debugging/SKILL.md +11 -0
- package/.agent/skills/tdd-workflow/SKILL.md +6 -7
- package/.agent/workflows/orchestrate.md +6 -6
- package/package.json +1 -1
- package/template/.agent/skills/mini-antigravity-injection/SKILL.md +59 -0
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nuxt-app
|
|
3
|
-
description: Nuxt
|
|
3
|
+
description: Nuxt 3 full-stack template. Vue 3, Pinia, Tailwind, Prisma.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Nuxt
|
|
7
|
-
|
|
8
|
-
Mẫu template Full-Stack hiện đại cho Nuxt 4, tối ưu hóa hiệu suất với Vue Vapor Mode và Tailwind v4.
|
|
6
|
+
# Nuxt 3 Full-Stack Template
|
|
9
7
|
|
|
10
8
|
## Tech Stack
|
|
11
9
|
|
|
12
|
-
| Component | Technology |
|
|
13
|
-
|
|
14
|
-
| Framework | Nuxt
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
| State | Pinia |
|
|
18
|
-
| Database | PostgreSQL
|
|
19
|
-
| Styling | Tailwind CSS |
|
|
20
|
-
|
|
|
21
|
-
| Validation | Zod | Schema validation |
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | Nuxt 3 |
|
|
13
|
+
| Language | TypeScript |
|
|
14
|
+
| UI | Vue 3 (Composition API) |
|
|
15
|
+
| State | Pinia |
|
|
16
|
+
| Database | PostgreSQL + Prisma |
|
|
17
|
+
| Styling | Tailwind CSS |
|
|
18
|
+
| Validation | Zod |
|
|
22
19
|
|
|
23
20
|
---
|
|
24
21
|
|
|
25
|
-
## Directory Structure
|
|
26
|
-
|
|
27
|
-
Sử dụng cấu trúc `app/` để giữ thư mục gốc gọn gàng.
|
|
22
|
+
## Directory Structure
|
|
28
23
|
|
|
29
24
|
```
|
|
30
25
|
project-name/
|
|
31
|
-
├── app/ # Application Source
|
|
32
|
-
│ ├── assets/
|
|
33
|
-
│ │ └── css/
|
|
34
|
-
│ │ └── main.css # Tailwind v4 imports
|
|
35
|
-
│ ├── components/ # Auto-imported components
|
|
36
|
-
│ ├── composables/ # Auto-imported logic
|
|
37
|
-
│ ├── layouts/
|
|
38
|
-
│ ├── pages/ # File-based routing
|
|
39
|
-
│ ├── app.vue # Root component
|
|
40
|
-
│ └── router.options.ts
|
|
41
|
-
├── server/ # Nitro Server Engine
|
|
42
|
-
│ ├── api/ # API Routes (e.g. /api/users)
|
|
43
|
-
│ ├── routes/ # Server Routes
|
|
44
|
-
│ └── utils/ # Server-only helpers (Prisma)
|
|
45
26
|
├── prisma/
|
|
46
27
|
│ └── schema.prisma
|
|
47
|
-
├──
|
|
48
|
-
├──
|
|
28
|
+
├── server/
|
|
29
|
+
│ ├── api/
|
|
30
|
+
│ │ └── [resource]/
|
|
31
|
+
│ │ └── index.ts
|
|
32
|
+
│ └── utils/
|
|
33
|
+
│ └── db.ts # Prisma client
|
|
34
|
+
├── composables/
|
|
35
|
+
│ └── useAuth.ts
|
|
36
|
+
├── stores/
|
|
37
|
+
│ └── user.ts # Pinia store
|
|
38
|
+
├── components/
|
|
39
|
+
│ └── ui/
|
|
40
|
+
├── pages/
|
|
41
|
+
│ ├── index.vue
|
|
42
|
+
│ └── [...slug].vue
|
|
43
|
+
├── layouts/
|
|
44
|
+
│ └── default.vue
|
|
45
|
+
├── assets/
|
|
46
|
+
│ └── css/
|
|
47
|
+
│ └── main.css
|
|
48
|
+
├── .env.example
|
|
49
|
+
├── nuxt.config.ts
|
|
49
50
|
└── package.json
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
---
|
|
53
54
|
|
|
54
|
-
## Key Concepts
|
|
55
|
+
## Key Concepts
|
|
55
56
|
|
|
56
|
-
| Concept | Description |
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
57
|
+
| Concept | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| Auto-imports | Components, composables, utils |
|
|
60
|
+
| File-based routing | pages/ → routes |
|
|
61
|
+
| Server Routes | server/api/ → API endpoints |
|
|
62
|
+
| Composables | Reusable reactive logic |
|
|
63
|
+
| Pinia | State management |
|
|
63
64
|
|
|
64
65
|
---
|
|
65
66
|
|
|
@@ -67,68 +68,34 @@ project-name/
|
|
|
67
68
|
|
|
68
69
|
| Variable | Purpose |
|
|
69
70
|
|----------|---------|
|
|
70
|
-
| DATABASE_URL | Prisma connection
|
|
71
|
-
| NUXT_PUBLIC_APP_URL |
|
|
72
|
-
| NUXT_SESSION_PASSWORD | Session encryption key |
|
|
71
|
+
| DATABASE_URL | Prisma connection |
|
|
72
|
+
| NUXT_PUBLIC_APP_URL | Public URL |
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
76
|
## Setup Steps
|
|
77
77
|
|
|
78
|
-
1.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
2. Install Core Deps:
|
|
85
|
-
```bash
|
|
86
|
-
npm install @pinia/nuxt @prisma/client zod
|
|
87
|
-
npm install -D prisma
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
3. Setup Tailwind v4:
|
|
91
|
-
Install the Vite plugin (new standard):
|
|
92
|
-
```bash
|
|
93
|
-
npm install tailwindcss @tailwindcss/vite
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Add to `nuxt.config.ts`:
|
|
78
|
+
1. `npx nuxi@latest init {{name}}`
|
|
79
|
+
2. `cd {{name}}`
|
|
80
|
+
3. `npm install @pinia/nuxt @prisma/client prisma zod`
|
|
81
|
+
4. `npm install -D @nuxtjs/tailwindcss`
|
|
82
|
+
5. Add modules to `nuxt.config.ts`:
|
|
97
83
|
```ts
|
|
98
|
-
|
|
99
|
-
export default defineNuxtConfig({
|
|
100
|
-
vite: {
|
|
101
|
-
plugins: [tailwindcss()]
|
|
102
|
-
},
|
|
103
|
-
css: ['~/assets/css/main.css']
|
|
104
|
-
})
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
4. Configure CSS:
|
|
108
|
-
In `app/assets/css/main.css`:
|
|
109
|
-
```css
|
|
110
|
-
@import "tailwindcss";
|
|
111
|
-
@theme {
|
|
112
|
-
--color-primary: oklch(0.6 0.15 150);
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
5. Run Development:
|
|
117
|
-
```bash
|
|
118
|
-
npm run dev
|
|
119
|
-
# Runs with Turbo/Vite
|
|
84
|
+
modules: ['@pinia/nuxt', '@nuxtjs/tailwindcss']
|
|
120
85
|
```
|
|
86
|
+
6. `npx prisma init`
|
|
87
|
+
7. Configure schema
|
|
88
|
+
8. `npx prisma db push`
|
|
89
|
+
9. `npm run dev`
|
|
121
90
|
|
|
122
91
|
---
|
|
123
92
|
|
|
124
93
|
## Best Practices
|
|
125
94
|
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
-
|
|
133
|
-
- **State**: Dùng `defineStore` (Pinia) cho global state, `useState` của Nuxt cho state đơn giản chia sẻ giữa Server/Client.
|
|
134
|
-
- **Type Safety**: Tự động tạo type cho API routes (`$fetch` typed automatically).
|
|
95
|
+
- Use `<script setup>` for components
|
|
96
|
+
- Composables for reusable logic
|
|
97
|
+
- Pinia stores in `stores/` folder
|
|
98
|
+
- Server routes for API logic
|
|
99
|
+
- Auto-import for clean code
|
|
100
|
+
- TypeScript for type safety
|
|
101
|
+
- See `@[skills/vue-expert]` for Vue patterns
|
|
@@ -3,117 +3,91 @@ name: react-native-app
|
|
|
3
3
|
description: React Native mobile app template principles. Expo, TypeScript, navigation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# React Native App Template
|
|
7
|
-
|
|
8
|
-
Modern mobile app template, optimized for New Architecture and React 19.
|
|
6
|
+
# React Native App Template
|
|
9
7
|
|
|
10
8
|
## Tech Stack
|
|
11
9
|
|
|
12
|
-
| Component | Technology |
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
| Language | TypeScript |
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
| Styling | NativeWind |
|
|
19
|
-
|
|
|
20
|
-
| Storage | Expo SecureStore | Encrypted local storage |
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | React Native + Expo |
|
|
13
|
+
| Language | TypeScript |
|
|
14
|
+
| Navigation | Expo Router |
|
|
15
|
+
| State | Zustand + React Query |
|
|
16
|
+
| Styling | NativeWind |
|
|
17
|
+
| Testing | Jest + RNTL |
|
|
21
18
|
|
|
22
19
|
---
|
|
23
20
|
|
|
24
21
|
## Directory Structure
|
|
25
22
|
|
|
26
|
-
Standardized structure for Expo Router and NativeWind v4.
|
|
27
|
-
|
|
28
23
|
```
|
|
29
24
|
project-name/
|
|
30
|
-
├── app/ # Expo Router (
|
|
31
|
-
│ ├── _layout.tsx # Root
|
|
32
|
-
│ ├── index.tsx #
|
|
33
|
-
│ ├── (tabs)/ #
|
|
34
|
-
│
|
|
35
|
-
│ │ ├── home.tsx
|
|
36
|
-
│ │ └── profile.tsx
|
|
37
|
-
│ ├── +not-found.tsx # 404 Page
|
|
38
|
-
│ └── [id].tsx # Dynamic Route (Typed)
|
|
25
|
+
├── app/ # Expo Router (file-based)
|
|
26
|
+
│ ├── _layout.tsx # Root layout
|
|
27
|
+
│ ├── index.tsx # Home
|
|
28
|
+
│ ├── (tabs)/ # Tab navigation
|
|
29
|
+
│ └── [id].tsx # Dynamic route
|
|
39
30
|
├── components/
|
|
40
|
-
│ ├── ui/ #
|
|
41
|
-
│ └── features/
|
|
42
|
-
├── hooks/
|
|
31
|
+
│ ├── ui/ # Reusable
|
|
32
|
+
│ └── features/
|
|
33
|
+
├── hooks/
|
|
43
34
|
├── lib/
|
|
44
|
-
│ ├── api.ts
|
|
45
|
-
│ └── storage.ts
|
|
46
|
-
├── store/
|
|
47
|
-
├── constants/
|
|
48
|
-
|
|
49
|
-
├── global.css # Entry point for NativeWind v4
|
|
50
|
-
├── tailwind.config.ts # Tailwind Config (if custom theme needed)
|
|
51
|
-
├── babel.config.js # NativeWind Babel Plugin
|
|
52
|
-
└── app.json # Expo Config
|
|
35
|
+
│ ├── api.ts
|
|
36
|
+
│ └── storage.ts
|
|
37
|
+
├── store/
|
|
38
|
+
├── constants/
|
|
39
|
+
└── app.json
|
|
53
40
|
```
|
|
54
41
|
|
|
55
42
|
---
|
|
56
43
|
|
|
57
|
-
## Navigation Patterns
|
|
44
|
+
## Navigation Patterns
|
|
58
45
|
|
|
59
|
-
| Pattern |
|
|
60
|
-
|
|
61
|
-
| Stack |
|
|
62
|
-
| Tabs | Bottom navigation
|
|
63
|
-
| Drawer | Side
|
|
64
|
-
|
|
|
46
|
+
| Pattern | Use |
|
|
47
|
+
|---------|-----|
|
|
48
|
+
| Stack | Page hierarchy |
|
|
49
|
+
| Tabs | Bottom navigation |
|
|
50
|
+
| Drawer | Side menu |
|
|
51
|
+
| Modal | Overlay screens |
|
|
65
52
|
|
|
66
53
|
---
|
|
67
54
|
|
|
68
|
-
##
|
|
55
|
+
## State Management
|
|
69
56
|
|
|
70
|
-
|
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
| zustand | Global state management (lighter than Redux) |
|
|
77
|
-
| expo-image | Optimized image rendering for performance |
|
|
57
|
+
| Type | Tool |
|
|
58
|
+
|------|------|
|
|
59
|
+
| Local | Zustand |
|
|
60
|
+
| Server | React Query |
|
|
61
|
+
| Forms | React Hook Form |
|
|
62
|
+
| Storage | Expo SecureStore |
|
|
78
63
|
|
|
79
64
|
---
|
|
80
65
|
|
|
81
|
-
##
|
|
66
|
+
## Key Packages
|
|
82
67
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npx expo install expo-router react-native-safe-area-context react-native-screens expo-link expo-constants expo-status-bar
|
|
92
|
-
```
|
|
68
|
+
| Package | Purpose |
|
|
69
|
+
|---------|---------|
|
|
70
|
+
| expo-router | File-based routing |
|
|
71
|
+
| zustand | Local state |
|
|
72
|
+
| @tanstack/react-query | Server state |
|
|
73
|
+
| nativewind | Tailwind styling |
|
|
74
|
+
| expo-secure-store | Secure storage |
|
|
93
75
|
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npm install nativewind tailwindcss react-native-reanimated
|
|
97
|
-
```
|
|
76
|
+
---
|
|
98
77
|
|
|
99
|
-
|
|
100
|
-
- Add plugin to `babel.config.js`: `plugins: ["nativewind/babel"]`.
|
|
101
|
-
- Create `global.css` with: `@import "tailwindcss";`.
|
|
102
|
-
- Import `global.css` in `app/_layout.tsx`.
|
|
78
|
+
## Setup Steps
|
|
103
79
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```
|
|
80
|
+
1. `npx create-expo-app {{name}} -t expo-template-blank-typescript`
|
|
81
|
+
2. `npx expo install expo-router react-native-safe-area-context`
|
|
82
|
+
3. Install state: `npm install zustand @tanstack/react-query`
|
|
83
|
+
4. `npx expo start`
|
|
109
84
|
|
|
110
85
|
---
|
|
111
86
|
|
|
112
|
-
## Best Practices
|
|
87
|
+
## Best Practices
|
|
113
88
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
- **API**: Always wrap API calls with TanStack Query, avoid direct calls in `useEffect`.
|
|
89
|
+
- Expo Router for navigation
|
|
90
|
+
- Zustand for local, React Query for server state
|
|
91
|
+
- NativeWind for consistent styling
|
|
92
|
+
- Expo SecureStore for tokens
|
|
93
|
+
- Test on both iOS and Android
|
|
@@ -21,14 +21,18 @@ allowed-tools: Read, Glob, Grep
|
|
|
21
21
|
| Update/change request | 🛑 Confirm scope |
|
|
22
22
|
| Vague requirements | 🛑 Ask purpose, users, constraints |
|
|
23
23
|
|
|
24
|
-
### 🚫 MANDATORY:
|
|
25
|
-
|
|
26
|
-
1. **STOP** - Do NOT start coding
|
|
27
|
-
2. **
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
3. **
|
|
24
|
+
### 🚫 MANDATORY: Socratic Gate & Bias Filter
|
|
25
|
+
|
|
26
|
+
1. **STOP** - Do NOT start coding
|
|
27
|
+
2. **COGNITIVE BIAS CHECK (Self-Debate)** - Ask yourself these 3 questions silently:
|
|
28
|
+
- *Anchoring Bias (Mỏ neo)*: Am I trying to patch a fundamentally broken 100-line function just because it's there, instead of throwing it away and writing a crisp 10-line one?
|
|
29
|
+
- *Sunk Cost (Chi phí chìm)*: Am I sticking to a bad architectural decision just because we spent hours on it yesterday?
|
|
30
|
+
- *Second-Order Effect (Hệ quả bậc 2)*: If I change this DB schema or API payload, what frontend component will break globally?
|
|
31
|
+
3. **ASK THE USER** - Minimum 3 questions:
|
|
32
|
+
- 🎯 Purpose: What problem are you solving?
|
|
33
|
+
- 👥 Users: Who will use this?
|
|
34
|
+
- 📦 Scope: Must-have vs nice-to-have?
|
|
35
|
+
4. **WAIT** - Get response before proceeding
|
|
32
36
|
|
|
33
37
|
---
|
|
34
38
|
|
|
@@ -156,6 +160,7 @@ allowed-tools: Read, Glob, Grep
|
|
|
156
160
|
|--------------|-----|
|
|
157
161
|
| Jumping to solutions before understanding | Wastes time on wrong problem |
|
|
158
162
|
| Assuming requirements without asking | Creates wrong output |
|
|
163
|
+
| Assuming Data/API is dead | Testing at the wrong time (e.g., market closed) and concluding the API is removed. ALWAYS verify with SDK sample code or Docs first. |
|
|
159
164
|
| Over-engineering first version | Delays value delivery |
|
|
160
165
|
| Ignoring constraints | Creates unusable solutions |
|
|
161
166
|
| "I think" phrases | Uncertainty → Ask instead |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: business-ops
|
|
3
|
+
description: Skill Quản trị Vận Hành. Đọc soát Hợp đồng (Legal), Phân tích Kế toán (Finance), và Quản lý Tuyển dụng (HR).
|
|
4
|
+
allowed-tools: Read, Bash
|
|
5
|
+
version: 1.0
|
|
6
|
+
priority: MODERATE
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Kỹ năng Vận Hành Doanh Nghiệp (Business Operations)
|
|
10
|
+
|
|
11
|
+
> **MỤC TIÊU:** Hỗ trợ Giám đốc xử lý các mảng "Back-Office" ngoài luồng lập trình để Tiết kiệm thời gian quản trị.
|
|
12
|
+
|
|
13
|
+
Các phân hệ Vận hành cụ thể:
|
|
14
|
+
|
|
15
|
+
## 1. Finance Ops (Nghiệp vụ Tài chính - Kế toán)
|
|
16
|
+
* Kiểm tra Bảng giá API các dịch vụ Sub (AWS, Supabase, Vercel) xem code có vi phạm rủi ro "Tràn hóa đơn" (Billing Attack) không?
|
|
17
|
+
* Gợi ý giải pháp tiết kiệm Cost Token khi gọi LLM Agent.
|
|
18
|
+
|
|
19
|
+
## 2. Legal & Compliance (Pháp lý - Hợp đồng)
|
|
20
|
+
* Đọc hiểu Terms of Service (TOS) của các Provider (như DNSE, Yuanta, SSI).
|
|
21
|
+
* Cảnh báo rủi ro về Privacy (Lưu Mật khẩu User dạng Plain text là vi phạm GDPR).
|
|
22
|
+
* Quét Compliance: Đảm bảo không lộ Key, không vi phạm quy chuẩn chia sẻ dữ liệu chứng khoán.
|
|
23
|
+
|
|
24
|
+
## 3. HR & Ops (Tuyển mộ - Quy trình)
|
|
25
|
+
* User có thể yêu cầu: "Viết giúp JD để tuyển 3 ông lính ReactJS". Hệ thống sẽ dùng kiến thức Codebase hiện tại để sinh ra 1 bản Yêu cầu Công việc sát thực tế nhất 100%. (Bắt buộc phải biết Redux? Hook? Tailwind? Hệ thống tự đọc Code của dự án và sinh ra luật).
|
|
26
|
+
* Tạo Quy trình làm việc (Standard Operating Procedure - SOP) cho Developer mới Onboard.
|
|
@@ -64,9 +64,10 @@ priority: CRITICAL
|
|
|
64
64
|
|
|
65
65
|
| Situation | Action |
|
|
66
66
|
|-----------|--------|
|
|
67
|
-
| User asks for feature |
|
|
67
|
+
| User asks for feature | STOP. Use Socratic Gate (brainstorming) |
|
|
68
68
|
| User reports bug | Fix it, don't explain |
|
|
69
69
|
| No clear requirement | Ask, don't assume |
|
|
70
|
+
| Need current time/date | ALWAYS use `get_time_machine().now()` or `.is_trading_hours()`. NEVER use `datetime.now()` directly. |
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
@@ -103,7 +104,7 @@ File to edit: UserService.ts
|
|
|
103
104
|
└── Do they need changes too? → Check function signatures
|
|
104
105
|
```
|
|
105
106
|
|
|
106
|
-
> 🔴 **Rule:** Edit
|
|
107
|
+
> 🔴 **Rule:** Edit dependent files using independent 5-minute micro-tasks strictly within the Plan.
|
|
107
108
|
> 🔴 **Never leave broken imports or missing updates.**
|
|
108
109
|
|
|
109
110
|
---
|
|
@@ -112,7 +113,7 @@ File to edit: UserService.ts
|
|
|
112
113
|
|
|
113
114
|
| Do | Don't |
|
|
114
115
|
|----|-------|
|
|
115
|
-
|
|
|
116
|
+
| Ask questions before big features | Write tutorials |
|
|
116
117
|
| Let code self-document | Add obvious comments |
|
|
117
118
|
| Fix bugs immediately | Explain the fix first |
|
|
118
119
|
| Inline small things | Create unnecessary files |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cli-generator
|
|
3
|
+
description: Meta-skill enabling the Agent to automatically convert local software, repositories, or APIs into structured CLI tools using HKUDS/CLI-Anything.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLI-Generator (Meta-Skill)
|
|
7
|
+
|
|
8
|
+
> 🔴 **CRITICAL**: This is a Meta-Skill. It gives you (the AI Agent) the ability to forge your own tools to solve complex constraints.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
Use this skill when:
|
|
13
|
+
- The user asks you to interact with a complex local GUI software (e.g., GIMP, OBS).
|
|
14
|
+
- You are working with a messy, undocumented local API or scripting repository that is too brittle to run manually via ad-hoc scripts.
|
|
15
|
+
- You need a dedicated CLI tool to perform repetitive tasks reliably, but none exists.
|
|
16
|
+
|
|
17
|
+
## The Forging Process
|
|
18
|
+
|
|
19
|
+
When you decide you need a new CLI tool for a given `TARGET_DIR` (the source code of the application), follow exactly these steps:
|
|
20
|
+
|
|
21
|
+
### 1. Install CLI-Anything (If not already installed)
|
|
22
|
+
Check if `cli-anything` is available in your PATH. If not, install it globally:
|
|
23
|
+
```bash
|
|
24
|
+
pip install cli-anything
|
|
25
|
+
```
|
|
26
|
+
*(If the package is not on PyPI, clone `https://github.com/HKUDS/CLI-Anything` and run `pip install -e .`)*
|
|
27
|
+
|
|
28
|
+
### 2. Run the Generator Pipeline
|
|
29
|
+
Navigate to a neutral workspace or the target, and run the automated generation pipeline:
|
|
30
|
+
```bash
|
|
31
|
+
cli-anything --source /absolute/path/to/TARGET_DIR
|
|
32
|
+
```
|
|
33
|
+
*Note: This process analyzes the source code and generates the harness. It may take several minutes and uses the underlying LLM's API tokens.*
|
|
34
|
+
|
|
35
|
+
### 3. Integrate the Forged Skill into `ag-kit`
|
|
36
|
+
The pipeline will generate a new Python package (e.g., `cli-anything-targetname`) and automatically produce a `SKILL.md` file within its package directory (usually `cli_anything/<software>/skills/SKILL.md`).
|
|
37
|
+
You MUST locate this generated `SKILL.md` and copy it into the user's `ag-kit` workspace:
|
|
38
|
+
```bash
|
|
39
|
+
mkdir -p .agent/skills/<targetname-cli>
|
|
40
|
+
cp /path/to/generated/SKILL.md .agent/skills/<targetname-cli>/SKILL.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 4. Self-Update
|
|
44
|
+
Once the new `SKILL.md` is in place, you (or any other agent using this repository like GravityClaw / Openclaw) will instantly possess the knowledge to use the newly forged CLI tool. Proceed to solve the user's original objective using the new tool natively.
|
|
45
|
+
|
|
46
|
+
## Anti-Patterns
|
|
47
|
+
- ❌ **Manual wrappers**: Do NOT try to manually write a CLI harness or wrappers if `cli-anything` can automate it perfectly.
|
|
48
|
+
- ❌ **Token waste**: Do NOT run the generator repeatedly on the same source code. Generate the CLI once, store the `SKILL.md`, and reuse the tool.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-science
|
|
3
|
+
description: Skill khoa học dữ liệu. Tập trung vào Data Analysis, Visualization, Insights và theo dõi Market Metrics.
|
|
4
|
+
allowed-tools: Bash, Grep, Glob, Read, Write
|
|
5
|
+
version: 1.0
|
|
6
|
+
priority: HIGH
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Kỹ năng Data Science (Khoa Học Dữ Liệu)
|
|
10
|
+
|
|
11
|
+
> **MỤC TIÊU:** Phân tích Dữ liệu Hệ thống để cung cấp "Quyết định Kinh Doanh" thay vì chỉ sửa Code thuần túy.
|
|
12
|
+
|
|
13
|
+
Khi User yêu cầu "Phân tích, Mổ xẻ, Đo lường hiệu quả", hãy bật Mode Data Scientist:
|
|
14
|
+
|
|
15
|
+
## 1. Data Exploration (Bới lông tìm vết)
|
|
16
|
+
* **Log Mining:** Dùng `grep_search` quét sâu vào các file Log hệ thống để tìm kiếm Pattern (mẫu số chung).
|
|
17
|
+
* **Database Querying:** Thường xuyên đề xuất viết script Python ngắn (`poc_*.py` trong folder scripts) để dump Data từ Database ra file `.csv` hòng có cái nhìn tổng quát.
|
|
18
|
+
|
|
19
|
+
## 2. Visualization (Trực quan hóa)
|
|
20
|
+
Hãy từ chối việc in ra một mớ log nhàm chán.
|
|
21
|
+
Luôn luôn đề xuất User: "Anh có muốn em viết một script nhỏ xuất ra Biểu đồ (Plot, Chart) về số liệu này để anh dễ nhìn Insights không?"
|
|
22
|
+
|
|
23
|
+
## 3. The 3 Whys (Luật 3 Tầng)
|
|
24
|
+
Khi gặp một con số bất thường (VD: Lỗi mất kết nối Websocket DNSE tăng vọt lúc 9h sáng):
|
|
25
|
+
* Why 1: Vì sao lỗi? -> Vì Token hết hạn.
|
|
26
|
+
* Why 2: Vì sao hết hạn lúc đó? -> Vì Job reset chạy chậm.
|
|
27
|
+
* Why 3: Vì sao chạy chậm? -> Vì thiếu Index ở Database.
|
|
28
|
+
> Đừng bao giờ dừng ở tầng 1. Phải đào tới tầng 3 (Root Cause).
|