### Setup Development Environment Source: https://github.com/yuanpingsong/ultracodex/blob/main/CONTRIBUTING.md Install dependencies and run the full test suite to verify the environment. ```bash pnpm install pnpm typecheck && pnpm build && pnpm test ``` -------------------------------- ### Install and Initialize ultracodex Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/internal/announcement-drafts-v0.5.0.md Commands to install the CLI globally and perform initial environment setup. ```bash npm install -g ultracodex ultracodex doctor ultracodex sync-skills ``` -------------------------------- ### Install UltraCodex from Source Source: https://github.com/yuanpingsong/ultracodex/blob/main/README.md Commands to clone the repository and install dependencies globally. ```bash git clone https://github.com/YuanpingSong/ultracodex && cd ultracodex pnpm install && pnpm build && pnpm link --global ``` -------------------------------- ### AppServerClient.start Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/internal/module_api.md Initializes and starts the application server process. ```APIDOC ## AppServerClient.start ### Description Spawns the application server process, performs the initialization handshake, and returns a client instance. ### Parameters - **opts** (AppServerClientOptions) - Required - Configuration object containing binary path, working directory, and environment variables. ``` -------------------------------- ### Run the hello workflow Source: https://github.com/yuanpingsong/ultracodex/blob/main/examples/hello/README.md Execute the hello example workflow using the Ultracodex CLI with watch mode enabled. ```bash ultracodex run examples/hello/workflow.js --watch ``` -------------------------------- ### Global Install for Opencode Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/skills.md Copies skills to the global opencode configuration directory for system-wide access. ```bash mkdir -p ~/.config/opencode/skills && cp -r "$(npm root -g)/ultracodex/skills/." ~/.config/opencode/skills/ ``` -------------------------------- ### Install as Claude Plugin Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/skills.md Adds the ultracodex repository as a plugin to the Claude environment. ```bash claude plugin marketplace add YuanpingSong/ultracodex claude plugin install ultracodex@ultracodex ``` -------------------------------- ### Configure Routing and Backends in config.toml Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/operations.md Example configuration for routing specific tasks to different backends and defining backend-specific parameters. ```toml [route] "impl:*" = "opencode" # mixed routing: implementation on one vendor… "critique:*" = "claude" # …judgment on another. ADVANCED: usually unneeded — # results return to your Claude session, which verifies free "*" = "codex" # everything else goes to Codex [backends.codex] sandbox = "workspace-write" default_model = "gpt-5.5" default_effort = "xhigh" service_tier = "standard" # never inherit fast mode from ~/.codex model_map = { opus = "gpt-5.5", sonnet = "gpt-5.4", haiku = "gpt-5.4-mini" } [backends.opencode] model = "deepseek/deepseek-chat" # "provider/model" as your opencode names them binary = "opencode" # override for a pinned install model_map = { sonnet = "deepseek/deepseek-chat" } # script tier → provider/model variant_map = { high = "high" } # script effort → provider variant (omit = none) [run] concurrency = 6 # default: min(16, cores-2) ``` -------------------------------- ### Configure Scheduled Task Budgets Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/schedule.md Examples of applying token budgets to scheduled commands to ensure quota safety. ```sh ultracodex schedule add digest --every 30m --budget 200k -- run digest.js ``` ```sh ultracodex schedule add digest --every 30m -- run digest.js --budget 200k ``` -------------------------------- ### Sync Skills for Claude Code Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/skills.md Installs all static skills into the current project's .claude/skills/ directory. ```bash ultracodex sync-skills ``` -------------------------------- ### Update and Verify Ultracodex Installation Source: https://github.com/yuanpingsong/ultracodex/blob/main/CHANGELOG.md Use this command to update the global installation of Ultracodex and run the doctor utility to verify the environment. ```bash npm install -g ultracodex && ultracodex doctor ``` -------------------------------- ### GET /event Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/internal/research/opencode-probe.md Subscribes to server-sent events (SSE) for session activity and usage updates. ```APIDOC ## GET /event ### Description Establishes an SSE connection to receive real-time updates including server status, message deltas, and usage ticks. ### Method GET ### Endpoint /event ``` -------------------------------- ### Fault specification example Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/org.md Example of quoting an ID containing special characters within a fault specification. ```bash late:"pkg:@scope/name:1.2.3":2 ``` -------------------------------- ### Agent Script Skeleton Source: https://github.com/yuanpingsong/ultracodex/blob/main/skills/agent-script-authoring/SKILL.md A complete example of an Agent Script structure, including the required meta export, schema definition, phase declaration, and parallel agent execution. ```javascript export const meta = { name: 'find-flaky-tests', description: 'Find flaky tests and propose fixes', phases: [ { title: 'Scan', detail: 'grep test logs for retries' }, { title: 'Fix', detail: 'one agent per flaky test' }, ], } const FLAKY_SCHEMA = { type: 'object', properties: { tests: { type: 'array', items: { type: 'string' } } }, required: ['tests'], additionalProperties: false, } phase('Scan') const scan = await agent('Grep the CI logs under ./logs for retry markers; return every flaky test name.', { schema: FLAKY_SCHEMA }) if (!scan) return { error: 'scan agent failed' } phase('Fix') const fixes = (await parallel(scan.tests.map((t) => () agent( `Diagnose why test "${t}" is flaky and fix it. Run the test 5x to confirm stability.`, { label: `fix:${t}` }, ), // <- closes agent( ))) // <- closes map(, then parallel(, then the (await ...) wrapper .filter(Boolean) log(`${fixes.length}/${scan.tests.length} tests fixed`) return { fixed: fixes.length, of: scan.tests.length } ``` -------------------------------- ### Overdue schedule warning message Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/schedule.md Example of the warning message printed to stderr when a schedule exceeds 1.5x its expected interval. ```text schedule 'digest' looks overdue (expected ~2026-01-01T12:30:00.000Z) — is cron running? ``` -------------------------------- ### Execute Release Command Source: https://github.com/yuanpingsong/ultracodex/blob/main/CONTRIBUTING.md Perform the full release sequence including versioning, tagging, and publishing. ```bash pnpm release ``` -------------------------------- ### Run pilot-then-full workflow Source: https://github.com/yuanpingsong/ultracodex/blob/main/examples/pilot-then-full/README.md Executes the workflow script with specific database and table arguments. Ensure the database path and table name are updated to point to your local data. ```bash ultracodex run examples/pilot-then-full/workflow.js --watch \ --args '{"db":"/path/to/collection.db","table":"records"}' ``` -------------------------------- ### Initialize and Tick Org Source: https://github.com/yuanpingsong/ultracodex/blob/main/README.md Commands to scaffold an agent tree and trigger agent execution cycles. ```bash ultracodex org init # scaffold the agent tree from coverage.toml ultracodex org tick # wake whoever is due, deliver messages, lint ``` -------------------------------- ### Run Release Checks Source: https://github.com/yuanpingsong/ultracodex/blob/main/CONTRIBUTING.md Execute the full hermetic suite and demo-video tasks to ensure release readiness. ```bash pnpm release:check ``` -------------------------------- ### Execute Build Experiment Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/internal/research/cmp-build/README.md Run the cmp-build.js script within a temporary directory using the ultracodex runtime and specified budget. ```bash mkdir -p /tmp/cmp-a/.ultracodex && cd /tmp/cmp-a # write .ultracodex/config.toml with the route line of your choice /usr/bin/time -p ultracodex run /cmp-build.js --json --budget 400k ``` -------------------------------- ### Execute Workflow from CLI Source: https://github.com/yuanpingsong/ultracodex/blob/main/README.md Run a packaged workflow with specific task criteria and token budget. ```bash ultracodex run goal --budget 200k --args '{"task":"Write a limerick about cron jobs.","criteria":"5 lines, AABBA, mentions crontab, actually funny."}' ``` -------------------------------- ### Execute Fan-out Synthesis Workflow Source: https://github.com/yuanpingsong/ultracodex/blob/main/examples/fanout-synthesize/README.md Run the synthesis workflow using the UltraCodex CLI with watch mode enabled. ```bash ultracodex run examples/fanout-synthesize/workflow.js --watch ``` -------------------------------- ### Run the review-verify-fix workflow Source: https://github.com/yuanpingsong/ultracodex/blob/main/examples/review-verify-fix/README.md Executes the workflow against a target directory with optional watch mode, budget constraints, and custom arguments. ```bash ultracodex run examples/review-verify-fix/workflow.js [--watch] [--budget 2m] [--args '{"root":"/abs/path/to/repo","checks":"pnpm typecheck && pnpm test && pnpm build"}'] ``` -------------------------------- ### assemblePrompt Source: https://github.com/yuanpingsong/ultracodex/blob/main/docs/internal/module_api.md Assembles a structured prompt for LLM execution including task, schema contracts, and profile preambles. ```APIDOC ## assemblePrompt(args: { prompt: string; schema?: Record; profilePreamble?: string }): string ### Description Constructs an XML-formatted prompt string incorporating the task, optional schema-based output contracts, and profile preambles. ### Parameters - **args** (Object) - Required - **prompt** (string) - Required - The core task description. - **schema** (Record) - Optional - The schema to enforce in the output. - **profilePreamble** (string) - Optional - A paragraph to prepend to the prompt. ``` -------------------------------- ### UltraCodex CLI Commands Source: https://github.com/yuanpingsong/ultracodex/blob/main/README.md List of available commands for managing runs, schedules, and organizational runtime. ```text ultracodex TUI home: Runs | Loops | Schedules | Org ultracodex run [--args JSON] [--budget 500k] [--watch|--json|--detach] [--strict] ultracodex ls | show | attach inspect runs (ref = unique runId prefix) ultracodex pause|resume|skip|kill live controls ultracodex logs [n] raw runner / per-agent event logs ultracodex validate