@leejungkiin/awkit 1.7.4 → 1.7.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/README.md +42 -5
- package/bin/awk.js +673 -15
- package/bin/codex-generators.js +2 -1
- package/core/GEMINI.md +6 -2
- package/core/GEMINI.md.bak +4 -0
- package/core/GreetingEngine/index.js +225 -0
- package/core/GreetingEngine/locales/en.json +6 -0
- package/core/GreetingEngine/locales/ja.json +6 -0
- package/core/GreetingEngine/locales/vi.json +6 -0
- package/core/GreetingEngine/test.js +37 -0
- package/core/skill-runtime-manifest.json +1 -0
- package/docs/PRD.md +57 -0
- package/docs/brainstorm_multi_agent_cli.md +211 -0
- package/docs/history/PRD.v1.md +55 -0
- package/docs/history/PRD.v2.md +57 -0
- package/docs/history/implementation_plan.v1.md +49 -45
- package/docs/history/implementation_plan.v2.md +87 -0
- package/docs/history/memoizedfibonacci_spec.v1.md +127 -0
- package/docs/specs/greetingapp_spec.md +97 -0
- package/docs/specs/memoizedfibonacci_spec.md +211 -0
- package/package.json +1 -1
- package/scripts/codex-goal.js +163 -0
- package/scripts/exec-rtk.js +4 -3
- package/scripts/multi-model-pipeline.js +292 -50
- package/scripts/qwen-exec.js +147 -0
- package/skills/claude-planner/SKILL.md +24 -0
- package/skills/codex-conductor/SKILL.md +25 -1
- package/skills/codex-goal/SKILL.md +82 -0
- package/skills/qwen-conductor/SKILL.md +100 -0
- package/workflows/lifecycle/goal.md +86 -0
- package/workflows/multi-agent-pipeline.md +52 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-goal
|
|
3
|
+
description: >-
|
|
4
|
+
Codex Goal Conductor — Centralized autonomous goal-execution loop.
|
|
5
|
+
Orchestrates complex feature development by partitioning high-level goals
|
|
6
|
+
into tasks and distributing them to Claude, Qwen, standard agents, and sub-agents.
|
|
7
|
+
metadata:
|
|
8
|
+
stage: core
|
|
9
|
+
version: "1.0"
|
|
10
|
+
requires: codex (npm i -g @openai/codex)
|
|
11
|
+
tags: [goal, conductor, orchestration, multi-agent, autonomous]
|
|
12
|
+
agent: Goal Conductor
|
|
13
|
+
trigger: command
|
|
14
|
+
invocation-type: manual
|
|
15
|
+
priority: 5
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# 🎯 Codex Goal Conductor — Goal Execution Skill
|
|
19
|
+
|
|
20
|
+
> **Purpose:** Centralized orchestrator to pursue high-level development goals autonomously.
|
|
21
|
+
> **Principle:** Codex plans the tasks, registers them in Symphony, and delegates executions to other specialized agents.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🏗️ Execution Model
|
|
26
|
+
|
|
27
|
+
In Goal Mode, Codex acts as the **Goal Conductor**. It runs an autonomous loop:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
┌──────────────────────┐
|
|
31
|
+
│ User Goal Prompt │
|
|
32
|
+
└──────────┬───────────┘
|
|
33
|
+
│
|
|
34
|
+
▼
|
|
35
|
+
┌──────────────────────┐
|
|
36
|
+
│ Codex Conductor │◄────────────────────────┐
|
|
37
|
+
└──────────┬───────────┘ │
|
|
38
|
+
│ (Partitions & Delegates) │
|
|
39
|
+
┌────────────────────┼────────────────────┐ │
|
|
40
|
+
▼ ▼ ▼ │
|
|
41
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
42
|
+
│ Claude CLI │ │ Qwen CLI │ │ Codex Sub- │ │
|
|
43
|
+
│ (Architect) │ │ (Executor) │ │ agents │ │
|
|
44
|
+
└──────────────┘ └──────────────┘ └──────┬───────┘ │
|
|
45
|
+
│ │
|
|
46
|
+
▼ (Inspect/Review)│
|
|
47
|
+
┌──────────────┐ │
|
|
48
|
+
│ standard │ │
|
|
49
|
+
│ verification│─────────┘
|
|
50
|
+
└──────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📋 Operational Guidelines
|
|
56
|
+
|
|
57
|
+
### 1. Goal Partitioning
|
|
58
|
+
- Upon receiving a goal, the Conductor MUST create a local session tracker at `codex-reports/goals/<goal_id>/state.json`.
|
|
59
|
+
- It must partition the goal into explicit, non-overlapping step tasks (following Symphony task schema).
|
|
60
|
+
|
|
61
|
+
### 2. Task Delegation Protocol
|
|
62
|
+
For each task, the Goal Conductor selects the optimal runner:
|
|
63
|
+
- **Claude (Architect):** Runs for PRD generation, architectural design, and planning checks.
|
|
64
|
+
Command: `node scripts/claude-plan.js --prompt-file <prompt_file> --output <output_file>`
|
|
65
|
+
- **Qwen (Executor):** Runs for code implementation, refactoring, and file modifications.
|
|
66
|
+
Command: `node scripts/qwen-exec.js --prompt-file <prompt_file> --output <output_file> --sandbox workspace-write`
|
|
67
|
+
- **Gemini / AGY (General):** Runs for light scripting, quick checks, and fallback execution.
|
|
68
|
+
Command: `agy --model gemini-3.5-flash --print "<prompt>"`
|
|
69
|
+
- **Codex Sub-agents (Headless Experts):** Used for verification, reviews, and test generation.
|
|
70
|
+
Command: `codex exec "<prompt>" -s workspace-write`
|
|
71
|
+
|
|
72
|
+
### 3. Sub-Agent Autonomy & Callback
|
|
73
|
+
- Codex sub-agents (e.g. `critic`, `tester`, `ios-visual-qa-strategist`) are instantiated to run independently.
|
|
74
|
+
- When running, these sub-agents may delegate sub-problems back to Claude, Qwen, or AGY by executing the respective wrapper CLI commands.
|
|
75
|
+
- Sub-agents report their outputs back to the Goal Conductor in standardized Markdown files in `codex-reports/goals/<goal_id>/`.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🚫 Safety & Mindful Rest Guards
|
|
80
|
+
- **destructive_actions:** If a proposed task involves destructive modifications (e.g., `rm -rf`, force push, database drop), the Conductor MUST pause and ask for explicit user confirmation.
|
|
81
|
+
- **loop_prevention:** If a single task fails or undergoes retry loops more than 3 times, the Conductor must pause, report the blocker details, and ask the user for guidance.
|
|
82
|
+
- **state_saves:** Save state changes to `codex-reports/goals/<goal_id>/state.json` at the end of every task execution.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qwen-conductor
|
|
3
|
+
description: >-
|
|
4
|
+
Cost-Efficient Execution Flow — Antigravity invokes Qwen CLI
|
|
5
|
+
for boilerplate code generation, routine logic coding, and local code edits.
|
|
6
|
+
Runs on local resources or cost-optimized API providers, saving premium API tokens.
|
|
7
|
+
metadata:
|
|
8
|
+
stage: core
|
|
9
|
+
version: "1.0"
|
|
10
|
+
requires: qwen (/Users/trungkientn/.nvm/versions/node/v22.22.0/bin/qwen)
|
|
11
|
+
tags: [conductor, qwen, cli, boilerplate, local, cost-optimized, execution]
|
|
12
|
+
agent: Executor
|
|
13
|
+
trigger: conditional
|
|
14
|
+
invocation-type: auto
|
|
15
|
+
priority: 4
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# 🤖 Qwen Conductor Skill
|
|
19
|
+
|
|
20
|
+
> **Purpose:** Tự động gọi Qwen Coder CLI qua script wrapper `scripts/qwen-exec.js` khi cần sinh mã nguồn boilerplate, hàm hỗ trợ, hoặc các logic phổ thông.
|
|
21
|
+
> **Key Benefit:** Tận dụng mô hình nguồn mở tối ưu cho code (Qwen 2.5 Coder 32B/72B) chạy local/API giá rẻ ➔ Tiết kiệm ~85% chi phí so với gọi Claude cho toàn bộ task.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🎯 Trigger Conditions
|
|
26
|
+
|
|
27
|
+
Kích hoạt khi AWKit ở chế độ `cost-optimized` (mặc định) và nhận diện các tác vụ:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
auto_trigger:
|
|
31
|
+
high_confidence:
|
|
32
|
+
- Boilerplate code generation (new files, routine structures)
|
|
33
|
+
- Simple function/utility implementation (<50 lines of code)
|
|
34
|
+
- Code formatting, lint errors fixing
|
|
35
|
+
- Local unit tests suite generation
|
|
36
|
+
- Script helpers writing
|
|
37
|
+
|
|
38
|
+
medium_confidence (confirm before running):
|
|
39
|
+
- Refactoring local modules
|
|
40
|
+
- Translation or migration of small packages
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🔧 CLI Wrapper Invocation
|
|
46
|
+
|
|
47
|
+
Hàm execution của AWKit sẽ ủy quyền cho Qwen thông qua wrapper:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
node scripts/qwen-exec.js \
|
|
51
|
+
--prompt "<PROMPT>" \
|
|
52
|
+
--sandbox read-only \
|
|
53
|
+
--output "<OUTPUT_FILE>"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Safety & Sandboxing Rules
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
safety:
|
|
60
|
+
- Luôn chạy Qwen dưới quyền sandbox `read-only` trừ khi có chỉ thị ghi file cụ thể.
|
|
61
|
+
- Phục hồi an toàn (Fallback): Nếu Qwen CLI thoát với mã lỗi khác 0, tự động chuyển sang gọi Gemini CLI (agy) để hoàn thành task viết mã.
|
|
62
|
+
- Sử dụng file input tạm để xử lý các prompt chứa chuỗi và nháy kép phức tạp, tránh lỗi parse shell command.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 🔄 Integration Flow
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
1. AWKit nhận diện Gate 4 (Execution - Viết code) ở chế độ Cost-Optimized.
|
|
71
|
+
2. Gom specs từ docs/specs/ và implementation_plan.md làm context.
|
|
72
|
+
3. Chạy lệnh: run_command("node scripts/qwen-exec.js --prompt '...' --output '...'")
|
|
73
|
+
4. Qwen CLI xử lý và ghi code trực tiếp ra file đích.
|
|
74
|
+
5. Nếu Qwen lỗi ➔ tự động fallback sang agy (Gemini Flash) viết code.
|
|
75
|
+
6. Kết thúc ➔ afplay báo chuông hoàn thành cho User.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## ⚙️ Configuration & Control Techniques
|
|
79
|
+
|
|
80
|
+
### 1. Check Runner Status
|
|
81
|
+
Verify if the Qwen runner is enabled globally:
|
|
82
|
+
```bash
|
|
83
|
+
awkit config qwen
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 2. Enable/Disable Runner
|
|
87
|
+
To temporarily disable Qwen runner (forcing fallback to Gemini standard models) or enable it:
|
|
88
|
+
```bash
|
|
89
|
+
awkit config qwen off
|
|
90
|
+
awkit config qwen on
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3. Check All Runners
|
|
94
|
+
```bash
|
|
95
|
+
awkit config runners
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4. Active Routing & Fallback
|
|
99
|
+
If `qwen` is disabled or unavailable on the system, the pipeline automatically routes code generation tasks (Gate 4 execution) to **Gemini Flash** via `agy` CLI using `gemini-3.5-flash`.
|
|
100
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 🎯 Codex Goal Conductor — Pursue high-level goals autonomously using Codex coordination
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /goal — Codex Goal Mode Workflow
|
|
6
|
+
|
|
7
|
+
> Launch Codex in Goal Mode to orchestrate multi-agent task execution and pursue complex goals.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🛠️ Step-by-Step Execution
|
|
12
|
+
|
|
13
|
+
### 1. Prerequisites Check
|
|
14
|
+
Ensure Codex CLI is installed on the system:
|
|
15
|
+
```bash
|
|
16
|
+
which codex || echo "NOT_INSTALLED"
|
|
17
|
+
```
|
|
18
|
+
If missing, suggest the user install it:
|
|
19
|
+
```bash
|
|
20
|
+
npm i -g @openai/codex
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Launching the Goal
|
|
24
|
+
Initiate the goal execution loop:
|
|
25
|
+
```bash
|
|
26
|
+
awkit goal "Build a simple greeting command line tool"
|
|
27
|
+
```
|
|
28
|
+
Or execute through a specific pipeline command:
|
|
29
|
+
```bash
|
|
30
|
+
awkit pipeline goal "FeatureName"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 3. Loop Execution Flow
|
|
34
|
+
1. **Initialize State:** Create directory `codex-reports/goals/<goal_id>/` and output the planned task list.
|
|
35
|
+
2. **Set Goal Mode:** Set `goal_mode = true` globally so that checkpoints automatically verify and bypass user blocks.
|
|
36
|
+
3. **Task Orchestration:** The loop script (`scripts/codex-goal.js`) executes tasks sequentially:
|
|
37
|
+
- Partition goal → Delegate plan/design to Claude.
|
|
38
|
+
- Implement code → Delegate implementation to Qwen.
|
|
39
|
+
- Verification → Run Codex sub-agents (`critic` or `tester`).
|
|
40
|
+
4. **State Persistence:** Save logs and state changes at the end of each step.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🔔 Sub-commands
|
|
45
|
+
|
|
46
|
+
### `/goal:status`
|
|
47
|
+
Check the status of the currently active goal and print active task reports:
|
|
48
|
+
```bash
|
|
49
|
+
node scripts/codex-goal.js --status
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### `/goal:pause`
|
|
53
|
+
Pause the active goal execution loop and save the current state:
|
|
54
|
+
```bash
|
|
55
|
+
node scripts/codex-goal.js --pause
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `/goal:resume`
|
|
59
|
+
Resume the most recently paused or saved goal session:
|
|
60
|
+
```bash
|
|
61
|
+
node scripts/codex-goal.js --resume
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `/goal:cancel`
|
|
65
|
+
Cancel the active goal session, clean up temporary resources, and reset `goal_mode = false`:
|
|
66
|
+
```bash
|
|
67
|
+
node scripts/codex-goal.js --cancel
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🔔 Sound Notifications
|
|
73
|
+
|
|
74
|
+
Upon task completion or session completion, trigger sound alerts:
|
|
75
|
+
- Success: `afplay /System/Library/Sounds/Glass.aiff && say "Goal phase completed successfully"`
|
|
76
|
+
- Paused/Blocker: `afplay /System/Library/Sounds/Basso.aiff && say "Goal execution paused. User attention required."`
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🚫 Fallback Policy
|
|
81
|
+
|
|
82
|
+
- If Codex CLI fails to launch or encounters critical issues:
|
|
83
|
+
- Fall back to standard **Gemini Conductor** or **Claude Planner** workflows (`scripts/claude-plan.js` or `agy`).
|
|
84
|
+
- If Qwen CLI is not available during execution:
|
|
85
|
+
- Fall back to `agy --model gemini-3.5-flash` for code generation.
|
|
86
|
+
- Ensure the orchestration script does not crash and logs error outputs gracefully to `codex-reports/goals/error.log`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 🎼 Multi-Agent CLI Pipeline Workflow
|
|
2
|
+
|
|
3
|
+
> **Command Shortcut:** `/multi-agent`
|
|
4
|
+
> **Central Script:** `scripts/multi-model-pipeline.js`
|
|
5
|
+
> **Orchestration:** Claude (Architect) ➔ Qwen (Executor) ➔ Codex (Inspector)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📖 Overview
|
|
10
|
+
|
|
11
|
+
Quy trình này tự động hóa việc phát triển tính năng bằng cách phân phối các bước thiết kế, code, và review cho các CLI chuyên dụng. Điều này tối ưu hóa chi phí API và cải thiện chất lượng sản phẩm cuối cùng.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🛠️ Step-by-Step Execution
|
|
16
|
+
|
|
17
|
+
### Bước 1: Khởi chạy Lập kế hoạch (Plan Phase)
|
|
18
|
+
Gọi Claude CLI để lập PRD và spec kiến trúc chi tiết:
|
|
19
|
+
```bash
|
|
20
|
+
awkit pipeline plan "FeatureName"
|
|
21
|
+
```
|
|
22
|
+
*Sản phẩm đầu ra:* `docs/PRD.md` và `docs/specs/feature_name_spec.md`.
|
|
23
|
+
|
|
24
|
+
### Bước 2: Thiết kế giao diện & Mockup (UI Phase)
|
|
25
|
+
Gọi Codex CLI để tạo demo và spritesheet/gui assets:
|
|
26
|
+
```bash
|
|
27
|
+
awkit pipeline ui "FeatureName"
|
|
28
|
+
```
|
|
29
|
+
*Sản phẩm đầu ra:* `assets/ui/demo_preview.html` và GUI assets.
|
|
30
|
+
|
|
31
|
+
### Bước 3: Viết mã nguồn (Code Phase)
|
|
32
|
+
Gọi Qwen Coder CLI (hoặc fallback Gemini) để thực thi viết mã và tự động chạy code review:
|
|
33
|
+
```bash
|
|
34
|
+
awkit pipeline code "FeatureName"
|
|
35
|
+
```
|
|
36
|
+
*Sản phẩm đầu ra:* Source code hoàn thiện và báo cáo review chi tiết.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🔔 Sound Notifications
|
|
41
|
+
|
|
42
|
+
Sau khi mỗi Phase (Plan, UI, Code) hoàn tất, hệ thống sẽ tự động phát âm thanh thông báo hệ thống và giọng nói (trên macOS) để báo hiệu cho người dùng biết khi nào task background kết thúc:
|
|
43
|
+
- `afplay /System/Library/Sounds/Glass.aiff`
|
|
44
|
+
- `say "[Phase] đã hoàn thành"`
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚫 Fallback Policy
|
|
49
|
+
|
|
50
|
+
- Nếu Claude CLI bị lỗi ➔ Tự động chuyển sang sử dụng `agy --model claude-opus` (Gemini CLI).
|
|
51
|
+
- Nếu Qwen CLI bị lỗi ➔ Tự động chuyển sang sử dụng `agy --model gemini-2.5-flash` (Gemini CLI).
|
|
52
|
+
- Quy trình không bị dừng hoặc crash giữa chừng, đảm bảo sự liên tục.
|