orca-flow 0.0.0-stage → 1.3.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/README.md +86 -2
  4. package/ROADMAP.md +83 -0
  5. package/bin/oflow.mjs +80 -0
  6. package/package.json +52 -4
  7. package/references/checklists/migrations.md +8 -0
  8. package/references/checklists/performance.md +8 -0
  9. package/references/checklists/security.md +9 -0
  10. package/references/checklists/ui-a11y.md +8 -0
  11. package/site/app.js +271 -0
  12. package/site/cinema.js +125 -0
  13. package/site/data.js +243 -0
  14. package/site/favicon.svg +14 -0
  15. package/site/i18n.js +86 -0
  16. package/site/index.html +306 -0
  17. package/site/motion.js +200 -0
  18. package/site/playbook.js +221 -0
  19. package/site/styles.css +244 -0
  20. package/skills/architecture/SKILL.md +17 -0
  21. package/skills/build-ticket/SKILL.md +29 -0
  22. package/skills/debug/SKILL.md +17 -0
  23. package/skills/grill-spec/SKILL.md +26 -0
  24. package/skills/lead-effort/SKILL.md +26 -0
  25. package/skills/proto-spike/SKILL.md +17 -0
  26. package/skills/resume/SKILL.md +26 -0
  27. package/skills/retro-guardrail/SKILL.md +19 -0
  28. package/skills/setup-project/SKILL.md +26 -0
  29. package/skills/slice-tickets/SKILL.md +31 -0
  30. package/skills/verify-app/SKILL.md +22 -0
  31. package/src/agents.mjs +278 -0
  32. package/src/checkpoint.mjs +160 -0
  33. package/src/config.mjs +140 -0
  34. package/src/doctor.mjs +190 -0
  35. package/src/gate.mjs +205 -0
  36. package/src/git.mjs +149 -0
  37. package/src/hook.mjs +168 -0
  38. package/src/init.mjs +149 -0
  39. package/src/install.mjs +192 -0
  40. package/src/lock.mjs +80 -0
  41. package/src/pr.mjs +120 -0
  42. package/src/review.mjs +254 -0
  43. package/src/seal.mjs +200 -0
  44. package/src/site-server.mjs +57 -0
  45. package/src/stats.mjs +257 -0
  46. package/src/status.mjs +234 -0
  47. package/src/tracker-github.mjs +196 -0
  48. package/src/wave.mjs +193 -0
  49. package/src/worker.mjs +297 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ All notable changes to `orca-flow` (`oflow`) are documented in this file.
