@leejungkiin/awkit 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/awk.js +204 -52
- package/core/AGENTS.md +38 -0
- package/core/GEMINI.md.bak +126 -199
- package/package.json +1 -1
- package/skills/awf-session-restore/SKILL.md +12 -2
- package/skills/brainstorm-agent/SKILL.md +11 -8
- package/skills/gitnexus/gitnexus-cli/SKILL.md +82 -0
- package/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
- package/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
- package/skills/gitnexus/gitnexus-guide/SKILL.md +64 -0
- package/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
- package/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
- package/skills/nm-memory-sync/SKILL.md +14 -1
- package/skills/orchestrator/SKILL.md +0 -38
- package/skills/ship-to-code/SKILL.md +115 -0
- package/skills/single-flow-task-execution/SKILL.md +409 -0
- package/skills/single-flow-task-execution/code-quality-reviewer-prompt.md +20 -0
- package/skills/single-flow-task-execution/implementer-prompt.md +78 -0
- package/skills/single-flow-task-execution/spec-reviewer-prompt.md +61 -0
- package/skills/symphony-enforcer/SKILL.md +36 -18
- package/skills/trello-sync/SKILL.md +25 -17
- package/templates/CODEBASE.md +26 -42
- package/templates/configs/trello-config.json +2 -2
- package/templates/project-identity/android.json +10 -0
- package/templates/project-identity/backend-nestjs.json +10 -0
- package/templates/project-identity/expo.json +10 -0
- package/templates/project-identity/ios.json +10 -0
- package/templates/project-identity/web-nextjs.json +10 -0
- package/templates/workflow_dual_mode_template.md +5 -5
- package/workflows/_uncategorized/conductor-codex.md +125 -0
- package/workflows/_uncategorized/conductor.md +97 -0
- package/workflows/_uncategorized/trello-sync.md +52 -0
- package/workflows/quality/visual-debug.md +66 -12
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-exploring
|
|
3
|
+
description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Exploring Codebases with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "How does authentication work?"
|
|
11
|
+
- "What's the project structure?"
|
|
12
|
+
- "Show me the main components"
|
|
13
|
+
- "Where is the database logic?"
|
|
14
|
+
- Understanding code you haven't seen before
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. READ gitnexus://repos → Discover indexed repos
|
|
20
|
+
2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
|
|
21
|
+
3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
|
|
22
|
+
4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
|
|
23
|
+
5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
- [ ] READ gitnexus://repo/{name}/context
|
|
32
|
+
- [ ] gitnexus_query for the concept you want to understand
|
|
33
|
+
- [ ] Review returned processes (execution flows)
|
|
34
|
+
- [ ] gitnexus_context on key symbols for callers/callees
|
|
35
|
+
- [ ] READ process resource for full execution traces
|
|
36
|
+
- [ ] Read source files for implementation details
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Resources
|
|
40
|
+
|
|
41
|
+
| Resource | What you get |
|
|
42
|
+
| --------------------------------------- | ------------------------------------------------------- |
|
|
43
|
+
| `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
|
|
44
|
+
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
|
|
45
|
+
| `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
|
|
46
|
+
| `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |
|
|
47
|
+
|
|
48
|
+
## Tools
|
|
49
|
+
|
|
50
|
+
**gitnexus_query** — find execution flows related to a concept:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
gitnexus_query({query: "payment processing"})
|
|
54
|
+
→ Processes: CheckoutFlow, RefundFlow, WebhookHandler
|
|
55
|
+
→ Symbols grouped by flow with file locations
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**gitnexus_context** — 360-degree view of a symbol:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
gitnexus_context({name: "validateUser"})
|
|
62
|
+
→ Incoming calls: loginHandler, apiMiddleware
|
|
63
|
+
→ Outgoing calls: checkToken, getUserById
|
|
64
|
+
→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Example: "How does payment processing work?"
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
|
|
71
|
+
2. gitnexus_query({query: "payment processing"})
|
|
72
|
+
→ CheckoutFlow: processPayment → validateCard → chargeStripe
|
|
73
|
+
→ RefundFlow: initiateRefund → calculateRefund → processRefund
|
|
74
|
+
3. gitnexus_context({name: "processPayment"})
|
|
75
|
+
→ Incoming: checkoutHandler, webhookHandler
|
|
76
|
+
→ Outgoing: validateCard, chargeStripe, saveTransaction
|
|
77
|
+
4. Read src/payments/processor.ts for implementation details
|
|
78
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-guide
|
|
3
|
+
description: "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitNexus Guide
|
|
7
|
+
|
|
8
|
+
Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema.
|
|
9
|
+
|
|
10
|
+
## Always Start Here
|
|
11
|
+
|
|
12
|
+
For any task involving code understanding, debugging, impact analysis, or refactoring:
|
|
13
|
+
|
|
14
|
+
1. **Read `gitnexus://repo/{name}/context`** — codebase overview + check index freshness
|
|
15
|
+
2. **Match your task to a skill below** and **read that skill file**
|
|
16
|
+
3. **Follow the skill's workflow and checklist**
|
|
17
|
+
|
|
18
|
+
> If step 1 warns the index is stale, run `npx gitnexus analyze` in the terminal first.
|
|
19
|
+
|
|
20
|
+
## Skills
|
|
21
|
+
|
|
22
|
+
| Task | Skill to read |
|
|
23
|
+
| -------------------------------------------- | ------------------- |
|
|
24
|
+
| Understand architecture / "How does X work?" | `gitnexus-exploring` |
|
|
25
|
+
| Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` |
|
|
26
|
+
| Trace bugs / "Why is X failing?" | `gitnexus-debugging` |
|
|
27
|
+
| Rename / extract / split / refactor | `gitnexus-refactoring` |
|
|
28
|
+
| Tools, resources, schema reference | `gitnexus-guide` (this file) |
|
|
29
|
+
| Index, status, clean, wiki CLI commands | `gitnexus-cli` |
|
|
30
|
+
|
|
31
|
+
## Tools Reference
|
|
32
|
+
|
|
33
|
+
| Tool | What it gives you |
|
|
34
|
+
| ---------------- | ------------------------------------------------------------------------ |
|
|
35
|
+
| `query` | Process-grouped code intelligence — execution flows related to a concept |
|
|
36
|
+
| `context` | 360-degree symbol view — categorized refs, processes it participates in |
|
|
37
|
+
| `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence |
|
|
38
|
+
| `detect_changes` | Git-diff impact — what do your current changes affect |
|
|
39
|
+
| `rename` | Multi-file coordinated rename with confidence-tagged edits |
|
|
40
|
+
| `cypher` | Raw graph queries (read `gitnexus://repo/{name}/schema` first) |
|
|
41
|
+
| `list_repos` | Discover indexed repos |
|
|
42
|
+
|
|
43
|
+
## Resources Reference
|
|
44
|
+
|
|
45
|
+
Lightweight reads (~100-500 tokens) for navigation:
|
|
46
|
+
|
|
47
|
+
| Resource | Content |
|
|
48
|
+
| ---------------------------------------------- | ----------------------------------------- |
|
|
49
|
+
| `gitnexus://repo/{name}/context` | Stats, staleness check |
|
|
50
|
+
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores |
|
|
51
|
+
| `gitnexus://repo/{name}/cluster/{clusterName}` | Area members |
|
|
52
|
+
| `gitnexus://repo/{name}/processes` | All execution flows |
|
|
53
|
+
| `gitnexus://repo/{name}/process/{processName}` | Step-by-step trace |
|
|
54
|
+
| `gitnexus://repo/{name}/schema` | Graph schema for Cypher |
|
|
55
|
+
|
|
56
|
+
## Graph Schema
|
|
57
|
+
|
|
58
|
+
**Nodes:** File, Function, Class, Interface, Method, Community, Process
|
|
59
|
+
**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS
|
|
60
|
+
|
|
61
|
+
```cypher
|
|
62
|
+
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
|
|
63
|
+
RETURN caller.name, caller.filePath
|
|
64
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-impact-analysis
|
|
3
|
+
description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Impact Analysis with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "Is it safe to change this function?"
|
|
11
|
+
- "What will break if I modify X?"
|
|
12
|
+
- "Show me the blast radius"
|
|
13
|
+
- "Who uses this code?"
|
|
14
|
+
- Before making non-trivial code changes
|
|
15
|
+
- Before committing — to understand what your changes affect
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this
|
|
21
|
+
2. READ gitnexus://repo/{name}/processes → Check affected execution flows
|
|
22
|
+
3. gitnexus_detect_changes() → Map current git changes to affected flows
|
|
23
|
+
4. Assess risk and report to user
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
|
|
32
|
+
- [ ] Review d=1 items first (these WILL BREAK)
|
|
33
|
+
- [ ] Check high-confidence (>0.8) dependencies
|
|
34
|
+
- [ ] READ processes to check affected execution flows
|
|
35
|
+
- [ ] gitnexus_detect_changes() for pre-commit check
|
|
36
|
+
- [ ] Assess risk level and report to user
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Understanding Output
|
|
40
|
+
|
|
41
|
+
| Depth | Risk Level | Meaning |
|
|
42
|
+
| ----- | ---------------- | ------------------------ |
|
|
43
|
+
| d=1 | **WILL BREAK** | Direct callers/importers |
|
|
44
|
+
| d=2 | LIKELY AFFECTED | Indirect dependencies |
|
|
45
|
+
| d=3 | MAY NEED TESTING | Transitive effects |
|
|
46
|
+
|
|
47
|
+
## Risk Assessment
|
|
48
|
+
|
|
49
|
+
| Affected | Risk |
|
|
50
|
+
| ------------------------------ | -------- |
|
|
51
|
+
| <5 symbols, few processes | LOW |
|
|
52
|
+
| 5-15 symbols, 2-5 processes | MEDIUM |
|
|
53
|
+
| >15 symbols or many processes | HIGH |
|
|
54
|
+
| Critical path (auth, payments) | CRITICAL |
|
|
55
|
+
|
|
56
|
+
## Tools
|
|
57
|
+
|
|
58
|
+
**gitnexus_impact** — the primary tool for symbol blast radius:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
gitnexus_impact({
|
|
62
|
+
target: "validateUser",
|
|
63
|
+
direction: "upstream",
|
|
64
|
+
minConfidence: 0.8,
|
|
65
|
+
maxDepth: 3
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
→ d=1 (WILL BREAK):
|
|
69
|
+
- loginHandler (src/auth/login.ts:42) [CALLS, 100%]
|
|
70
|
+
- apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
|
|
71
|
+
|
|
72
|
+
→ d=2 (LIKELY AFFECTED):
|
|
73
|
+
- authRouter (src/routes/auth.ts:22) [CALLS, 95%]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**gitnexus_detect_changes** — git-diff based impact analysis:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
gitnexus_detect_changes({scope: "staged"})
|
|
80
|
+
|
|
81
|
+
→ Changed: 5 symbols in 3 files
|
|
82
|
+
→ Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline
|
|
83
|
+
→ Risk: MEDIUM
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Example: "What breaks if I change validateUser?"
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
1. gitnexus_impact({target: "validateUser", direction: "upstream"})
|
|
90
|
+
→ d=1: loginHandler, apiMiddleware (WILL BREAK)
|
|
91
|
+
→ d=2: authRouter, sessionManager (LIKELY AFFECTED)
|
|
92
|
+
|
|
93
|
+
2. READ gitnexus://repo/my-app/processes
|
|
94
|
+
→ LoginFlow and TokenRefresh touch validateUser
|
|
95
|
+
|
|
96
|
+
3. Risk: 2 direct callers, 2 processes = MEDIUM
|
|
97
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-refactoring
|
|
3
|
+
description: "Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Refactoring with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "Rename this function safely"
|
|
11
|
+
- "Extract this into a module"
|
|
12
|
+
- "Split this service"
|
|
13
|
+
- "Move this to a new file"
|
|
14
|
+
- Any task involving renaming, extracting, splitting, or restructuring code
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. gitnexus_impact({target: "X", direction: "upstream"}) → Map all dependents
|
|
20
|
+
2. gitnexus_query({query: "X"}) → Find execution flows involving X
|
|
21
|
+
3. gitnexus_context({name: "X"}) → See all incoming/outgoing refs
|
|
22
|
+
4. Plan update order: interfaces → implementations → callers → tests
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
26
|
+
|
|
27
|
+
## Checklists
|
|
28
|
+
|
|
29
|
+
### Rename Symbol
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
- [ ] gitnexus_rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview all edits
|
|
33
|
+
- [ ] Review graph edits (high confidence) and ast_search edits (review carefully)
|
|
34
|
+
- [ ] If satisfied: gitnexus_rename({..., dry_run: false}) — apply edits
|
|
35
|
+
- [ ] gitnexus_detect_changes() — verify only expected files changed
|
|
36
|
+
- [ ] Run tests for affected processes
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Extract Module
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
- [ ] gitnexus_context({name: target}) — see all incoming/outgoing refs
|
|
43
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) — find all external callers
|
|
44
|
+
- [ ] Define new module interface
|
|
45
|
+
- [ ] Extract code, update imports
|
|
46
|
+
- [ ] gitnexus_detect_changes() — verify affected scope
|
|
47
|
+
- [ ] Run tests for affected processes
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Split Function/Service
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
- [ ] gitnexus_context({name: target}) — understand all callees
|
|
54
|
+
- [ ] Group callees by responsibility
|
|
55
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) — map callers to update
|
|
56
|
+
- [ ] Create new functions/services
|
|
57
|
+
- [ ] Update callers
|
|
58
|
+
- [ ] gitnexus_detect_changes() — verify affected scope
|
|
59
|
+
- [ ] Run tests for affected processes
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Tools
|
|
63
|
+
|
|
64
|
+
**gitnexus_rename** — automated multi-file rename:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
|
|
68
|
+
→ 12 edits across 8 files
|
|
69
|
+
→ 10 graph edits (high confidence), 2 ast_search edits (review)
|
|
70
|
+
→ Changes: [{file_path, edits: [{line, old_text, new_text, confidence}]}]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**gitnexus_impact** — map all dependents first:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
gitnexus_impact({target: "validateUser", direction: "upstream"})
|
|
77
|
+
→ d=1: loginHandler, apiMiddleware, testUtils
|
|
78
|
+
→ Affected Processes: LoginFlow, TokenRefresh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**gitnexus_detect_changes** — verify your changes after refactoring:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
gitnexus_detect_changes({scope: "all"})
|
|
85
|
+
→ Changed: 8 files, 12 symbols
|
|
86
|
+
→ Affected processes: LoginFlow, TokenRefresh
|
|
87
|
+
→ Risk: MEDIUM
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**gitnexus_cypher** — custom reference queries:
|
|
91
|
+
|
|
92
|
+
```cypher
|
|
93
|
+
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"})
|
|
94
|
+
RETURN caller.name, caller.filePath ORDER BY caller.filePath
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Risk Rules
|
|
98
|
+
|
|
99
|
+
| Risk Factor | Mitigation |
|
|
100
|
+
| ------------------- | ----------------------------------------- |
|
|
101
|
+
| Many callers (>5) | Use gitnexus_rename for automated updates |
|
|
102
|
+
| Cross-area refs | Use detect_changes after to verify scope |
|
|
103
|
+
| String/dynamic refs | gitnexus_query to find them |
|
|
104
|
+
| External/public API | Version and deprecate properly |
|
|
105
|
+
|
|
106
|
+
## Example: Rename `validateUser` to `authenticateUser`
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
1. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
|
|
110
|
+
→ 12 edits: 10 graph (safe), 2 ast_search (review)
|
|
111
|
+
→ Files: validator.ts, login.ts, middleware.ts, config.json...
|
|
112
|
+
|
|
113
|
+
2. Review ast_search edits (config.json: dynamic reference!)
|
|
114
|
+
|
|
115
|
+
3. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: false})
|
|
116
|
+
→ Applied 12 edits across 8 files
|
|
117
|
+
|
|
118
|
+
4. gitnexus_detect_changes({scope: "all"})
|
|
119
|
+
→ Affected: LoginFlow, TokenRefresh
|
|
120
|
+
→ Risk: MEDIUM — run tests for these flows
|
|
121
|
+
```
|
|
@@ -165,9 +165,22 @@ This surfaces memories that a keyword search would miss.
|
|
|
165
165
|
|
|
166
166
|
---
|
|
167
167
|
|
|
168
|
+
## Auto-Install Protocol (New Machine)
|
|
169
|
+
|
|
170
|
+
If `nmem` CLI is not available:
|
|
171
|
+
```
|
|
172
|
+
1. AI detects: command not found: nmem
|
|
173
|
+
2. AI auto-runs: pip install neural-memory (or python3 -m pip install neural-memory)
|
|
174
|
+
→ Requires Python >= 3.11
|
|
175
|
+
3. After install: nmem init (initialize brain DB)
|
|
176
|
+
4. Verify: nmem --version
|
|
177
|
+
5. If Python < 3.11 or pip fails:
|
|
178
|
+
→ Show user: "⚠️ NeuralMemory requires Python >= 3.11. Install via: brew install python@3.12"
|
|
179
|
+
```
|
|
180
|
+
|
|
168
181
|
## Fallback Mode (NeuralMemory Not Installed)
|
|
169
182
|
|
|
170
|
-
If `nmem` is not available, falls back to flat-file behavior:
|
|
183
|
+
If `nmem` is not available AND auto-install fails, falls back to flat-file behavior:
|
|
171
184
|
```
|
|
172
185
|
- Reads from brain/decisions/, brain/solutions/
|
|
173
186
|
- Keyword overlap matching (legacy behavior)
|
|
@@ -48,44 +48,6 @@ If user request involves iOS-specific → Check if mobile-ios pack enabled
|
|
|
48
48
|
If not enabled → Suggest: "awf enable-pack mobile-ios"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
### 3.5. Gate 4 Three-Phase Routing (v12.3 — AUTO-ENFORCE)
|
|
52
|
-
|
|
53
|
-
> ⚠️ AI PHẢI CHỦ ĐỘNG kích hoạt — KHÔNG chờ user gọi.
|
|
54
|
-
> Khi detect COMPLEX + UI → TỰ ĐỘNG announce Phase Announcement Block.
|
|
55
|
-
|
|
56
|
-
```yaml
|
|
57
|
-
gate4_triage:
|
|
58
|
-
trigger: After Gate 3 (tasks created), before execution begins
|
|
59
|
-
auto_activate: true # AI proactively triggers, no user command needed
|
|
60
|
-
|
|
61
|
-
complex_with_ui:
|
|
62
|
-
condition: complexity == COMPLEX AND task has UI components
|
|
63
|
-
action: Enforce Three-Phase Execution
|
|
64
|
-
phases:
|
|
65
|
-
- Phase A: Infrastructure (dependencies, DI, navigation skeleton)
|
|
66
|
-
→ Must build successfully before Phase B
|
|
67
|
-
- Phase B: UI Shell (all screens with mock data)
|
|
68
|
-
→ TRIGGER TP1.7: User Test Checkpoint (MANDATORY)
|
|
69
|
-
→ User must confirm UI OK before Phase C
|
|
70
|
-
- Phase C: Logic Integration (per feature)
|
|
71
|
-
→ TRIGGER TP1.7: after each feature (batch small ones)
|
|
72
|
-
task_ordering: UI tasks MUST be grouped before logic tasks in Symphony
|
|
73
|
-
|
|
74
|
-
moderate_with_ui:
|
|
75
|
-
condition: complexity == MODERATE AND task has UI components
|
|
76
|
-
action: Phase A+C merged, Phase B optional (recommend for hardware features)
|
|
77
|
-
|
|
78
|
-
trivial_or_backend:
|
|
79
|
-
condition: complexity == TRIVIAL OR no UI components
|
|
80
|
-
action: Skip phases, code straight through (no checkpoints)
|
|
81
|
-
|
|
82
|
-
detect_ui_components:
|
|
83
|
-
signals:
|
|
84
|
-
- Task mentions: screen, view, layout, UI, button, form, navigation
|
|
85
|
-
- Files include: *.xml (Android), *.swift (iOS views), *.compose, *.tsx
|
|
86
|
-
- Spec references: wireframe, mockup, design, screenshot
|
|
87
|
-
```
|
|
88
|
-
|
|
89
51
|
### 4. Fallback
|
|
90
52
|
```
|
|
91
53
|
No match → Ask clarifying question (max 2 times)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship-to-code
|
|
3
|
+
description: >-
|
|
4
|
+
Universal Code Porting & Migration Specialist. Translates legacy or reference code
|
|
5
|
+
from ANY source language/framework to ANY target language/framework.
|
|
6
|
+
Rebuilds the architecture while adhering to the target's modern best practices.
|
|
7
|
+
author: Antigravity Team
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
trigger: conditional
|
|
10
|
+
activation_keywords:
|
|
11
|
+
- "/ship-to-code"
|
|
12
|
+
- "/port-code"
|
|
13
|
+
- "/migrate-code"
|
|
14
|
+
- "port code"
|
|
15
|
+
- "chuyển ngôn ngữ"
|
|
16
|
+
- "ship to code"
|
|
17
|
+
- "dịch code"
|
|
18
|
+
priority: high
|
|
19
|
+
platform: agnostic
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# 🚢 Ship-to-Code Skill
|
|
23
|
+
|
|
24
|
+
> **Purpose:** Transform reference codebase from ANY source language/framework to ANY modern target language/framework.
|
|
25
|
+
> **Philosophy:** "Read source to understand WHAT and WHY → Write target for HOW."
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ⚠️ SCOPE CLARITY
|
|
30
|
+
|
|
31
|
+
| This skill DOES | This skill DOES NOT |
|
|
32
|
+
|-----------------|---------------------|
|
|
33
|
+
| Read & analyze source language code & structure | Write in the obsolete/source language |
|
|
34
|
+
| Rebuild logic idiomatically in modern target language | Blindly translate line-by-line (syntax-only) |
|
|
35
|
+
| Map source dependencies to target equivalents | Auto-migrate production database records directly |
|
|
36
|
+
| Implement Clean Architecture/Modern patterns in target | Just copy-paste without adapting paradigms |
|
|
37
|
+
| Extract/convert needed resources on-demand | Mass-copy entire resource folders blindly |
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 🎯 ROLE DEFINITION
|
|
42
|
+
|
|
43
|
+
When this skill is active, the agent becomes:
|
|
44
|
+
|
|
45
|
+
> **Expert Multi-Language Porting Architect**
|
|
46
|
+
> - Master at deciphering unfamiliar, foreign or legacy codebases.
|
|
47
|
+
> - Fluent in modern target architectures (Clean Architecture / MVC / MVVM / Hexagonal depending on target ecosystem).
|
|
48
|
+
> - Knows how to map business logic across different language paradigms (e.g., Object-Oriented to Functional, Sync to Async, etc).
|
|
49
|
+
> - Enforces exact Input/Output mathematical parity for core algorithms and cryptology.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 📋 EXECUTION PIPELINE (6 Phases)
|
|
54
|
+
|
|
55
|
+
> **Rule:** Always complete one phase fully before moving to the next.
|
|
56
|
+
> **Rule:** After each phase, create a checkpoint summary for the user to approve.
|
|
57
|
+
|
|
58
|
+
### Phase 0: Ecosystem & Dependency Mapping 🔍
|
|
59
|
+
**Purpose:** Identify all 3rd-party libraries, SDKs, and frameworks in the source project and map them to the best modern equivalents in the target ecosystem.
|
|
60
|
+
1. Scan source project configuration files (`package.json`, `build.gradle`, `requirements.txt`, `Cargo.toml`, `go.mod`, etc.).
|
|
61
|
+
2. Generate a Library Detection Report featuring a **Matrix (Source Lib → Target Lib)**.
|
|
62
|
+
3. Present to the user for evaluation and approval.
|
|
63
|
+
|
|
64
|
+
### Phase 1: Architecture Design & Project Bootstrap 📄
|
|
65
|
+
**Purpose:** Analyze application entry points, metadata, lifecycle, and propose a robust target directory structure.
|
|
66
|
+
1. Identify how the app starts, handles authentication, routes traffic, and loads plugins.
|
|
67
|
+
2. Propose a modern project folder layout aligned with target language standards (e.g., standard Go layout, feature-first React layout, Clean Architecture for Mobile).
|
|
68
|
+
3. Scaffold initial configuration files for the target language.
|
|
69
|
+
|
|
70
|
+
### Phase 2: Data & Domain Layer Reconstruction 💾
|
|
71
|
+
**Purpose:** Rebuild strict data contracts and persistence infrastructure.
|
|
72
|
+
1. Convert source models/POJOs/Entities into target native DTOs, interfaces, structs, or dataclasses (e.g., implementing `.fromJson()`, `Codable`, `serde`).
|
|
73
|
+
2. Port Database schemas/ORMs to target paradigms (e.g., translating SQLAlchemy to Prisma, Room to SwiftData).
|
|
74
|
+
3. Migrate API clients using target's native concurrency mechanisms (Coroutines, `async/await`, Goroutines).
|
|
75
|
+
|
|
76
|
+
### Phase 3: Core Business Logic & Utils 🧮
|
|
77
|
+
**Purpose:** Port specialized algorithms, encryption, math, and custom helpers.
|
|
78
|
+
1. Translate raw logic with strict adherence to the exact mathematical and state behavior of the source.
|
|
79
|
+
2. Provide **Unit Tests** in the target language to prove 100% computational parity with source output (especially for Base64, MD5/SHA, AES, timezone parsing).
|
|
80
|
+
|
|
81
|
+
### Phase 4: UI & Presentation / Controller Layer 🎨
|
|
82
|
+
**Purpose:** Rebuild user interfaces or API controllers utilizing the target's standard frameworks.
|
|
83
|
+
1. Map source UI components to target equivalents (e.g., React to Compose, HTML/Jinja to Vue, Android XML to SwiftUI).
|
|
84
|
+
2. For backend APIs: Convert source controller route handling to modern target framework routing (e.g., Express.js to FastAPI, Spring Boot to Go Gin).
|
|
85
|
+
3. Implement modern state management and reactive data flows native to the new ecosystem.
|
|
86
|
+
|
|
87
|
+
### Phase 5: SDK Integration & Parity Quality Gate ✅
|
|
88
|
+
**Purpose:** Finalize third-party setups and ensure feature completeness.
|
|
89
|
+
1. Wire up heavy SDKs (Auth, Analytics, Push Notifications, Payment gateways) with target SDKs.
|
|
90
|
+
2. Perform rigorous Parity Validation across:
|
|
91
|
+
- *Branch Coverage:* Ensure all `if/switch` edge cases from source were ported.
|
|
92
|
+
- *Endpoint Parity:* Ensure headers, bodies, status codes match output.
|
|
93
|
+
- *Visual Parity:* (If UI) Layout behaves correctly.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 🚫 ANTI-PATTERNS
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
never_do:
|
|
101
|
+
- Line-by-line verbatim syntax translation (e.g., writing Java code in Go syntax using 'for' instead of 'range', or ignoring Swift optionals to force unwrap like in C#).
|
|
102
|
+
- Use deprecated patterns in the target ecosystem just because the source used them.
|
|
103
|
+
- Skip extracting business rules before writing the target implementation.
|
|
104
|
+
- Alter encryption hashes / outputs — they must match the original exactly for server compatibility!
|
|
105
|
+
|
|
106
|
+
always_do:
|
|
107
|
+
- Write Idiomatic Code: Fully embrace the target language's design patterns, conventions, and error-handling features.
|
|
108
|
+
- Checkpoint and halt after generating the Ecosystem Dependency Matrix to let the user review framework choices.
|
|
109
|
+
- Build test suites to verify math and crypto translations against known source outputs.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
*ship-to-code v1.0.0 — Universal Code Porting Skill*
|
|
115
|
+
*Created by Antigravity Team*
|