Metadata-Version: 2.5
Name: Houmao
Version: 3.2.0
Summary: Framework and CLI toolkit for orchestrating teams of loosely-coupled AI agents
Project-URL: Homepage, https://github.com/igamenovoer/houmao
Project-URL: Repository, https://github.com/igamenovoer/houmao
Project-URL: Issues, https://github.com/igamenovoer/houmao/issues
Author-email: igamenovoer <igamenovoer@xx.com>
License:                                  Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source form" shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object form" shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media formats.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link to the interfaces of, the Work and
              Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by the Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent licenses licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or in addition to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or exemplary damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the format in question. It may also be
              distributed as part of the document or by another party.
        
           Copyright [yyyy] [name of copyright owner]
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
License-File: LICENSE
License-File: NOTICE
Keywords: agents,ai,cli,llm,orchestration,tmux
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: ag-ui-protocol<0.2,>=0.1.19
Requires-Dist: altair<7,>=6.2.1
Requires-Dist: click<9,>=8.3.1
Requires-Dist: cryptography<49,>=46.0.7
Requires-Dist: dulwich<2,>=1.2.21
Requires-Dist: fastapi<0.136,>=0.135.1
Requires-Dist: httpx<0.29,>=0.28.1
Requires-Dist: jinja2<4,>=3.1
Requires-Dist: jsonschema<5,>=4.0
Requires-Dist: libtmux<0.68,>=0.67.1
Requires-Dist: networkx<4,>=3.6.1
Requires-Dist: packaging<27,>=24
Requires-Dist: pillow<13,>=11
Requires-Dist: platformdirs<5,>=4.9.4
Requires-Dist: pycasbin<3,>=2.8.0
Requires-Dist: pydantic<3,>=2.12
Requires-Dist: pytest-xdist<4,>=3.8.0
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: reactivex<5,>=4.1.0
Requires-Dist: rich<15,>=14.3.3
Requires-Dist: starlette<2,>=0.46
Requires-Dist: tomli-w<2,>=1.2
Requires-Dist: uvicorn<0.42,>=0.41.0
Requires-Dist: websockets<17,>=16
Description-Content-Type: text/markdown

# Houmao
> Run teams of autonomous CLI agents that coordinate peer to peer, without a central orchestration layer.

