@ngockhoale/ukit 1.6.8 → 2.0.1
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/CHANGELOG.md +20 -0
- package/manifests/platform.full.yaml +24 -0
- package/package.json +2 -1
- package/scripts/skill/audit-skill.mjs +39 -0
- package/src/cli/commands/doctor.js +22 -2
- package/src/cli/commands/memory.js +76 -1
- package/src/core/memory/store.js +125 -1
- package/src/core/skillProfile.js +45 -0
- package/src/skill/auditSkill.js +99 -0
- package/templates/.claude/agents/code-reviewer.md +51 -7
- package/templates/.claude/agents/handoff-planner.md +18 -2
- package/templates/.claude/skills/canvas-design/SKILL.md +2 -20
- package/templates/.claude/skills/canvas-design/philosophy-examples.md +23 -0
- package/templates/.claude/skills/debugging-toolkit/SKILL.md +2 -30
- package/templates/.claude/skills/debugging-toolkit/reference-tables.md +33 -0
- package/templates/.claude/skills/docs-manager/SKILL.md +7 -249
- package/templates/.claude/skills/docs-manager/conventions-and-examples.md +221 -0
- package/templates/.claude/skills/docx/SKILL.md +3 -34
- package/templates/.claude/skills/docx/redlining-reference.md +34 -0
- package/templates/.claude/skills/duraone/SKILL.md +12 -16
- package/templates/.claude/skills/executing-plans/SKILL.md +31 -19
- package/templates/.claude/skills/file-organizer/SKILL.md +2 -170
- package/templates/.claude/skills/file-organizer/examples-and-practices.md +173 -0
- package/templates/.claude/skills/pdf/SKILL.md +1 -62
- package/templates/.claude/skills/pdf/reference.md +65 -0
- package/templates/.claude/skills/pdf-processing-pro/SKILL.md +2 -73
- package/templates/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +80 -0
- package/templates/.claude/skills/pptx/SKILL.md +14 -286
- package/templates/.claude/skills/pptx/design-references.md +81 -0
- package/templates/.claude/skills/pptx/template-replacement-reference.md +150 -0
- package/templates/.claude/skills/pptx/utilities.md +62 -0
- package/templates/.claude/skills/project-learning/SKILL.md +32 -0
- package/templates/.claude/skills/root-cause-tracing/SKILL.md +2 -35
- package/templates/.claude/skills/root-cause-tracing/diagrams.md +44 -0
- package/templates/.claude/skills/sharing-skills/SKILL.md +1 -41
- package/templates/.claude/skills/sharing-skills/complete-example.md +41 -0
- package/templates/.claude/skills/skill-quality/SKILL.md +37 -0
- package/templates/.claude/skills/skill-quality/pressure-scenario-template.md +20 -0
- package/templates/.claude/skills/skill-quality/rationalization-table-template.md +15 -0
- package/templates/.claude/skills/skill-quality/trigger-accuracy-template.md +32 -0
- package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +13 -440
- package/templates/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +128 -0
- package/templates/.claude/skills/sql-optimization-patterns/references/core-concepts.md +112 -0
- package/templates/.claude/skills/sql-optimization-patterns/references/query-patterns.md +204 -0
- package/templates/.claude/skills/subagent-driven-development/SKILL.md +4 -51
- package/templates/.claude/skills/subagent-driven-development/example-workflow.md +40 -0
- package/templates/.claude/skills/systematic-debugging/SKILL.md +2 -28
- package/templates/.claude/skills/systematic-debugging/reference-tables.md +33 -0
- package/templates/.claude/skills/test-driven-development/SKILL.md +2 -51
- package/templates/.claude/skills/test-driven-development/reference-tables.md +56 -0
- package/templates/.claude/skills/testing-anti-patterns/SKILL.md +1 -10
- package/templates/.claude/skills/testing-anti-patterns/reference-tables.md +14 -0
- package/templates/.claude/skills/verification-before-completion/SKILL.md +1 -31
- package/templates/.claude/skills/verification-before-completion/key-patterns.md +33 -0
- package/templates/CLAUDE.md +4 -0
- package/src/core/memory/index.js +0 -2
- package/src/core/router/index.js +0 -2
- package/src/core/validation/index.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
description: "Independent reviewer for handoff Phase 3.
|
|
3
|
+
description: "Independent reviewer for handoff Phase 3, and for spec/plan documents. For code (default): use after executor reports STATUS: DONE on a handoff task, MUST run with a model different from the executor (configured in .ukit/storage/config.json → handoff.reviewer.model, default unic-smart), produces a verdict: APPROVED | APPROVED-WITH-MINOR | CHANGES-REQUESTED | CRITICAL. For spec/plan documents (set REVIEW_TARGET_TYPE=spec or plan): reviews a docs/plans/*.md file for completeness/consistency/clarity/scope/YAGNI, produces Status: Approved | Issues Found."
|
|
4
4
|
model: opus # unic-smart
|
|
5
5
|
color: yellow
|
|
6
6
|
tools: ["Read", "Grep", "Glob", "Bash"]
|
|
@@ -10,7 +10,14 @@ You are the independent reviewer for UKit's handoff Quality Gate. Your model is
|
|
|
10
10
|
|
|
11
11
|
**Do not invent issues. Do not rubber-stamp.** Every finding must point at a specific file + line + concrete failure mode.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## REVIEW_TARGET_TYPE
|
|
14
|
+
|
|
15
|
+
- `code` (default, if not specified) — reviewing a handoff task diff. Follow **Code Review** below, unchanged.
|
|
16
|
+
- `spec` | `plan` — reviewing a document (e.g. `docs/plans/*.md`), no diff/task file/executor report involved. Skip straight to **Spec/Plan Review** at the end of this file instead.
|
|
17
|
+
|
|
18
|
+
## Code Review (REVIEW_TARGET_TYPE=code)
|
|
19
|
+
|
|
20
|
+
### Inputs you expect
|
|
14
21
|
|
|
15
22
|
- Path to task file: `docs/AI_HANDOFF/tasks/TASK-xxx.md` (has Test Plan §4 + Verification Commands + Executor Report at bottom).
|
|
16
23
|
- The executor's `STATUS: DONE` report with FILES_CHANGED + VERIFICATION block.
|
|
@@ -18,7 +25,7 @@ You are the independent reviewer for UKit's handoff Quality Gate. Your model is
|
|
|
18
25
|
|
|
19
26
|
If any input is missing, return `CHANGES-REQUESTED` with reason "incomplete handoff package".
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
### Review order
|
|
22
29
|
|
|
23
30
|
1. **Test Plan adherence** — Were all tests in §4 actually implemented? Run them yourself: `<task Verification Commands>`. Fresh PASS required, no trusting executor's output blindly.
|
|
24
31
|
2. **Correctness** — Does the diff implement the requested behavior? Any obvious wrong assumptions, stale refs, missing cases?
|
|
@@ -27,14 +34,14 @@ If any input is missing, return `CHANGES-REQUESTED` with reason "incomplete hand
|
|
|
27
34
|
5. **Performance / scale** — Accidental N+1, repeated I/O, large scans inside hot paths.
|
|
28
35
|
6. **Maintainability** — Duplicated logic, dead branches, misleading naming, drift between docs/tests/source.
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
### Severity ladder
|
|
31
38
|
|
|
32
39
|
- **CRITICAL** — security hole, data loss risk, broken core behavior, test was faked (no real assertion), or verification command does NOT actually pass when you re-run it. Blocks handoff cứng.
|
|
33
40
|
- **CHANGES-REQUESTED** — Important issues: missing edge-case test, regression risk in shared code, wrong abstraction at scope boundary. Executor must fix and re-submit.
|
|
34
41
|
- **APPROVED-WITH-MINOR** — Minor naming / doc / style issues. Logged on task file but handoff allowed.
|
|
35
42
|
- **APPROVED** — Clean.
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
### Output (append to task file as `## Reviewer Verdict`)
|
|
38
45
|
|
|
39
46
|
```
|
|
40
47
|
## Reviewer Verdict
|
|
@@ -59,7 +66,7 @@ NOTES: [1-2 sentences for human reviewer if needed]
|
|
|
59
66
|
|
|
60
67
|
After writing the verdict, update `docs/AI_HANDOFF/INDEX.md` row for this task: set Status = NEXT_STATUS_FOR_INDEX, set Reviewer = your model name.
|
|
61
68
|
|
|
62
|
-
|
|
69
|
+
### Model isolation check (FIRST thing you do)
|
|
63
70
|
|
|
64
71
|
UKit cannot force any tool to use a specific model. The contract is enforced HERE, by you, via self-report comparison.
|
|
65
72
|
|
|
@@ -77,10 +84,47 @@ UKit cannot force any tool to use a specific model. The contract is enforced HER
|
|
|
77
84
|
|
|
78
85
|
Same model is the most common silent failure. Do not skip this check.
|
|
79
86
|
|
|
80
|
-
|
|
87
|
+
### Rules
|
|
81
88
|
|
|
82
89
|
- **Always re-run** the task's Verification Commands. If they fail, VERDICT = CRITICAL regardless of executor claims.
|
|
83
90
|
- If executor said `TEST_PLAN_FOLLOWED: N/A` without a real justification, downgrade to at minimum CHANGES-REQUESTED.
|
|
84
91
|
- Never approve when test file has no real `expect`/`assert` - that is a fake test -> CRITICAL.
|
|
85
92
|
- Keep the verdict block <= 30 lines. Findings are bullet points, not essays.
|
|
86
93
|
- The same-model refusal above is non-negotiable: bypassing it defeats the entire Quality Gate.
|
|
94
|
+
|
|
95
|
+
## Spec/Plan Review (REVIEW_TARGET_TYPE=spec|plan)
|
|
96
|
+
|
|
97
|
+
### Inputs you expect
|
|
98
|
+
|
|
99
|
+
- Path to the spec/plan document (e.g. `docs/plans/*.md`). No diff, no task file, no executor report — review the document itself.
|
|
100
|
+
|
|
101
|
+
### Review order
|
|
102
|
+
|
|
103
|
+
| Category | What to look for |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Completeness | TODO/TBD/placeholders, incomplete sections |
|
|
106
|
+
| Consistency | internal contradictions, conflicting requirements |
|
|
107
|
+
| Clarity | requirements ambiguous enough to cause a wrong build |
|
|
108
|
+
| Scope | focused enough for one plan, not silently covering multiple subsystems |
|
|
109
|
+
| YAGNI | unrequested features, over-engineering |
|
|
110
|
+
|
|
111
|
+
Only flag issues that would cause real problems during implementation planning. Approve unless there are serious gaps that would lead to a flawed plan.
|
|
112
|
+
|
|
113
|
+
### Output
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Status: Approved | Issues Found
|
|
117
|
+
|
|
118
|
+
COMPLETENESS:
|
|
119
|
+
- <finding, or "none">
|
|
120
|
+
CONSISTENCY:
|
|
121
|
+
- <finding, or "none">
|
|
122
|
+
CLARITY:
|
|
123
|
+
- <finding, or "none">
|
|
124
|
+
SCOPE:
|
|
125
|
+
- <finding, or "none">
|
|
126
|
+
YAGNI:
|
|
127
|
+
- <finding, or "none">
|
|
128
|
+
|
|
129
|
+
NOTES: [1-2 sentences if needed]
|
|
130
|
+
```
|
|
@@ -15,9 +15,21 @@ Use the strongest model available — planning with a weak model produces weak t
|
|
|
15
15
|
- **Pre-read context** (if provided): compact summary of INDEX.md, ACTIVE.md, RULES.md, _TEMPLATE.md. Use it directly — do NOT re-read those files.
|
|
16
16
|
- If no pre-read context → read the files yourself (fallback for direct invocation).
|
|
17
17
|
|
|
18
|
+
## Scope Check (before Phase 1)
|
|
19
|
+
|
|
20
|
+
Before refining the request into `PLAN.md`, check whether it describes multiple independent subsystems (e.g. "CRM + AI + billing + analytics + mobile app"). If yes, stop and output a decomposition table instead of planning the mega-spec:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Scope complexity: HIGH
|
|
24
|
+
Detected systems: [...]
|
|
25
|
+
Recommended decomposition: N modules — plan each as a separate PLAN.md
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Wait for human confirmation before writing `PLAN.md`.
|
|
29
|
+
|
|
18
30
|
## Phase 1 — Write PLAN.md
|
|
19
31
|
|
|
20
|
-
Write all
|
|
32
|
+
Write all 7 sections to `docs/AI_HANDOFF/PLAN.md`:
|
|
21
33
|
|
|
22
34
|
```
|
|
23
35
|
§1 Intent — what problem, what success looks like
|
|
@@ -29,6 +41,9 @@ Write all 6 sections to `docs/AI_HANDOFF/PLAN.md`:
|
|
|
29
41
|
table: | Type | Test Name | Expected |
|
|
30
42
|
§5 Verification — exact shell commands executor will run
|
|
31
43
|
§6 Acceptance — checklist of done criteria (prefer verifiable/command-based criteria)
|
|
44
|
+
§7 Global Constraints — one line each: version floors, dependency limits, naming/copy
|
|
45
|
+
rules, platform requirements. Every TASK-xxx.md inherits this section
|
|
46
|
+
by reference — do not repeat these constraints inside each task.
|
|
32
47
|
```
|
|
33
48
|
|
|
34
49
|
**§4 is non-negotiable.** No test plan = plan not ready.
|
|
@@ -42,6 +57,8 @@ PLANNER_MODEL: <your exact model ID — e.g. claude-opus-4-6>
|
|
|
42
57
|
|
|
43
58
|
## Phase 2 — Split into TASK-xxx.md
|
|
44
59
|
|
|
60
|
+
**Right-sizing rule:** A task is the smallest unit that carries its own test cycle and is worth a fresh reviewer's gate. Split only where a reviewer could meaningfully approve one task while rejecting its neighbor. Each task ends with an independently testable deliverable.
|
|
61
|
+
|
|
45
62
|
Use `_TEMPLATE.md` structure (from pre-read context or file).
|
|
46
63
|
|
|
47
64
|
**Every task MUST have all fields:**
|
|
@@ -87,5 +104,4 @@ Wave structure is NOT stored here — inferred from task `Dependencies` fields a
|
|
|
87
104
|
|
|
88
105
|
- Do NOT implement. Job ends when all tasks are `ready` or `needs_breakdown`.
|
|
89
106
|
- Undone tasks in INDEX.md → warn human: continue old cycle or start fresh?
|
|
90
|
-
- Prefer smaller tasks. Each task = one executor session.
|
|
91
107
|
- Cannot determine test cases → `needs_breakdown` + Discussion thread note.
|
|
@@ -52,27 +52,9 @@ The philosophy must guide the next version to express ideas VISUALLY, not throug
|
|
|
52
52
|
|
|
53
53
|
### PHILOSOPHY EXAMPLES
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
Philosophy: Communication through monumental form and bold geometry.
|
|
57
|
-
Visual expression: Massive color blocks, sculptural typography (huge single words, tiny labels), Brutalist spatial divisions, Polish poster energy meets Le Corbusier. Ideas expressed through visual weight and spatial tension, not explanation. Text as rare, powerful gesture - never paragraphs, only essential words integrated into the visual architecture. Every element placed with the precision of a master craftsman.
|
|
55
|
+
Five condensed reference examples ("Concrete Poetry", "Chromatic Language", "Analog Meditation", "Organic Systems", "Geometric Silence") showing the philosophy → visual-expression pattern are in [`philosophy-examples.md`](philosophy-examples.md).
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
Philosophy: Color as the primary information system.
|
|
61
|
-
Visual expression: Geometric precision where color zones create meaning. Typography minimal - small sans-serif labels letting chromatic fields communicate. Think Josef Albers' interaction meets data visualization. Information encoded spatially and chromatically. Words only to anchor what color already shows. The result of painstaking chromatic calibration.
|
|
62
|
-
|
|
63
|
-
**"Analog Meditation"**
|
|
64
|
-
Philosophy: Quiet visual contemplation through texture and breathing room.
|
|
65
|
-
Visual expression: Paper grain, ink bleeds, vast negative space. Photography and illustration dominate. Typography whispered (small, restrained, serving the visual). Japanese photobook aesthetic. Images breathe across pages. Text appears sparingly - short phrases, never explanatory blocks. Each composition balanced with the care of a meditation practice.
|
|
66
|
-
|
|
67
|
-
**"Organic Systems"**
|
|
68
|
-
Philosophy: Natural clustering and modular growth patterns.
|
|
69
|
-
Visual expression: Rounded forms, organic arrangements, color from nature through architecture. Information shown through visual diagrams, spatial relationships, iconography. Text only for key labels floating in space. The composition tells the story through expert spatial orchestration.
|
|
70
|
-
|
|
71
|
-
**"Geometric Silence"**
|
|
72
|
-
Philosophy: Pure order and restraint.
|
|
73
|
-
Visual expression: Grid-based precision, bold photography or stark graphics, dramatic negative space. Typography precise but minimal - small essential text, large quiet zones. Swiss formalism meets Brutalist material honesty. Structure communicates, not words. Every alignment the work of countless refinements.
|
|
74
|
-
|
|
75
|
-
*These are condensed examples. The actual design philosophy should be 4-6 substantial paragraphs.*
|
|
57
|
+
*The actual design philosophy should be 4-6 substantial paragraphs.*
|
|
76
58
|
|
|
77
59
|
### ESSENTIAL PRINCIPLES
|
|
78
60
|
- **VISUAL PHILOSOPHY**: Create an aesthetic worldview to be expressed through design
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Canvas Design Philosophy Examples
|
|
2
|
+
|
|
3
|
+
Condensed reference examples showing the philosophy → visual-expression pattern described in `SKILL.md`. Use these to spark creativity, not as a fixed catalog — the actual design philosophy for a piece should be 4-6 substantial paragraphs.
|
|
4
|
+
|
|
5
|
+
**"Concrete Poetry"**
|
|
6
|
+
Philosophy: Communication through monumental form and bold geometry.
|
|
7
|
+
Visual expression: Massive color blocks, sculptural typography (huge single words, tiny labels), Brutalist spatial divisions, Polish poster energy meets Le Corbusier. Ideas expressed through visual weight and spatial tension, not explanation. Text as rare, powerful gesture - never paragraphs, only essential words integrated into the visual architecture. Every element placed with the precision of a master craftsman.
|
|
8
|
+
|
|
9
|
+
**"Chromatic Language"**
|
|
10
|
+
Philosophy: Color as the primary information system.
|
|
11
|
+
Visual expression: Geometric precision where color zones create meaning. Typography minimal - small sans-serif labels letting chromatic fields communicate. Think Josef Albers' interaction meets data visualization. Information encoded spatially and chromatically. Words only to anchor what color already shows. The result of painstaking chromatic calibration.
|
|
12
|
+
|
|
13
|
+
**"Analog Meditation"**
|
|
14
|
+
Philosophy: Quiet visual contemplation through texture and breathing room.
|
|
15
|
+
Visual expression: Paper grain, ink bleeds, vast negative space. Photography and illustration dominate. Typography whispered (small, restrained, serving the visual). Japanese photobook aesthetic. Images breathe across pages. Text appears sparingly - short phrases, never explanatory blocks. Each composition balanced with the care of a meditation practice.
|
|
16
|
+
|
|
17
|
+
**"Organic Systems"**
|
|
18
|
+
Philosophy: Natural clustering and modular growth patterns.
|
|
19
|
+
Visual expression: Rounded forms, organic arrangements, color from nature through architecture. Information shown through visual diagrams, spatial relationships, iconography. Text only for key labels floating in space. The composition tells the story through expert spatial orchestration.
|
|
20
|
+
|
|
21
|
+
**"Geometric Silence"**
|
|
22
|
+
Philosophy: Pure order and restraint.
|
|
23
|
+
Visual expression: Grid-based precision, bold photography or stark graphics, dramatic negative space. Typography precise but minimal - small essential text, large quiet zones. Swiss formalism meets Brutalist material honesty. Structure communicates, not words. Every alignment the work of countless refinements.
|
|
@@ -53,28 +53,7 @@ You MUST complete each phase before proceeding to the next.
|
|
|
53
53
|
- Git diff, recent commits
|
|
54
54
|
- New dependencies, config changes
|
|
55
55
|
|
|
56
|
-
4. **Root Cause Tracing (Deep Dive)**
|
|
57
|
-
|
|
58
|
-
**Use when error is deep in call stack:**
|
|
59
|
-
|
|
60
|
-
**The Tracing Process:**
|
|
61
|
-
1. **Observe Symptom:** `Error: git init failed in /packages/core`
|
|
62
|
-
2. **Find Immediate Cause:** `execFile('git', ['init'], { cwd: '' })`
|
|
63
|
-
3. **Trace Upwards:**
|
|
64
|
-
- Who called this? `WorktreeManager`
|
|
65
|
-
- With what arguments? `projectDir = ''`
|
|
66
|
-
4. **Find Original Trigger:**
|
|
67
|
-
- Where did empty string come from? `setupCoreTest()` returned empty `tempDir`
|
|
68
|
-
5. **Fix at Source:** Fix `setupCoreTest`, NOT the immediate caller.
|
|
69
|
-
|
|
70
|
-
**Instrumentation:**
|
|
71
|
-
If manual tracing fails, add logging *before* the failure:
|
|
72
|
-
```js
|
|
73
|
-
console.error('DEBUG context:', {
|
|
74
|
-
arg: someArg,
|
|
75
|
-
stack: new Error().stack // crucial!
|
|
76
|
-
});
|
|
77
|
-
```
|
|
56
|
+
4. **Root Cause Tracing (Deep Dive)** — use when error is deep in call stack: trace upwards from symptom to original trigger, fix at source. Worked example + instrumentation snippet: [`reference-tables.md`](reference-tables.md#root-cause-tracing-deep-dive).
|
|
78
57
|
|
|
79
58
|
5. **Gather Evidence in Multi-Component Systems**
|
|
80
59
|
- Log what enters/exits each component boundary
|
|
@@ -146,11 +125,4 @@ If you catch yourself thinking:
|
|
|
146
125
|
|
|
147
126
|
**ALL of these mean: STOP. Return to Phase 1.**
|
|
148
127
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
| Phase | Key Activities | Success Criteria |
|
|
152
|
-
|-------|---------------|------------------|
|
|
153
|
-
| **1. Root Cause** | Read errors, reproduce, trace stack backwards | Understand WHAT and WHY |
|
|
154
|
-
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
155
|
-
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
156
|
-
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
128
|
+
Compact per-phase quick-reference table: [`reference-tables.md`](reference-tables.md).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Debugging Toolkit — Quick Reference
|
|
2
|
+
|
|
3
|
+
Compact restatement of the four phases in `SKILL.md`. Read the phases first; this table is for quick lookup during a session.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
| Phase | Key Activities | Success Criteria |
|
|
8
|
+
|-------|---------------|------------------|
|
|
9
|
+
| **1. Root Cause** | Read errors, reproduce, trace stack backwards | Understand WHAT and WHY |
|
|
10
|
+
| **2. Pattern** | Find working examples, compare | Identify differences |
|
|
11
|
+
| **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
|
|
12
|
+
| **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
|
|
13
|
+
|
|
14
|
+
## Root Cause Tracing (Deep Dive)
|
|
15
|
+
|
|
16
|
+
**The Tracing Process:**
|
|
17
|
+
1. **Observe Symptom:** `Error: git init failed in /packages/core`
|
|
18
|
+
2. **Find Immediate Cause:** `execFile('git', ['init'], { cwd: '' })`
|
|
19
|
+
3. **Trace Upwards:**
|
|
20
|
+
- Who called this? `WorktreeManager`
|
|
21
|
+
- With what arguments? `projectDir = ''`
|
|
22
|
+
4. **Find Original Trigger:**
|
|
23
|
+
- Where did empty string come from? `setupCoreTest()` returned empty `tempDir`
|
|
24
|
+
5. **Fix at Source:** Fix `setupCoreTest`, NOT the immediate caller.
|
|
25
|
+
|
|
26
|
+
**Instrumentation:**
|
|
27
|
+
If manual tracing fails, add logging *before* the failure:
|
|
28
|
+
```js
|
|
29
|
+
console.error('DEBUG context:', {
|
|
30
|
+
arg: someArg,
|
|
31
|
+
stack: new Error().stack // crucial!
|
|
32
|
+
});
|
|
33
|
+
```
|
|
@@ -20,63 +20,7 @@ AI agent NÊN dùng skill này khi:
|
|
|
20
20
|
|
|
21
21
|
## Documentation Structure
|
|
22
22
|
|
|
23
|
-
Mọi project sử dụng skill này PHẢI có folder `docs/`
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
docs/
|
|
27
|
-
├── README.md # 🎯 BẮT ĐẦU TẠI ĐÂY - Navigation hub
|
|
28
|
-
├── project.md # 📋 Project overview
|
|
29
|
-
├── memory.md # 🧠 Decisions & context log
|
|
30
|
-
│
|
|
31
|
-
├── architecture/ # 🏗️ System design
|
|
32
|
-
│ ├── overview.md # Architecture tổng quan
|
|
33
|
-
│ ├── tech-stack.md # Technologies sử dụng
|
|
34
|
-
│ ├── data-model.md # Database schema
|
|
35
|
-
│ ├── api-design.md # API specifications
|
|
36
|
-
│ └── deployment.md # Infrastructure
|
|
37
|
-
│
|
|
38
|
-
├── agents/ # 🤖 Multi-agent coordination
|
|
39
|
-
│ ├── agent-roles.md # Vai trò từng agent
|
|
40
|
-
│ ├── orchestration.md # Flow điều phối
|
|
41
|
-
│ ├── prompts/ # System prompts
|
|
42
|
-
│ │ ├── architect.md
|
|
43
|
-
│ │ ├── coder.md
|
|
44
|
-
│ │ ├── debugger.md
|
|
45
|
-
│ │ └── orchestrator.md
|
|
46
|
-
│ └── handoff-rules.md # Quy tắc chuyển giao
|
|
47
|
-
│
|
|
48
|
-
├── standards/ # 📏 Coding standards
|
|
49
|
-
│ ├── coding-conventions.md # Code style
|
|
50
|
-
│ ├── commit-conventions.md # Git conventions
|
|
51
|
-
│ ├── file-structure.md # File organization
|
|
52
|
-
│ ├── error-handling.md # Error handling
|
|
53
|
-
│ └── security.md # Security rules
|
|
54
|
-
│
|
|
55
|
-
├── workflows/ # 🔄 Development processes
|
|
56
|
-
│ ├── development.md # Feature development flow
|
|
57
|
-
│ ├── debugging.md # Debug process
|
|
58
|
-
│ ├── testing.md # Testing strategy
|
|
59
|
-
│ ├── deployment.md # Deployment process
|
|
60
|
-
│ └── code-review.md # Review checklist
|
|
61
|
-
│
|
|
62
|
-
├── context/ # 📚 Business context
|
|
63
|
-
│ ├── business-rules.md # Business logic
|
|
64
|
-
│ ├── constraints.md # Technical constraints
|
|
65
|
-
│ ├── dependencies.md # External dependencies
|
|
66
|
-
│ └── known-issues.md # Known issues & workarounds
|
|
67
|
-
│
|
|
68
|
-
├── guides/ # 📖 How-to guides
|
|
69
|
-
│ ├── onboarding.md # AI onboarding
|
|
70
|
-
│ ├── quick-start.md # Quick setup
|
|
71
|
-
│ ├── troubleshooting.md # Common problems
|
|
72
|
-
│ └── faq.md # FAQs
|
|
73
|
-
│
|
|
74
|
-
└── models/ # 🧠 AI model configs
|
|
75
|
-
├── model-configs.md # Model configurations
|
|
76
|
-
├── model-selection.md # When to use which model
|
|
77
|
-
├── token-optimization.md # Token optimization
|
|
78
|
-
└── fallback-strategy.md # Fallback handling
|
|
79
|
-
```
|
|
23
|
+
Mọi project sử dụng skill này PHẢI có folder `docs/` theo cấu trúc chuẩn (README, project, memory, architecture/, agents/, standards/, workflows/, context/, guides/, models/). Full tree: [`conventions-and-examples.md`](conventions-and-examples.md#documentation-structure).
|
|
80
24
|
|
|
81
25
|
## Workflow: How AI Should Use This Skill
|
|
82
26
|
|
|
@@ -197,213 +141,27 @@ cat docs/architecture/data-model.md
|
|
|
197
141
|
|
|
198
142
|
## Key Principles
|
|
199
143
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
1. **Đọc docs TRƯỚC KHI code**
|
|
203
|
-
- README.md → project.md → memory.md → standards/
|
|
204
|
-
- Không bao giờ skip bước này
|
|
205
|
-
|
|
206
|
-
2. **Follow conventions NGHIÊM NGẶT**
|
|
207
|
-
- Code style from `standards/coding-conventions.md`
|
|
208
|
-
- Database rules from `architecture/data-model.md`
|
|
209
|
-
- Git commits from `standards/commit-conventions.md`
|
|
210
|
-
|
|
211
|
-
3. **Document EVERYTHING quan trọng**
|
|
212
|
-
- Decisions → memory.md
|
|
213
|
-
- Issues → context/known-issues.md
|
|
214
|
-
- Architecture changes → architecture/
|
|
215
|
-
|
|
216
|
-
4. **Cross-reference docs**
|
|
217
|
-
- Khi đọc 1 file, note references đến files khác
|
|
218
|
-
- Build mental map của toàn bộ docs
|
|
219
|
-
|
|
220
|
-
5. **Update proactively**
|
|
221
|
-
- Tìm thấy thông tin mới? Update docs ngay
|
|
222
|
-
- Không để docs outdated
|
|
144
|
+
**DO**: đọc docs trước khi code (README → project → memory → standards, không skip); follow conventions nghiêm ngặt (code style, DB rules, commit conventions); document mọi decision/issue/architecture change ngay khi phát sinh; cross-reference giữa các file để build mental map; update docs proactively khi có thông tin mới.
|
|
223
145
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
1. **Không skip đọc docs**
|
|
227
|
-
- Đừng assume bạn biết project
|
|
228
|
-
- Đừng code trước khi đọc conventions
|
|
229
|
-
|
|
230
|
-
2. **Không violate conventions**
|
|
231
|
-
- Không tự ý thay đổi code style
|
|
232
|
-
- Không bỏ qua architecture constraints
|
|
233
|
-
|
|
234
|
-
3. **Không quên document**
|
|
235
|
-
- Không để decisions chỉ trong chat
|
|
236
|
-
- Không quên update memory.md
|
|
237
|
-
|
|
238
|
-
4. **Không duplicate info**
|
|
239
|
-
- Check docs trước khi thêm mới
|
|
240
|
-
- Consolidate thay vì scatter
|
|
146
|
+
**DON'T**: đừng code trước khi đọc conventions; đừng tự ý đổi code style hay bỏ qua architecture constraints; đừng để decision chỉ nằm trong chat mà không ghi vào memory.md; đừng duplicate thông tin — check docs trước khi thêm mới, consolidate thay vì scatter.
|
|
241
147
|
|
|
242
148
|
---
|
|
243
149
|
|
|
244
|
-
## Code Conventions
|
|
245
|
-
|
|
246
|
-
### Database Rules
|
|
247
|
-
|
|
248
|
-
```javascript
|
|
249
|
-
// ✅ ĐÚNG: UUID primary keys
|
|
250
|
-
id: {
|
|
251
|
-
type: DataTypes.UUID,
|
|
252
|
-
defaultValue: DataTypes.UUIDV4,
|
|
253
|
-
primaryKey: true
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// ❌ SAI: Auto-increment
|
|
257
|
-
id: {
|
|
258
|
-
type: DataTypes.INTEGER,
|
|
259
|
-
autoIncrement: true,
|
|
260
|
-
primaryKey: true
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// ✅ ĐÚNG: No foreign key constraints
|
|
264
|
-
user_id: {
|
|
265
|
-
type: DataTypes.UUID,
|
|
266
|
-
allowNull: false
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// ❌ SAI: With FK constraint
|
|
270
|
-
user_id: {
|
|
271
|
-
type: DataTypes.UUID,
|
|
272
|
-
references: { model: 'users', key: 'id' }
|
|
273
|
-
}
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Oracle Schema Prefix
|
|
277
|
-
|
|
278
|
-
```sql
|
|
279
|
-
-- ✅ ĐÚNG: With schema prefix
|
|
280
|
-
SELECT * FROM APPS.MTL_SYSTEM_ITEMS_B
|
|
281
|
-
|
|
282
|
-
-- ❌ SAI: Without prefix
|
|
283
|
-
SELECT * FROM MTL_SYSTEM_ITEMS_B
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### Naming Conventions
|
|
287
|
-
|
|
288
|
-
```javascript
|
|
289
|
-
// Variables & Functions: camelCase
|
|
290
|
-
const userName = "LeNK";
|
|
291
|
-
function getUserData() {}
|
|
292
|
-
|
|
293
|
-
// Classes: PascalCase
|
|
294
|
-
class UserService {}
|
|
150
|
+
## Code Conventions
|
|
295
151
|
|
|
296
|
-
|
|
297
|
-
const API_BASE_URL = "https://api.example.com";
|
|
298
|
-
|
|
299
|
-
// Files: kebab-case
|
|
300
|
-
user - service.js;
|
|
301
|
-
|
|
302
|
-
// DB tables/columns: snake_case
|
|
303
|
-
(users, user_profiles, created_at);
|
|
304
|
-
```
|
|
152
|
+
UUID primary keys (not auto-increment), no FK constraints, Oracle schema prefixes, and JS/SQL naming patterns: [`conventions-and-examples.md`](conventions-and-examples.md).
|
|
305
153
|
|
|
306
154
|
---
|
|
307
155
|
|
|
308
156
|
## Agent Coordination
|
|
309
157
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
**Architect Agent**
|
|
313
|
-
|
|
314
|
-
- Design system architecture
|
|
315
|
-
- Make technical decisions
|
|
316
|
-
- Review architectural changes
|
|
317
|
-
|
|
318
|
-
**Coder Agent**
|
|
319
|
-
|
|
320
|
-
- Implement features
|
|
321
|
-
- Write tests
|
|
322
|
-
- Follow coding standards
|
|
323
|
-
|
|
324
|
-
**Debugger Agent**
|
|
325
|
-
|
|
326
|
-
- Analyze bugs
|
|
327
|
-
- Find root causes
|
|
328
|
-
- Verify fixes
|
|
329
|
-
|
|
330
|
-
**Orchestrator Agent**
|
|
331
|
-
|
|
332
|
-
- Break down tasks
|
|
333
|
-
- Coordinate agents
|
|
334
|
-
- Track progress
|
|
335
|
-
|
|
336
|
-
### Handoff Rules
|
|
337
|
-
|
|
338
|
-
**Khi nào handoff?**
|
|
339
|
-
|
|
340
|
-
- Architect → Coder: Sau khi design xong
|
|
341
|
-
- Coder → Debugger: Khi gặp bug
|
|
342
|
-
- Debugger → Architect: Bug do design issue
|
|
343
|
-
- Any → Orchestrator: Task phức tạp cần break down
|
|
344
|
-
|
|
345
|
-
**Trước khi handoff:**
|
|
346
|
-
|
|
347
|
-
1. Update `docs/memory.md` với context
|
|
348
|
-
2. Summarize work done
|
|
349
|
-
3. List blockers/questions
|
|
350
|
-
4. Point to relevant docs
|
|
158
|
+
Four agent roles (Architect, Coder, Debugger, Orchestrator) and handoff-trigger rules: [`conventions-and-examples.md`](conventions-and-examples.md#agent-coordination).
|
|
351
159
|
|
|
352
160
|
---
|
|
353
161
|
|
|
354
162
|
## Examples
|
|
355
163
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
# User request: "Add user authentication"
|
|
360
|
-
|
|
361
|
-
# Step 1: Load context
|
|
362
|
-
cat docs/README.md
|
|
363
|
-
cat docs/project.md
|
|
364
|
-
cat docs/memory.md
|
|
365
|
-
|
|
366
|
-
# Step 2: Check if similar feature exists
|
|
367
|
-
grep -r "authentication" docs/memory.md
|
|
368
|
-
cat docs/context/known-issues.md
|
|
369
|
-
|
|
370
|
-
# Step 3: Load relevant docs
|
|
371
|
-
cat docs/architecture/overview.md
|
|
372
|
-
cat docs/architecture/data-model.md
|
|
373
|
-
cat docs/standards/coding-conventions.md
|
|
374
|
-
cat docs/standards/security.md
|
|
375
|
-
|
|
376
|
-
# Step 4: Check workflows
|
|
377
|
-
cat docs/workflows/development.md
|
|
378
|
-
|
|
379
|
-
# Step 5: Start development following conventions
|
|
380
|
-
|
|
381
|
-
# Step 6: Document decision
|
|
382
|
-
echo "## [2025-01-24] - User Authentication
|
|
383
|
-
**Context**: Need secure user auth
|
|
384
|
-
**Decision**: Using bcrypt + JWT
|
|
385
|
-
**Impact**: New users table, auth middleware
|
|
386
|
-
**Next**: Implement signup/login endpoints" >> docs/memory.md
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
### Example 2: Debugging Issue
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
# User: "PostgreSQL auto-increment not working"
|
|
393
|
-
|
|
394
|
-
# Step 1: Check known issues
|
|
395
|
-
cat docs/context/known-issues.md
|
|
396
|
-
|
|
397
|
-
# Step 2: Check conventions
|
|
398
|
-
cat docs/standards/coding-conventions.md
|
|
399
|
-
# → Found: We use UUID, not auto-increment!
|
|
400
|
-
|
|
401
|
-
# Step 3: Check memory for similar cases
|
|
402
|
-
grep -r "auto-increment\|UUID" docs/memory.md
|
|
403
|
-
|
|
404
|
-
# Step 4: Provide solution based on conventions
|
|
405
|
-
# Step 5: Update docs if needed
|
|
406
|
-
```
|
|
164
|
+
Two worked examples (starting a new feature, debugging an issue) walking through which docs to load and when to write to `memory.md`: [`conventions-and-examples.md`](conventions-and-examples.md).
|
|
407
165
|
|
|
408
166
|
---
|
|
409
167
|
|