thienbun-ai-dev-toolkit 1.0.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 +310 -0
- package/cross-ide/.cursorrules +30 -0
- package/cross-ide/AGENTS.md +33 -0
- package/cross-ide/CLAUDE.md +41 -0
- package/package.json +25 -0
- package/references/skill-discovery.md +78 -0
- package/scripts/setup-antigravity.sh +130 -0
- package/skills/code-review/SKILL.md +94 -0
- package/skills/ddd-core-rules/SKILL.md +91 -0
- package/skills/git-workflow/SKILL.md +131 -0
- package/skills/typescript-mastery/SKILL.md +180 -0
- package/user-rules/memory-rules.md +115 -0
- package/workflows/debug.md +12 -0
- package/workflows/plan.md +14 -0
- package/workflows/review.md +12 -0
- package/workflows/verify.md +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# AI Dev Toolkit
|
|
2
|
+
|
|
3
|
+
Personal toolkit for AI-assisted development. Combines curated skills, workflows, and rules for **Antigravity**, **Cursor**, **Claude Code**, and **GitHub Copilot**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [First-Time Setup](#first-time-setup)
|
|
10
|
+
- [What's Automatic vs Manual](#whats-automatic-vs-manual)
|
|
11
|
+
- [Repository Structure](#repository-structure)
|
|
12
|
+
- [How the 3-Tier System Works](#how-the-3-tier-system-works)
|
|
13
|
+
- [Skills Reference](#skills-reference)
|
|
14
|
+
- [Workflows Reference](#workflows-reference)
|
|
15
|
+
- [Cross-IDE Support](#cross-ide-support)
|
|
16
|
+
- [Skill Discovery](#skill-discovery)
|
|
17
|
+
- [Updating](#updating)
|
|
18
|
+
- [Adding to a New Project](#adding-to-a-new-project)
|
|
19
|
+
- [Team Onboarding](#team-onboarding)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## First-Time Setup
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
- macOS with Zsh
|
|
28
|
+
- Antigravity IDE (primary)
|
|
29
|
+
- Git installed
|
|
30
|
+
|
|
31
|
+
### Step 1: Clone and make executable
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
cd ~/Documents
|
|
35
|
+
git clone <your-repo-url> ai-dev-toolkit
|
|
36
|
+
chmod +x ai-dev-toolkit/scripts/setup-antigravity.sh
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Step 2: Run setup from inside your project
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cd ~/Documents/Zigvy/hr-forte/hr-leave-module
|
|
43
|
+
~/Documents/ai-dev-toolkit/scripts/setup-antigravity.sh
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This one command does:
|
|
47
|
+
|
|
48
|
+
| Step | What happens | Auto? |
|
|
49
|
+
| ---- | -------------------------------------------------------------- | ------------ |
|
|
50
|
+
| 1 | Backs up `~/.gemini/GEMINI.md` → `GEMINI.md.backup` | ✅ Automatic |
|
|
51
|
+
| 2 | Writes all 42 rules (Sections I–XI) to `~/.gemini/GEMINI.md` | ✅ Automatic |
|
|
52
|
+
| 3 | Copies skills to `~/.agents/skills/` + symlinks to Antigravity | ✅ Automatic |
|
|
53
|
+
| 4 | Copies workflows to `<project>/.agent/workflows/` | ✅ Automatic |
|
|
54
|
+
| 5 | Checks for bloated skills (>50 files = warning) | ✅ Automatic |
|
|
55
|
+
| 6 | Creates `.cursor/skills/` and `.claude/skills/` symlinks | ✅ Automatic |
|
|
56
|
+
|
|
57
|
+
### Step 3: Verify in Antigravity
|
|
58
|
+
|
|
59
|
+
1. Open Antigravity → **Customizations** → **Rules** tab
|
|
60
|
+
- You should see Sections I–XI (42 rules)
|
|
61
|
+
2. Open Antigravity → **Customizations** → **Workflows** tab
|
|
62
|
+
- You should see: plan, review, debug, verify
|
|
63
|
+
|
|
64
|
+
### Step 4: (Optional) Cross-IDE config
|
|
65
|
+
|
|
66
|
+
If you also use Cursor, Claude Code, or Copilot:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# For Cursor — copy .cursorrules to project root
|
|
70
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/.cursorrules ~/Documents/Zigvy/hr-forte/hr-leave-module/.cursorrules
|
|
71
|
+
|
|
72
|
+
# For Claude Code — copy CLAUDE.md to project root
|
|
73
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/CLAUDE.md ~/Documents/Zigvy/hr-forte/hr-leave-module/CLAUDE.md
|
|
74
|
+
|
|
75
|
+
# For GitHub Copilot / Codex — copy AGENTS.md to project root
|
|
76
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/AGENTS.md ~/Documents/Zigvy/hr-forte/hr-leave-module/AGENTS.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> **Note**: Edit these files after copying to add project-specific context (architecture, DB, key patterns).
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## What's Automatic vs Manual
|
|
84
|
+
|
|
85
|
+
### ✅ Automatic (AI does this without prompting)
|
|
86
|
+
|
|
87
|
+
| What | How it works | Source file |
|
|
88
|
+
| -------------------------- | ------------------------------------------------------- | ---------------------------------------------------- |
|
|
89
|
+
| **TypeScript rules** | Always active — AI reads `GEMINI.md` every conversation | `user-rules/memory-rules.md` → `~/.gemini/GEMINI.md` |
|
|
90
|
+
| **No `any`**, strict types | Part of Section III (TS Essentials) in rules | Always active |
|
|
91
|
+
| **Proposal-only mode** | AI proposes first, asks before editing | Section I in rules |
|
|
92
|
+
| **Verify before done** | AI re-reads checklist, runs `tsc`, reports status | Section X in rules |
|
|
93
|
+
| **English output** | All code, comments, docs in English | Section XI in rules |
|
|
94
|
+
| **DDD skill** | AI reads when task involves DDD patterns | `skills/ddd-core-rules/SKILL.md` |
|
|
95
|
+
| **TS patterns** | AI reads when writing TypeScript | `skills/typescript-mastery/SKILL.md` |
|
|
96
|
+
| **Review checklist** | AI reads when reviewing code | `skills/code-review/SKILL.md` |
|
|
97
|
+
| **Git conventions** | AI reads when making commits | `skills/git-workflow/SKILL.md` |
|
|
98
|
+
|
|
99
|
+
### 🔧 Manual (You trigger these)
|
|
100
|
+
|
|
101
|
+
| What | How to trigger | When to use |
|
|
102
|
+
| --------------------- | -------------------------- | ------------------------------------------------- |
|
|
103
|
+
| **Plan workflow** | Type `/plan` in chat | Starting a new feature or complex task |
|
|
104
|
+
| **Review workflow** | Type `/review` in chat | Before creating a PR |
|
|
105
|
+
| **Debug workflow** | Type `/debug` in chat | Stuck on a bug |
|
|
106
|
+
| **Verify workflow** | Type `/verify` in chat | Before declaring task complete |
|
|
107
|
+
| **Setup script** | Run `setup-antigravity.sh` | New machine, new project, or after toolkit update |
|
|
108
|
+
| **Cross-IDE configs** | Copy files to project root | When using Cursor/Claude/Copilot |
|
|
109
|
+
|
|
110
|
+
### 🧠 Semi-Automatic (AI decides)
|
|
111
|
+
|
|
112
|
+
Skills are read **only when relevant**. The AI matches the `description` field in each `SKILL.md` against your current task:
|
|
113
|
+
|
|
114
|
+
- Working on DDD module? → AI reads `ddd-core-rules`
|
|
115
|
+
- Writing TypeScript? → AI reads `typescript-mastery`
|
|
116
|
+
- Reviewing code? → AI reads `code-review`
|
|
117
|
+
- Not related? → AI skips it (saves context)
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Repository Structure
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
ai-dev-toolkit/
|
|
125
|
+
│
|
|
126
|
+
├── README.md ← This file
|
|
127
|
+
│
|
|
128
|
+
├── skills/ ← Global skills (copied to ~/.agents/skills/)
|
|
129
|
+
│ ├── ddd-core-rules/SKILL.md ← DDD best practices (Eric Evans, Fowler)
|
|
130
|
+
│ ├── typescript-mastery/SKILL.md ← TS patterns, type guards, generics
|
|
131
|
+
│ ├── code-review/SKILL.md ← 8-section review checklist
|
|
132
|
+
│ └── git-workflow/SKILL.md ← Conventional Commits, PR workflow
|
|
133
|
+
│
|
|
134
|
+
├── workflows/ ← Workflows (copied to project .agent/workflows/)
|
|
135
|
+
│ ├── plan.md ← /plan — structured planning
|
|
136
|
+
│ ├── review.md ← /review — code review
|
|
137
|
+
│ ├── debug.md ← /debug — systematic debugging
|
|
138
|
+
│ └── verify.md ← /verify — verification before done
|
|
139
|
+
│
|
|
140
|
+
├── user-rules/
|
|
141
|
+
│ └── memory-rules.md ← All 42 rules (written to ~/.gemini/GEMINI.md)
|
|
142
|
+
│
|
|
143
|
+
├── cross-ide/ ← Templates for other AI IDEs
|
|
144
|
+
│ ├── CLAUDE.md ← Claude Code project config
|
|
145
|
+
│ ├── AGENTS.md ← GitHub Copilot / Codex config
|
|
146
|
+
│ └── .cursorrules ← Cursor IDE rules
|
|
147
|
+
│
|
|
148
|
+
├── references/
|
|
149
|
+
│ └── skill-discovery.md ← How to find and install new skills
|
|
150
|
+
│
|
|
151
|
+
├── plans/ ← Implementation plans archive
|
|
152
|
+
│ ├── plan-core.md
|
|
153
|
+
│ ├── plan-hr-leave-module.md
|
|
154
|
+
│ └── plan-hr-forte-mobile.md
|
|
155
|
+
│
|
|
156
|
+
└── scripts/
|
|
157
|
+
└── setup-antigravity.sh ← One-command setup script
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## How the 3-Tier System Works
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
┌─────────────────────────────────────────────────────────┐
|
|
166
|
+
│ Tier 1: RULES (Always Active) │
|
|
167
|
+
│ ~/.gemini/GEMINI.md │
|
|
168
|
+
│ Applied to EVERY conversation, EVERY project │
|
|
169
|
+
│ 42 rules: strict mode, TS, workflow, verify, English │
|
|
170
|
+
├─────────────────────────────────────────────────────────┤
|
|
171
|
+
│ Tier 2: SKILLS (Semi-Auto) │
|
|
172
|
+
│ ~/.agents/skills/*.SKILL.md │
|
|
173
|
+
│ AI reads when description matches current task │
|
|
174
|
+
│ DDD rules, TS mastery, code review, git workflow │
|
|
175
|
+
├─────────────────────────────────────────────────────────┤
|
|
176
|
+
│ Tier 3: WORKFLOWS (Manual) │
|
|
177
|
+
│ <project>/.agent/workflows/*.md │
|
|
178
|
+
│ Triggered by /command in chat │
|
|
179
|
+
│ /plan, /review, /debug, /verify │
|
|
180
|
+
└─────────────────────────────────────────────────────────┘
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Key insight**: Put rules you want **always enforced** in Tier 1. Put **detailed reference material** in Tier 2 (skills). Put **step-by-step processes** in Tier 3 (workflows).
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Skills Reference
|
|
188
|
+
|
|
189
|
+
### ddd-core-rules
|
|
190
|
+
|
|
191
|
+
- **When AI reads it**: Working on DDD-structured modules
|
|
192
|
+
- **Content**: Aggregate rules, layer dependencies, tactical patterns, anti-patterns
|
|
193
|
+
- **Sources**: Eric Evans, Martin Fowler, nestjslatam/ddd
|
|
194
|
+
|
|
195
|
+
### typescript-mastery
|
|
196
|
+
|
|
197
|
+
- **When AI reads it**: Writing or reviewing TypeScript code
|
|
198
|
+
- **Content**: Type design, discriminated unions, branded types, type guards, generics, RO-RO, pitfalls
|
|
199
|
+
- **Naming conventions table** included
|
|
200
|
+
|
|
201
|
+
### code-review
|
|
202
|
+
|
|
203
|
+
- **When AI reads it**: Reviewing code (own or others')
|
|
204
|
+
- **Content**: 8-section checklist (type safety, architecture, performance, error handling, security, testing, docs)
|
|
205
|
+
- **Severity levels**: 🔴 Critical, 🟡 Warning, 🟢 Suggestion
|
|
206
|
+
|
|
207
|
+
### git-workflow
|
|
208
|
+
|
|
209
|
+
- **When AI reads it**: Making commits, creating branches, preparing PRs
|
|
210
|
+
- **Content**: Conventional Commits format, branch naming, PR template, release flow diagram
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Workflows Reference
|
|
215
|
+
|
|
216
|
+
| Command | Purpose | When to use |
|
|
217
|
+
| --------- | ------------------------------------- | ----------------------------------- |
|
|
218
|
+
| `/plan` | Create structured plan with checklist | Starting new feature, 3+ step task |
|
|
219
|
+
| `/review` | Systematic code review | Before PR, after implementation |
|
|
220
|
+
| `/debug` | Step-by-step debugging | Stuck on a bug, unexpected behavior |
|
|
221
|
+
| `/verify` | Evidence-based completion check | Before declaring task done |
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Cross-IDE Support
|
|
226
|
+
|
|
227
|
+
| IDE | Config file | How AI reads it | Template location |
|
|
228
|
+
| ------------------ | ------------------------------ | ------------------------------------ | ------------------------- |
|
|
229
|
+
| **Antigravity** | `GEMINI.md` + `.agent/skills/` | Auto (rules always, skills by match) | Setup script handles this |
|
|
230
|
+
| **Cursor** | `.cursorrules` in project root | Auto reads on project open | `cross-ide/.cursorrules` |
|
|
231
|
+
| **Claude Code** | `CLAUDE.md` in project root | Auto reads on project open | `cross-ide/CLAUDE.md` |
|
|
232
|
+
| **GitHub Copilot** | `AGENTS.md` in project root | Auto reads for agent mode | `cross-ide/AGENTS.md` |
|
|
233
|
+
|
|
234
|
+
> **Important**: After copying cross-IDE templates, edit them to add project-specific details (architecture, database, key patterns). The templates contain generic TypeScript rules only.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Skill Discovery
|
|
239
|
+
|
|
240
|
+
### Find and install new skills
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npx skills find <query> # Search by keyword
|
|
244
|
+
npx skills add <owner/repo> # Install from GitHub
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Curated catalogs
|
|
248
|
+
|
|
249
|
+
| Catalog | URL |
|
|
250
|
+
| -------------------- | -------------------------------------------------------------------------- |
|
|
251
|
+
| skills.sh | [skills.sh](https://skills.sh) |
|
|
252
|
+
| Antigravity Awesome | [GitHub](https://github.com/sickn33/antigravity-awesome-skills) |
|
|
253
|
+
| Awesome Agent Skills | [GitHub](https://github.com/VoltAgent/awesome-agent-skills) |
|
|
254
|
+
| Awesome Cursorrules | [GitHub](https://github.com/PatrickJS/awesome-cursorrules/tree/main/rules) |
|
|
255
|
+
|
|
256
|
+
See [references/skill-discovery.md](references/skill-discovery.md) for detailed guide with evaluation criteria.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Updating
|
|
261
|
+
|
|
262
|
+
When you update this toolkit repo:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# 1. Update the toolkit
|
|
266
|
+
cd ~/Documents/ai-dev-toolkit
|
|
267
|
+
git pull # or edit files directly
|
|
268
|
+
|
|
269
|
+
# 2. Re-run setup in each project
|
|
270
|
+
cd ~/Documents/Zigvy/hr-forte/hr-leave-module
|
|
271
|
+
~/Documents/ai-dev-toolkit/scripts/setup-antigravity.sh
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The script is **idempotent** — safe to run multiple times. It will:
|
|
275
|
+
|
|
276
|
+
- Overwrite rules with the latest version (old version backed up)
|
|
277
|
+
- Overwrite skills (latest version)
|
|
278
|
+
- Overwrite workflows (latest version)
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Adding to a New Project
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
cd ~/Documents/Zigvy/new-project
|
|
286
|
+
~/Documents/ai-dev-toolkit/scripts/setup-antigravity.sh
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
That's it. The script creates `.agent/workflows/` in the project and installs global skills + rules.
|
|
290
|
+
|
|
291
|
+
For cross-IDE support, also copy the config templates:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/.cursorrules .
|
|
295
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/CLAUDE.md .
|
|
296
|
+
cp ~/Documents/ai-dev-toolkit/cross-ide/AGENTS.md .
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Team Onboarding
|
|
302
|
+
|
|
303
|
+
For a new team member:
|
|
304
|
+
|
|
305
|
+
1. **Clone the project** → workflows in `.agent/workflows/` are included
|
|
306
|
+
2. **Run setup script** → installs global rules + skills
|
|
307
|
+
3. **Verify** → open Antigravity → Customizations → check Rules + Workflows tabs
|
|
308
|
+
4. **Done** — AI now understands project context and follows all conventions
|
|
309
|
+
|
|
310
|
+
> **Note**: User rules in `GEMINI.md` are personal (not committed to git). Each team member runs the setup script once on their machine.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
You are a senior TypeScript programmer with experience in NestJS and React Native.
|
|
2
|
+
Generate code, corrections, and refactorings that comply with these principles.
|
|
3
|
+
|
|
4
|
+
## TypeScript Rules
|
|
5
|
+
- Never use `any`. Use `unknown` + type guards if type is truly unknown.
|
|
6
|
+
- Always declare return types for all functions and methods.
|
|
7
|
+
- Prefer `interface` for object shapes, `type` for unions/intersections.
|
|
8
|
+
- Use `readonly` for data that should not change after creation.
|
|
9
|
+
- PascalCase for classes/interfaces/types, camelCase for variables/methods, kebab-case for files.
|
|
10
|
+
- Functions: single purpose, <20 lines, verb-first naming.
|
|
11
|
+
- Use RO-RO pattern (Receive Object, Return Object) for 3+ parameters.
|
|
12
|
+
- DTOs: validate inputs with class-validator. Declare simple types for outputs.
|
|
13
|
+
- Prefer composition over inheritance. Follow SOLID principles.
|
|
14
|
+
- Use `as const` for literals, `readonly` arrays/tuples where applicable.
|
|
15
|
+
|
|
16
|
+
## Code Quality
|
|
17
|
+
- No empty catch blocks.
|
|
18
|
+
- No TODO/FIXME without linked issue.
|
|
19
|
+
- No magic numbers — use named constants.
|
|
20
|
+
- No dead code or unused imports.
|
|
21
|
+
|
|
22
|
+
## Architecture
|
|
23
|
+
- Adapt to existing module patterns (DDD or Legacy).
|
|
24
|
+
- Controllers: thin — routing + validation + DTO mapping only.
|
|
25
|
+
- Services: contain business logic.
|
|
26
|
+
- Domain layer must not import from framework or ORM.
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
- All code, comments, documentation must be in English.
|
|
30
|
+
- Commit messages follow Conventional Commits format.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# AGENTS.md Template
|
|
2
|
+
|
|
3
|
+
# Copy this to your project root for GitHub Copilot / Codex support.
|
|
4
|
+
|
|
5
|
+
# These tools read AGENTS.md for project-specific instructions.
|
|
6
|
+
|
|
7
|
+
## Project Context
|
|
8
|
+
|
|
9
|
+
<!-- Replace with your project description -->
|
|
10
|
+
|
|
11
|
+
This is a TypeScript project. Follow these rules strictly.
|
|
12
|
+
|
|
13
|
+
## Coding Standards
|
|
14
|
+
|
|
15
|
+
- Never use `any` type. Use `unknown` + type guards.
|
|
16
|
+
- Always declare return types for functions.
|
|
17
|
+
- Interface for object shapes, type for unions/intersections.
|
|
18
|
+
- Functions: single purpose, <20 lines.
|
|
19
|
+
- Use `readonly` for immutable data.
|
|
20
|
+
- PascalCase for classes, camelCase for variables, kebab-case for files.
|
|
21
|
+
|
|
22
|
+
## Architecture Rules
|
|
23
|
+
|
|
24
|
+
<!-- Add your architecture-specific rules -->
|
|
25
|
+
|
|
26
|
+
- Follow existing module patterns
|
|
27
|
+
- Keep controllers thin — routing + validation only
|
|
28
|
+
- Business logic in services/use-cases
|
|
29
|
+
|
|
30
|
+
## Output Language
|
|
31
|
+
|
|
32
|
+
- All code, comments, variable names, documentation: English only
|
|
33
|
+
- Never write non-English text in code files
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# CLAUDE.md Template
|
|
2
|
+
|
|
3
|
+
# Copy this to your project root for Claude Code support.
|
|
4
|
+
|
|
5
|
+
# Claude Code reads this file automatically when opening a project.
|
|
6
|
+
|
|
7
|
+
## Project Overview
|
|
8
|
+
|
|
9
|
+
<!-- Replace with your project description -->
|
|
10
|
+
|
|
11
|
+
This is a TypeScript project using [NestJS/React Native/etc].
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
<!-- Describe your architecture (DDD, MVC, etc) -->
|
|
16
|
+
|
|
17
|
+
## Coding Standards
|
|
18
|
+
|
|
19
|
+
- TypeScript strict mode. No `any`.
|
|
20
|
+
- Prefer `interface` for object shapes, `type` for unions.
|
|
21
|
+
- Functions: single purpose, <20 lines, verb-first naming.
|
|
22
|
+
- Use `readonly` for immutable data.
|
|
23
|
+
- DTOs: validate with class-validator.
|
|
24
|
+
|
|
25
|
+
## Conventions
|
|
26
|
+
|
|
27
|
+
- File naming: kebab-case (e.g., `user-profile.service.ts`)
|
|
28
|
+
- Commit messages: Conventional Commits (`feat:`, `fix:`, `refactor:`)
|
|
29
|
+
- Branch naming: `feature/TICKET-description`, `fix/TICKET-description`
|
|
30
|
+
|
|
31
|
+
## Testing
|
|
32
|
+
|
|
33
|
+
- Unit tests: Arrange-Act-Assert pattern
|
|
34
|
+
- Run: `npm test`
|
|
35
|
+
- Type check: `npx tsc --noEmit`
|
|
36
|
+
|
|
37
|
+
## Important Rules
|
|
38
|
+
|
|
39
|
+
- PROPOSAL ONLY: Propose changes first, don't edit without confirmation.
|
|
40
|
+
- All output in English (code, comments, docs, commits).
|
|
41
|
+
- Verify before done: re-read checklist, run type check, confirm each item.
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "thienbun-ai-dev-toolkit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Personal AI dev toolkit — curated skills, workflows, and rules for Antigravity, Cursor, Claude Code",
|
|
5
|
+
"bin": {
|
|
6
|
+
"thienbun-ai-dev-toolkit": "./scripts/setup-antigravity.sh"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"skills/",
|
|
10
|
+
"workflows/",
|
|
11
|
+
"user-rules/",
|
|
12
|
+
"cross-ide/",
|
|
13
|
+
"references/",
|
|
14
|
+
"scripts/"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"antigravity",
|
|
18
|
+
"ai-coding",
|
|
19
|
+
"skills",
|
|
20
|
+
"workflows",
|
|
21
|
+
"typescript",
|
|
22
|
+
"ddd"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT"
|
|
25
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Skill Discovery Guide
|
|
2
|
+
|
|
3
|
+
## Finding Skills
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Search for skills by keyword
|
|
7
|
+
npx skills find <query>
|
|
8
|
+
|
|
9
|
+
# Examples
|
|
10
|
+
npx skills find "react native"
|
|
11
|
+
npx skills find "nestjs"
|
|
12
|
+
npx skills find "typescript"
|
|
13
|
+
npx skills find "ddd"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Installing Skills
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install from GitHub repo (all skills in that repo)
|
|
20
|
+
npx skills add <owner/repo>
|
|
21
|
+
|
|
22
|
+
# Install specific skill from a repo
|
|
23
|
+
npx skills add <owner/repo> --skill <skill-name>
|
|
24
|
+
|
|
25
|
+
# Example
|
|
26
|
+
npx skills add vercel/next.js --skill next-performance
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Curated Catalogs
|
|
30
|
+
|
|
31
|
+
### Primary Resources
|
|
32
|
+
|
|
33
|
+
| Catalog | URL | Description |
|
|
34
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
35
|
+
| **skills.sh** | [skills.sh](https://skills.sh) | Central registry. Browse by category, filter by popularity |
|
|
36
|
+
| **Antigravity Awesome** | [GitHub](https://github.com/sickn33/antigravity-awesome-skills) | Curated for Antigravity specifically |
|
|
37
|
+
| **Awesome Agent Skills** | [GitHub](https://github.com/VoltAgent/awesome-agent-skills) | Cross-platform catalog (works with any AI IDE) |
|
|
38
|
+
| **Awesome Cursorrules** | [GitHub](https://github.com/PatrickJS/awesome-cursorrules/tree/main/rules) | 100+ stack-specific rules for Cursor |
|
|
39
|
+
| **Antigravity Prompts** | [GitHub](https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools/tree/main/Google/Antigravity) | Reference system prompts |
|
|
40
|
+
|
|
41
|
+
### Relevant Stack Rules (from awesome-cursorrules)
|
|
42
|
+
|
|
43
|
+
| Stack | Rule Set |
|
|
44
|
+
| ------------------------ | ---------------------------------------------------- |
|
|
45
|
+
| **NestJS + TypeScript** | `typescript-nestjs-best-practices-cursorrules-promp` |
|
|
46
|
+
| **React Native + Expo** | `react-native-expo-cursorrules-prompt-file` |
|
|
47
|
+
| **React + TypeScript** | `typescript-react-cursorrules-prompt-file` |
|
|
48
|
+
| **Next.js + TypeScript** | `nextjs-typescript-cursorrules-prompt-file` |
|
|
49
|
+
| **Code Quality** | `javascript-typescript-code-quality-cursorrules-pro` |
|
|
50
|
+
| **Jest Testing** | `jest-unit-testing-cursorrules-prompt-file` |
|
|
51
|
+
| **Git Commits** | `git-conventional-commit-messages` |
|
|
52
|
+
|
|
53
|
+
> **Note**: `.cursorrules` format ≠ `SKILL.md` format. To convert:
|
|
54
|
+
>
|
|
55
|
+
> 1. Create folder: `your-skill-name/SKILL.md`
|
|
56
|
+
> 2. Add YAML frontmatter: `name` + `description`
|
|
57
|
+
> 3. Paste cursorrules content as markdown body
|
|
58
|
+
|
|
59
|
+
## Evaluating Skills
|
|
60
|
+
|
|
61
|
+
Before installing a skill, check:
|
|
62
|
+
|
|
63
|
+
- ⭐ Stars/popularity — community validation
|
|
64
|
+
- 📝 Content quality — specific rules vs generic advice
|
|
65
|
+
- 🔧 Stack match — does it match your actual tech stack?
|
|
66
|
+
- 📏 Size — avoid bloated skills (>50 files = likely too much context)
|
|
67
|
+
|
|
68
|
+
### Strategy: Keep Few, Keep Curated
|
|
69
|
+
|
|
70
|
+
> Installing 100+ generic skills dilutes AI attention. Better: 5–10 curated skills with project-specific context.
|
|
71
|
+
|
|
72
|
+
| Category | Recommendation |
|
|
73
|
+
| ------------------------------- | --------------------------------------------------- |
|
|
74
|
+
| Super-Coder (SOLID, Clean Code) | Keep 1-2 curated. AI already knows these basics. |
|
|
75
|
+
| Tech-Stack (NestJS, React, RN) | ✅ High value if matched to your stack |
|
|
76
|
+
| QA & Debugging | `verification-before-completion` + custom is enough |
|
|
77
|
+
| Documentation | `documentation-templates` + Knowledge Router |
|
|
78
|
+
| UI/UX Design | ✅ Useful for FE/mobile/personal projects |
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# setup-antigravity.sh — One command to set up everything
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# cd <your-project>
|
|
6
|
+
# ~/Documents/ai-dev-toolkit/scripts/setup-antigravity.sh
|
|
7
|
+
#
|
|
8
|
+
# What it does:
|
|
9
|
+
# 1. Updates global rules → ~/.gemini/GEMINI.md
|
|
10
|
+
# 2. Installs global skills → ~/.agents/skills/ (+ symlink)
|
|
11
|
+
# 3. Installs workflows → <project>/.agent/workflows/
|
|
12
|
+
# 4. Cleans bloated skills + creates cross-IDE symlinks
|
|
13
|
+
|
|
14
|
+
set -e
|
|
15
|
+
|
|
16
|
+
TOOLKIT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
17
|
+
AGENTS_SKILLS_DIR="$HOME/.agents/skills"
|
|
18
|
+
ANTIGRAVITY_SKILLS_DIR="$HOME/.gemini/antigravity/skills"
|
|
19
|
+
GEMINI_RULES="$HOME/.gemini/GEMINI.md"
|
|
20
|
+
PROJECT_AGENT_DIR=".agent"
|
|
21
|
+
|
|
22
|
+
echo "🚀 AI Dev Toolkit — One Command Setup"
|
|
23
|
+
echo " Toolkit: $TOOLKIT_DIR"
|
|
24
|
+
echo " Project: $(pwd)"
|
|
25
|
+
echo ""
|
|
26
|
+
|
|
27
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
28
|
+
# Step 1: Update global rules (GEMINI.md)
|
|
29
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
30
|
+
echo "📝 Step 1: Updating global rules → $GEMINI_RULES"
|
|
31
|
+
|
|
32
|
+
if [ -f "$TOOLKIT_DIR/user-rules/memory-rules.md" ]; then
|
|
33
|
+
# Extract the content between ``` blocks
|
|
34
|
+
RULES_CONTENT=$(sed -n '/^```$/,/^```$/p' "$TOOLKIT_DIR/user-rules/memory-rules.md" | sed '1d;$d')
|
|
35
|
+
|
|
36
|
+
if [ -n "$RULES_CONTENT" ]; then
|
|
37
|
+
# Backup existing rules
|
|
38
|
+
if [ -f "$GEMINI_RULES" ]; then
|
|
39
|
+
cp "$GEMINI_RULES" "$GEMINI_RULES.backup"
|
|
40
|
+
echo " 📋 Backed up existing rules → GEMINI.md.backup"
|
|
41
|
+
fi
|
|
42
|
+
# Write new rules
|
|
43
|
+
echo "$RULES_CONTENT" > "$GEMINI_RULES"
|
|
44
|
+
echo " ✅ Global rules updated (Sections I–XI)"
|
|
45
|
+
else
|
|
46
|
+
echo " ⚠️ Could not parse rules from memory-rules.md"
|
|
47
|
+
fi
|
|
48
|
+
else
|
|
49
|
+
echo " ⚠️ user-rules/memory-rules.md not found"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
echo ""
|
|
53
|
+
|
|
54
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
55
|
+
# Step 2: Install global skills
|
|
56
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
57
|
+
echo "📦 Step 2: Installing global skills"
|
|
58
|
+
mkdir -p "$AGENTS_SKILLS_DIR"
|
|
59
|
+
mkdir -p "$ANTIGRAVITY_SKILLS_DIR"
|
|
60
|
+
|
|
61
|
+
if [ -d "$TOOLKIT_DIR/skills" ]; then
|
|
62
|
+
for skill_dir in "$TOOLKIT_DIR/skills"/*/; do
|
|
63
|
+
skill_name=$(basename "$skill_dir")
|
|
64
|
+
if [ -f "$skill_dir/SKILL.md" ]; then
|
|
65
|
+
# Copy to ~/.agents/skills/ (actual location)
|
|
66
|
+
cp -r "$skill_dir" "$AGENTS_SKILLS_DIR/"
|
|
67
|
+
# Create symlink in ~/.gemini/antigravity/skills/ (Antigravity reads here)
|
|
68
|
+
ln -sf "$AGENTS_SKILLS_DIR/$skill_name" "$ANTIGRAVITY_SKILLS_DIR/$skill_name" 2>/dev/null || true
|
|
69
|
+
echo " ✅ $skill_name"
|
|
70
|
+
fi
|
|
71
|
+
done
|
|
72
|
+
else
|
|
73
|
+
echo " ⚠️ No skills/ directory found"
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
echo ""
|
|
77
|
+
|
|
78
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
79
|
+
# Step 3: Install workflows into project
|
|
80
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
81
|
+
echo "📋 Step 3: Installing workflows → $PROJECT_AGENT_DIR/workflows/"
|
|
82
|
+
|
|
83
|
+
if [ -d ".git" ] || [ -d "$PROJECT_AGENT_DIR" ]; then
|
|
84
|
+
mkdir -p "$PROJECT_AGENT_DIR/workflows"
|
|
85
|
+
if [ -d "$TOOLKIT_DIR/workflows" ]; then
|
|
86
|
+
for wf in "$TOOLKIT_DIR/workflows"/*.md; do
|
|
87
|
+
wf_name=$(basename "$wf")
|
|
88
|
+
cp "$wf" "$PROJECT_AGENT_DIR/workflows/"
|
|
89
|
+
echo " ✅ $wf_name"
|
|
90
|
+
done
|
|
91
|
+
fi
|
|
92
|
+
else
|
|
93
|
+
echo " ⚠️ Not in a project directory (no .git or .agent found)"
|
|
94
|
+
echo " Run this script from inside your project folder"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
echo ""
|
|
98
|
+
|
|
99
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
100
|
+
# Step 4: Health check
|
|
101
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
102
|
+
echo "🔍 Step 4: Health check"
|
|
103
|
+
|
|
104
|
+
# Check bloated skills
|
|
105
|
+
if [ -d "$PROJECT_AGENT_DIR/skills" ]; then
|
|
106
|
+
SKILL_COUNT=$(find "$PROJECT_AGENT_DIR/skills" -type f | wc -l | tr -d ' ')
|
|
107
|
+
if [ "$SKILL_COUNT" -gt 50 ]; then
|
|
108
|
+
echo " ⚠️ Project has $SKILL_COUNT skill files (too many, AI gets diluted)"
|
|
109
|
+
else
|
|
110
|
+
echo " ✅ Project skills: $SKILL_COUNT files"
|
|
111
|
+
fi
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# Cross-IDE symlinks
|
|
115
|
+
if [ -d "$PROJECT_AGENT_DIR/skills" ]; then
|
|
116
|
+
mkdir -p .cursor .claude 2>/dev/null || true
|
|
117
|
+
ln -sf "../$PROJECT_AGENT_DIR/skills" .cursor/skills 2>/dev/null \
|
|
118
|
+
&& echo " ✅ .cursor/skills → .agent/skills" || true
|
|
119
|
+
ln -sf "../$PROJECT_AGENT_DIR/skills" .claude/skills 2>/dev/null \
|
|
120
|
+
&& echo " ✅ .claude/skills → .agent/skills" || true
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
echo ""
|
|
124
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
125
|
+
echo "✅ All done! Summary:"
|
|
126
|
+
echo " 📝 Rules → ~/.gemini/GEMINI.md (backed up old version)"
|
|
127
|
+
echo " 📦 Skills → ~/.agents/skills/ (symlinked to Antigravity)"
|
|
128
|
+
echo " 📋 Workflows → .agent/workflows/ (this project)"
|
|
129
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
130
|
+
echo ""
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: >
|
|
4
|
+
Systematic code review checklist for TypeScript/NestJS projects.
|
|
5
|
+
Covers type safety, architecture compliance, performance, error handling,
|
|
6
|
+
and DDD pattern verification.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Code Review Checklist
|
|
10
|
+
|
|
11
|
+
## How to Use
|
|
12
|
+
|
|
13
|
+
When reviewing code (your own or others'), go through each section below.
|
|
14
|
+
Flag issues with severity:
|
|
15
|
+
|
|
16
|
+
- 🔴 **Critical** — Must fix before merge (bugs, security, data loss)
|
|
17
|
+
- 🟡 **Warning** — Should fix (tech debt, performance, maintainability)
|
|
18
|
+
- 🟢 **Suggestion** — Nice to have (readability, consistency)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Type Safety
|
|
23
|
+
|
|
24
|
+
- [ ] No `any` types anywhere
|
|
25
|
+
- [ ] All exported functions have explicit return types
|
|
26
|
+
- [ ] DTOs use `class-validator` decorators for input validation
|
|
27
|
+
- [ ] No unsafe type assertions (`as X` without prior validation)
|
|
28
|
+
- [ ] Nullable types handled explicitly (`?:` or `| null`)
|
|
29
|
+
- [ ] No implicit `any` from untyped imports
|
|
30
|
+
|
|
31
|
+
## 2. Architecture Compliance
|
|
32
|
+
|
|
33
|
+
### For DDD Modules
|
|
34
|
+
|
|
35
|
+
- [ ] Domain layer has NO imports from Infrastructure or Framework
|
|
36
|
+
- [ ] Aggregates enforce business invariants internally
|
|
37
|
+
- [ ] Use Cases have single `execute()` method
|
|
38
|
+
- [ ] Repository interfaces defined in Domain, implemented in Infrastructure
|
|
39
|
+
- [ ] DTOs only in Presentation layer, domain objects internally
|
|
40
|
+
- [ ] Cross-aggregate references by ID only (not by object)
|
|
41
|
+
|
|
42
|
+
### For Legacy Modules
|
|
43
|
+
|
|
44
|
+
- [ ] Service contains business logic (not controller)
|
|
45
|
+
- [ ] Controller is thin — routing + validation only
|
|
46
|
+
- [ ] Entity relationships properly defined
|
|
47
|
+
|
|
48
|
+
## 3. Error Handling
|
|
49
|
+
|
|
50
|
+
- [ ] No empty catch blocks (`catch (e) {}`)
|
|
51
|
+
- [ ] Errors have meaningful messages with context
|
|
52
|
+
- [ ] Custom exceptions for domain-specific errors
|
|
53
|
+
- [ ] HTTP exceptions only in Controller/Presentation layer
|
|
54
|
+
- [ ] Async operations have proper error boundaries
|
|
55
|
+
|
|
56
|
+
## 4. Performance
|
|
57
|
+
|
|
58
|
+
- [ ] No N+1 queries (check `find` calls in loops)
|
|
59
|
+
- [ ] Queries use appropriate `relations` / `join` when needed
|
|
60
|
+
- [ ] No synchronous heavy operations blocking event loop
|
|
61
|
+
- [ ] Pagination for list endpoints
|
|
62
|
+
- [ ] Indexing for frequently queried fields
|
|
63
|
+
|
|
64
|
+
## 5. Code Quality
|
|
65
|
+
|
|
66
|
+
- [ ] Functions < 20 lines, single responsibility
|
|
67
|
+
- [ ] No dead code or unused imports
|
|
68
|
+
- [ ] No TODO/FIXME without linked issue
|
|
69
|
+
- [ ] Naming follows conventions (PascalCase/camelCase/kebab-case)
|
|
70
|
+
- [ ] No magic numbers — use named constants
|
|
71
|
+
- [ ] No duplicated logic — extract to shared utilities
|
|
72
|
+
|
|
73
|
+
## 6. Testing
|
|
74
|
+
|
|
75
|
+
- [ ] New public methods have unit tests
|
|
76
|
+
- [ ] Tests follow Arrange-Act-Assert pattern
|
|
77
|
+
- [ ] Test names describe behavior, not implementation
|
|
78
|
+
- [ ] Mocks/stubs for external dependencies
|
|
79
|
+
- [ ] Edge cases covered (null, empty, boundary values)
|
|
80
|
+
|
|
81
|
+
## 7. Security
|
|
82
|
+
|
|
83
|
+
- [ ] No secrets or credentials in code
|
|
84
|
+
- [ ] Input validation on all external data
|
|
85
|
+
- [ ] Authorization checks where needed
|
|
86
|
+
- [ ] SQL injection prevention (parameterized queries)
|
|
87
|
+
- [ ] No sensitive data in logs
|
|
88
|
+
|
|
89
|
+
## 8. Documentation
|
|
90
|
+
|
|
91
|
+
- [ ] Public APIs have JSDoc comments
|
|
92
|
+
- [ ] Complex business logic explained with comments
|
|
93
|
+
- [ ] Breaking changes documented
|
|
94
|
+
- [ ] README updated if architecture changed
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ddd-core-rules
|
|
3
|
+
description: >
|
|
4
|
+
DDD best practices for any project. Aggregate rules, layer dependencies,
|
|
5
|
+
tactical patterns (Entity, Value Object, Domain Event, Port/Adapter).
|
|
6
|
+
Sources: Eric Evans, Martin Fowler, nestjslatam/ddd.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# DDD Core Rules
|
|
10
|
+
|
|
11
|
+
## Strategic Patterns
|
|
12
|
+
|
|
13
|
+
- **Ubiquitous Language**: Shared terms between code and domain experts. Name classes, methods, and variables using domain language.
|
|
14
|
+
- **Bounded Context**: Clear boundary where a domain model applies. Do not leak models across contexts.
|
|
15
|
+
- **Context Mapping**: Define relationships between bounded contexts (Shared Kernel, Anti-Corruption Layer, Conformist, etc.)
|
|
16
|
+
|
|
17
|
+
## Tactical Patterns
|
|
18
|
+
|
|
19
|
+
### Aggregates
|
|
20
|
+
|
|
21
|
+
- Transactional consistency boundary with a single root entity
|
|
22
|
+
- Keep aggregates small — prefer fewer entities per aggregate
|
|
23
|
+
- Reference other aggregates by ID, never by direct object reference
|
|
24
|
+
- One transaction per aggregate — never modify multiple aggregates in one transaction
|
|
25
|
+
- Encapsulate business rules within the aggregate root
|
|
26
|
+
|
|
27
|
+
### Entities
|
|
28
|
+
|
|
29
|
+
- Identity-based objects with lifecycle
|
|
30
|
+
- Equality determined by ID, not attributes
|
|
31
|
+
- Can change state through defined methods
|
|
32
|
+
|
|
33
|
+
### Value Objects
|
|
34
|
+
|
|
35
|
+
- Immutable — always create new instances for changes
|
|
36
|
+
- Equality determined by all attributes, not identity
|
|
37
|
+
- No ID — purely defined by their values
|
|
38
|
+
- Examples: Money, Address, DateRange, Email
|
|
39
|
+
|
|
40
|
+
### Domain Events
|
|
41
|
+
|
|
42
|
+
- Communicate changes across aggregates
|
|
43
|
+
- Named in past tense: `OrderPlaced`, `PaymentProcessed`
|
|
44
|
+
- Carry only necessary data, not the entire aggregate
|
|
45
|
+
|
|
46
|
+
### Ports / Adapters (Hexagonal Architecture)
|
|
47
|
+
|
|
48
|
+
- Domain defines interfaces (Ports)
|
|
49
|
+
- Infrastructure implements them (Adapters)
|
|
50
|
+
- Domain NEVER depends on infrastructure
|
|
51
|
+
|
|
52
|
+
## Layer Dependency Rules
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Domain ← Application ← Infrastructure ← Presentation
|
|
56
|
+
|
|
57
|
+
Domain layer MUST NOT import from:
|
|
58
|
+
- Framework (NestJS, Express, Spring)
|
|
59
|
+
- ORM (TypeORM, Prisma, Sequelize)
|
|
60
|
+
- External services (Stripe, AWS, SendGrid)
|
|
61
|
+
|
|
62
|
+
Application layer:
|
|
63
|
+
- Orchestrates domain logic via Use Cases / Command Handlers
|
|
64
|
+
- Each Use Case = single execute() method
|
|
65
|
+
- Depends on domain interfaces (Ports), never on implementations
|
|
66
|
+
|
|
67
|
+
Infrastructure layer:
|
|
68
|
+
- Implements domain Ports (Repository interfaces, Gateway interfaces)
|
|
69
|
+
- Contains ORM entities, API clients, queue consumers, email services
|
|
70
|
+
- Handles serialization/deserialization between domain and persistence
|
|
71
|
+
|
|
72
|
+
Presentation layer:
|
|
73
|
+
- HTTP controllers, GraphQL resolvers, CLI handlers
|
|
74
|
+
- Thin — only routing + validation + DTO mapping
|
|
75
|
+
- Never contains business logic
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Anti-Patterns to Avoid
|
|
79
|
+
|
|
80
|
+
- ❌ Anemic Domain Model — entities with only getters/setters, no behavior
|
|
81
|
+
- ❌ God Aggregate — aggregate with too many entities and responsibilities
|
|
82
|
+
- ❌ Cross-aggregate transactions — modifying multiple aggregates in one transaction
|
|
83
|
+
- ❌ Domain depending on infrastructure — importing ORM or framework in domain layer
|
|
84
|
+
- ❌ Leaking domain objects to presentation — always use DTOs at boundaries
|
|
85
|
+
|
|
86
|
+
## References
|
|
87
|
+
|
|
88
|
+
- Eric Evans, "Domain-Driven Design: Tackling Complexity in the Heart of Software" (Blue Book)
|
|
89
|
+
- Martin Fowler, Patterns of Enterprise Application Architecture
|
|
90
|
+
- [nestjslatam/ddd](https://github.com/nestjslatam/ddd) — NestJS + CQRS + Sagas
|
|
91
|
+
- [Sairyss/domain-driven-hexagon](https://github.com/Sairyss/domain-driven-hexagon) — Reference architecture (3.5k⭐)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: >
|
|
4
|
+
Git conventions for branch naming, commit messages, PR workflow, and
|
|
5
|
+
release management. Follows Conventional Commits standard.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Git Workflow
|
|
9
|
+
|
|
10
|
+
## Branch Naming
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
<type>/<ticket-id>-<short-description>
|
|
14
|
+
|
|
15
|
+
# Examples
|
|
16
|
+
feature/HR-123-add-leave-approval
|
|
17
|
+
fix/HR-456-quota-calculation-error
|
|
18
|
+
refactor/HR-789-extract-pricing-service
|
|
19
|
+
chore/update-dependencies
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Type | When to use |
|
|
23
|
+
| ----------- | --------------------------------------- |
|
|
24
|
+
| `feature/` | New functionality |
|
|
25
|
+
| `fix/` | Bug fix |
|
|
26
|
+
| `refactor/` | Code restructuring (no behavior change) |
|
|
27
|
+
| `chore/` | Dependencies, configs, tooling |
|
|
28
|
+
| `hotfix/` | Urgent production fix |
|
|
29
|
+
|
|
30
|
+
## Commit Messages (Conventional Commits)
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
<type>(<scope>): <description>
|
|
34
|
+
|
|
35
|
+
[optional body]
|
|
36
|
+
|
|
37
|
+
[optional footer]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Types
|
|
41
|
+
|
|
42
|
+
| Type | Description | Example |
|
|
43
|
+
| ---------- | ----------------------------------- | --------------------------------------------- |
|
|
44
|
+
| `feat` | New feature | `feat(leave): add auto-approval for < 3 days` |
|
|
45
|
+
| `fix` | Bug fix | `fix(billing): correct proration calculation` |
|
|
46
|
+
| `refactor` | Restructure without behavior change | `refactor(auth): extract token service` |
|
|
47
|
+
| `docs` | Documentation only | `docs(api): update endpoint descriptions` |
|
|
48
|
+
| `test` | Add or fix tests | `test(billing): add proration edge cases` |
|
|
49
|
+
| `chore` | Build, tooling, deps | `chore: upgrade TypeORM to 0.3.20` |
|
|
50
|
+
| `perf` | Performance improvement | `perf(query): add index for leave lookups` |
|
|
51
|
+
|
|
52
|
+
### Rules
|
|
53
|
+
|
|
54
|
+
- Subject line: imperative mood, lowercase, no period, max 72 chars
|
|
55
|
+
- Body: wrap at 72 chars, explain WHY not WHAT
|
|
56
|
+
- Footer: `BREAKING CHANGE:` for breaking changes, `Closes #123` for issues
|
|
57
|
+
|
|
58
|
+
### Examples
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
feat(billing): implement interval change with proration
|
|
62
|
+
|
|
63
|
+
Allow subscription interval change from monthly to yearly.
|
|
64
|
+
Proration calculated proportionally for remaining days.
|
|
65
|
+
|
|
66
|
+
Closes HR-567
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
fix(saga): prevent duplicate invoice creation
|
|
71
|
+
|
|
72
|
+
The AdminOnboardingSaga was creating duplicate invoices when
|
|
73
|
+
the user clicked submit twice rapidly. Added idempotency check
|
|
74
|
+
using metadata key.
|
|
75
|
+
|
|
76
|
+
Closes HR-890
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## PR Workflow
|
|
80
|
+
|
|
81
|
+
### Before Creating PR
|
|
82
|
+
|
|
83
|
+
1. Rebase on latest `develop`
|
|
84
|
+
2. Run `npx tsc --noEmit` — zero errors
|
|
85
|
+
3. Run tests — all pass
|
|
86
|
+
4. Self-review the diff
|
|
87
|
+
|
|
88
|
+
### PR Description Template
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
## What
|
|
92
|
+
|
|
93
|
+
Brief description of the change.
|
|
94
|
+
|
|
95
|
+
## Why
|
|
96
|
+
|
|
97
|
+
Business context or bug report.
|
|
98
|
+
|
|
99
|
+
## How
|
|
100
|
+
|
|
101
|
+
Technical approach taken.
|
|
102
|
+
|
|
103
|
+
## Testing
|
|
104
|
+
|
|
105
|
+
- [ ] Unit tests added/updated
|
|
106
|
+
- [ ] Manual testing done
|
|
107
|
+
- [ ] Edge cases covered
|
|
108
|
+
|
|
109
|
+
## Screenshots (if UI)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Review Process
|
|
113
|
+
|
|
114
|
+
1. Author creates PR and assigns reviewers
|
|
115
|
+
2. Reviewer uses code-review SKILL.md checklist
|
|
116
|
+
3. Address feedback — resolve conversations
|
|
117
|
+
4. Squash merge to `develop`
|
|
118
|
+
|
|
119
|
+
## Release Flow
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
feature/* → develop → staging → main
|
|
123
|
+
↑ ↓
|
|
124
|
+
hotfix/* ←────── main (tag)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
| Branch | Purpose | Deploy to |
|
|
128
|
+
| --------- | ------------------- | ------------------- |
|
|
129
|
+
| `develop` | Integration branch | Dev environment |
|
|
130
|
+
| `staging` | Pre-release testing | Staging environment |
|
|
131
|
+
| `main` | Production ready | Production |
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-mastery
|
|
3
|
+
description: >
|
|
4
|
+
Advanced TypeScript patterns for production codebases. Strict typing, generics,
|
|
5
|
+
utility types, type guards, discriminated unions, branded types, and common pitfalls.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# TypeScript Mastery
|
|
9
|
+
|
|
10
|
+
## Core Principles
|
|
11
|
+
|
|
12
|
+
1. **No `any`** — ever. Use `unknown` + type guards when type is truly unknown.
|
|
13
|
+
2. **Explicit return types** on all exported functions and methods.
|
|
14
|
+
3. **Strict mode** always enabled (`strict: true` in tsconfig).
|
|
15
|
+
|
|
16
|
+
## Type Design
|
|
17
|
+
|
|
18
|
+
### Prefer `interface` for Object Shapes
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// ✅ Good — extendable, clear intent
|
|
22
|
+
interface UserProfile {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
email: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ✅ Good — `type` for unions and intersections
|
|
29
|
+
type PaymentStatus = "pending" | "completed" | "failed";
|
|
30
|
+
type AdminUser = UserProfile & { role: "admin" };
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Discriminated Unions for State
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// ✅ Use discriminated unions — exhaustive checking
|
|
37
|
+
type AsyncState<T> =
|
|
38
|
+
| { status: "idle" }
|
|
39
|
+
| { status: "loading" }
|
|
40
|
+
| { status: "success"; data: T }
|
|
41
|
+
| { status: "error"; error: Error };
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Branded Types for Domain Safety
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
type UserId = string & { readonly __brand: 'UserId' };
|
|
48
|
+
type OrderId = string & { readonly __brand: 'OrderId' };
|
|
49
|
+
|
|
50
|
+
// Prevents accidental swapping of userId and orderId
|
|
51
|
+
function getOrder(userId: UserId, orderId: OrderId): Order { ... }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Type Guards
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// ✅ Custom type guard
|
|
58
|
+
function isUser(value: unknown): value is User {
|
|
59
|
+
return (
|
|
60
|
+
typeof value === "object" &&
|
|
61
|
+
value !== null &&
|
|
62
|
+
"id" in value &&
|
|
63
|
+
"email" in value
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ✅ Discriminated union guard
|
|
68
|
+
function isSuccess<T>(
|
|
69
|
+
state: AsyncState<T>,
|
|
70
|
+
): state is { status: "success"; data: T } {
|
|
71
|
+
return state.status === "success";
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Immutability
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
// ✅ Readonly for data that shouldn't change
|
|
79
|
+
interface Config {
|
|
80
|
+
readonly apiUrl: string;
|
|
81
|
+
readonly timeout: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ✅ as const for literal values
|
|
85
|
+
const ROLES = ['admin', 'user', 'guest'] as const;
|
|
86
|
+
type Role = (typeof ROLES)[number]; // 'admin' | 'user' | 'guest'
|
|
87
|
+
|
|
88
|
+
// ✅ Readonly arrays and tuples
|
|
89
|
+
function processItems(items: readonly Item[]): void { ... }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Generics
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// ✅ Constrained generics
|
|
96
|
+
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
|
|
97
|
+
return obj[key];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ✅ Generic with default
|
|
101
|
+
interface Repository<T extends BaseEntity = BaseEntity> {
|
|
102
|
+
findById(id: string): Promise<T | null>;
|
|
103
|
+
save(entity: T): Promise<T>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ✅ Utility type composition
|
|
107
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Function Patterns
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
// ✅ RO-RO (Receive Object, Return Object) for 3+ params
|
|
114
|
+
interface CreateUserParams {
|
|
115
|
+
readonly name: string;
|
|
116
|
+
readonly email: string;
|
|
117
|
+
readonly role?: Role;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface CreateUserResult {
|
|
121
|
+
readonly user: User;
|
|
122
|
+
readonly token: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function createUser(params: CreateUserParams): CreateUserResult { ... }
|
|
126
|
+
|
|
127
|
+
// ✅ Overloads for different return types
|
|
128
|
+
function parse(input: string): number;
|
|
129
|
+
function parse(input: string, asArray: true): number[];
|
|
130
|
+
function parse(input: string, asArray?: boolean): number | number[] { ... }
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Common Pitfalls
|
|
134
|
+
|
|
135
|
+
### ❌ Don't
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// ❌ Using `any`
|
|
139
|
+
function process(data: any) { ... }
|
|
140
|
+
|
|
141
|
+
// ❌ Type assertion without validation
|
|
142
|
+
const user = data as User;
|
|
143
|
+
|
|
144
|
+
// ❌ Optional chaining without null handling
|
|
145
|
+
const name = user?.profile?.name; // name is string | undefined — handle it
|
|
146
|
+
|
|
147
|
+
// ❌ Enum (prefer union types or const objects)
|
|
148
|
+
enum Status { Active, Inactive }
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### ✅ Do Instead
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
// ✅ Type guard + unknown
|
|
155
|
+
function process(data: unknown): ProcessedResult {
|
|
156
|
+
if (!isValidInput(data)) throw new InvalidInputError(data);
|
|
157
|
+
return transform(data);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ✅ Runtime validation before assertion
|
|
161
|
+
const user = validateUser(data); // throws if invalid
|
|
162
|
+
|
|
163
|
+
// ✅ Handle undefined explicitly
|
|
164
|
+
const name = user?.profile?.name ?? "Anonymous";
|
|
165
|
+
|
|
166
|
+
// ✅ Const object instead of enum
|
|
167
|
+
const Status = { Active: "active", Inactive: "inactive" } as const;
|
|
168
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Naming Conventions
|
|
172
|
+
|
|
173
|
+
| Type | Convention | Example |
|
|
174
|
+
| ---------------------------- | -------------------------- | ----------------------------------------- |
|
|
175
|
+
| Class / Interface / Type | PascalCase | `UserProfile`, `IRepository` |
|
|
176
|
+
| Variable / Function / Method | camelCase | `getUserById`, `isValid` |
|
|
177
|
+
| File / Directory | kebab-case | `user-profile.ts`, `auth-service.ts` |
|
|
178
|
+
| Constant | UPPER_SNAKE_CASE | `MAX_RETRIES`, `API_URL` |
|
|
179
|
+
| Boolean variable | `is/has/can/should` prefix | `isLoading`, `hasPermission` |
|
|
180
|
+
| Function | verb-first | `getUser`, `createOrder`, `validateInput` |
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# User Rules (MEMORY[user_global])
|
|
2
|
+
|
|
3
|
+
Copy this entire block into your IDE → Settings → User Rules.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
SYSTEM INSTRUCTIONS: ANTIGRAVITY CODING PROTOCOL
|
|
7
|
+
|
|
8
|
+
I. STRICT MODE: NO AUTO-EDIT (HIGHEST PRIORITY)
|
|
9
|
+
1. PROPOSAL ONLY: When analyzing a problem, NEVER jump to a full solution. ONLY propose the analysis/strategy text first.
|
|
10
|
+
2. STOP & ASK: You are STRICTLY FORBIDDEN from calling tools (editing files) until you explicitly ask: "Shall I apply this?" and receive user Confirmation.
|
|
11
|
+
3. ITERATIVE CLARIFICATION: If the logic is complex (> 1 step) or requirements are vague, DO NOT provide a full plan. Break it down -> Analyze Part 1 -> Ask User -> Analyze Part 2 -> Ask User.
|
|
12
|
+
|
|
13
|
+
II. RESPONSE PROTOCOL (MANDATORY)
|
|
14
|
+
4. Stop & Analyze:
|
|
15
|
+
- If the request involves planning, logic, or new features -> STRICTLY NO CODE BLOCKS initially.
|
|
16
|
+
- Force yourself to identify missing information and Ask 1-2 clarifying questions before proposing a full strategy.
|
|
17
|
+
5. Report First: Every response must start with a "Conceptual Report" in Vietnamese. Includes:
|
|
18
|
+
- Analysis: Your understanding.
|
|
19
|
+
- Strategy: Proposed logic/architecture.
|
|
20
|
+
- Constraints: Types, potential risks.
|
|
21
|
+
- Question Gate: End with a specific question to clarify ambiguous points OR a request for confirmation to proceed to the next analysis phase.
|
|
22
|
+
6. Formatting: Use a Horizontal Rule ("---") to separate sections. Code must ALWAYS be at the very end, and ONLY after Confirmation.
|
|
23
|
+
|
|
24
|
+
III. TYPESCRIPT ESSENTIALS (Always Active)
|
|
25
|
+
7. Never use `any`. Use `unknown` + type guards if type is truly unknown.
|
|
26
|
+
8. Always declare return types for functions and methods.
|
|
27
|
+
9. Prefer `interface` for object shapes, `type` for unions/intersections.
|
|
28
|
+
10. Use `readonly` for data that should not change after creation.
|
|
29
|
+
11. Naming: PascalCase for classes/interfaces/types, camelCase for variables/methods, kebab-case for files.
|
|
30
|
+
12. Functions: single purpose, <20 lines, verb-first naming (getUser, createOrder, isValid).
|
|
31
|
+
13. Use Receive-Object-Return-Object (RO-RO) pattern for 3+ parameters.
|
|
32
|
+
14. DTOs: validate inputs with class-validator. Declare simple types for outputs.
|
|
33
|
+
15. Prefer composition over inheritance. Follow SOLID principles.
|
|
34
|
+
16. Use `as const` for literals, `readonly` arrays/tuples where applicable.
|
|
35
|
+
|
|
36
|
+
IV. PROJECT AWARENESS
|
|
37
|
+
17. Existing Context: Adapt to existing styles.
|
|
38
|
+
18. Language Rule: Vietnamese for Reports, English for Technical.
|
|
39
|
+
|
|
40
|
+
V. WORKFLOW ORCHESTRATION
|
|
41
|
+
19. Plan Mode Default:
|
|
42
|
+
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
|
|
43
|
+
- If something goes sideways, STOP and re-plan immediately — don't keep pushing
|
|
44
|
+
- Use plan mode for verification steps, not just building
|
|
45
|
+
- Write detailed specs upfront to reduce ambiguity
|
|
46
|
+
20. Self-Improvement Loop:
|
|
47
|
+
- After ANY correction from the user: update `tasks/lessons.md` with the pattern
|
|
48
|
+
- Write rules for yourself that prevent the same mistake
|
|
49
|
+
- Review lessons at session start for relevant project
|
|
50
|
+
21. Demand Elegance (Balanced):
|
|
51
|
+
- For non-trivial changes: pause and ask "is there a more elegant way?"
|
|
52
|
+
- If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
|
|
53
|
+
- Skip this for simple, obvious fixes — don't over-engineer
|
|
54
|
+
- Challenge your own work before presenting it
|
|
55
|
+
22. Autonomous Bug Fixing:
|
|
56
|
+
- When given a bug report: just fix it. Don't ask for hand-holding
|
|
57
|
+
- Point at logs, errors, failing tests — then resolve them
|
|
58
|
+
- Zero context switching required from the user
|
|
59
|
+
|
|
60
|
+
VI. TASK MANAGEMENT
|
|
61
|
+
23. Plan First: Write plan to `tasks/todo.md` with checkable items
|
|
62
|
+
24. Verify Plan: Check in before starting implementation
|
|
63
|
+
25. Track Progress: Mark items complete as you go
|
|
64
|
+
26. Document Results: Add review section to `tasks/todo.md`
|
|
65
|
+
27. Capture Lessons: Update `tasks/lessons.md` after corrections
|
|
66
|
+
- `tasks/lessons.md` = AI session notes (temporary, self-improvement)
|
|
67
|
+
- `docs/<module>/decisions/` = permanent team knowledge (committed to git)
|
|
68
|
+
|
|
69
|
+
VII. CORE PRINCIPLES
|
|
70
|
+
28. Simplicity First: Make every change as simple as possible. Impact minimal code.
|
|
71
|
+
29. No Laziness: Find root causes. No temporary fixes. Senior developer standards.
|
|
72
|
+
30. Minimal Impact: Changes should only touch what's necessary. Avoid introducing bugs.
|
|
73
|
+
|
|
74
|
+
VIII. CONTEXT-AWARE CODING
|
|
75
|
+
31. Always read project-context SKILL.md FIRST when starting work
|
|
76
|
+
32. Auto-detect module pattern (DDD vs Legacy) before writing code
|
|
77
|
+
33. Proactively flag: N+1 queries, missing types, circular deps
|
|
78
|
+
34. When planning in DDD modules, always identify the layer sequence:
|
|
79
|
+
Domain (Aggregate/Port) → Application (UseCase/Saga) → Infra → Presentation
|
|
80
|
+
|
|
81
|
+
IX. KNOWLEDGE ROUTING (Self-Organizing)
|
|
82
|
+
35. After every task, evaluate: "Is there knowledge worth preserving?"
|
|
83
|
+
36. Classify → Route → Confirm with user before saving
|
|
84
|
+
37. Target locations:
|
|
85
|
+
- Business decisions → docs/<module>/decisions/
|
|
86
|
+
- Patterns/conventions → project-context SKILL.md
|
|
87
|
+
- Repeatable processes → .agent/workflows/
|
|
88
|
+
- Lessons learned → docs/<module>/decisions/
|
|
89
|
+
38. After corrections, update docs with the lesson learned
|
|
90
|
+
|
|
91
|
+
X. VERIFICATION BEFORE DONE (MANDATORY)
|
|
92
|
+
39. Before declaring ANY task complete, you MUST:
|
|
93
|
+
a. Re-read the original plan/checklist
|
|
94
|
+
b. Confirm EACH item is actually implemented (not just "addressed")
|
|
95
|
+
c. Run `npx tsc --noEmit` for TypeScript projects and fix ALL errors
|
|
96
|
+
d. If ANY lint/type error remains, fix it BEFORE reporting done
|
|
97
|
+
40. If implementation is partial, EXPLICITLY state:
|
|
98
|
+
- ✅ What IS done (with file list)
|
|
99
|
+
- ❌ What is NOT done yet (with reasons)
|
|
100
|
+
- NEVER say "done" or "complete" when items remain
|
|
101
|
+
41. After code changes, always verify:
|
|
102
|
+
- File compiles without errors
|
|
103
|
+
- Imports are correct and used
|
|
104
|
+
- Types match interfaces
|
|
105
|
+
- No placeholder or TODO left behind
|
|
106
|
+
|
|
107
|
+
XI. LANGUAGE RULE (STRICT)
|
|
108
|
+
42. User may prompt in Vietnamese, but ALL output MUST be English:
|
|
109
|
+
- Code, variable names, function names
|
|
110
|
+
- Code comments
|
|
111
|
+
- Documentation files (docs/, README.md)
|
|
112
|
+
- SKILL.md files, workflow files
|
|
113
|
+
- Commit messages
|
|
114
|
+
- NEVER write Vietnamese in project files, even if user prompts in Vietnamese
|
|
115
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Step-by-step debugging methodology. Trace data flow through layers.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. Read project-context SKILL.md
|
|
6
|
+
2. Reproduce: Understand the exact error/symptom
|
|
7
|
+
3. Hypothesize: Form 2-3 likely root causes
|
|
8
|
+
4. Investigate: Check logs, trace data flow
|
|
9
|
+
5. For DDD: Trace Use Case → Service → Port → Gateway
|
|
10
|
+
6. For Legacy: Trace Controller → Service → Repository
|
|
11
|
+
7. Fix: Propose minimal fix
|
|
12
|
+
8. Verify: Suggest how to verify the fix works
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Structured planning for any feature or bugfix. Auto-detects module pattern.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
// turbo-all
|
|
6
|
+
|
|
7
|
+
1. Read the project-context SKILL.md first
|
|
8
|
+
2. Identify which module(s) are affected
|
|
9
|
+
3. Detect module pattern (DDD vs Legacy)
|
|
10
|
+
4. Create a plan in `tasks/todo.md` with checkable items
|
|
11
|
+
5. For DDD modules, identify: Aggregate → Use Case → Port → Gateway
|
|
12
|
+
6. For Legacy modules, identify: Controller → Service → Entity
|
|
13
|
+
7. List files to create/modify
|
|
14
|
+
8. Ask user to confirm plan before proceeding
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Systematic code review checklist. Checks patterns, types, errors, performance.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. Read project-context SKILL.md
|
|
6
|
+
2. Check: Does the code follow the correct module pattern?
|
|
7
|
+
3. Check: Type safety (no `any`, proper interfaces)
|
|
8
|
+
4. Check: Error handling (no silent catches)
|
|
9
|
+
5. Check: N+1 queries (missing relations/joins)
|
|
10
|
+
6. Check: Missing test coverage
|
|
11
|
+
7. Check: Unused imports and dead code
|
|
12
|
+
8. Present findings as a checklist with severity levels
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Verification checklist before declaring any task complete. Evidence-based completion.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. Re-read the original plan/checklist
|
|
6
|
+
2. For EACH checklist item, verify it is actually implemented:
|
|
7
|
+
- Open the file and confirm the change exists
|
|
8
|
+
- Not just "addressed" — actually working
|
|
9
|
+
3. Run type check: `npx tsc --noEmit`
|
|
10
|
+
4. Fix any type/lint errors found
|
|
11
|
+
5. Report explicitly:
|
|
12
|
+
- ✅ Done items (with file paths)
|
|
13
|
+
- ❌ Remaining items (with reasons)
|
|
14
|
+
- ⚠️ Blocked items (needs user input)
|
|
15
|
+
6. Only declare "done" when ALL items are ✅
|