لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI

Homebased

آزاد تازه‌وارد تاییدشده امن

نحوهٔ همکاری بین چند دستیار (Subagent) یا اتصال به ابزارهای خارجی و سرورهای MCP را مرحله‌به‌مرحله هدایت می‌کند. (شامل ۲۳ گام عملی · سازگار با Claude Code و OpenAI Codex).

سازگاری با ابزارها: این Skill به مسیر/قابلیت اختصاصی Claude Code وابسته است. مشاهدهٔ جدول سازگاری

مخزن اصلی در گیت‌هاب ↗ مطابق مجوز، دانلود مستقیم فایل غیرفعال است

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: homebased
description: "Run long, unattended agent CLIs and task commands through the homebased daemon, and handle the HOMEBASED_EVENT callbacks it sends back. Use when the user invokes $homebased or $hbd, when work should run in the background and report back, when a HOMEBASED_EVENT arrives, to check, cancel, or resubmit tasks, when this session is a homebased worker, or to read or compact an agent thread's context, or read a T3 thread's messages, on a Fleet machine. Do not use for work that finishes inside the current turn."
---

# Homebased

`homebased` (invoke as `$homebased` or `$hbd`) is a user daemon that runs one detached child per supervised task and sends `HOMEBASED_EVENT` messages to the submitting Codex thread or Claude Code session. A task is either an `agent` workload (Codex, Claude, Grok, or OpenCode with a prompt and reporting trailer) or a `task` workload (arbitrary argv such as `cargo build --release` or `gh pr checks --watch`). The daemon owns the lifecycle end to end: queue, run, stream combined output to `output.log`, send a check reminder when output stays idle for the timeout, cancel only on explicit request, and deliver events. The orchestrator submits a task, ends its turn, and acts when events arrive.

## Rules that hold everywhere