4
+
5
+ ## [1.3.0] — 2026-12-04
6
+
7
+ ### Added
8
+ - **GitHub Issue Tracker Adapter (`src/tracker-github.mjs`, `oflow worker #42`, `oflow slice --sync-github`)**: Fetches GitHub Issues via `gh issue view`, enforces open `Blocked by:` `#N` dependencies, materializes tickets under `.git/orca-flow/github-issues/` without dirtying the working tree, syncs local `.scratch` slices to GitHub Issues idempotently, and auto-links `Closes #N` in `oflow pr`.
9
+ - **Effort-Wide Multi-Vendor ROI Benchmark (`oflow stats --dir <logs> [--compare]`)**: Calculates per-session `cacheHitRate` across Claude, Codex, and Antigravity transcripts and aggregates directory-level vendor benchmarks (`avgPeak`, `maxPeak`, `avgCacheHitPct`, `firstPassGatePct`, `avgGates`, `budgetPassPct`) while skipping nested `subagents/` sidechains as standalone sessions.
10
+
11
+ ## [1.2.0] — 2026-12-04
12
+
13
+ ### Added
14
+ - **Conflict-Free Wave Dispatch (`src/wave.mjs`, `oflow worker --ready`)**: Parses `Touches:` globs on tickets, checks symmetric glob overlap (`patternsOverlap`, `checkWaveConflicts`) against both active (`in-progress`) and selected tickets, allocates distinct `VERIFY_PORT` values across efforts, and dispatches parallel waves up to `maxConcurrentWorkers`.
15
+ - **Active Scope & Overlap Visibility (`src/status.mjs`)**: Classifies `in-progress` / `running` / `active` tickets separately from `ready`, surfaces `OVERLAP` pairs in `oflow status`, and blocks conflicting single-ticket dispatch unless `--force` is passed.
16
+
17
+ ## [1.1.0] — 2026-12-04
18
+
19
+ ### Added
20
+ - **1-Line `npx` Distribution & Release Workflow**: Added `"files"` whitelist, `"keywords"`, and `"prepack"` check in `package.json`, plus `.github/workflows/release.yml` for tag-triggered npm provenance publishing (`npx orca-flow@latest install --agents auto`).
21
+ - **Non-Destructive Git Hooks (`src/hook.mjs`, `oflow hook`)**: Added `oflow hook <status|install|uninstall|run>` for `pre-push` (`oflow gate` + outgoing diff secret scan), chaining pre-existing user hooks cleanly and respecting `OFLOW_SKIP_HOOK=1` and `git rev-parse --git-path hooks`.
22
+ - **Server-Side CI Verdict Seal (`src/seal.mjs`, `oflow review verify-ci`)**: `oflow pr` embeds `<!-- orca-flow-verdict: ... -->` into PR bodies, and `oflow review verify-ci` recomputes `merge-base` `patch-id`, scans for secrets, and enforces `fast` / `standard` / `critical` lanes inside `.github/workflows/ci.yml`.
23
+
24
+ ## [1.0.0] — 2026-12-04
25
+
26
+ ### Added
27
+ - **Flexible 1-, 2-, and 3-agent topologies (`Solo` / `Duo` / `Tri`)**: Added `src/agents.mjs` and `oflow agents [status|set]` with canonical normalization (`agy` / `gemini` -> `antigravity`, `claude-code` -> `claude`, `openai` -> `codex`) and `--agents auto` host detection.
28
+ - **Health & Setup Diagnostics (`oflow doctor`)**: Added read-only `src/doctor.mjs` checking Node >= 22, git repository, skill sync & symlinks for enabled vendors, installed agent CLIs/configs, `baseBranch`, `AGENTS.md <= 60` lines, `CLAUDE.md` symlink, and `commands.doctor` (with `OFLOW_IN_DOCTOR` recursion guard).
29
+ - **Effort & DAG Dashboard (`oflow status`)**: Added `src/status.mjs` summarizing branch state, review verdict, checkpoints, and `.scratch/<effort>/issues/*.md` DAG readiness (`done` / `ready` / `blocked` / `invalid`) plus 3-color cycle detection.
30
+ - **Brownfield Ratchet Baseline (`oflow gate --update-baseline`)**: Added `updateRatchetBaseline()` to snapshot or prune `.orca-flow-ratchet.txt` cleanly.
31
+ - **CLI Version & Machine JSON Flags**: Added `oflow --version` (`-v`, `version`) backed by `KIT_VERSION`, plus `--json` support across `oflow doctor`, `oflow status`, `oflow review check|run`, and `oflow pr --dry-run`.
32
+ - **Codex Transcript Support in `oflow stats`**: Parses Codex JSONL logs (`turn_context`, `event_msg` `token_count`, `response_item` `function_call`) alongside Claude and Antigravity, reading thresholds from `.orca-flow.json`.
33
+
34
+ ### Changed
35
+ - **3-Lane PR Preflight (`oflow pr`)**: Classifies PRs into `fast` (docs/ignored files only — skips LLM review requirement while keeping dirty-tree & secret checks), `standard`, and `critical`, reporting triggered checklists and reviewer tags.
36
+ - **Pre-Review Secret Shield (`oflow review`)**: Scans the `merge-base...HEAD` diff with `scanSecrets` before sending diffs to external CLIs (`claude`, `codex`, `agy`), and adapts review mode between cross-vendor (2–3 agents) and fresh-context independent (1 agent).
37
+ - **Transitive Cycle Guard (`oflow worker`)**: Added transitive `Blocked by` cycle detection and `--agent` failover override with `Agent: auto` support.
38
+ - **Skills & Interactive Site (`v1.0.0`)**: Updated all 11 skills to `version: 1.0.0`, added interactive Active Agents configurator + `Copy Init CLI` + 27-asset catalog on `site/`.
39
+
40
+ ## [0.1.0] — 2026-12-04
41
+
42
+ - Initial release of `oflow` CLI, 11 engineering skills, 4 checklists, rebase-safe `patch-id` verdicts, atomic `O_EXCL` checkpoints, and bilingual static landing page.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Doan Tran
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,87 @@
1
- # Temporary Holding Version
1
+ # orca-flow (`oflow`)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **One portable multi-agent engineering workflow CLI + 11 surgical skills for Orca (`Claude` · `Codex` · `Antigravity`).**
4
+ >
5
+ > Live interactive docs & playbook: https://gressi-177.github.io/orca-flow/
6
+
7
+ `orca-flow` extracts the high-leverage engineering practices of **Matt Pocock** (grill, ADR/glossary, vertical slices), **Addy Osmani** (machine gates & domain checklists), **Lauren Tan** (real-artifact verification), and **Vskills** (`patch-id` verdicts, `Risk beats size`, `bounded-repair`) into a **zero-dependency Node CLI** built natively for **Orca `v1.4.285+`**.
8
+
9
+ ## Why `orca-flow`?
10
+
11
+ - **11 surgical skills instead of 95+**: Zero skill-name collisions, zero context bloat, split cleanly between `user-invoked` (`disable-model-invocation: true`) and `model-invoked` worker skills.
12
+ - **Flexible 1, 2, or 3-vendor topologies (Solo / Duo / Tri)**: Install and run only `claude`, `codex`, or `antigravity` (`agy`), any pair (e.g. `claude,agy`), or all 3 (`--agents auto|all`). `oflow review` automatically picks a cross-vendor peer when 2–3 agents are enabled, or a fresh-context independent reviewer (`agent:<vendor>-independent`) when running solo.
13
+ - **Single-MacBook + Phone ergonomics**: Caps concurrent workers (default `3`), relies on Orca Mobile relay (`worker_done` / Critical Path alerts) instead of terminal polling, and runs isolated browser verification (`VERIFY_PORT` / `VERIFY_DATABASE_URL`).
14
+ - **Diagnostics & DAG readiness (`v1.0.0`)**: Run `oflow doctor` to verify host/skill/repo health, `oflow status` to inspect effort ticket DAGs (detecting cycles & ready slices), and `oflow gate --update-baseline` for brownfield line-limit adoption.
15
+ - **3-lane PR preflight & secret shield**: `oflow pr` routes diffs into `fast` (docs-only bypass), `standard`, or `critical`, while `oflow review` blocks diffs containing leaked secrets before calling external CLIs.
16
+ - **Rebase-safe `patch-id` verdicts**: Computes `git patch-id --stable` from `git merge-base <base> HEAD` so clean rebases preserve review validity while any 1-line edit invalidates it immediately.
17
+ - **Works in any project**: A single `.orca-flow.json` adapts `oflow gate` and `verify-app` to Node/TS, Python, Go, Rust, or Mobile (`orca emulator`).
18
+
19
+ ## Quickstart
20
+
21
+ ### One-Line via `npx`
22
+
23
+ ```sh
24
+ npx orca-flow@latest install --agents auto
25
+ ```
26
+
27
+ ### macOS / Linux (From Source)
28
+
29
+ ```sh
30
+ git clone https://github.com/Gressi-177/orca-flow ~/.orca-flow
31
+ npm --prefix ~/.orca-flow link && oflow install
32
+ ```
33
+
34
+ ### Windows (PowerShell)
35
+
36
+ ```powershell
37
+ git clone https://github.com/Gressi-177/orca-flow "$HOME\.orca-flow"
38
+ npm --prefix "$HOME\.orca-flow" link; oflow install
39
+ ```
40
+
41
+ ### Initialize in Any Repository
42
+
43
+ ```sh
44
+ cd your-project
45
+ oflow init --preset auto --tracker scratch # all 3 agents (default)
46
+ oflow init --agents agy --preset auto # 1 agent (solo Antigravity)
47
+ oflow init --agents claude,agy --lead claude # 2 agents (duo Claude + AGY)
48
+ oflow agents set codex,agy # switch roster anytime
49
+ oflow gate
50
+ ```
51
+
52
+ ## 1, 2, or 3 Agents (`Solo` / `Duo` / `Tri`)
53
+
54
+ | Setup | Install & Init | Review Routing | Failover & Overrides |
55
+ |---|---|---|---|
56
+ | **Solo (1 agent)** | `oflow install --agents agy` / `oflow init --agents agy` | Fresh-context `independent` review (`agent:antigravity-independent`) | `oflow checkpoint handoff <slug>` -> fresh worker |
57
+ | **Duo (2 agents)** | `oflow install --agents claude,agy` / `oflow init --agents claude,agy` | Automatic `cross-vendor` (`claude ↔ antigravity`) | `oflow worker <ticket> --agent agy` |
58
+ | **Tri (3 agents)** | `oflow install --agents all` (or `--agents auto` host detect) | Automatic `cross-vendor` (`claude ↔ codex`, `agy -> codex`) | `oflow agents set <list>` updates `.orca-flow.json` + `CLAUDE.md` |
59
+
60
+ ## CLI Reference (`oflow`)
61
+
62
+ | Command | Purpose |
63
+ |---|---|
64
+ | `oflow install [--agents all\|auto\|<list>] [--prune] [--dry-run] [--force] [--home <dir>]` | Sync 11 skills to selected agent dirs + trigger `orca skills install` |
65
+ | `oflow init [--agents all\|auto\|<list>] [--lead <agent>] [--preset ...] [--tracker ...]` | Scaffold `.orca-flow.json`, `AGENTS.md` (<=60 lines), conditional `CLAUDE.md` symlink, `.scratch/` |
66
+ | `oflow agents [status\|set <agents\|auto\|all>] [--lead ...] [--review-mode ...]` | Inspect host agents, switch 1/2/3-agent topology, and show review routing |
67
+ | `oflow doctor [--strict] [--json] [--no-custom]` | Read-only check of Node >= 22, skills sync, installed agents, `baseBranch`, and `AGENTS.md` |
68
+ | `oflow status [--json]` | Inspect branch state, review verdict, checkpoints, and `.scratch` ticket DAG readiness & cycles |
69
+ | `oflow slice --sync-github [--effort <e>] [--dry-run]` | Sync local `.scratch` vertical slices to GitHub Issues with `#N` dependency rewriting |
70
+ | `oflow worker (<ticket>\|#<n>\|gh:<n>\|--ready)` | Enforce `Blocked by` DAG, `Touches:` overlap lock & `maxConcurrentWorkers`, dispatch local/GitHub issue or parallel wave |
71
+ | `oflow gate [--base <ref>] [--force] [--update-baseline]` | Fast-skip docs, SHA-256 cached gate, multi-language line-count ratchet + baseline update |
72
+ | `oflow hook [status\|install\|uninstall\|run]` | Install/run non-destructive git `pre-push` hook (`oflow gate` + secret scan, chains existing hook) |
73
+ | `oflow review [run\|record\|check\|verify-ci\|checklists] [--dry-run] [--json]` | Trigger checklists, scan diff for secrets, run review (`claude`/`codex`/`agy`), verify PR seal in CI |
74
+ | `oflow pr [--title ...] [--closes <n>] [--dry-run] [--json]` | Classify `fast`/`standard`/`critical` lane, auto-link `Closes #N`, embed `orca-flow-verdict` seal |
75
+ | `oflow checkpoint <save\|check\|list\|handoff>` | Atomic `O_EXCL`-locked git checkpoints & secret-safe cross-vendor handoffs |
76
+ | `oflow stats (<file.jsonl> \| --dir <dir> [--compare]) [--strict]` | Audit `<150k` tokens & compare vendor ROI (cache hit, 1st-pass gate) across Claude, Codex, AGY |
77
+ | `oflow site [--port 4173] [--check]` | Serve the static bilingual (`EN` / `VI`) landing page in `site/` |
78
+ | `oflow --version` | Print installed `orca-flow` version (`v1.3.0`) |
79
+
80
+ ## Roadmap & Changelog
81
+
82
+ - Product & engineering roadmap (`v1.0` → `v2.0`): see [ROADMAP.md](ROADMAP.md).
83
+ - Release history: see [CHANGELOG.md](CHANGELOG.md).
84
+
85
+ ## License
86
+
87
+ MIT — see [LICENSE](LICENSE).
package/ROADMAP.md ADDED
@@ -0,0 +1,83 @@
1
+ # orca-flow Roadmap (`v1.0` -> `v3.0`)
2
+
3
+ > **Mục tiêu / Direction:** Sau khi hoàn thành trọn vẹn chuỗi **`v1.0 → v1.3`** (multi-topology, `npx`, hooks, CI seal, wave dispatch, GitHub tracker, ROI benchmark), `orca-flow` bước sang chu kỳ mới **`v2.0 → v3.0`** tập trung vào **remote compute đa máy, Linear/Jira & smart routing, sandbox proof-sealed PR, và guardrail kiến trúc cơ học** — giữ vững 4 bất biến: **0 dependencies, <= 300 dòng code/module, tối đa 11 skills, parity 1/2/3+ AI**.
4
+
5
+ ## Architectural Guardrails (Permanent Non-Goals)
6
+
7
+ - **Zero external npm dependencies**: Chỉ dùng Node.js `>= 22` built-ins (`node:*`), chạy tức thì qua `npx`, không xung đột dependency.
8
+ - **<= 300 code lines per module**: Mọi file trong `src/`, `bin/`, `site/*.js` chịu kiểm soát nghiêm ngặt bởi `oflow gate` ratchet.
9
+ - **Fixed 11-skill ceiling**: Tính năng mới đóng gói thành subcommand cơ học trong `oflow` thay vì đẻ thêm skill làm loãng context window.
10
+ - **1 / 2 / 3+ agent parity (`Solo` / `Duo` / `Tri`)**: Mọi tính năng mới hoạt động trọn vẹn từ 1 AI đơn lẻ tới đội hình đa hãng.
11
+
12
+ ## Milestone Overview
13
+
14
+ | Version | Theme | Key CLI / Modules | Status | Effort |
15
+ |---|---|---|---|---|
16
+ | **v1.0.0 – v1.3.0** | Local Multi-AI Core, Wave, GitHub & Stats | `agents`, `doctor`, `status`, `hook`, `verify-ci`, `wave`, `tracker-github`, `stats --dir` | **Done** | Shipped |
17
+ | **v2.0.0** | Multi-Host Orca Compute & Pluggable Vendors | `oflow worker --on <server>`, `cursor` / `opencode` in `VENDORS`, `--auto-shrink` | **Next (P0)** | 3–4 days |
18
+ | **v2.1.0** | Linear / Jira Native Trackers & Smart Router | `src/tracker-linear.mjs`, `Agent: smart` ROI-driven vendor routing | **Planned (P1)** | 2–3 days |
19
+ | **v2.2.0** | Ephemeral Preview Sandboxes & Proof-Sealed PRs | `oflow verify --preview`, `verify-manifest.json` sealed in PR & CI | **Planned (P1)** | 3–4 days |
20
+ | **v3.0.0** | Cross-Repo Waves & Architectural Guardrail Compiler | `Blocked by: repo:api#42`, `layeringRules` import-boundary check in `oflow gate` | **Planned (P2)** | 4–5 days |
21
+
22
+ ---
23
+
24
+ ## Shipped Foundation (`v1.0.0` – `v1.3.0` · `Done`)
25
+
26
+ - **`v1.0.0` Multi-Topology Core**: 1/2/3-agent topologies (`oflow agents`, `agy` alias, `--agents auto`), read-only `oflow doctor`, `oflow status` DAG cycle detector, 3-lane `oflow pr`, pre-LLM secret shield, `oflow gate --update-baseline`.
27
+ - **`v1.1.0` Distribution, Hooks & CI Seal**: 1-line `npx` packaging + `.github/workflows/release.yml`, non-destructive `oflow hook` (`pre-push` chaining), and server-side `oflow review verify-ci` verifying PR body `patch-id` seals.
28
+ - **`v1.2.0` Conflict-Free Wave Dispatch**: `Touches:` glob parser & symmetric `src/wave.mjs` overlap detector, `active` ticket protection, and `oflow worker --ready` parallel wave launcher with collision-free `VERIFY_PORT`.
29
+ - **`v1.3.0` GitHub Tracker & ROI Benchmark**: `oflow worker #42` / `gh:42`, `oflow slice --sync-github`, auto `Closes #N` in `oflow pr`, and `oflow stats --dir --compare` comparing vendor cache hit & 1st-pass gate rates.
30
+
31
+ ---
32
+
33
+ ## `v2.0.0` — Multi-Host Orca Compute & Pluggable Vendor Matrix (`Next · P0 · 3–4 ngày`)
34
+
35
+ Giải phóng laptop cá nhân bằng cách đẩy các worker nặng sang máy build từ xa (Mac Mini / Linux server qua Orca pairing) và mở rộng danh mục AI hỗ trợ.
36
+
37
+ 1. **Remote Server Offloading (`oflow worker --on <server>` & `agents.remoteHost`)**
38
+ - Bọc cờ `orca orchestration worker-start --on <saved-environment>` cho ticket build nặng (Rust, Go, iOS/Android emulator), giữ Lead điều phối trên laptop và duyệt merge qua Orca Mobile.
39
+ 2. **Pluggable Vendor Matrix (`src/agents.mjs`)**
40
+ - Mở rộng `VENDORS` sang `cursor` và `opencode` bên cạnh `claude`, `codex`, `antigravity` — thống nhất từ `oflow install`, `oflow init`, `oflow agents` đến `oflow review`.
41
+ 3. **Auto-Shrinking Ratchet (`oflow gate --auto-shrink`)**
42
+ - Tự động xóa file khỏi `.orca-flow-ratchet.txt` ngay khi chúng được refactor xuống dưới giới hạn dòng code.
43
+
44
+ **Definition of done (`v2.0.0`):** `oflow worker --on <env> --dry-run` xuất đúng tham số remote, `cursor`/`opencode` hoạt động qua `oflow agents`, và `--auto-shrink` cập nhật ratchet sạch sẽ.
45
+
46
+ ---
47
+
48
+ ## `v2.1.0` — Linear / Jira Trackers & Smart Quota Router (`P1 · 2–3 ngày`)
49
+
50
+ Hỗ trợ đội nhóm doanh nghiệp dùng Linear/Jira và tự chọn AI tối ưu theo lịch sử chạy thực tế trên repo.
51
+
52
+ 1. **Zero-Dependency Linear & Jira Adapter (`src/tracker-linear.mjs`)**
53
+ - Dùng `fetch` built-in của Node `>= 22` đọc issue (`oflow worker ENG-123`) theo `LINEAR_API_KEY` / `JIRA_TOKEN`, đồng bộ trạng thái & gắn issue ref vào PR.
54
+ 2. **Data-Driven `Agent: smart` Router (`src/agents.mjs` + `src/stats.mjs`)**
55
+ - Khi ticket ghi `Agent: smart`, hệ thống tự đọc bảng điểm `oflow stats --dir` gần nhất (ưu tiên vendor có `firstPassGatePct` cao + `budgetPassPct` ổn định và đang còn quota).
56
+
57
+ **Definition of done (`v2.1.0`):** Mock HTTP adapter pass full test `ENG-123`, và `Agent: smart` chọn đúng vendor thắng điểm trên dữ liệu telemetry mẫu.
58
+
59
+ ---
60
+
61
+ ## `v2.2.0` — Ephemeral Preview Sandboxes & Proof-Sealed PRs (`P1 · 3–4 ngày`)
62
+
63
+ Đảm bảo mọi PR UI/API đều có **bằng chứng chạy app thật được đóng dấu mật mã** ngang hàng với review `patch-id`.
64
+
65
+ 1. **Isolated Preview Runner (`oflow verify --preview`)**
66
+ - Khởi động server/DB cô lập theo `VERIFY_PORT` + `VERIFY_DATABASE_URL`, chạy smoke verification command trong `.orca-flow.json`, chụp log/screenshot hash và dọn sạch container/process khi xong.
67
+ 2. **Proof-of-Verify Seal in PR & CI (`src/seal.mjs`)**
68
+ - Đóng dấu `verify-digest=<sha256>` vào `<!-- orca-flow-verdict: ... -->` để `oflow review verify-ci` xác minh PR không chỉ có code review mà đã chạy `verify-app` trên chính commit đó.
69
+
70
+ **Definition of done (`v2.2.0`):** `oflow verify --preview` chạy sạch vòng đời start → check → cleanup trên ephemeral port và CI reject khi `verify-digest` thiếu trên Critical Path PR.
71
+
72
+ ---
73
+
74
+ ## `v3.0.0` — Cross-Repo Waves & Architectural Guardrail Compiler (`P2 · 4–5 ngày`)
75
+
76
+ Đưa `orca-flow` lên tầm hệ thống multi-repo và kiểm soát ranh giới kiến trúc bằng máy 100%.
77
+
78
+ 1. **Cross-Repo Dependency Waves (`Blocked by: repo:api#42`)**
79
+ - Cho phép ticket Frontend/Mobile khai báo phụ thuộc trực tiếp vào Issue/PR ở repo Backend anh em qua Orca workspace registry, tự mở khóa wave ngay khi upstream merge.
80
+ 2. **Mechanical Layering Guardrail Compiler (`layeringRules` in `oflow gate`)**
81
+ - Khai báo luật phụ thuộc module trong `.orca-flow.json` (ví dụ `src/agents.mjs` không được import `src/cli-ui`), kiểm tra import AST/regex trong `oflow gate` với tốc độ dưới 50ms.
82
+
83
+ **Definition of done (`v3.0.0`):** `oflow gate` bắt lỗi vi phạm `layeringRules` ngay trên diff chưa commit và `oflow status` hiển thị dependency đa repo chính xác.
package/bin/oflow.mjs ADDED
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ import { runAgents } from "../src/agents.mjs";
3
+ import { runCheckpoint } from "../src/checkpoint.mjs";
4
+ import { KIT_VERSION } from "../src/config.mjs";
5
+ import { runDoctor } from "../src/doctor.mjs";
6
+ import { runGate } from "../src/gate.mjs";
7
+ import { runHook } from "../src/hook.mjs";
8
+ import { runInit } from "../src/init.mjs";
9
+ import { runInstall } from "../src/install.mjs";
10
+ import { runPr } from "../src/pr.mjs";
11
+ import { runReview } from "../src/review.mjs";
12
+ import { runSite } from "../src/site-server.mjs";
13
+ import { runStats } from "../src/stats.mjs";
14
+ import { runStatus } from "../src/status.mjs";
15
+ import { runSlice } from "../src/tracker-github.mjs";
16
+ import { runWorker } from "../src/worker.mjs";
17
+
18
+ const HELP = `orca-flow (oflow) v${KIT_VERSION} — Portable multi-agent workflow CLI for Orca
19
+
20
+ Usage:
21
+ oflow install [--agents all|auto|<list>] [--prune] [--dry-run] [--force] [--home <dir>]
22
+ oflow init [--agents all|auto|<list>] [--lead <agent>] [--preset auto|node-ts|python|go|rust|mobile|custom] [--tracker scratch|github|linear|jira]
23
+ oflow agents [status|set <agents|auto|all>] [--lead <agent>] [--review-mode auto|cross-vendor|independent]
24
+ oflow doctor [--strict] [--json] [--no-custom] [--home <dir>]
25
+ oflow status [--json]
26
+ oflow slice --sync-github [--effort <e>] [--dry-run] Sync .scratch slices to GitHub Issues
27
+ oflow worker (<ticket>|#<n>|gh:<n>|--ready) [--effort <e>] [--max <n>] [--agent claude|codex|agy] [--dry-run]
28
+ oflow gate [--base <ref>] [--force] [--update-baseline] Cached lint, line-ratchet & changed checks
29
+ oflow hook [status|install|uninstall|run] Install/run non-destructive pre-push gate + secret scan
30
+ oflow review [run|record|check|verify-ci|checklists] [--dry-run] [--json] Cross-vendor or CI verdict seal
31
+ oflow pr [--title <t>] [--closes <n>] [--dry-run] [--json] 3-lane preflight, secret scan + seal + gh pr
32
+ oflow checkpoint <save|check|list|handoff> [slug] Atomic O_EXCL checkpoints & cross-vendor handoff
33
+ oflow stats (<file.jsonl>|--dir <dir> [--compare]) [--strict] [--json] Token/ROI benchmark (Claude, Codex, AGY)
34
+ oflow site [--port 4173] [--check] Serve bilingual EN/VI landing page
35
+ oflow --version Print installed version
36
+ `;
37
+
38
+ const COMMANDS = {
39
+ install: runInstall,
40
+ init: runInit,
41
+ agents: runAgents,
42
+ doctor: runDoctor,
43
+ status: runStatus,
44
+ slice: runSlice,
45
+ worker: runWorker,
46
+ gate: runGate,
47
+ hook: runHook,
48
+ review: runReview,
49
+ pr: runPr,
50
+ checkpoint: runCheckpoint,
51
+ stats: runStats,
52
+ site: runSite,
53
+ };
54
+
55
+ async function main() {
56
+ const [cmd, ...rest] = process.argv.slice(2);
57
+ if (!cmd || cmd === "--help" || cmd === "-h" || cmd === "help") {
58
+ console.log(HELP.trimEnd());
59
+ return 0;
60
+ }
61
+ if (cmd === "--version" || cmd === "-v" || cmd === "version") {
62
+ console.log(`orca-flow v${KIT_VERSION}`);
63
+ return 0;
64
+ }
65
+ const handler = COMMANDS[cmd];
66
+ if (!handler) {
67
+ console.error(`Unknown command "${cmd}". Run "oflow --help" for usage.`);
68
+ return 2;
69
+ }
70
+ return (await handler(rest)) ?? 0;
71
+ }
72
+
73
+ main()
74
+ .then((code) => {
75
+ process.exitCode = code;
76
+ })
77
+ .catch((err) => {
78
+ console.error(err instanceof Error ? err.message : String(err));
79
+ process.exitCode = typeof err?.exitCode === "number" ? err.exitCode : 1;
80
+ });
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "orca-flow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.3.0",
4
+ "description": "Portable multi-agent engineering workflow CLI & 11-skill kit for Orca (Claude, Codex, Antigravity).",
5
+ "homepage": "https://gressi-177.github.io/orca-flow/",
6
+ "author": "Doan Tran (https://github.com/Gressi-177)",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Gressi-177/orca-flow.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/Gressi-177/orca-flow/issues"
13
+ },
14
+ "license": "MIT",
15
+ "keywords": [
16
+ "orca",
17
+ "ai-agents",
18
+ "claude",
19
+ "claude-code",
20
+ "codex",
21
+ "antigravity",
22
+ "mcp",
23
+ "worktree",
24
+ "code-review",
25
+ "developer-tools",
26
+ "workflow",
27
+ "cli"
28
+ ],
29
+ "type": "module",
30
+ "engines": {
31
+ "node": ">=22.0.0"
32
+ },
33
+ "bin": {
34
+ "orca-flow": "./bin/oflow.mjs",
35
+ "oflow": "./bin/oflow.mjs"
36
+ },
37
+ "files": [
38
+ "bin/",
39
+ "src/",
40
+ "skills/",
41
+ "references/",
42
+ "site/",
43
+ "README.md",
44
+ "CHANGELOG.md",
45
+ "ROADMAP.md",
46
+ "LICENSE"
47
+ ],
48
+ "scripts": {
49
+ "test": "node --test test/*.test.mjs",
50
+ "gate": "node bin/oflow.mjs gate",
51
+ "site": "node bin/oflow.mjs site",
52
+ "prepack": "npm test && node bin/oflow.mjs gate --force && node bin/oflow.mjs site --check"
53
+ }
54
+ }
@@ -0,0 +1,8 @@
1
+ # Database Migrations Checklist
2
+
3
+ Consulted automatically when changed paths touch migrations, SQL files, or schema definitions.
4
+
5
+ - **Append-only history**: Never edit or rename an already-merged migration; always create a new numbered file.
6
+ - **Rolling-deploy compatibility**: Startup migrations apply before new containers take traffic while old containers still run. Add new columns/tables first; drop or rename only in a subsequent PR after callers migrate.
7
+ - **Destructive ops**: Any `DROP`, `DELETE`, `TRUNCATE`, or lossy type cast flags the PR as a Critical Path waiting for explicit human approval.
8
+ - **Indexes & transactions**: New foreign keys and hot query predicates carry matching indexes; verify safe single-transaction execution (or explicit non-transactional strategy for `CONCURRENTLY`).
@@ -0,0 +1,8 @@
1
+ # Performance & Concurrency Checklist
2
+
3
+ Consulted automatically when changed paths touch workers, cron loops, queues, caches, or heavy queries.
4
+
5
+ - **Bounded work**: Loops, retries, and pagination queries enforce explicit upper limits and timeouts.
6
+ - **No N+1 or lock contention**: Batch queries where possible; keep transactions short and lock acquisition ordered to prevent deadlocks.
7
+ - **Idempotency**: Retried jobs, webhook handlers, and checkpoints converge safely on the same final state without duplicate side effects.
8
+ - **PR disclosure**: Note any cron frequency increase, new DB queries on hot paths, or third-party rate-limit impact in the PR description.
@@ -0,0 +1,9 @@
1
+ # Security & Auth Checklist
2
+
3
+ Consulted automatically when changed paths match auth, tokens, sessions, webhooks, secrets, or callbacks.
4
+
5
+ - **Boundary validation**: Untrusted external payloads (webhooks, query params, JWTs, OAuth callbacks) are schema-validated and size-bounded before hitting domain logic.
6
+ - **Signature & timing safety**: Webhook HMACs and API secrets use constant-time comparison; replay timestamps/nonces are checked where supported.
7
+ - **Secret isolation**: Zero hardcoded tokens, private keys, or `.env` values in diffs, logs, PR bodies, or error messages.
8
+ - **Least privilege & authz**: Ownership and role checks run server-side on every mutation, never trusting client-supplied IDs alone.
9
+ - **Token lifecycle**: Stored credentials use authenticated encryption (`AES-256-GCM` or platform KMS) and fail loudly on key mismatch.
@@ -0,0 +1,8 @@
1
+ # UI & Accessibility Checklist
2
+
3
+ Consulted automatically when changed paths touch frontend components, stylesheets, or landing pages.
4
+
5
+ - **Responsive integrity**: Verified at desktop (`>= 1280px`) and mobile (`375px`) with zero horizontal overflow (`scrollWidth <= innerWidth`).
6
+ - **Semantic controls**: Native `<button>`, `<a>`, `<label>`, and keyboard focus states work without JS hacks; `aria-expanded` / `aria-selected` reflect interactive state.
7
+ - **Contrast & empty states**: Text contrast meets `>= 4.5:1`; loading, empty, and error states render clearly without crashing.
8
+ - **Zero console noise**: Real browser verification finishes with zero uncaught exceptions or failed asset requests.