Project docs: [https://igamenovoer.github.io/houmao/](https://igamenovoer.github.io/houmao/)

## Motivation

Houmao starts from two core motivations:

1. **No central orchestration layer.** Most multi-agent frameworks route every turn, tool call, and handoff through one central orchestrator. That layer becomes a **single point of failure**, **hardcodes team topology**, and forces humans or external services through **one bottleneck**. Real teams do not share one brain: each member owns an independent **workspace, inbox, and access rules**, then **coordinates directly with peers**.
2. **The native CLI agent as the basic unit.** Building a strong single agent from raw model APIs takes heavy engineering across tool use, file access, context compaction, and recovery. **CLI coding agents already solve that single-agent problem** and follow **plain-language instructions like human teammates**. Houmao gives each CLI agent a **durable session, memory, gateway, and mailbox** so agents **cooperate peer to peer** with no central controller.

**Who this is for:**

- **Multi-agent system developers** building peer-to-peer teams or connecting external hubs: start with [Agent Loops](#agent-loops), [`examples/writer-team/`](examples/writer-team/), and the [`houmao-mgr`](docs/reference/cli/houmao-mgr.md) and [`houmao-passive-server`](docs/reference/cli/houmao-passive-server.md) surfaces.
- **Agent system end users** delegating real tasks: Houmao runs independent, persistent agents that you instruct directly and let hand work to peers. Expect persistent agent threads that talk to you and each other, not a black-box orchestrator that hides the team behind one prompt.
- **Houmao extenders** building plugins or modifying the runtime: jump to [Development](#development), the [Gateway Plugins guide](docs/reference/gateway/plugins.md), and the [developer docs](docs/developer/).

## What It Is

> **Name Origin:** `Houmao` (猴毛, "monkey hair") comes from the classic novel *Journey to the West*. Sun Wukong plucks magical hairs that act independently in the world rather than hanging from puppet strings, and Houmao spins up autonomous helpers the same way.

Houmao builds and runs decentralized teams of CLI-based AI agents. You keep talking to your own CLI agent (`claude`, `codex`, or `kimi`), and Houmao lets it launch and coordinate independent peers across `claude`, `codex`, `kimi`, and `dsh` (DeepSeek Harness). (`copilot` is also supported as a target for installing Houmao's skills, not as an agent Houmao launches.)

The model has five load-bearing pieces:

- **Managed agent**: a real native agent process running in `tui`, `headless`, `service`, or `web` mode with its own isolated home, disk state, memory, and execution owner.
- **Specialist**: a named role you define once, bundling a provider tool, credentials, skills, tool parameters, and a system prompt. Houmao launches it as many managed agents as you need.
- **Project profile**: reusable launch defaults over one specialist, such as agent name, working directory, run mode, tmux server, or mailbox bindings.
- **Gateway**: an optional per-agent HTTP sidecar for prompt and work-request admission, state observation, reminders, signed access control, skill or MCP updates, and plugins.
- **Mailbox**: a shared async messaging layer over local files or Stalwart JMAP so peers exchange work without calling each other in process.

## Why This Design

**Eliminate the central orchestration bottleneck.** Agents do not live inside one Python object graph or depend on a resident master server. `houmao-mgr` is a stateless CLI that updates persisted manifests and exits, while each running agent keeps its own session, gateway sidecar, and mailbox bindings. Stopping your operator chat, one gateway, or an optional observer never takes down the rest of the team.

**Use native CLI agents as the atomic unit.** Houmao does not rebuild an LLM agent loop or flatten providers behind a lowest-common-denominator SDK. Each managed agent runs the real `claude`, `codex`, `kimi`, or `dsh` harness with its native tools, context management, skills, MCP servers, and system prompt intact.

**Manage agents like human contractors.** A specialist is the job description, written once with role, tool, credentials, and skills. The project profile is the standing assignment that sets where the agent works and how it starts. Each managed agent then works at its own desk with private notes (managed memory), an inbox, and per-agent permissions from observer up to admin.

**Let your CLI agent operate the system.** You do not learn a bespoke control console first. Install Houmao's skills into Claude, Codex, Kimi, or Copilot, then ask that assistant in plain language to create specialists, launch peers, inspect state, and supervise runs.

**Compile workflows instead of centralizing runtime control.** Start with one reviewer, then add peers that message each other directly over mail or authenticated gateways. When a workflow outgrows ad-hoc prompting, ask for a **loop**: a multi-agent plan compiled into contracts, skills, and mailbox wakeups so peers coordinate directly.

## Architecture at a Glance

Your CLI agent operates Houmao from outside the team through stateless `houmao-mgr` commands and installed system skills. Once launched, each managed agent runs independently under its execution owner (`local`, `sudo`, `ssh`, or `docker`) in `tui`, `headless`, `service`, or `web` mode. A per-agent gateway sidecar handles authenticated requests, prompt queueing, state observation, and plugins without routing traffic through a central server. Peers hand work to each other horizontally through shared mailboxes or direct gateway requests, while project definitions live in a `.houmao/` overlay inside your repo.

![Houmao peer-to-peer team architecture](docs/figures/houmao-team-architecture.svg)

One managed agent, from the inside:

![Anatomy of a Houmao managed agent](docs/figures/houmao-managed-agent.svg)

The normal experience stays conversational: your CLI agent reads Houmao's skills and invokes `houmao-mgr` for you. Direct CLI use and optional passive-server APIs remain supported, while this README shows the agent-driven path first.

## Quick Start

**Prerequisites:** Python 3.11+ with [`uv`](https://docs.astral.sh/uv/), tmux 3.3a or later, and Linux or macOS. The preferred skill installer also needs `npx`. Local managed sessions use tmux-backed supervision across your default server, a shared Houmao server, or isolated sockets.

```bash
# 1. Install the CLI: `houmao-mgr --version` should print a version after this
uv tool install houmao

# 2. Verify tmux is version 3.3a or later
tmux -V

# 3. Install Houmao skills into your CLI agent: select your agent and the complete
#    admin surface (welcome, admin entrypoint, shared routines, and both loop skills)
npx skills add https://github.com/igamenovoer/houmao-skills
```

The unqualified skills URL tracks the latest stable Houmao release. Append a matching tag such as `#v3.2.0` to pin the skills to an exact `houmao-mgr` version. Without `npx` or internet access, or when you need an explicit agent home, use `houmao-mgr system-skills install --tool <tool> --pack admin`. [System Skills CLI Reference](docs/reference/cli/system-skills.md)

Now start your CLI agent from the project directory and ask:

```text
$houmao-admin-welcome start-guided-tour
```

A `$name` line invokes an installed skill in your CLI agent's chat. If you learn only one Houmao invocation, learn this one. The welcome tour is read-only: it checks your setup and walks beginner, intermediate, and advanced paths. When you are ready to act, it hands execution to `$houmao-admin-entrypoint`. Both welcome and the actor entrypoints also answer `help` (for example, `$houmao-admin-welcome help`).

Your first real task looks like this:

```text
You: $houmao-admin-entrypoint create a houmao Codex backend-reviewer specialist
     for this repo, make a reusable launch profile, launch it, and ask it to
     review the current working tree.

AI:  Done. I initialized the Houmao project overlay, created specialist
     `backend-reviewer` (tool: codex), prepared profile
     `backend-reviewer-default`, launched managed agent `reviewer-1` with its
     gateway attached, and sent the review prompt. The agent is running; I will
     report when the turn completes.
```

Naming the entrypoint skill explicitly works best for the first request of a session. Later requests can drop the handle; keep the keyword `houmao` in the prompt so your agent routes them to Houmao skills. Underlying commands are documented in the [Easy Specialists guide](docs/getting-started/easy-specialists.md), the [Launch Profiles guide](docs/getting-started/launch-profiles.md), and the [`houmao-mgr` CLI reference](docs/reference/cli/houmao-mgr.md).

> **Provider version minimums.** Claude Code requires 2.1.296+. Codex requires 0.162.1+ (0.169.0+ for `service` mode). Kimi Code requires 2.1.1+ for `headless` and `tui`, or 2.6.0+ for `service` and `web`, and receives its composed role prompt through `$KIMI_CODE_HOME/SYSTEM.md` after `${base_prompt}`. DeepSeek Harness (`dsh`) requires 0.2.2-rc.1+ for `web` and 0.2.2-rc.3+ for `headless` and `service`. See [Launch Policy](docs/reference/build-phase/launch-policy.md).

## Agent-Driven Examples

Once an agent is running, later requests read naturally. Including `houmao` in the prompt keeps implicit routing reliable:

```text
You: Use houmao to ask reviewer-1 whether the migration is safe, then show me
     its current state.

AI:  Sent the prompt through reviewer-1's gateway and inspected the
     managed-agent state. It is running, the last turn is complete, and the
     response is ready.
```

Per-agent gateways give operators and peers a direct interface for attributed work requests, verbatim prompts, interrupts, state and usage queries, native home refresh, Web browser entry, and signed access control. You never need a central broker to reach one agent. See the [Gateway Reference](docs/reference/gateway/index.md), [Gateway Authorization Policy](docs/reference/gateway/operations/authorization-policy.md), and [Managed Agent Memory](docs/getting-started/managed-memory-dirs.md).

## Core Concepts

| Concept | Mental model |
|---|---|
| User CLI agent | The assistant you talk to now. It has Houmao skills installed and operates Houmao from outside the managed team. |
| Specialist | A reusable role, tool, skill, and credential definition: "backend reviewer", "story writer", "researcher", "release engineer". |
| Project profile | Reusable birth-time defaults over one specialist: agent name, working directory, run mode, tmux server, credential override, mailbox bindings, and skill policy. |
| Managed agent | An independent live agent (`tui`, `headless`, `service`, or `web`) running under its execution owner with durable manifest, registry, and memory state. |
| Gateway | An optional per-agent HTTP sidecar for request queueing, state, reminders, signed role-based access (`agent-observer` through `agent-admin`), versioned file edits, and plugins. |
| Mailbox | Shared async messaging over local filesystem or online Stalwart JMAP bindings (plus optional CCCC plugin channels) without a central orchestrator. |
| Loop | A generated multi-agent plan compiled into per-agent contracts, skills, and mailbox wakeups. Your CLI agent authors, launches, and observes it from outside the execution loop. |

Project state lives under a `.houmao/` overlay with specialists, profiles, credentials, projected content, mailbox roots, memory, and catalog metadata. Concrete setup routes through `$houmao-admin-entrypoint project-mgr ...`; layout details live in the [Quickstart guide](docs/getting-started/quickstart.md).

## Agent Loops

Complex multi-agent workflows still do not require a central orchestration server. Invoke `$houmao-agent-loop-pro` with a complex multi-agent plan, and your CLI agent compiles it into per-agent contracts, skills, and mailbox wakeups:

```text
You: $houmao-agent-loop-pro create a loop for this plan:
     three agents should design, implement, and review a migration.
     The planner decomposes the work, the builder edits code, the reviewer
     checks behavior, and the team should stop only after tests and review
     notes are complete.

AI:  I created the loop intention, clarified the topology, generated the
     execplan, prepared specialists and launch profiles, checked workspace
     and mailbox/gateway posture, launched the participants, started the run,
     and I will report status from outside the execution loop.
```

Pro loops own the schema-rich path: intention clarification, `tree-loop` versus `generic-loop` topology choice, generated contracts, harnesses, skills, validation, launch, run control, and recovery. The `houmao-agent-loop-lite` sibling is the lighter Markdown/direct-SQL path for smaller loops, without JSON schemas, Jinja2, or generated harnesses. Both loops require explicit invocation and an explicit `<loop-dir>` before any filesystem work.

The reusable [`examples/writer-team/`](examples/writer-team/) template shows a three-agent story-writing team with prompt files, a tree loop plan, a start charter, and local setup commands. A **story-writer** drafts and finalizes chapters, a **character-designer** builds profiles, and a **story-reviewer** checks logic and pacing while the operator watches from outside the loop.

The video below shows this writer team running: three managed agents drafting, refining, and reviewing chapters peer to peer while the operator observes.

https://github.com/user-attachments/assets/6cff608a-8b5b-4dcd-96fb-f2f0208a18b6

For the full loop-authoring workflow, see the [Loop Authoring Guide](docs/getting-started/loop-authoring.md) and the [System Skills Overview](docs/getting-started/system-skills-overview.md).

## System Skills

Houmao ships six system skills. Each directory works at rest and installs with a standard Agent Skills tool; Houmao does not assemble skill Markdown at runtime.

| Standalone skill | Pack | Role |
|---|---|---|
| `houmao-admin-welcome` | `admin` | **Start here.** Read-only first-use orientation with five guided paths; `$houmao-admin-welcome start-guided-tour` is the one invocation to learn first. |
| `houmao-admin-entrypoint` | `admin` | Router for any Houmao-related request from a human operator. Informational requests stay local; operational work keeps the admin frame and requires explicit targets. |
| `houmao-agent-entrypoint` | `agent` | Router for any Houmao-related request from a genuine managed-agent session. Operational work requires fresh identity verification first. |
| `houmao-shared-routines` | `admin`, `agent` | Advanced router for parent-scoped routines, including project definitions, messaging, gateway access, versioned files, and inspection. |
| `houmao-agent-loop-pro` | `admin`, `agent` | Explicit entrypoint for schema-rich loop authoring and run control. |
| `houmao-agent-loop-lite` | `admin`, `agent` | Explicit entrypoint for Markdown/direct-SQL loop authoring and run control. |

Routing follows the actor: in a human-operator session your agent selects the admin entrypoint, and in a genuine managed session it selects the agent entrypoint. Welcome and both loop skills run only when invoked explicitly, and advanced users may call `$houmao-shared-routines` directly. The complete admin pack installs five roots (welcome, admin entrypoint, shared routines, both loops); the agent pack installs four. Pack membership, install lifecycle, route selection, and the full route map live in the [System Skills Overview](docs/getting-started/system-skills-overview.md) and the [System Skills CLI reference](docs/reference/cli/system-skills.md).

For example, use `$houmao-admin-entrypoint agent-access help` for gateway permissions or `$houmao-agent-entrypoint agent-files help` for versioned skill and MCP edits on a peer gateway.

## Subsystems at a Glance

| Subsystem | Description | Docs |
|---|---|---|
| Gateway and Access Policy | Per-agent FastAPI sidecar for request queues, state, reminders, SSHSIG/PyCasbin permissions, versioned skill/MCP edits, AG-UI routes, Web dashboard, and plugins | [Gateway Reference](docs/reference/gateway/index.md), [Authorization Policy](docs/reference/gateway/operations/authorization-policy.md) |
| Mailbox and CCCC | Independent offline filesystem and online Stalwart JMAP bindings, plus optional `houmao-cccc` Actor chat and deferred mail | [Mailbox Reference](docs/reference/mailbox/index.md), [CCCC Integration](docs/reference/gateway/cccc.md) |
| Run Modes and Execution Owners | `tui`, `headless`, `service`, and `web` sessions across `local`, `sudo`, `ssh`, and `docker` execution contexts and configurable tmux servers | [Session Lifecycle](docs/reference/run-phase/session-lifecycle.md), [Execution Contexts](docs/reference/run-phase/execution-contexts.md) |
| TUI and Hook Tracking | Shadow terminal state machine, CLI hook observation channel, detectors, and replay engine | [TUI Tracking Reference](docs/reference/tui-tracking/state-model.md) |
| Usage and Native Refresh | Normalized per-turn usage ledgers and non-restarting native skill/MCP freshness inspection and refresh | [Usage Records](docs/reference/run-phase/usage-records.md), [Native Refresh](docs/reference/gateway/operations/native-refresh.md) |
| Passive Server | Optional stateless, registry-driven HTTP server for discovery, observation, and gateway or mail relay without owning agent sessions | [Passive Server Reference](docs/reference/cli/houmao-passive-server.md) |

## Demos and Examples

- [`examples/writer-team/`](examples/writer-team/) - Complete tree-loop template for the three-agent story-writing team shown above.
- [`examples/gateway-plugin/`](examples/gateway-plugin/) - Standalone gateway plugin package built on the `houmao.gateway.plugins` SDK.
- [`examples/cccc-gateway/`](examples/cccc-gateway/) - Live CCCC Actor chat and deferred mail attachment on an existing managed agent.
- [`examples/agent-authoring/`](examples/agent-authoring/) - Portable immutable agent-definition authoring and deployment example (`swe-critic`).
- [`scripts/demo/minimal-agent-launch/`](scripts/demo/minimal-agent-launch/) - Recipe-backed headless launch with Claude or Codex.
- [`scripts/demo/single-agent-mail-wakeup/`](scripts/demo/single-agent-mail-wakeup/) - Specialist plus gateway and mailbox-notifier wakeup.
- [`scripts/demo/single-agent-gateway-wakeup-headless/`](scripts/demo/single-agent-gateway-wakeup-headless/) - Headless specialist with gateway wakeup and turn evidence.
- [`scripts/demo/shared-tui-tracking-demo-pack/`](scripts/demo/shared-tui-tracking-demo-pack/) - Standalone tracked-TUI capture, watch, and replay validation.

## CLI Entry Points

| Entrypoint | Purpose | Status |
|---|---|---|
| `houmao-mgr` | Stateless operator CLI for project setup, specialists/profiles, launch, requests, gateway access, mailbox, memory, credentials, and `houmao-mgr manual` guides | **Active** |
| `houmao-passive-server` | Optional registry-driven stateless API server for discovering, observing, and relaying requests to running agents | **Active** |

Detailed command syntax lives in the [`houmao-mgr` CLI reference](docs/reference/cli/houmao-mgr.md), [System Skills CLI reference](docs/reference/cli/system-skills.md), [agents mail reference](docs/reference/cli/agents-mail.md), [agents gateway reference](docs/reference/cli/agents-gateway.md), and [internals graph reference](docs/reference/cli/internals.md). Use a [managed launch](docs/getting-started/quickstart.md) to start a worker. If an earlier release managed a manually started session, follow the [upgrade instructions](docs/reference/run-phase/session-lifecycle.md#upgrading-from-manual-session-adoption).

```bash
houmao-mgr --help
houmao-mgr manual
houmao-mgr --version
houmao-passive-server --help
```

## Full Documentation

Complete reference, guides, and developer docs are published at **[igamenovoer.github.io/houmao](https://igamenovoer.github.io/houmao/)**.

## Related Projects

- [Paperthin](https://github.com/LilMGenius/paperthin) - A skillbook of low-level agentic design patterns for CLI coding agents such as Codex and Claude Code, built around recursive self-improvement and removing rather than adding.
- [Socratic](https://github.com/m4vic/socratic) - A self-interrogation skill for agentic coding agents that makes the agent question its own plan before building and asks the user only the few decisions that require human authority.
- [Ouroboros](https://github.com/Q00/ouroboros) - A spec-first agent OS and MCP server across many coding-agent runtimes: it interviews you to pin down the goal, writes a spec with checkable acceptance criteria, hands it to your agent, then checks the result against it.

## Development

```bash
pixi run format
pixi run lint
pixi run typecheck
pixi run test-runtime
pixi run docs-serve
```

## License

Houmao is licensed under the [Apache License, Version 2.0](LICENSE).

---

> **Legacy note:** Houmao was originally inspired by [CAO (CLI Agent Orchestrator)](https://github.com/awslabs/cli-agent-orchestrator). Retired surfaces (`houmao-cli`, standalone `houmao-server`, and `cao_rest`) are no longer supported. Use `houmao-mgr`, `houmao-passive-server`, and decentralized per-agent workflows instead.
