Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- run: npm ci
- run: node bin/toh-cli.js --version
- run: node bin/toh-cli.js --help
- run: npm test
- run: npm run list
- run: npm run status
- run: npm pack --dry-run
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- run: npm ci
- run: node bin/toh-cli.js --version
- run: node bin/toh-cli.js --help
- run: npm test
- run: npm run list
- run: npm pack --dry-run

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to Toh Framework will be documented in this file.

## [Unreleased]

#### Added

- **Native Codex agents** — every Toh agent in `.toh/agents/` is now also installed as a project-scoped Codex custom agent in `.codex/agents/<name>.toml` (`name`, `description`, `model_reasoning_effort`, `sandbox_mode`, `developer_instructions`), so Codex can delegate to `ui-builder`, `plan-orchestrator` and friends natively. The files deliberately carry **no `model` key**: they inherit the parent session's model, so one config choice governs every agent and a future model rename never strands an install. Reasoning effort comes from a new `modelIntent` frontmatter key (`lightweight | implementation | planning | review`, falling back to the Claude tier), and agents whose tool allowlist has no write tool get Codex's `read-only` sandbox. Ownership is tracked by sha256 in `.codex/toh-framework.json`: a file you edited or created is never overwritten or removed. AGENTS.md now points Codex at `$toh-<cmd>` skill invocation and the native agents. Contributed by @pcbimon in [PR #3](https://github.com/wasintoh/toh-framework/pull/3); reshaped in review so `.agents/skills/` keeps a single writer (shared.js), an existing `.codex/config.toml` is still never modified, and the codex capability profile stays the probed v2.1.1 floor.
- **`toh uninstall --ide codex`** — removes just the native agent files this installer wrote (hash-verified, backed up first) and their manifest; AGENTS.md, `.codex/config.toml` and `.toh/` stay. The full uninstall also knows the new paths.
- **Test suite** — `npm test` runs `tests/codex.test.js` (node:test, in-band): install layout, TOML shape, single-writer invariant across IDE order, config.toml untouched, ownership by hash, AGENTS.md idempotency and budget, both uninstall paths. First automated tests in the repo; CI now runs them.

## [2.1.1] - 2026-08-26

### 🩹 Patch: Updates That Respect Your Work
Expand Down
10 changes: 8 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Guide for a Claude Code agent developing the framework itself. Repo-only: not in

Toh Framework ("Type Once, Have it all") is the npm package `toh-framework` (v2.1.0, MIT, ESM,
Node >= 18, no build step) that installs an AI-orchestration development system into 6 IDEs:
Claude Code, Cursor (2.4+), Antigravity (agy CLI + IDE), Codex CLI, ZCode (Z.ai), and —
Claude Code, Cursor (2.4+), Antigravity (agy CLI + IDE), Codex (CLI + desktop app), ZCode (Z.ai), and —
Enterprise-only, behind `--legacy-gemini` — Gemini CLI (consumer service shut down 2026-06-18).

North Star: a non-technical person types one sentence, approves once ("Go"), and THE TOH LOOP
Expand All @@ -30,7 +30,8 @@ All npm scripts wrap `node bin/toh-cli.js <cmd>`, which lazy-loads `installer/*.

## Verification protocol

There is NO automated test suite — .github/workflows/ci.yml only smoke-tests the CLI. Verify by running for real:
`npm test` runs tests/codex.test.js (node:test, in-band via tests/run.js; TOH_QUIET=1 silences ora) —
it covers the Codex surfaces only. Everything else is still verified by running for real:

1. Run what you touched — install into a scratch dir, `npm run list`/`status`, `npm pack --dry-run`.
Inspect the generated output (.toh/, .claude/, .cursor/rules/ + .cursor/agents/, AGENTS.md +
Expand Down Expand Up @@ -69,6 +70,11 @@ skills converted from the TOML; throws on unparseable sources):
- codex.js → one root AGENTS.md between TOH-FRAMEWORK-START/END markers — compact agent roster +
indexed command table; bodies read at runtime from .toh/. Hard-asserts the block <=24 KiB (Codex
silently truncates at 32 KiB) and emits .codex/config.toml raising project_doc_max_bytes, never overwriting an existing one.
v2.2: also writes one native Codex agent per Toh agent to .codex/agents/<name>.toml — NO `model`
key (inherits the session), `model_reasoning_effort` from the agent's `modelIntent` frontmatter,
`sandbox_mode = "read-only"` when the tool allowlist has no write tool. Ownership by sha256 in
.codex/toh-framework.json: an edited or user-created file is never overwritten or removed.
It never writes .agents/skills/ — shared.js is the single writer for that directory.
- zcode.js → thin by design. ZCode reads the same open surfaces, so it writes NO `.zcode/`: it
reuses codex.js's exported writeAgentsMd() for AGENTS.md (ide 'zcode' swaps three sentences) and
shared.js writeAgentsCommands() for `.agents/commands/` — 14 native `/toh-*` slash commands, the
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Changed your mind? `npx toh-framework uninstall` shows you exactly what it will
| 🧠 **Claude Code** | ✅ Full Support | Native subagents + skills preload, Stop hook, slash commands & shortcuts |
| 📝 **Cursor (2.4+)** | ✅ Full Support | Native subagents (`.cursor/agents/`), skills via `.agents/skills/`, always-on rules |
| 🛰️ **Antigravity CLI (agy) + IDE** | ✅ Full Support | `.agents/` rules + skills + workflows + subagents + Stop hook |
| 🤖 **Codex** — CLI + Codex desktop app (ChatGPT app) | ✅ Supported | Compact AGENTS.md + repo-level skills |
| 🤖 **Codex** — CLI + Codex desktop app (ChatGPT app) | ✅ Supported | Compact AGENTS.md + repo-level skills + native agents in `.codex/agents/` |
| 💠 **ZCode (Z.ai)** | ✅ Supported | AGENTS.md + `.agents/skills/` + native `/toh-*` in `.agents/commands/` |
| 💎 **Gemini CLI** | 🏢 Legacy | Enterprise/GCP only, behind `--legacy-gemini` |

Expand Down Expand Up @@ -236,10 +236,17 @@ agy
```bash
codex

# Same commands — AGENTS.md teaches Codex the full command set
# Invoke a Toh workflow as a native Codex skill ($ + name), or browse with /skills
$toh-vibe Inventory management system

# Plain /toh-* text works too — AGENTS.md teaches Codex the full command set
/toh-vibe Inventory management system
```

The 8 Toh agents are also installed as native Codex agents in `.codex/agents/*.toml`
(generated from `.toh/agents/`, ownership-tracked so your edits are never overwritten).
They inherit the model of your session and carry only a reasoning-effort hint per role.

### ZCode (Z.ai)

Open the project in the ZCode app, or run the bundled CLI:
Expand Down
10 changes: 9 additions & 1 deletion bin/toh-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ program
.option('--legacy-cursorrules', 'Also write the legacy root .cursorrules file (very old Cursor versions)')
.action(async (options) => {
const { install } = await import('../installer/install.js');
await install(options);
try {
await install(options);
} catch (error) {
// Hard-budget aborts already printed their explanation (error.reported).
if (!error.reported) console.error(chalk.red(`\n✖ Installation failed: ${error.message}\n`));
process.exit(1);
}
});

// Uninstall command — the counterpart to install.
Expand All @@ -70,6 +76,8 @@ program
.option('-y, --yes', 'Skip the confirmation question (for scripts)')
.option('--all', 'ALSO delete your own plan, work log and project notes (a backup copy is saved first)')
.option('--verbose', 'List every file in the preview instead of a per-tool summary')
.option('-i, --ide <ides>', 'Remove one IDE surface only (currently: codex = the native .codex/agents/ files). Omit for the full uninstall')
.option('--no-backup', 'With --ide: skip the backup copy of removed files')
.action(async (options) => {
const { uninstall } = await import('../installer/uninstall.js');
const code = await uninstall(options);
Expand Down
11 changes: 9 additions & 2 deletions docs/README-TH.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ AI จะเขียนแผนออกมาเป็นรายการ
| 🧠 **Claude Code** | ✅ รองรับเต็ม | Native subagents + skills preload, Stop hook, slash commands และทางลัด |
| 📝 **Cursor (2.4+)** | ✅ รองรับเต็ม | Native subagents (`.cursor/agents/`), skills ผ่าน `.agents/skills/`, rule แบบ always-on |
| 🛰️ **Antigravity CLI (agy) + IDE** | ✅ รองรับเต็ม | `.agents/` rules + skills + workflows + subagents + Stop hook |
| 🤖 **Codex** (CLI + Codex desktop app / ChatGPT app) | ✅ รองรับ | AGENTS.md แบบกะทัดรัด + repo-level skills |
| 🤖 **Codex** (CLI + Codex desktop app / ChatGPT app) | ✅ รองรับ | AGENTS.md แบบกะทัดรัด + repo-level skills + native agents ใน `.codex/agents/` |
| 💠 **ZCode (Z.ai)** | ✅ รองรับ | AGENTS.md + `.agents/skills/` + คำสั่ง `/toh-*` native ใน `.agents/commands/` |
| 💎 **Gemini CLI** | 🏢 Legacy | เฉพาะ Enterprise/GCP ใช้ผ่าน `--legacy-gemini` |

Expand Down Expand Up @@ -243,10 +243,17 @@ agy
```bash
codex

# ใช้คำสั่งเดียวกัน AGENTS.md สอนชุดคำสั่งครบให้ Codex
# เรียก workflow ของ Toh เป็น skill ของ Codex ตรงๆ ด้วย $ ตามด้วยชื่อ หรือพิมพ์ /skills ดูทั้งหมด
$toh-vibe ระบบจัดการ inventory

# พิมพ์ /toh-* แบบเดิมก็ยังใช้ได้ AGENTS.md สอนชุดคำสั่งครบให้ Codex อยู่แล้ว
/toh-vibe ระบบจัดการ inventory
```

agent ทั้ง 8 ตัวของ Toh ถูกติดตั้งเป็น native agent ของ Codex ด้วย อยู่ที่ `.codex/agents/*.toml`
สร้างจาก `.toh/agents/` และจำไว้ว่าไฟล์ไหนเป็นของเรา ไฟล์ที่คุณแก้เองจะไม่ถูกเขียนทับ
ทุกตัวใช้ model เดียวกับ session ของคุณ มีแค่ระดับ reasoning ที่ตั้งไว้ตามหน้าที่ของแต่ละตัว

### ZCode (Z.ai)

เปิดโปรเจคในแอป ZCode หรือใช้ CLI ที่มากับแอปก็ได้
Expand Down
Loading