thachvd-kit 1.0.18 → 1.0.20
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/docs/architecture.md +3 -2
- package/.agent/docs/conventions.md +1 -1
- package/.agent/docs/tooling.md +5 -8
- package/.agent/skills/project-onboarding/SKILL.md +1 -1
- package/.agent/skills/using-git-worktrees/SKILL.md +2 -3
- package/.agent/skills/writing-skills/SKILL.md +170 -110
- package/.agent/workflows/review.md +125 -0
- package/.agent/workflows/spec.md +140 -0
- package/README.md +45 -44
- package/bin/cli.js +347 -330
- package/kit/README.md +2 -1
- package/package.json +1 -1
- package/skills/code-review-checklist/SKILL.md +142 -109
- package/skills/project-onboarding/SKILL.md +1 -1
- package/skills/tdd-workflow/SKILL.md +25 -1
- package/skills/using-git-worktrees/SKILL.md +2 -3
- package/skills/verification-before-completion/SKILL.md +24 -10
- package/skills/writing-skills/SKILL.md +170 -110
package/kit/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# thachvd-kit Kit
|
|
2
2
|
|
|
3
|
-
This kit keeps AI coding behavior consistent across Codex, Antigravity,
|
|
3
|
+
This kit keeps AI coding behavior consistent across Codex, Antigravity, Claude Code, and Cursor.
|
|
4
4
|
|
|
5
5
|
## Entry Files
|
|
6
6
|
|
|
7
7
|
- `AGENTS.md`: shared cross-agent instructions.
|
|
8
8
|
- `CLAUDE.md`: Claude Code entry file that imports `AGENTS.md`.
|
|
9
9
|
- `GEMINI.md`: Antigravity entry file that points to `AGENTS.md`.
|
|
10
|
+
- `.cursorrules`: Cursor entry file that points to `AGENTS.md`.
|
|
10
11
|
|
|
11
12
|
## Shared Docs
|
|
12
13
|
|
package/package.json
CHANGED
|
@@ -1,109 +1,142 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-review-checklist
|
|
3
|
-
description: Code review guidelines covering
|
|
4
|
-
allowed-tools: Read, Glob, Grep
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Code Review Checklist
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
###
|
|
18
|
-
- [ ]
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ]
|
|
21
|
-
- [ ]
|
|
22
|
-
- [ ]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- [ ]
|
|
27
|
-
- [ ]
|
|
28
|
-
- [ ]
|
|
29
|
-
- [ ]
|
|
30
|
-
|
|
31
|
-
###
|
|
32
|
-
- [ ]
|
|
33
|
-
- [ ]
|
|
34
|
-
- [ ]
|
|
35
|
-
- [ ]
|
|
36
|
-
|
|
37
|
-
###
|
|
38
|
-
- [ ]
|
|
39
|
-
- [ ]
|
|
40
|
-
- [ ]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- [ ]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- [ ]
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
1
|
+
---
|
|
2
|
+
name: code-review-checklist
|
|
3
|
+
description: Code review guidelines covering correctness, readability, architecture, security, and performance. Use before merging any PR, after completing a feature, or when reviewing AI-generated code.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Review Checklist
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Multi-dimensional code review with quality gates. Every change gets reviewed before merge — no exceptions.
|
|
12
|
+
|
|
13
|
+
**The approval standard:** Approve when it definitely improves overall code health, even if imperfect. Don't block because it isn't exactly how you would have written it.
|
|
14
|
+
|
|
15
|
+
## The Five-Axis Review
|
|
16
|
+
|
|
17
|
+
### 1. Correctness
|
|
18
|
+
- [ ] Code does what the spec/task requires
|
|
19
|
+
- [ ] Edge cases handled (null, empty, boundary values)
|
|
20
|
+
- [ ] Error paths handled (not just the happy path)
|
|
21
|
+
- [ ] Tests pass and are testing the right things
|
|
22
|
+
- [ ] No off-by-one errors, race conditions, or state inconsistencies
|
|
23
|
+
|
|
24
|
+
### 2. Readability & Simplicity
|
|
25
|
+
- [ ] Names descriptive and consistent with project conventions (no `temp`, `data`, `result` without context)
|
|
26
|
+
- [ ] Control flow straightforward (no nested ternaries, deep callbacks)
|
|
27
|
+
- [ ] **Could this be done in fewer lines?** (1000 lines where 100 suffice is a failure)
|
|
28
|
+
- [ ] **Are abstractions earning their complexity?** (Don't generalize before the third use case)
|
|
29
|
+
- [ ] No dead code: no-op variables, backwards-compat shims, `// removed` comments
|
|
30
|
+
|
|
31
|
+
### 3. Architecture
|
|
32
|
+
- [ ] Follows existing patterns (or new pattern is justified)
|
|
33
|
+
- [ ] Clean module boundaries maintained
|
|
34
|
+
- [ ] No code duplication that should be shared
|
|
35
|
+
- [ ] Dependencies flow in the right direction (no circular dependencies)
|
|
36
|
+
|
|
37
|
+
### 4. Security
|
|
38
|
+
- [ ] Input validated and sanitized
|
|
39
|
+
- [ ] No SQL/NoSQL injection vulnerabilities
|
|
40
|
+
- [ ] No XSS or CSRF vulnerabilities
|
|
41
|
+
- [ ] No hardcoded secrets or sensitive credentials
|
|
42
|
+
- [ ] **AI-Specific:** Protection against Prompt Injection (if applicable)
|
|
43
|
+
- [ ] **AI-Specific:** Outputs sanitized before use in critical sinks
|
|
44
|
+
|
|
45
|
+
### 5. Performance
|
|
46
|
+
- [ ] No N+1 queries
|
|
47
|
+
- [ ] No unbounded loops or unconstrained data fetching
|
|
48
|
+
- [ ] Synchronous operations that should be async
|
|
49
|
+
- [ ] No unnecessary re-renders in UI components
|
|
50
|
+
- [ ] Missing pagination on list endpoints
|
|
51
|
+
|
|
52
|
+
## Change Sizing
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
~100 lines changed → Good. Reviewable in one sitting.
|
|
56
|
+
~300 lines changed → Acceptable if it's a single logical change.
|
|
57
|
+
~1000 lines changed → Too large. Split it.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Splitting strategies:**
|
|
61
|
+
|
|
62
|
+
| Strategy | How | When |
|
|
63
|
+
|----------|-----|------|
|
|
64
|
+
| **Stack** | Submit small change, next based on it | Sequential dependencies |
|
|
65
|
+
| **By file group** | Separate changes needing different reviewers | Cross-cutting concerns |
|
|
66
|
+
| **Vertical** | Break into smaller full-stack slices | Feature work |
|
|
67
|
+
|
|
68
|
+
**Always separate refactoring from feature work.** Submit them independently.
|
|
69
|
+
|
|
70
|
+
## AI & LLM Review Patterns (2025)
|
|
71
|
+
|
|
72
|
+
### Logic & Hallucinations
|
|
73
|
+
- [ ] **Chain of Thought:** Does the logic follow a verifiable path?
|
|
74
|
+
- [ ] **Edge Cases:** Did the AI account for empty states, timeouts, and partial failures?
|
|
75
|
+
- [ ] **External State:** Is the code making safe assumptions about file systems or networks?
|
|
76
|
+
|
|
77
|
+
### Prompt Engineering Review
|
|
78
|
+
```markdown
|
|
79
|
+
// ❌ Vague prompt in code
|
|
80
|
+
const response = await ai.generate(userInput);
|
|
81
|
+
|
|
82
|
+
// ✅ Structured & Safe prompt
|
|
83
|
+
const response = await ai.generate({
|
|
84
|
+
system: "You are a specialized parser...",
|
|
85
|
+
input: sanitize(userInput),
|
|
86
|
+
schema: ResponseSchema
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Code Anti-Patterns to Flag
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
// ❌ Magic numbers
|
|
94
|
+
if (status === 3) { ... }
|
|
95
|
+
|
|
96
|
+
// ✅ Named constants
|
|
97
|
+
if (status === Status.ACTIVE) { ... }
|
|
98
|
+
|
|
99
|
+
// ❌ Deep nesting
|
|
100
|
+
if (a) { if (b) { if (c) { ... } } }
|
|
101
|
+
|
|
102
|
+
// ✅ Early returns
|
|
103
|
+
if (!a) return;
|
|
104
|
+
if (!b) return;
|
|
105
|
+
|
|
106
|
+
// ❌ any type
|
|
107
|
+
const data: any = ...
|
|
108
|
+
|
|
109
|
+
// ✅ Proper types
|
|
110
|
+
const data: UserData = ...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Review Comment Conventions
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
🔴 BLOCKING: SQL injection vulnerability here
|
|
117
|
+
🟡 SUGGESTION: Consider using useMemo for performance
|
|
118
|
+
🟢 NIT: Prefer const over let for immutable variable
|
|
119
|
+
❓ QUESTION: What happens if user is null here?
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Anti-Rationalization
|
|
123
|
+
|
|
124
|
+
| Excuse | Correct Response |
|
|
125
|
+
|--------|-----------------|
|
|
126
|
+
| "It's a small PR, not worth full review" | Small PRs still introduce bugs. Run the five-axis check. |
|
|
127
|
+
| "I wrote this code, I know it's correct" | Author bias is real. Treat your own code as a stranger's. |
|
|
128
|
+
| "Tests pass, it's fine" | Tests prove what you tested, not what you didn't. Check all 5 axes. |
|
|
129
|
+
| "No time for a thorough review" | A partial review is a false sense of security. Flag it as skipped. |
|
|
130
|
+
| "The security checks don't apply here" | Apply them and explicitly confirm they don't apply — don't skip. |
|
|
131
|
+
| "It's just refactoring, no new behavior" | Refactors introduce bugs. Correctness + test axes are non-negotiable. |
|
|
132
|
+
|
|
133
|
+
## Exit Criteria
|
|
134
|
+
|
|
135
|
+
Before approving or merging any change:
|
|
136
|
+
|
|
137
|
+
- [ ] All five axes reviewed (correctness, readability, architecture, security, performance)
|
|
138
|
+
- [ ] Change size is appropriate (< ~300 lines for a single logical change)
|
|
139
|
+
- [ ] All 🔴 BLOCKING issues resolved
|
|
140
|
+
- [ ] Tests present and passing for changed behavior
|
|
141
|
+
- [ ] No secrets, magic numbers, or hardcoded values
|
|
142
|
+
- [ ] Review comment posted or change approved with explicit rationale
|
|
@@ -9,7 +9,7 @@ Use this skill when a project has just run `thachvd-kit init`, when `.agent/docs
|
|
|
9
9
|
|
|
10
10
|
## Goal
|
|
11
11
|
|
|
12
|
-
Create or update the shared project docs used by Codex, Antigravity,
|
|
12
|
+
Create or update the shared project docs used by Codex, Antigravity, Claude Code, and Cursor:
|
|
13
13
|
|
|
14
14
|
- `.agent/docs/project.md`
|
|
15
15
|
- `.agent/docs/architecture.md`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd-workflow
|
|
3
|
-
description: Test-Driven Development workflow principles. RED-GREEN-REFACTOR cycle
|
|
3
|
+
description: Test-Driven Development workflow principles. Use when writing new features, fixing bugs, or implementing any logic — enforces RED-GREEN-REFACTOR cycle, prevents writing code before tests
|
|
4
4
|
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -146,4 +146,28 @@ Every test follows:
|
|
|
146
146
|
|
|
147
147
|
---
|
|
148
148
|
|
|
149
|
+
## Anti-Rationalization
|
|
150
|
+
|
|
151
|
+
The most common reasons AI skips writing tests first — and why they're wrong:
|
|
152
|
+
|
|
153
|
+
| Excuse | Correct Response |
|
|
154
|
+
|--------|------------------|
|
|
155
|
+
| "It's a simple change, tests aren't needed" | Simplicity is not an exemption. Simple code breaks too. Write the test. |
|
|
156
|
+
| "I'll write tests after the implementation" | That's TAD (Test After Development), not TDD. Tests written after implementation don't drive design. |
|
|
157
|
+
| "The feature is exploratory, tests would slow me down" | Write a spike without TDD, then delete and rewrite TDD. Don't skip the RED phase permanently. |
|
|
158
|
+
| "The test would be too complex to write" | Complex test = unclear requirement. Stop and clarify the requirement first. |
|
|
159
|
+
| "I already know what the code should do" | Knowing what it should do is exactly when you write the test — to prove it. |
|
|
160
|
+
| "This is UI code, hard to test" | UI logic can be extracted and tested. Pure rendering tests have lower value — skip those, not the logic. |
|
|
161
|
+
|
|
162
|
+
## Exit Criteria
|
|
163
|
+
|
|
164
|
+
Before claiming a TDD cycle is complete:
|
|
165
|
+
|
|
166
|
+
- [ ] Test was written BEFORE the implementation (RED phase confirmed — test failed first)
|
|
167
|
+
- [ ] Test failure message was read and confirmed it failed for the right reason
|
|
168
|
+
- [ ] Minimum code was written to make the test pass (GREEN)
|
|
169
|
+
- [ ] Test suite runs green with the new test included
|
|
170
|
+
- [ ] Code was refactored if needed while keeping tests green (REFACTOR)
|
|
171
|
+
- [ ] No production code exists that isn't covered by a test written in this cycle
|
|
172
|
+
|
|
149
173
|
> **Remember:** The test is the specification. If you can't write a test, you don't understand the requirement.
|
|
@@ -27,11 +27,10 @@ ls -d worktrees 2>/dev/null # Alternative
|
|
|
27
27
|
|
|
28
28
|
**If found:** Use that directory. If both exist, `.worktrees` wins.
|
|
29
29
|
|
|
30
|
-
### 2. Check CLAUDE.md / GEMINI.md
|
|
30
|
+
### 2. Check CLAUDE.md / GEMINI.md / .cursorrules
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
|
|
34
|
-
grep -i "worktree.*director" GEMINI.md 2>/dev/null
|
|
33
|
+
grep -i "worktree.*director" CLAUDE.md GEMINI.md .cursorrules 2>/dev/null
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
**If preference specified:** Use it without asking.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verification-before-completion
|
|
3
|
-
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs
|
|
3
|
+
description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs, or before moving to next task — requires running verification commands and confirming output; evidence before assertions always
|
|
4
4
|
allowed-tools: Bash, Read
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -57,16 +57,19 @@ Skip any step = lying, not verifying
|
|
|
57
57
|
- Relying on partial verification
|
|
58
58
|
- **ANY wording implying success without having run verification**
|
|
59
59
|
|
|
60
|
-
## Rationalization
|
|
60
|
+
## Anti-Rationalization
|
|
61
61
|
|
|
62
|
-
| Excuse |
|
|
63
|
-
|
|
64
|
-
| "Should work now" |
|
|
65
|
-
| "I'm confident" | Confidence ≠ evidence |
|
|
66
|
-
| "Just this once" | No exceptions |
|
|
67
|
-
| "Linter passed" | Linter ≠ compiler |
|
|
68
|
-
| "Agent said success" | Verify independently |
|
|
69
|
-
| "Partial check is enough" | Partial proves nothing |
|
|
62
|
+
| Excuse | Correct Response |
|
|
63
|
+
|--------|------------------|
|
|
64
|
+
| "Should work now" | Run the verification. "Should" is not evidence. |
|
|
65
|
+
| "I'm confident" | Confidence ≠ evidence. Run it anyway. |
|
|
66
|
+
| "Just this once" | No exceptions. "Just this once" is how standards die. |
|
|
67
|
+
| "Linter passed" | Linter ≠ compiler ≠ tests. All three are separate gates. |
|
|
68
|
+
| "Agent said success" | Verify independently. Agent reports are not evidence. |
|
|
69
|
+
| "Partial check is enough" | Partial proves nothing. Run the full suite. |
|
|
70
|
+
| "I already ran this earlier" | Stale results. Run fresh verification in this message. |
|
|
71
|
+
| "The change is too small to matter" | Small changes cause prod incidents. Run the gate. |
|
|
72
|
+
| "Tests take too long" | A broken deploy takes longer. Run the gate. |
|
|
70
73
|
|
|
71
74
|
## Key Patterns
|
|
72
75
|
|
|
@@ -96,4 +99,15 @@ Skip any step = lying, not verifying
|
|
|
96
99
|
- Moving to next task
|
|
97
100
|
- Delegating to agents
|
|
98
101
|
|
|
102
|
+
## Exit Criteria
|
|
103
|
+
|
|
104
|
+
Before claiming any task is done:
|
|
105
|
+
|
|
106
|
+
- [ ] Verification command identified ("what command proves this claim?")
|
|
107
|
+
- [ ] Verification command run fresh in this session (not relying on past results)
|
|
108
|
+
- [ ] Full output read, not skimmed
|
|
109
|
+
- [ ] Exit code or failure count checked explicitly
|
|
110
|
+
- [ ] No "should", "probably", or "seems to" language used in the claim
|
|
111
|
+
- [ ] Claim is accompanied by specific evidence from the output
|
|
112
|
+
|
|
99
113
|
**The Bottom Line:** Run the command. Read the output. THEN claim the result.
|