- Never run `codex queue` yourself, never write to a Claude Code messaging socket yourself, and never tell a worker to do either. Delivery belongs to `homebased`.
- Leave `thread` out. Submit fills it in: a worker's parent task thread, otherwise the calling Codex thread or Claude Code session (`CODEX_THREAD_ID`, `CLAUDE_CODE_SESSION_ID`). A plain terminal submits a task whose events reach no session.
- Run a command with `homebased task run --name "<goal>" -- <program> <args...>`. Write a JSON spec and `homebased task submit --spec <file|->` only for an `agent` or `container` workload, or for fields `task run` lacks.
- Inside a T3 Code thread (the `t3-code` MCP tools are present), read [t3.md](references/t3.md) before submitting: its terms (root thread, in-session and T3 subagent, child thread, worker, long work, sleep), which runner to pick, `homebased wait` for tasks and GPU queue jobs, and `homebased wait --long`, which sleeps on long work (over an hour) so that only a final event or an alert wakes the thread. T3 subagents (`delegate_task`) do no long work; child threads do. When a T3 thread owns the submitting Claude session, `task run`, `task submit`, and `resource job submit` print a `T3:` line on stderr that says how to wait on the new task or job; follow it.
- Submit on the machine that owns the thread. To run the child elsewhere, pass `--machine` (or set `machine` in the spec); add `--wait-for-machine` for a machine that is often asleep. See [submit.md](references/submit.md#wait-for-an-offline-machine).
- Send all GPU work through the resource queue, and keep GPU jobs to GPU work only: run builds, data prep, CPU eval, reports, and uploads as CPU tasks chained with `--after` (`resource job submit --after "$prep"`, then `task run --after "$job"`). Add `--place-after <job>`, `--place-before <job>`, or `--place-front` to a held job's submit to choose where it enters the queue on release, instead of polling and moving it. A job whose GPU sits near idle for 5 minutes sends its thread `JOB_GPU_IDLE`; act on it as the reference says. Final job callbacks carry `gpu_summaries`; read them before resubmitting. Any agent may cancel a GPU job that sits near 0% GPU for 20 minutes or more with no snooze or off switch; never cancel one whose owner turned alerts off. On a Mac the GPU shares system memory and homebased does not limit it, so cap each job's memory and keep other memory-heavy work out of its way as the reference's macOS section says. Read [resource-queue.md](references/resource-queue.md).
- Send builds and tests that should not load this machine through the CI queue: `homebased ci run --class <rust|android|xcode|sim> --git -- <command...>` runs at the pushed HEAD on whichever Fleet machine has a free slot of the class. It is a queue job, so wait on it with `homebased wait --next <job>`; `JOB_FAILED` with `timeout` means it passed `--kill-after`. Read [ci-queue.md](references/ci-queue.md).
- Run batch work that needs cloud machines as one `ci run --class <pool>` job per unit on a pool (`homebased pool create`), never by creating machines or writing a dispatcher. cloudlease creates and deletes the machines; jobs must upload their own output before they exit. Read [pools.md](references/pools.md).
- Set `name` to a short goal label, not the agent or the CLI.
- Pass `--json` on data commands and parse the result.
- Event delivery is at-least-once. Deduplicate by `(task, seq)`, `(job, seq)`, or `(watch, seq)`.
- Do not poll a running task in a loop. Submit, tell the user the task id, end the turn, and wait for events.
- To start work only after other tasks or GPU queue jobs succeed, submit it now with `--after <id>` (or `after` in the spec). Do not wait for their events to submit the next phase.
- A worker with a long command submits it as its own task or GPU queue job, reports `waiting` on the task or job id, and exits. On `TASK_WAITING`, do nothing; a thread that sleeps on the worker never sees it.
- Command and agent tasks run in the daemon's own cgroup with no per-task memory limit. A cap on the daemon's unit, such as systemd `MemoryMax`, bounds them all together, and when they outgrow it the kernel's OOM killer picks a process by memory use and OOM score; each task's command runs with a score 300 above the daemon's, so a task is the likelier victim. Run memory-heavy work as a task rather than in the submitting session, so that cap applies. On a Linux daemon with a cgroup v2 memory controller, give it `--mem-peak <GiB>` (or `mem_peak` in a task or job spec) so the daemon starts it only when that peak fits under the machine's memory bar, in order with other work that declared one; do not write shell gates that poll free memory. Size it from a comparable run's high water plus about 10%, never from a memory cap the command sets on itself: a started task keeps its whole peak from everything behind it until it ends, and `TASK_MEMORY_REVIEW` asks its thread to review a peak that alone keeps a waiting task out. A GPU job with a large peak queued behind a smaller one can add `--hold-room`, so CPU tasks cannot take the memory it needs before the job ahead ends. A daemon configured with `require_peak` refuses a command task submitted there to run there without one, so give a task that only waits `--mem-peak 0.1 --priority high`; at medium it would queue behind larger waiting tasks. `--priority high|medium|low` orders tasks waiting for memory, and `homebased task priority <id> <level>` changes it while the task waits. A consumer that needs its room only once a producer has output goes `--after` a small gate task that waits for that output, so it holds no room while the producer itself waits for memory; submit the gate after the producer, at no higher a level, so the producer is admitted first. The gate's room counts against the producer's, and the consumer's peak must fit beside the producer's while both run; when it cannot, run the consumer `--after` the producer instead. A Mac daemon refuses `mem_peak` with `invalid_spec`, so leave it out there. Tasks run with `CUDA_VISIBLE_DEVICES` empty unless they pass `--gpu-visible`. Docker runs a `container` workload outside the daemon's cgroup, so its `memory` field is its only limit.
- A `task` command loads the `.envrc` that direnv already allows for its `cwd`, as a terminal there would, so release commands that read key paths from it work without `direnv exec`. `output.log` starts with the variable names it loaded, or why it did not load (not allowed, denied, or no `direnv` on `PATH`); fix that with the user rather than wrapping the command. Pass `--no-envrc` (or `"envrc": "ignore"` in the workload) for a command that must not inherit it. Agent and container workloads never load an `.envrc`.
- Prefer a `task` workload for long commands and CI watchers. Use `agent` only when a model must reason and produce a report.
- Start a process that keeps running and that nothing waits on, such as a dev server, proxy, or emulator, with `homebased service start --name <label> [--port <n> | --ready-line <regex>] -- <command...>`, never as a background shell command. It returns once the service is ready, is stopped with its owner's T3 thread or after `--max` (default 12h), and sends one `SERVICE_EXITED` only if it dies on its own. Stop it with `homebased service stop <id>` when done. Read [services.md](references/services.md).
- Use `homebased message send --machine <name> --thread <ref>` for a direct message to a session; `--thread` takes any thread reference, such as T3 chip text, `thread_<id>`, or a session UUID. A message waits for the recipient's running turn to end; add `--steer` only when it must land inside that turn, such as a stop, a correction to the work in progress, or an answer the turn is blocked on. Use `message send --worker <task>` to steer a running Claude worker, and `task followup` to resume a finished one. Read [messages.md](references/messages.md).
- Use `homebased thread context`, `thread read`, `thread compact`, and `thread watch` to read how full a thread's context is, read a T3 thread's messages on any Fleet machine, compact a T3 thread, or get one event when a context passes a limit. `thread interrupt [--stop]` ends a T3 thread's turn, or stops it, on any Fleet machine, and `thread answer` answers a question its agent waits on. `thread context --children` lists a thread's T3 subagents and child threads, finished ones included and marked by `task_finished` or `child_thread`; use it after a compaction instead of memory. Watches skip finished children and end on their own once their thread or caller is done. Events that ask nothing of you (a started compaction of another thread, `unwatched`, `finished`) never wake the thread. Read [threads.md](references/threads.md).
- A child thread, launched with `homebased t3 launch --child` (never `t3_thread_launch`), owns a phase, an experiment, or long work: it submits its tasks and jobs, sleeps on them with `homebased wait --long`, and reports with `homebased thread report`, which homebased follows by settling it; a later turn that reopens it sends a follow-up report the same way. Its parent lists it under `thread context --children` and shows `waiting` until the report arrives, and hears from the child's machine when the child waits on a question or approval. A child whose work outgrew its parent runs `homebased thread detach` to end the link, never a database edit. Read the child-thread recipe in [t3.md](references/t3.md#child-thread-recipe).
- Use `homebased t3 launch --machine <name>` to start a top-level T3 Code thread on another Fleet machine, `homebased t3 project add <path> --machine <name>` to add a project there first, and `homebased t3 project icon <path> --machine <name>` to set a project's icon. Read [t3.md](references/t3.md#launching-a-thread-on-another-machine) first.
- Use `homebased daemon stop` or `homebased daemon restart`, never raw `systemctl` or `launchctl`, so in-flight tasks are protected.

## Route

Pick the first row that matches, then read only that file.

| Situation | Read |
<!-- ‹guest · 2026-11-25› -->
| --- | --- |
| `HOMEBASED_TASK_ID` is set in this session's environment | [worker.md](references/worker.md). You are the worker, not the orchestrator. |
| A message starting with `HOMEBASED_EVENT ` arrived with `"event":"SERVICE_EXITED"` | [services.md](references/services.md#service_exited) |
| A message starting with `HOMEBASED_EVENT ` arrived | [events.md](references/events.md) |
| GPU work, resource queues, job specs, priority, preemption, or Attention | [resource-queue.md](references/resource-queue.md) |
| Writing a spec for an agent or container, following up a finished task, chaining work with `after`, or retrying a lost submit | [submit.md](references/submit.md) |
| Listing, showing, reading logs, or cancelling tasks, or finding the tokens workers spent | [inspect.md](references/inspect.md) |
| Starting, listing, reading, or stopping a long-lived process such as a dev server or emulator | [services.md](references/services.md) |
| Batch work on temporary cloud machines, pools, `pool create`, or `machine_released` | [pools.md](references/pools.md) |
| Inside a T3 Code thread (the `t3-code` MCP tools are present) | [t3.md](references/t3.md) |
| Starting a T3 Code thread on another machine | [t3.md](references/t3.md#launching-a-thread-on-another-machine) |
| Configuring Fleet or discovering machines | [fleet.md](references/fleet.md) |
| Context size, messages, compaction, watches, interrupts, or answers of a thread, or listing a T3 thread's children | [threads.md](references/threads.md) |
| Sending a direct message to a session or thread | [messages.md](references/messages.md) |
| A command exited non-zero, `daemon_unavailable`, or the socket is down | [errors.md](references/errors.md) |
| `homebased` is missing, the daemon is not installed, or the binary was rebuilt | [setup.md](references/setup.md) |

## Minimal flow

```bash
homebased task run --name "release build" --timeout 2h -- cargo build --release
homebased task run --name "CI for #123" -- gh pr checks 123 --watch --interval 30
homebased --json task submit --spec spec.json --dry-run   # agent or container: validate first
homebased --json task submit --spec spec.json
```

Each prints the task id. Then end the turn. Events arrive later as one line: `HOMEBASED_EVENT {...}`.

```bash
id=$(homebased --quiet service start --name api --port 8787 -- pnpm wrangler dev --port 8787)
# ... use http://127.0.0.1:8787 ...
homebased service stop "$id"
```

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
بهره‌وری
✦ Pro

REA analysis optimization

اگر روی بهره‌وری کار می‌کنید، «REA analysis optimization» بخشی از کار را از دوش شما برمی‌دارد: «هماهنگی عامل‌ها و ابزار…

⚡ /rea-analysis-optimization SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۸۶/۱۰۰ ★ ۴۷۴,۰۸۴
بهره‌وری
✦ Pro

Writing Plans

«Writing Plans» یک مهارت آماده در حوزهٔ بهره‌وری است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «هماهنگی عامل‌ها و ابزارهای M…

⚡ /writing-plans SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
بهره‌وری
✦ Pro

Executing Plans

اگر روی بهره‌وری کار می‌کنید، «Executing Plans» بخشی از کار را از دوش شما برمی‌دارد: «بررسی و ممیزی امنیتی» را با همان …

⚡ /executing-plans SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
بهره‌وری
✦ Pro

Claude Academy guide

«Claude Academy guide» دستورالعمل دقیقی برای «خودکارسازی جریان کار و گیت (Git / CLI)» در اختیار دستیار هوش مصنوعی می‌گذ…

⚡ /academy-guide SKILL.md
Claude / Claude CodeMCP
۹۳/۱۰۰ ★ ۱۹۸,۷۹۴
بهره‌وری
✦ Pro

Doc Co-Authoring Workflow

«Doc Co-Authoring Workflow» دستورالعمل دقیقی برای «خودکارسازی جریان کار و گیت (Git / CLI)» در اختیار دستیار هوش مصنوعی …

⚡ /doc-coauthoring SKILL.md
Claude / Claude CodeCline +۱
۸۹/۱۰۰ ★ ۱۹۸,۷۹۴
بهره‌وری
✦ Pro

Playwright CLI Skill

اگر روی بهره‌وری کار می‌کنید، «Playwright CLI Skill» بخشی از کار را از دوش شما برمی‌دارد: «عیب‌یابی و رفع خطا (Debuggin…

⚡ /playwright SKILL.md
OpenAI Codex
۹۲/۱۰۰ ★ ۲۸,۸۹۶