@leejungkiin/awkit 1.1.4 → 1.1.6
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/VERSION +1 -1
- package/bin/awk.js +21 -55
- package/package.json +2 -2
- package/skills/CATALOG.md +11 -3
- package/skills/code-review/SKILL.md +125 -0
- package/skills/codex-conductor/SKILL.md +337 -0
- package/skills/symphony-enforcer/SKILL.md +12 -1
- package/skills/systematic-debugging/SKILL.md +174 -0
- package/skills/verification-gate/SKILL.md +130 -0
- package/skills/writing-skills/SKILL.md +110 -0
- package/workflows/conductor-codex.md +125 -0
- package/workflows/lifecycle/code.md +28 -1
- package/workflows/lifecycle/debug.md +34 -14
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.6
|
package/bin/awk.js
CHANGED
|
@@ -274,40 +274,16 @@ function syncGeminiMd() {
|
|
|
274
274
|
// ─── Commands ────────────────────────────────────────────────────────────────
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
|
-
*
|
|
278
|
-
* Returns true if bd is available after the call.
|
|
277
|
+
* Check if Symphony is available.
|
|
279
278
|
*/
|
|
280
|
-
function
|
|
281
|
-
// Check if bd already installed
|
|
279
|
+
function checkSymphony({ silent = false } = {}) {
|
|
282
280
|
try {
|
|
283
|
-
execSync('which
|
|
284
|
-
if (!silent) ok('Symphony
|
|
281
|
+
execSync('which symphony', { stdio: 'ignore' });
|
|
282
|
+
if (!silent) ok('Symphony CLI is installed');
|
|
285
283
|
return true;
|
|
286
|
-
} catch (_) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
// Check if brew is available
|
|
291
|
-
let brewAvailable = false;
|
|
292
|
-
try { execSync('which brew', { stdio: 'ignore' }); brewAvailable = true; } catch (_) { }
|
|
293
|
-
|
|
294
|
-
if (!brewAvailable) {
|
|
295
|
-
warn('Homebrew not found. Please install bd manually:');
|
|
296
|
-
dim(' npm install -g @anthropic/symphony');
|
|
297
|
-
dim(' or visit: https://github.com/anthropic/symphony');
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
try {
|
|
302
|
-
if (!silent) info('Running: npm install -g @anthropic/symphony');
|
|
303
|
-
execSync('npm install -g @anthropic/symphony', { stdio: silent ? 'pipe' : 'inherit' });
|
|
304
|
-
// Verify install
|
|
305
|
-
execSync('which bd', { stdio: 'ignore' });
|
|
306
|
-
if (!silent) ok('Symphony installed successfully ✨');
|
|
307
|
-
return true;
|
|
308
|
-
} catch (e) {
|
|
309
|
-
warn(`Failed to install bd via brew: ${e.message}`);
|
|
310
|
-
dim('Try manually: npm install -g @anthropic/symphony');
|
|
284
|
+
} catch (_) {
|
|
285
|
+
if (!silent) warn('Symphony CLI not found. Please install it manually:');
|
|
286
|
+
if (!silent) dim(' npm install -g awkit-symphony');
|
|
311
287
|
return false;
|
|
312
288
|
}
|
|
313
289
|
}
|
|
@@ -336,9 +312,9 @@ function cmdInstall(platformArg) {
|
|
|
336
312
|
info(`Installing for ${C.bold}${plat.name}${C.reset}...`);
|
|
337
313
|
log('');
|
|
338
314
|
|
|
339
|
-
// 0.
|
|
315
|
+
// 0. Check Symphony dependency
|
|
340
316
|
info('Checking dependencies...');
|
|
341
|
-
|
|
317
|
+
checkSymphony();
|
|
342
318
|
|
|
343
319
|
// 1. Ensure target dirs exist
|
|
344
320
|
info('Creating directories...');
|
|
@@ -1808,30 +1784,20 @@ function cmdInit(forceFlag = false) {
|
|
|
1808
1784
|
ok('CODEBASE.md created');
|
|
1809
1785
|
}
|
|
1810
1786
|
|
|
1811
|
-
// ── 5. Symphony
|
|
1787
|
+
// ── 5. Symphony folder ───────────────────────────────────────────────────────
|
|
1812
1788
|
const symphonyDir = path.join(cwd, '.symphony');
|
|
1813
1789
|
if (fs.existsSync(symphonyDir) && !forceFlag) {
|
|
1814
|
-
warn('.symphony/ already exists
|
|
1790
|
+
warn('.symphony/ folder already exists');
|
|
1815
1791
|
} else {
|
|
1816
|
-
info('
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
ok('Symphony initialized (.symphony/)');
|
|
1826
|
-
} catch (e) {
|
|
1827
|
-
const msg = (e.stderr || e.stdout || e.message || '').toString().trim();
|
|
1828
|
-
if (msg.includes('already')) {
|
|
1829
|
-
warn('Symphony already initialized — skipping');
|
|
1830
|
-
} else {
|
|
1831
|
-
warn(`bd init failed: ${msg || e.message}`);
|
|
1832
|
-
dim('Try manually: cd <project> && bd init');
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1792
|
+
info('Creating .symphony/ folder to mark project context...');
|
|
1793
|
+
fs.mkdirSync(symphonyDir, { recursive: true });
|
|
1794
|
+
// Create an empty .gitignore just in case
|
|
1795
|
+
fs.writeFileSync(path.join(symphonyDir, '.gitignore'), '*\n');
|
|
1796
|
+
ok('Symphony project marker created (.symphony/)');
|
|
1797
|
+
|
|
1798
|
+
const symReady = checkSymphony({ silent: true });
|
|
1799
|
+
if (!symReady) {
|
|
1800
|
+
dim('Symphony CLI is not installed. Run: npm i -g awkit-symphony');
|
|
1835
1801
|
}
|
|
1836
1802
|
}
|
|
1837
1803
|
|
|
@@ -1847,7 +1813,7 @@ function cmdInit(forceFlag = false) {
|
|
|
1847
1813
|
log('');
|
|
1848
1814
|
log(`${C.cyan}👉 Open ${workspaceName} in VS Code to get started.${C.reset}`);
|
|
1849
1815
|
log(`${C.cyan}👉 Run '/codebase-sync' in AI chat to keep CODEBASE.md updated.${C.reset}`);
|
|
1850
|
-
log(`${C.cyan}👉 Run '
|
|
1816
|
+
log(`${C.cyan}👉 Run 'symphony task list' to manage tasks.${C.reset}`);
|
|
1851
1817
|
log('');
|
|
1852
1818
|
}
|
|
1853
1819
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leejungkiin/awkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Antigravity Workflow Kit. Unified AI agent orchestration system.",
|
|
5
5
|
"main": "bin/awk.js",
|
|
6
6
|
"bin": {
|
|
@@ -38,4 +38,4 @@
|
|
|
38
38
|
"CHANGELOG.md",
|
|
39
39
|
"VERSION"
|
|
40
40
|
]
|
|
41
|
-
}
|
|
41
|
+
}
|
package/skills/CATALOG.md
CHANGED
|
@@ -34,10 +34,18 @@
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Quality & Discipline Skills (Superpowers-Inspired)
|
|
38
|
+
|
|
39
|
+
> Skills ported and adapted from [obra/superpowers](https://github.com/obra/superpowers) framework.
|
|
40
|
+
> Integrated into AWKit with NeuralMemory + Symphony extensions.
|
|
41
|
+
|
|
42
|
+
| # | Skill | Type | Trigger | Priority | Status |
|
|
43
|
+
|---|-------|------|---------|----------|--------|
|
|
44
|
+
| 14 | `verification-gate` | `auto` | Task completion, commit, deploy | 1 | ✅ Active |
|
|
45
|
+
| 15 | `systematic-debugging` | `auto` | `/debug`, error detected, test failures | 2 | ✅ Active |
|
|
46
|
+
| 16 | `code-review` | `auto` | Task completion, before merge | 3 | ✅ Active |
|
|
47
|
+
| 17 | `writing-skills` | `manual` | Creating/modifying skills | — | ✅ Active |
|
|
38
48
|
|
|
39
|
-
> `awk enable-pack superpowers` — 13 structured dev workflow skills ported from Claude Code.
|
|
40
|
-
> See [`skill-packs/superpowers/README.md`](../skill-packs/superpowers/README.md) for full details.
|
|
41
49
|
|
|
42
50
|
---
|
|
43
51
|
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Use when completing tasks, implementing features, or before merging. Dispatch structured code review with severity classification. Auto-triggers after task completion in subagent-driven or single-flow execution.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Review early, review often. Catch issues before they cascade.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Structured review with actionable, severity-classified feedback.
|
|
13
|
+
|
|
14
|
+
## When to Request Review
|
|
15
|
+
|
|
16
|
+
**Mandatory:**
|
|
17
|
+
- After completing each task in execution flow
|
|
18
|
+
- After implementing major feature or fix
|
|
19
|
+
- Before merge to main branch
|
|
20
|
+
- Before deploy to production
|
|
21
|
+
|
|
22
|
+
**Optional but valuable:**
|
|
23
|
+
- When stuck (fresh perspective helps)
|
|
24
|
+
- Before refactoring (baseline check)
|
|
25
|
+
- After fixing complex bug
|
|
26
|
+
|
|
27
|
+
## The Review Process
|
|
28
|
+
|
|
29
|
+
### Step 1: Prepare Context
|
|
30
|
+
|
|
31
|
+
Gather what the reviewer needs:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Get the diff scope
|
|
35
|
+
git diff main..HEAD --stat
|
|
36
|
+
git log main..HEAD --oneline
|
|
37
|
+
|
|
38
|
+
# OR for specific task
|
|
39
|
+
git diff HEAD~1..HEAD --stat
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Step 2: Construct Review Request
|
|
43
|
+
|
|
44
|
+
Every review request needs:
|
|
45
|
+
|
|
46
|
+
| Field | Description | Example |
|
|
47
|
+
|-------|-------------|---------|
|
|
48
|
+
| **WHAT** | What was implemented | "Water reminder notification system" |
|
|
49
|
+
| **SPEC** | What it should do | "Send notification every 2h between 8am-10pm" |
|
|
50
|
+
| **FILES** | Changed files | `WaterReminderManager.swift`, `NotificationService.swift` |
|
|
51
|
+
| **SCOPE** | Review focus | "Logic correctness + thread safety" |
|
|
52
|
+
|
|
53
|
+
### Step 3: Classify Findings
|
|
54
|
+
|
|
55
|
+
| Severity | Action | Example |
|
|
56
|
+
|----------|--------|---------|
|
|
57
|
+
| 🔴 **Critical** | BLOCK — fix immediately | Thread-unsafe shared state, data loss risk |
|
|
58
|
+
| 🟡 **Important** | Fix before proceeding | Missing error handling, incomplete validation |
|
|
59
|
+
| 🟢 **Minor** | Note for later | Naming convention, code style preference |
|
|
60
|
+
| ℹ️ **Suggestion** | Consider but optional | Performance optimization, alternative approach |
|
|
61
|
+
|
|
62
|
+
### Step 4: Act on Feedback
|
|
63
|
+
|
|
64
|
+
1. Fix 🔴 Critical issues IMMEDIATELY
|
|
65
|
+
2. Fix 🟡 Important issues before proceeding to next task
|
|
66
|
+
3. Log 🟢 Minor issues — fix in refactoring pass
|
|
67
|
+
4. Evaluate ℹ️ Suggestions — adopt if clear improvement
|
|
68
|
+
|
|
69
|
+
## Two-Stage Review (Subagent-Driven)
|
|
70
|
+
|
|
71
|
+
For automated execution, run TWO separate review passes:
|
|
72
|
+
|
|
73
|
+
### Stage 1: Spec Compliance Review
|
|
74
|
+
```
|
|
75
|
+
- Does the code implement ALL requirements from the spec/plan?
|
|
76
|
+
- Is anything MISSING from the spec?
|
|
77
|
+
- Is anything EXTRA that wasn't specified (scope creep)?
|
|
78
|
+
- Does behavior match expected output for each requirement?
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Stage 2: Code Quality Review
|
|
82
|
+
```
|
|
83
|
+
- Is the code clean, readable, and well-structured?
|
|
84
|
+
- Are there any thread safety issues?
|
|
85
|
+
- Is error handling comprehensive?
|
|
86
|
+
- Are there performance concerns?
|
|
87
|
+
- Does it follow project coding conventions?
|
|
88
|
+
- Are there any security vulnerabilities?
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Order matters:** Spec compliance FIRST, then code quality. No point reviewing quality of wrong code.
|
|
92
|
+
|
|
93
|
+
## Self-Review Checklist (Before Requesting External Review)
|
|
94
|
+
|
|
95
|
+
Before asking for review, verify yourself:
|
|
96
|
+
|
|
97
|
+
- [ ] All requirements from plan/spec addressed
|
|
98
|
+
- [ ] No TODO/FIXME/HACK left unresolved
|
|
99
|
+
- [ ] Error handling for all failure paths
|
|
100
|
+
- [ ] No hardcoded values that should be configurable
|
|
101
|
+
- [ ] Thread safety for shared state
|
|
102
|
+
- [ ] Localization for user-facing strings
|
|
103
|
+
- [ ] No print/debugPrint left in production code
|
|
104
|
+
- [ ] File sizes < 500 lines
|
|
105
|
+
|
|
106
|
+
## Integration
|
|
107
|
+
|
|
108
|
+
**Used by:**
|
|
109
|
+
- `single-flow-task-execution` — Review after each task
|
|
110
|
+
- `symphony-enforcer` — Review before `symphony_complete_task`
|
|
111
|
+
|
|
112
|
+
**Related skills:**
|
|
113
|
+
- `verification-gate` — Run tests BEFORE requesting review
|
|
114
|
+
- `systematic-debugging` — If review reveals bugs
|
|
115
|
+
|
|
116
|
+
## Anti-Rationalization Table
|
|
117
|
+
|
|
118
|
+
| Excuse | Reality |
|
|
119
|
+
|--------|---------|
|
|
120
|
+
| "It's a small change" | Small changes cause big bugs |
|
|
121
|
+
| "Tests pass so it's correct" | Tests ≠ requirements. Review catches logic gaps |
|
|
122
|
+
| "I'm confident in this code" | Confidence ≠ correctness |
|
|
123
|
+
| "No time for review" | 5 min review saves 2 hours debugging |
|
|
124
|
+
| "I'll review it later" | Later never comes. Review now |
|
|
125
|
+
| "Only I understand this code" | That's exactly why someone else should review |
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-conductor
|
|
3
|
+
description: >-
|
|
4
|
+
Three-Agent Flow — Antigravity proactively invokes Codex CLI (headless)
|
|
5
|
+
for debugging, code review, logic verification, and plan auditing.
|
|
6
|
+
Codex is READ-ONLY: it inspects and reports to .md files, never edits code.
|
|
7
|
+
metadata:
|
|
8
|
+
stage: core
|
|
9
|
+
version: "1.0"
|
|
10
|
+
requires: codex (npm i -g @openai/codex)
|
|
11
|
+
tags: [conductor, codex, debug, review, logic, verification, delegation]
|
|
12
|
+
agent: Inspector
|
|
13
|
+
trigger: conditional
|
|
14
|
+
invocation-type: auto
|
|
15
|
+
priority: 5
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# 🔍 Codex Conductor Skill
|
|
19
|
+
|
|
20
|
+
> **Purpose:** Antigravity gọi Codex CLI qua terminal khi cần rà soát logic, debug, hoặc review code chuyên sâu.
|
|
21
|
+
> **Key Benefit:** Codex cực mạnh rule compliance + logic analysis. Output = báo cáo `.md`, KHÔNG sửa code.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## ⚠️ Core Principle
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Antigravity (IDE) = Executor — code, implement, create
|
|
29
|
+
Gemini CLI = Strategist — analysis, architecture, planning
|
|
30
|
+
Codex CLI = Inspector — debug, review, verify, test
|
|
31
|
+
|
|
32
|
+
┌──────────────────────────────────────────────┐
|
|
33
|
+
│ Codex CHỈ RÀ SOÁT + TẠO BÁO CÁO (.md) │
|
|
34
|
+
│ TUYỆT ĐỐI KHÔNG ĐƯỢC SỬA CODE │
|
|
35
|
+
└──────────────────────────────────────────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🔧 Prerequisites
|
|
41
|
+
|
|
42
|
+
Trước khi gọi Codex CLI, kiểm tra:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Check if codex is installed
|
|
46
|
+
which codex || command -v codex
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
if_not_installed:
|
|
51
|
+
option_1: "npm i -g @openai/codex"
|
|
52
|
+
option_2: Ask user to install manually
|
|
53
|
+
message: "⚠️ Codex CLI chưa cài. Chạy: npm i -g @openai/codex"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🎯 Trigger Conditions
|
|
59
|
+
|
|
60
|
+
Kích hoạt khi Antigravity nhận diện task cần thế mạnh Codex:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
auto_trigger:
|
|
64
|
+
high_confidence:
|
|
65
|
+
- Bug report from user (crash, unexpected behavior)
|
|
66
|
+
- Pre-commit code review (>3 files changed)
|
|
67
|
+
- Logic verification (race conditions, edge cases)
|
|
68
|
+
- Implementation plan review (find holes in plan)
|
|
69
|
+
- Refactor verification (ensure no regression)
|
|
70
|
+
|
|
71
|
+
medium_confidence (confirm before invoking):
|
|
72
|
+
- Test case generation for new feature
|
|
73
|
+
- Security audit
|
|
74
|
+
- Performance bottleneck analysis
|
|
75
|
+
|
|
76
|
+
never_trigger:
|
|
77
|
+
- Simple questions / explanations
|
|
78
|
+
- UI-only changes (styling, layout)
|
|
79
|
+
- Documentation edits
|
|
80
|
+
- Tasks Antigravity can handle alone easily
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🔧 CLI Invocation Pattern
|
|
86
|
+
|
|
87
|
+
### Mode 1: Quick Analysis (read + stream response)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
cd <PROJECT_ROOT> && timeout 120 codex \
|
|
91
|
+
"<PROMPT>. DO NOT edit any files. Output your analysis as text." \
|
|
92
|
+
--approval-mode suggest \
|
|
93
|
+
-q 2>/dev/null
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
| Flag | Purpose |
|
|
97
|
+
|------|---------|
|
|
98
|
+
| `"prompt"` | Single-prompt mode — reads cwd, streams response, exits |
|
|
99
|
+
| `--approval-mode suggest` | Read-only: can browse files, won't make changes |
|
|
100
|
+
| `-q` | Quiet mode — no TUI, output to stdout |
|
|
101
|
+
|
|
102
|
+
### Mode 2: Deep Inspection (exec with JSON output)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cd <PROJECT_ROOT> && timeout 180 codex exec \
|
|
106
|
+
"<PROMPT>. DO NOT edit any files. Output your findings as structured text." \
|
|
107
|
+
--json 2>/dev/null
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
| Flag | Purpose |
|
|
111
|
+
|------|---------|
|
|
112
|
+
| `exec` | Non-interactive scripting mode |
|
|
113
|
+
| `--json` | Structured JSON output for parsing |
|
|
114
|
+
|
|
115
|
+
### Safety Rules
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
safety:
|
|
119
|
+
- Codex TUYỆT ĐỐI KHÔNG ĐƯỢC sửa code. CHỈ đọc + báo cáo.
|
|
120
|
+
- ALWAYS use --approval-mode suggest (read-only mode).
|
|
121
|
+
- ALWAYS inject "DO NOT edit any files" in every prompt.
|
|
122
|
+
- Timeout: 120s for quick analysis, 180s for deep inspection.
|
|
123
|
+
- If CLI fails → gracefully fallback to Antigravity-only mode.
|
|
124
|
+
- NEVER pass secrets/tokens in prompt.
|
|
125
|
+
- Working directory: ALWAYS set to project root.
|
|
126
|
+
- Output: ALWAYS save to .md report file.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 📋 Use Cases & Prompt Templates
|
|
132
|
+
|
|
133
|
+
### 1. Bug Root Cause Analysis
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
codex "A bug was reported: <BUG_DESCRIPTION>. \
|
|
137
|
+
Analyze the codebase to find the root cause. \
|
|
138
|
+
List: (1) most likely root cause with file:line, \
|
|
139
|
+
(2) contributing factors, (3) suggested fix approach. \
|
|
140
|
+
DO NOT edit any files." \
|
|
141
|
+
--approval-mode suggest -q
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**When:** User reports a bug, crash, or unexpected behavior.
|
|
145
|
+
**Report to:** `codex-reports/bug-analysis-<date>.md`
|
|
146
|
+
|
|
147
|
+
### 2. Pre-Commit Code Review
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
codex "Review the uncommitted changes in this repo. \
|
|
151
|
+
Check for: bugs, logic errors, edge cases, thread safety, \
|
|
152
|
+
security issues, performance problems, naming inconsistencies. \
|
|
153
|
+
Rank issues by severity (critical/warning/info). \
|
|
154
|
+
DO NOT edit any files." \
|
|
155
|
+
--approval-mode suggest -q
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**When:** Before committing changes across >3 files.
|
|
159
|
+
**Report to:** `codex-reports/review-<date>.md`
|
|
160
|
+
|
|
161
|
+
### 3. Logic & Edge Case Analysis
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
codex "Analyze <FILE_OR_MODULE> for logic correctness. \
|
|
165
|
+
Focus on: edge cases (null, empty, boundary), race conditions, \
|
|
166
|
+
error handling gaps, unreachable code, off-by-one errors. \
|
|
167
|
+
List each issue with file:line and severity. \
|
|
168
|
+
DO NOT edit any files." \
|
|
169
|
+
--approval-mode suggest -q
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**When:** Complex logic that needs verification.
|
|
173
|
+
**Report to:** `codex-reports/logic-analysis-<date>.md`
|
|
174
|
+
|
|
175
|
+
### 4. Test Case Generation
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
codex "Analyze <FILE_OR_MODULE> and generate a comprehensive \
|
|
179
|
+
list of test cases. Include: happy path, edge cases, error cases, \
|
|
180
|
+
boundary values, concurrent scenarios. Format as markdown table. \
|
|
181
|
+
DO NOT edit any files." \
|
|
182
|
+
--approval-mode suggest -q
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**When:** New feature needs test coverage planning.
|
|
186
|
+
**Report to:** `codex-reports/test-cases-<date>.md`
|
|
187
|
+
|
|
188
|
+
### 5. Implementation Plan Review
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
codex "Review this implementation plan: <PLAN_CONTENT>. \
|
|
192
|
+
Find: logic holes, missing error handling, security risks, \
|
|
193
|
+
race conditions, scalability issues, missing edge cases. \
|
|
194
|
+
Rate each issue by severity. \
|
|
195
|
+
DO NOT edit any files." \
|
|
196
|
+
--approval-mode suggest -q
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**When:** After Antigravity creates an implementation plan.
|
|
200
|
+
**Report to:** `codex-reports/plan-review-<date>.md`
|
|
201
|
+
|
|
202
|
+
### 6. Refactor Verification
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
codex "Compare the recent changes in this repo against the \
|
|
206
|
+
original code. Verify: (1) no behavioral regression, \
|
|
207
|
+
(2) all original edge cases still handled, \
|
|
208
|
+
(3) no new bugs introduced. List any regressions found. \
|
|
209
|
+
DO NOT edit any files." \
|
|
210
|
+
--approval-mode suggest -q
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**When:** After refactoring to ensure no regression.
|
|
214
|
+
**Report to:** `codex-reports/refactor-verify-<date>.md`
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 🔄 Integration Flow
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
1. Antigravity detects trigger condition
|
|
222
|
+
2. Check Codex CLI: which codex || prompt install
|
|
223
|
+
3. Thông báo user: "🔍 Đang gọi Codex CLI để [mục đích]..."
|
|
224
|
+
4. Build prompt with project context
|
|
225
|
+
5. Run: run_command("cd <ROOT> && timeout 120 codex '<prompt>' --approval-mode suggest -q")
|
|
226
|
+
6. Capture output
|
|
227
|
+
7. Save report to codex-reports/<type>-<date>.md
|
|
228
|
+
8. Summarize key findings for user
|
|
229
|
+
9. Act on findings (Antigravity executes fixes if needed)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Output Handling
|
|
233
|
+
|
|
234
|
+
```yaml
|
|
235
|
+
on_success:
|
|
236
|
+
- Parse Codex output (text or JSON)
|
|
237
|
+
- Save full report to codex-reports/<type>-<date>.md
|
|
238
|
+
- Extract key findings + severity
|
|
239
|
+
- Present summary to user
|
|
240
|
+
- If critical issues found → suggest fixes
|
|
241
|
+
|
|
242
|
+
on_timeout:
|
|
243
|
+
- Log: "⏳ Codex analysis timed out (>120s), proceeding with Antigravity"
|
|
244
|
+
- Fall back to Antigravity-only analysis
|
|
245
|
+
|
|
246
|
+
on_error:
|
|
247
|
+
- Log: "⚠️ Codex CLI invocation failed"
|
|
248
|
+
- Check: "codex --version" → suggest install if missing
|
|
249
|
+
- Fall back gracefully — CLI is enhancement, not dependency
|
|
250
|
+
|
|
251
|
+
on_not_installed:
|
|
252
|
+
- Ask user: "Codex CLI chưa cài. Cài bằng: npm i -g @openai/codex?"
|
|
253
|
+
- If yes → run install → retry
|
|
254
|
+
- If no → fall back to Antigravity-only
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📁 Report Output Structure
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
<project_root>/
|
|
263
|
+
└── codex-reports/ # Gitignored recommended
|
|
264
|
+
├── bug-analysis-2026-03-21.md
|
|
265
|
+
├── review-2026-03-21.md
|
|
266
|
+
├── logic-analysis-2026-03-21.md
|
|
267
|
+
├── test-cases-2026-03-21.md
|
|
268
|
+
├── plan-review-2026-03-21.md
|
|
269
|
+
└── refactor-verify-2026-03-21.md
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 🚫 Anti-Patterns
|
|
275
|
+
|
|
276
|
+
```yaml
|
|
277
|
+
never_do:
|
|
278
|
+
- Let Codex edit source code (EVER)
|
|
279
|
+
- Use --approval-mode auto or full-access (ALWAYS use suggest)
|
|
280
|
+
- Pass sensitive data (API keys, tokens) in prompts
|
|
281
|
+
- Block on CLI response indefinitely (always use timeout)
|
|
282
|
+
- Call CLI more than 3 times per task (diminishing returns)
|
|
283
|
+
- Ignore CLI output — if you called it, use the result
|
|
284
|
+
- Call Codex for tasks Antigravity handles well alone
|
|
285
|
+
|
|
286
|
+
always_do:
|
|
287
|
+
- Mention to user: "🔍 Đang gọi Codex CLI [mục đích]..."
|
|
288
|
+
- Include "DO NOT edit any files" in EVERY prompt
|
|
289
|
+
- Use --approval-mode suggest (read-only)
|
|
290
|
+
- Save reports to codex-reports/ directory
|
|
291
|
+
- Summarize findings before acting on them
|
|
292
|
+
- Fall back gracefully if CLI unavailable
|
|
293
|
+
- Check codex installation before first use
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🤝 Three-Agent Collaboration
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
┌─────────────────────────────────────────────────────────┐
|
|
302
|
+
│ User Request │
|
|
303
|
+
└─────────────┬───────────────────────────────────────────┘
|
|
304
|
+
│
|
|
305
|
+
▼
|
|
306
|
+
┌─────────────────┐
|
|
307
|
+
│ Antigravity │ ← Primary: plan, code, implement
|
|
308
|
+
│ (IDE Agent) │
|
|
309
|
+
└───┬─────────┬───┘
|
|
310
|
+
│ │
|
|
311
|
+
Strategy? Debug/Review?
|
|
312
|
+
│ │
|
|
313
|
+
▼ ▼
|
|
314
|
+
┌──────────┐ ┌──────────┐
|
|
315
|
+
│ Gemini │ │ Codex │
|
|
316
|
+
│ CLI │ │ CLI │
|
|
317
|
+
│ ────────── │ ────────── │
|
|
318
|
+
│ Architect │ │ Inspector│
|
|
319
|
+
│ .md only │ │ .md only │
|
|
320
|
+
└──────────┘ └──────────┘
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## 🧩 Skill Relationships
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
Uses: run_command (to invoke codex CLI)
|
|
329
|
+
Enhances: /debug, /code, /refactor, /plan workflows
|
|
330
|
+
Saves to: codex-reports/*.md
|
|
331
|
+
Parallel: gemini-conductor (different role, can coexist)
|
|
332
|
+
Independent of: NeuralMemory (CLI has its own context)
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
*codex-conductor v1.0 — Three-Agent Flow Inspector for Antigravity*
|
|
@@ -181,9 +181,20 @@ Signal 4: Verification pass (tests OK, build OK)
|
|
|
181
181
|
|
|
182
182
|
**Action:**
|
|
183
183
|
```
|
|
184
|
+
0. ⚡ VERIFICATION GATE (BẮT BUỘC — Iron Law):
|
|
185
|
+
- IDENTIFY: What command proves this task is done?
|
|
186
|
+
- RUN: Execute verification (build, test, lint)
|
|
187
|
+
- READ: Full output, check exit code
|
|
188
|
+
- VERIFY: Does output confirm completion?
|
|
189
|
+
- If NO → FIX trước, KHÔNG complete task
|
|
190
|
+
- If YES → Proceed with evidence
|
|
191
|
+
⛔ Skip verification = VI PHẠM (xem verification-gate skill)
|
|
192
|
+
|
|
184
193
|
1. symphony_complete_task(
|
|
185
194
|
task_id=current_task,
|
|
186
|
-
summary="mô tả ngắn
|
|
195
|
+
summary="mô tả ngắn + VERIFICATION EVIDENCE"
|
|
196
|
+
// ✅ "Implemented X. Build: ✅ exit 0. Tests: ✅ 47/47. Lint: ✅ 0 errors."
|
|
197
|
+
// ❌ "Implemented X" (không evidence)
|
|
187
198
|
)
|
|
188
199
|
2. Hiển thị: "✅ SYM #sym-XYZ — Done"
|
|
189
200
|
3. → TRIGGER TP2.5 (Atomic Git Commit)
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: Use for ANY technical issue - bugs, test failures, build errors, crashes. Enforces 4-phase root cause process before any fix attempts. Auto-triggers on /debug, error detection, test failures.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Systematic Debugging
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
11
|
+
|
|
12
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
13
|
+
|
|
14
|
+
## The Iron Law
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If you haven't completed Phase 1, you CANNOT propose fixes.
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
Use for ANY technical issue:
|
|
25
|
+
- Test failures
|
|
26
|
+
- Runtime crashes / EXC_BAD_ACCESS / ANR
|
|
27
|
+
- Unexpected behavior
|
|
28
|
+
- Performance problems
|
|
29
|
+
- Build failures (Xcode, Gradle, npm)
|
|
30
|
+
- Integration issues (API, SDK, Firebase)
|
|
31
|
+
|
|
32
|
+
**Use this ESPECIALLY when:**
|
|
33
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
34
|
+
- "Just one quick fix" seems obvious
|
|
35
|
+
- You've already tried multiple fixes
|
|
36
|
+
- Previous fix didn't work
|
|
37
|
+
- You don't fully understand the issue
|
|
38
|
+
|
|
39
|
+
## The Four Phases
|
|
40
|
+
|
|
41
|
+
You MUST complete each phase before proceeding to the next.
|
|
42
|
+
|
|
43
|
+
### Phase 1: Root Cause Investigation (BEFORE ANY FIX)
|
|
44
|
+
|
|
45
|
+
1. **Read Error Messages Carefully**
|
|
46
|
+
- Don't skip past errors or warnings
|
|
47
|
+
- Read stack traces COMPLETELY — they often contain the exact answer
|
|
48
|
+
- Note line numbers, file paths, error codes
|
|
49
|
+
- For iOS: read the full crash log, not just the top frame
|
|
50
|
+
- For Android: read logcat with proper filters
|
|
51
|
+
|
|
52
|
+
2. **Reproduce Consistently**
|
|
53
|
+
- Can you trigger it reliably? What are the exact steps?
|
|
54
|
+
- If not reproducible → gather more data, DON'T guess
|
|
55
|
+
- For intermittent: add diagnostic logging at component boundaries
|
|
56
|
+
|
|
57
|
+
3. **Check Recent Changes**
|
|
58
|
+
- `git diff` — what changed?
|
|
59
|
+
- Recent commits, new dependencies, config changes
|
|
60
|
+
- Environmental differences (device, OS version, network)
|
|
61
|
+
|
|
62
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
63
|
+
```
|
|
64
|
+
For EACH component boundary:
|
|
65
|
+
- Log what data enters component
|
|
66
|
+
- Log what data exits component
|
|
67
|
+
- Verify environment/config propagation
|
|
68
|
+
- Check state at each layer
|
|
69
|
+
|
|
70
|
+
Run once to gather evidence showing WHERE it breaks
|
|
71
|
+
THEN analyze evidence to identify failing component
|
|
72
|
+
THEN investigate that specific component
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
5. **Trace Data Flow**
|
|
76
|
+
- Where does the bad value originate?
|
|
77
|
+
- What called this with the bad value?
|
|
78
|
+
- Keep tracing UP until you find the source
|
|
79
|
+
- **Fix at source, not at symptom**
|
|
80
|
+
|
|
81
|
+
### Phase 2: Pattern Analysis
|
|
82
|
+
|
|
83
|
+
1. **Find Working Examples** — Locate similar working code in same codebase
|
|
84
|
+
2. **Compare Against References** — Read reference implementation COMPLETELY (don't skim)
|
|
85
|
+
3. **Identify Differences** — List EVERY difference, however small
|
|
86
|
+
4. **Understand Dependencies** — What components, settings, config does this need?
|
|
87
|
+
|
|
88
|
+
### Phase 3: Hypothesis & Testing
|
|
89
|
+
|
|
90
|
+
1. **Form Single Hypothesis** — "I think X is the root cause because Y"
|
|
91
|
+
2. **Test Minimally** — SMALLEST possible change. One variable at a time
|
|
92
|
+
3. **Verify Before Continuing** — Worked? → Phase 4. Didn't? → NEW hypothesis
|
|
93
|
+
4. **When You Don't Know** — Say "I don't understand X". Don't pretend. Research more
|
|
94
|
+
|
|
95
|
+
### Phase 4: Implementation
|
|
96
|
+
|
|
97
|
+
1. **Create Failing Test Case** — Simplest possible reproduction. MUST have before fixing
|
|
98
|
+
2. **Implement Single Fix** — ONE change at a time. No "while I'm here" improvements
|
|
99
|
+
3. **Verify Fix** — Test passes? No other tests broken? Issue actually resolved?
|
|
100
|
+
|
|
101
|
+
## The 3-Fix Rule
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
If 3+ fixes have FAILED → STOP
|
|
105
|
+
|
|
106
|
+
This is NOT a failed hypothesis.
|
|
107
|
+
This is a WRONG ARCHITECTURE.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**After 3 failed fixes:**
|
|
111
|
+
- Is this pattern fundamentally sound?
|
|
112
|
+
- Are we sticking with it through sheer inertia?
|
|
113
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
114
|
+
- **DISCUSS with user before attempting more fixes**
|
|
115
|
+
|
|
116
|
+
**Pattern indicating architectural problem:**
|
|
117
|
+
- Each fix reveals new shared state/coupling
|
|
118
|
+
- Fixes require "massive refactoring" to implement
|
|
119
|
+
- Each fix creates new symptoms elsewhere
|
|
120
|
+
|
|
121
|
+
## Red Flags — STOP and Return to Phase 1
|
|
122
|
+
|
|
123
|
+
If you catch yourself thinking:
|
|
124
|
+
- "Quick fix for now, investigate later"
|
|
125
|
+
- "Just try changing X and see if it works"
|
|
126
|
+
- "It's probably X, let me fix that"
|
|
127
|
+
- "I don't fully understand but this might work"
|
|
128
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
129
|
+
- Proposing solutions before tracing data flow
|
|
130
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
131
|
+
- **Each fix reveals new problem in different place**
|
|
132
|
+
|
|
133
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
134
|
+
|
|
135
|
+
## Anti-Rationalization Table
|
|
136
|
+
|
|
137
|
+
| Excuse | Reality |
|
|
138
|
+
|--------|---------|
|
|
139
|
+
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs |
|
|
140
|
+
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check |
|
|
141
|
+
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start |
|
|
142
|
+
| "I'll write test after confirming fix" | Untested fixes don't stick. Test first proves it |
|
|
143
|
+
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs |
|
|
144
|
+
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause |
|
|
145
|
+
| "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Question pattern |
|
|
146
|
+
| "Reference too long, I'll adapt" | Partial understanding guarantees bugs. Read completely |
|
|
147
|
+
|
|
148
|
+
## Quick Reference
|
|
149
|
+
|
|
150
|
+
| Phase | Key Activities | Success Criteria |
|
|
151
|
+
|-------|---------------|------------------|
|
|
152
|
+
| **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
|
|
153
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
154
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
155
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
156
|
+
|
|
157
|
+
## NeuralMemory Integration
|
|
158
|
+
|
|
159
|
+
After fixing a bug:
|
|
160
|
+
1. `nmem_remember` the root cause, fix, and pattern — tag with projectId
|
|
161
|
+
2. Before debugging NEW bugs: `nmem_recall` for similar past issues
|
|
162
|
+
3. Saves hours on recurring patterns
|
|
163
|
+
|
|
164
|
+
## Integration
|
|
165
|
+
|
|
166
|
+
**Related skills:**
|
|
167
|
+
- **verification-gate** — Verify fix worked before claiming success
|
|
168
|
+
- **single-flow-task-execution** — For structured task execution
|
|
169
|
+
- **symphony-enforcer** — Report debug progress to Symphony
|
|
170
|
+
|
|
171
|
+
**Related workflows:**
|
|
172
|
+
- `/debug` — Primary trigger workflow
|
|
173
|
+
- `/bug-hunter` — Automated bug hunting
|
|
174
|
+
- `/hotfix` — Production emergency (still follows 4-phase!)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-gate
|
|
3
|
+
description: Use BEFORE claiming any work is complete, fixed, or passing. Requires running verification commands and confirming output before making success claims. Evidence before assertions, always. Auto-triggers on task completion, commit, deploy, or any positive status claim.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verification Before Completion
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Evidence before claims, always.
|
|
13
|
+
|
|
14
|
+
## The Iron Law
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
21
|
+
|
|
22
|
+
## The Gate Function
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
BEFORE claiming any status or expressing satisfaction:
|
|
26
|
+
|
|
27
|
+
1. IDENTIFY: What command proves this claim?
|
|
28
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
29
|
+
3. READ: Full output, check exit code, count failures
|
|
30
|
+
4. VERIFY: Does output confirm the claim?
|
|
31
|
+
- If NO: State actual status with evidence
|
|
32
|
+
- If YES: State claim WITH evidence
|
|
33
|
+
5. ONLY THEN: Make the claim
|
|
34
|
+
|
|
35
|
+
Skip any step = lying, not verifying
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## When to Apply
|
|
39
|
+
|
|
40
|
+
**ALWAYS before:**
|
|
41
|
+
- ANY variation of success/completion claims
|
|
42
|
+
- ANY expression of satisfaction ("Done!", "Fixed!", "Works!")
|
|
43
|
+
- Committing, PR creation, task completion
|
|
44
|
+
- `symphony_complete_task` calls
|
|
45
|
+
- Moving to next task
|
|
46
|
+
- Deploying or pushing code
|
|
47
|
+
|
|
48
|
+
## Verification Requirements by Claim Type
|
|
49
|
+
|
|
50
|
+
| Claim | Requires | NOT Sufficient |
|
|
51
|
+
|-------|----------|----------------|
|
|
52
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
53
|
+
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
54
|
+
| Build succeeds | Build command: exit 0 | Linter passing, looks good |
|
|
55
|
+
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
56
|
+
| Feature works | Demo/run showing behavior | Code written, assumed works |
|
|
57
|
+
| Requirements met | Line-by-line checklist | Tests passing |
|
|
58
|
+
| Deploy succeeded | Health check: 200 OK | Deploy command completed |
|
|
59
|
+
|
|
60
|
+
## Red Flags — STOP
|
|
61
|
+
|
|
62
|
+
If you catch yourself thinking any of these, STOP and run verification:
|
|
63
|
+
|
|
64
|
+
- Using "should", "probably", "seems to", "looks correct"
|
|
65
|
+
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!")
|
|
66
|
+
- About to commit/push without verification
|
|
67
|
+
- Relying on partial verification
|
|
68
|
+
- Thinking "just this once I can skip"
|
|
69
|
+
- Tired and wanting work to be over
|
|
70
|
+
- **ANY wording implying success without having run verification**
|
|
71
|
+
|
|
72
|
+
## Anti-Rationalization Table
|
|
73
|
+
|
|
74
|
+
| Excuse | Reality |
|
|
75
|
+
|--------|---------|
|
|
76
|
+
| "Should work now" | RUN the verification |
|
|
77
|
+
| "I'm confident" | Confidence ≠ evidence |
|
|
78
|
+
| "Just this once" | No exceptions |
|
|
79
|
+
| "Linter passed" | Linter ≠ compiler ≠ runtime |
|
|
80
|
+
| "I'm tired" | Exhaustion ≠ excuse |
|
|
81
|
+
| "Partial check is enough" | Partial proves nothing |
|
|
82
|
+
| "Build passed so tests pass" | Build ≠ tests |
|
|
83
|
+
| "I just changed one line" | One line can break everything |
|
|
84
|
+
| "It's a trivial change" | Trivial changes have the sneakiest bugs |
|
|
85
|
+
|
|
86
|
+
## Key Patterns
|
|
87
|
+
|
|
88
|
+
**Tests:**
|
|
89
|
+
```
|
|
90
|
+
✅ [Run test command] → [See: 34/34 pass] → "All tests pass"
|
|
91
|
+
❌ "Should pass now" / "Looks correct"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Build:**
|
|
95
|
+
```
|
|
96
|
+
✅ [Run build] → [See: BUILD SUCCEEDED] → "Build passes"
|
|
97
|
+
❌ "Linter passed so build is fine"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Bug Fix:**
|
|
101
|
+
```
|
|
102
|
+
✅ Write regression test → Run (FAIL) → Fix → Run (PASS) → "Bug is fixed"
|
|
103
|
+
❌ "I've changed the code, bug should be fixed"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Requirements:**
|
|
107
|
+
```
|
|
108
|
+
✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
|
|
109
|
+
❌ "Tests pass, so requirements are met"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Symphony Integration
|
|
113
|
+
|
|
114
|
+
When calling `symphony_complete_task`:
|
|
115
|
+
1. Run ALL relevant verification commands FIRST
|
|
116
|
+
2. Include verification evidence in the `summary` parameter
|
|
117
|
+
3. Include `files_changed` list with ACTUAL changed files
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
❌ symphony_complete_task(summary="Implemented feature X")
|
|
121
|
+
✅ symphony_complete_task(summary="Implemented feature X. Build: ✅ (exit 0). Tests: ✅ 47/47 pass. Lint: ✅ 0 errors.")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## The Bottom Line
|
|
125
|
+
|
|
126
|
+
**No shortcuts for verification.**
|
|
127
|
+
|
|
128
|
+
Run the command. Read the output. THEN claim the result.
|
|
129
|
+
|
|
130
|
+
This is non-negotiable.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-skills
|
|
3
|
+
description: Use when creating or modifying AWKit skills and workflows. Applies TDD methodology to process documentation. Ensures skills are testable, anti-rationalization-proof, and follow consistent structure.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Skills
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Writing skills IS Test-Driven Development applied to process documentation.
|
|
11
|
+
|
|
12
|
+
**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
|
|
13
|
+
|
|
14
|
+
## What is a Skill?
|
|
15
|
+
|
|
16
|
+
A **skill** is a reference guide for proven techniques, patterns, or tools.
|
|
17
|
+
|
|
18
|
+
**Skills ARE:** Reusable techniques, patterns, tools, reference guides
|
|
19
|
+
**Skills are NOT:** Narratives about how you solved a problem once
|
|
20
|
+
|
|
21
|
+
## Standard Skill Structure
|
|
22
|
+
|
|
23
|
+
Every AWKit skill MUST follow this structure:
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
name: skill-name
|
|
28
|
+
description: When to use + auto-trigger description (for CATALOG.md matching)
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Skill Title
|
|
32
|
+
|
|
33
|
+
## Overview (1-2 sentences — what + why)
|
|
34
|
+
## The Iron Law (core rule, no exceptions — for discipline skills)
|
|
35
|
+
## When to Use / When NOT to Use
|
|
36
|
+
## The Process (step by step)
|
|
37
|
+
## Red Flags — STOP (catch rationalization)
|
|
38
|
+
## Anti-Rationalization Table (excuse → reality)
|
|
39
|
+
## Integration (related skills + workflows)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Required sections:** Overview, When to Use, The Process
|
|
43
|
+
**Recommended for discipline skills:** Iron Law, Red Flags, Anti-Rationalization Table
|
|
44
|
+
|
|
45
|
+
## When to Create a Skill
|
|
46
|
+
|
|
47
|
+
**Create when:**
|
|
48
|
+
- Technique wasn't intuitively obvious
|
|
49
|
+
- You'd reference this again across projects
|
|
50
|
+
- Pattern applies broadly (not project-specific)
|
|
51
|
+
- An agent repeatedly makes the same mistake
|
|
52
|
+
|
|
53
|
+
**Don't create for:**
|
|
54
|
+
- One-off solutions
|
|
55
|
+
- Standard practices well-documented elsewhere
|
|
56
|
+
- Project-specific conventions (put in GEMINI.md or docs/specs/)
|
|
57
|
+
|
|
58
|
+
## Skill Types
|
|
59
|
+
|
|
60
|
+
### Rigid Skills (Follow Exactly)
|
|
61
|
+
- `verification-gate` — No shortcuts for verification
|
|
62
|
+
- `systematic-debugging` — 4-phase process mandatory
|
|
63
|
+
- TDD enforcement — RED-GREEN-REFACTOR cycle
|
|
64
|
+
|
|
65
|
+
### Flexible Skills (Adapt Principles)
|
|
66
|
+
- `brainstorm-agent` — Adapt questions to context
|
|
67
|
+
- `ios-engineer` — Apply patterns per project needs
|
|
68
|
+
|
|
69
|
+
**The skill itself tells you which type it is.**
|
|
70
|
+
|
|
71
|
+
## Key Writing Principles
|
|
72
|
+
|
|
73
|
+
### 1. Token Efficiency (Critical)
|
|
74
|
+
- Every token competes for agent context
|
|
75
|
+
- Use tables over paragraphs for rules
|
|
76
|
+
- Use bullet points over prose
|
|
77
|
+
- Eliminate redundancy ruthlessly
|
|
78
|
+
|
|
79
|
+
### 2. Bulletproofing Against Rationalization
|
|
80
|
+
- Agents are smart and WILL find loopholes under pressure
|
|
81
|
+
- Close every loophole explicitly
|
|
82
|
+
- Build rationalization table with common excuses
|
|
83
|
+
- Create Red Flags list
|
|
84
|
+
|
|
85
|
+
### 3. Cross-Referencing
|
|
86
|
+
- Link related skills: `**Related:** verification-gate, systematic-debugging`
|
|
87
|
+
- Note integration points: "Used by single-flow-task-execution"
|
|
88
|
+
- Reference workflows: `/debug`, `/code`, `/deploy`
|
|
89
|
+
|
|
90
|
+
## Checklist: Before Publishing Skill
|
|
91
|
+
|
|
92
|
+
- [ ] SKILL.md follows standard structure
|
|
93
|
+
- [ ] `name` and `description` in frontmatter
|
|
94
|
+
- [ ] When to Use is clear and specific
|
|
95
|
+
- [ ] Process steps are numbered and unambiguous
|
|
96
|
+
- [ ] Anti-rationalization table covers common excuses
|
|
97
|
+
- [ ] Integration section lists related skills/workflows
|
|
98
|
+
- [ ] File < 500 lines
|
|
99
|
+
- [ ] No narrative/story sections — only reference content
|
|
100
|
+
- [ ] Updated CATALOG.md entry
|
|
101
|
+
|
|
102
|
+
## Integration
|
|
103
|
+
|
|
104
|
+
**Related:**
|
|
105
|
+
- `awf-version-tracker` — Auto-snapshot skill changes
|
|
106
|
+
- CATALOG.md — Skill registry
|
|
107
|
+
|
|
108
|
+
**Workflows:**
|
|
109
|
+
- `/skill-health` — Check skill system health
|
|
110
|
+
- `/skill-rollback` — Rollback broken skill changes
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🔍 Codex Conductor — Gọi Codex CLI rà soát code, debug, review logic, và verify refactor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /conductor-codex — Three-Agent Inspector Workflow
|
|
6
|
+
|
|
7
|
+
> Antigravity gọi Codex CLI (headless, read-only) khi cần rà soát chuyên sâu.
|
|
8
|
+
> Codex CHỈ ĐỌC + TẠO BÁO CÁO `.md`. KHÔNG BAO GIỜ sửa code.
|
|
9
|
+
|
|
10
|
+
// turbo-all
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
1. Kiểm tra Codex CLI:
|
|
17
|
+
```bash
|
|
18
|
+
which codex || echo "NOT_INSTALLED"
|
|
19
|
+
```
|
|
20
|
+
2. Nếu chưa cài → đề xuất cài:
|
|
21
|
+
```bash
|
|
22
|
+
npm i -g @openai/codex
|
|
23
|
+
```
|
|
24
|
+
3. Tạo thư mục report nếu chưa có:
|
|
25
|
+
```bash
|
|
26
|
+
mkdir -p codex-reports
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Sub-commands
|
|
32
|
+
|
|
33
|
+
### `/conductor-codex:debug` — Phân tích root cause bug
|
|
34
|
+
|
|
35
|
+
1. User mô tả bug (crash, lỗi logic, unexpected behavior)
|
|
36
|
+
2. Thông báo: "🔍 Đang gọi Codex CLI phân tích bug..."
|
|
37
|
+
3. Gọi CLI:
|
|
38
|
+
```bash
|
|
39
|
+
cd <PROJECT_ROOT> && timeout 120 codex "A bug was reported: <BUG_DESCRIPTION>. Analyze the codebase to find the root cause. List: (1) most likely root cause with file:line, (2) contributing factors, (3) suggested fix approach. DO NOT edit any files." --approval-mode suggest -q 2>/dev/null
|
|
40
|
+
```
|
|
41
|
+
4. Parse output → lưu vào `codex-reports/bug-analysis-<DATE>.md`
|
|
42
|
+
5. Tóm tắt findings cho user
|
|
43
|
+
6. Nếu critical → Antigravity thực hiện fix
|
|
44
|
+
|
|
45
|
+
### `/conductor-codex:review` — Pre-commit code review
|
|
46
|
+
|
|
47
|
+
1. Kiểm tra có uncommitted changes: `git diff --stat`
|
|
48
|
+
2. Thông báo: "🔍 Đang gọi Codex CLI review code..."
|
|
49
|
+
3. Gọi CLI:
|
|
50
|
+
```bash
|
|
51
|
+
cd <PROJECT_ROOT> && timeout 120 codex "Review the uncommitted changes in this repo. Check for: bugs, logic errors, edge cases, thread safety, security issues, performance problems. Rank issues by severity (critical/warning/info). DO NOT edit any files." --approval-mode suggest -q 2>/dev/null
|
|
52
|
+
```
|
|
53
|
+
4. Parse output → lưu vào `codex-reports/review-<DATE>.md`
|
|
54
|
+
5. Tóm tắt: issues found + severity
|
|
55
|
+
6. Nếu clean → suggest `git commit`
|
|
56
|
+
|
|
57
|
+
### `/conductor-codex:logic` — Phân tích logic & edge cases
|
|
58
|
+
|
|
59
|
+
1. Xác định file/module cần kiểm tra
|
|
60
|
+
2. Thông báo: "🔍 Đang gọi Codex CLI kiểm tra logic..."
|
|
61
|
+
3. Gọi CLI:
|
|
62
|
+
```bash
|
|
63
|
+
cd <PROJECT_ROOT> && timeout 120 codex "Analyze <FILE_OR_MODULE> for logic correctness. Focus on: edge cases (null, empty, boundary), race conditions, error handling gaps, unreachable code, off-by-one errors. List each issue with file:line and severity. DO NOT edit any files." --approval-mode suggest -q 2>/dev/null
|
|
64
|
+
```
|
|
65
|
+
4. Parse output → lưu vào `codex-reports/logic-analysis-<DATE>.md`
|
|
66
|
+
5. Tóm tắt findings cho user
|
|
67
|
+
|
|
68
|
+
### `/conductor-codex:test` — Generate test cases
|
|
69
|
+
|
|
70
|
+
1. Xác định feature/module cần test
|
|
71
|
+
2. Thông báo: "🔍 Đang gọi Codex CLI generate test cases..."
|
|
72
|
+
3. Gọi CLI:
|
|
73
|
+
```bash
|
|
74
|
+
cd <PROJECT_ROOT> && timeout 120 codex "Analyze <FILE_OR_MODULE> and generate a comprehensive list of test cases. Include: happy path, edge cases, error cases, boundary values. Format as markdown table with columns: Test Name | Input | Expected Output | Type. DO NOT edit any files." --approval-mode suggest -q 2>/dev/null
|
|
75
|
+
```
|
|
76
|
+
4. Parse output → lưu vào `codex-reports/test-cases-<DATE>.md`
|
|
77
|
+
5. Trình bày test plan cho user
|
|
78
|
+
|
|
79
|
+
### `/conductor-codex:plan-review` — Review implementation plan
|
|
80
|
+
|
|
81
|
+
1. Đọc `implementation_plan.md` hiện tại
|
|
82
|
+
2. Thông báo: "🔍 Đang gọi Codex CLI review plan..."
|
|
83
|
+
3. Gọi CLI:
|
|
84
|
+
```bash
|
|
85
|
+
cd <PROJECT_ROOT> && timeout 120 codex "Review this implementation plan in the current directory. Find: logic holes, missing error handling, security risks, race conditions, scalability issues, missing edge cases. Rate each issue by severity (critical/warning/info). DO NOT edit any files." --approval-mode suggest -q 2>/dev/null
|
|
86
|
+
```
|
|
87
|
+
4. Parse output → lưu vào `codex-reports/plan-review-<DATE>.md`
|
|
88
|
+
5. Tóm tắt issues → Antigravity cập nhật plan
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Fallback Rules
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
cli_not_installed:
|
|
96
|
+
- "⚠️ Codex CLI chưa cài. Chạy: npm i -g @openai/codex"
|
|
97
|
+
- Offer to install automatically
|
|
98
|
+
|
|
99
|
+
cli_unavailable:
|
|
100
|
+
- "⚠️ Codex CLI không khả dụng, tiếp tục với Antigravity-only"
|
|
101
|
+
- Do NOT block workflow
|
|
102
|
+
|
|
103
|
+
cli_timeout:
|
|
104
|
+
- "⏳ Codex phân tích quá lâu (>120s), bỏ qua và tiếp tục"
|
|
105
|
+
|
|
106
|
+
cli_error:
|
|
107
|
+
- Log error
|
|
108
|
+
- Fall back gracefully
|
|
109
|
+
- Suggest: "codex --version" to check installation
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Communication
|
|
115
|
+
|
|
116
|
+
Mỗi khi gọi CLI, LUÔN thông báo user:
|
|
117
|
+
```
|
|
118
|
+
🔍 Đang gọi Codex CLI để [mục đích]...
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Sau khi nhận kết quả:
|
|
122
|
+
```
|
|
123
|
+
✅ Codex rà soát xong. Báo cáo: codex-reports/<file>.md
|
|
124
|
+
📊 Tóm tắt: [key findings]
|
|
125
|
+
```
|
|
@@ -291,6 +291,29 @@ Khi user gõ `/code all-phases`:
|
|
|
291
291
|
* Cài thêm thư viện mới → Hỏi trước
|
|
292
292
|
* Deploy/Push code → **LUÔN LUÔN** hỏi trước
|
|
293
293
|
|
|
294
|
+
### 5. TDD ENFORCEMENT (Superpowers-Inspired)
|
|
295
|
+
|
|
296
|
+
> **Iron Law:** Write failing test FIRST, then implement. RED → GREEN → REFACTOR.
|
|
297
|
+
> Ref: `~/.gemini/antigravity/skills/systematic-debugging/SKILL.md` Phase 4.
|
|
298
|
+
|
|
299
|
+
**For PRODUCTION and ENTERPRISE quality levels:**
|
|
300
|
+
```
|
|
301
|
+
1. Write failing test for the feature/fix
|
|
302
|
+
2. Run test → MUST FAIL (RED)
|
|
303
|
+
3. Write MINIMAL code to make test pass
|
|
304
|
+
4. Run test → MUST PASS (GREEN)
|
|
305
|
+
5. Refactor if needed, tests still pass
|
|
306
|
+
6. Commit
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Anti-Rationalization:**
|
|
310
|
+
| Excuse | Reality |
|
|
311
|
+
|--------|--------|
|
|
312
|
+
| "I'll write tests after" | Untested code = unknown state |
|
|
313
|
+
| "Too simple for tests" | Simple code breaks most |
|
|
314
|
+
| "Tests slow me down" | Tests prevent 2h debug sessions |
|
|
315
|
+
| "MVP doesn't need tests" | Even MVP needs syntax/build check |
|
|
316
|
+
|
|
294
317
|
---
|
|
295
318
|
|
|
296
319
|
## Giai đoạn 2: Hidden Requirements (Tự động thêm)
|
|
@@ -401,9 +424,13 @@ Test FAIL
|
|
|
401
424
|
[Lần 3] Rollback + Approach khác → Test lại
|
|
402
425
|
↓
|
|
403
426
|
├── PASS → Thoát loop, tiếp tục
|
|
404
|
-
└── FAIL →
|
|
427
|
+
└── FAIL → ⚠️ 3-Fix Rule: Question architecture!
|
|
428
|
+
→ Hỏi User + gợi ý /debug --systematic
|
|
405
429
|
```
|
|
406
430
|
|
|
431
|
+
> **3-Fix Rule (from Superpowers):** Nếu 3 lần fix fail → đây KHÔNG phải bug đơn giản.
|
|
432
|
+
> Đây là vấn đề kiến trúc. DỪNG fix symptoms, thảo luận root cause với user.
|
|
433
|
+
|
|
407
434
|
### 4.3. Khi fix loop thất bại
|
|
408
435
|
|
|
409
436
|
```
|
|
@@ -9,6 +9,18 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## ⚠️ Iron Law (from systematic-debugging skill)
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> Bắt buộc: Đọc `~/.gemini/antigravity/skills/systematic-debugging/SKILL.md` trước khi debug.
|
|
19
|
+
> 4 phases: Root Cause → Pattern Analysis → Hypothesis → Implementation
|
|
20
|
+
> 3-Fix Rule: Sau 3 fix thất bại → question architecture, discuss with user.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
12
24
|
## 🅰️ Expert Mode (Direct Execution)
|
|
13
25
|
|
|
14
26
|
**Usage:**
|
|
@@ -16,20 +28,28 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
|
|
|
16
28
|
/debug --auto-fix --file src/components/Cart.tsx
|
|
17
29
|
```
|
|
18
30
|
|
|
19
|
-
**Logic:**
|
|
20
|
-
1. **
|
|
21
|
-
- Đọc
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
31
|
+
**Logic (follows 4-phase systematic debugging):**
|
|
32
|
+
1. **Phase 1 — Root Cause Investigation:**
|
|
33
|
+
- Đọc error messages/stack traces HOÀN TOÀN (không skip).
|
|
34
|
+
- Reproduce consistently — exact steps.
|
|
35
|
+
- `git diff` — check recent changes.
|
|
36
|
+
- Multi-component: add diagnostic logging ở mỗi boundary.
|
|
37
|
+
- Trace data flow backward đến source.
|
|
38
|
+
2. **Phase 2 — Pattern Analysis:**
|
|
39
|
+
- Find similar WORKING code in codebase.
|
|
40
|
+
- Compare: list EVERY difference.
|
|
41
|
+
3. **Phase 3 — Hypothesis:**
|
|
42
|
+
- "I think X is root cause because Y"
|
|
43
|
+
- Test minimally — ONE variable at a time.
|
|
44
|
+
4. **Phase 4 — Implementation:**
|
|
45
|
+
- Create failing test FIRST.
|
|
46
|
+
- Implement single fix.
|
|
47
|
+
- Verify: tests pass, no regressions.
|
|
48
|
+
5. **Symphony Sync:**
|
|
49
|
+
- Nếu lỗi Critical và không thể auto-fix → `symphony_create_task(title="Fix Critical Bug in Cart.tsx")`.
|
|
50
|
+
6. **NeuralMemory:**
|
|
51
|
+
- `nmem_remember` root cause + fix + pattern (cho future recall).
|
|
52
|
+
7. **Report:** "✅ Fixed 1 issue. Evidence: [test output]. ⚠️ Created task #456 for manual review."
|
|
33
53
|
|
|
34
54
|
---
|
|
35
55
|
|