Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Prompts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/domios-dev-prompts)
---
name: prompts
description: "Change Domios prompts, placeholders, skills, and on-demand documentation."
---
# Prompt architecture
Domios uses `domios` as the canonical CLI and retains `CODETERM_*` as its frozen
host environment contract. Internal crate names, prompt filenames, the
`domios` skill id and `@codeterm/plugin-sdk` are technical identifiers.
User data lives under `~/.domios` (`~/.domios-dev[-<instance>]` in development).
Use the [consumer identity inventory](consumer-identities.md) to distinguish live
consumers from retained technical names, rejection inputs and historical evidence.
How Domios composes the prompts that drive the General Agent, project workers, and headless mem workers. This document explains where each piece lives, what gets included where, and how to decide which file a new instruction belongs in.
## Layout
```
src-tauri/prompts/
general_agent.md GA prompt — GA-unique content only; includes {codeterm_cli}
codeterm_cli.md Shared CLI reference — role-neutral, single source of truth
bridge_mem.md Mem protocol installed into each provider's rules dir
codeterm_rule.md Bridge rule appended to AGENTS.md, teaches CLI to spawned agents
bootstrap_instructions.md First-run bootstrap.md template
worker_suffix.md Appended to Worker task bodies
orchestrator_suffix.md Appended to Orchestrator task bodies
cron_complete_suffix.md Appended to every cron task
cron_report_hint.md Appended to cron tasks when creator_tab_id is set
worker_task_preamble.md Wrapper for headless mem worker tasks
mem_extraction.md Prompt for auto-extraction (haiku graph worker)
mem_rerank.md Prompt for search-result reranking
dreaming_rem.md REM-phase dreaming prompt
skills/domios/
SKILL.md Project-agent CLI reference — template with {codeterm_cli}
references/
mem.md Full mem command catalog
roles.md Agent-role rules + decision tree
cron.md Cron flag reference
telegram.md Bridge setup, formatting, migration
themes.md Theme TOML format
docs/ Embedded docs, read on demand via `domios docs <NAME>`
```
The layout is an excerpt; the complete prompt inventory is the table in [inventory.md](inventory.md); progressive-disclosure tiers are in [tiers.md](tiers.md). Neither is embedded in the binary: they describe Domios's own source, which a production agent cannot edit.
## Compile and substitution flow
`src-tauri/crates/codeterm-prompts/src/prompts.rs` declares prompt files as `const &str` via `include_str!()`. Service-core re-exports these constants and the persona, role-preset and skill-mirror modules. Pure tests move with the crate; host onboarding and parity tests stay in service-core. Run `./build.sh nextest codeterm-prompts` plus the affected service-core selectors.
### GA prompt rendering
`src-tauri/src/service/general_agent/instructions.rs::render_agent_md` substitutes placeholders into `general_agent.md`:
| Placeholder | Source |
|-------------|--------|
| `{version}` | `env!("CARGO_PKG_VERSION")` |
| `{platform}` | `cfg!(target_os = ...)` |
| `{hostname}` | `hostname::get()` |
| `{provider_name}` | runtime arg (`claude` / `codex` / etc.) |
| `{general_dir}` | `~/.domios/general/` |
| `{secrets_dir}` | `~/.domios/secrets/` |
| `{skills_dir}` | `~/.domios/skills/` |
| `{identity}` | `general/identity.md` contents |
| `{soul}` | `general/soul.md` contents wrapped in `## Soul\n...` |
| `{wake_up}` | `mem.wake_up()` L0+L1 snapshot wrapped in `## Live mem snapshot\n...` |
| `{codeterm_cli}` | `prompts/codeterm_cli.md` contents (shared CLI reference) |
The rendered output is written to three files in `general/`:
- `AGENT.md` — the rendered GA prompt (what the agent reads via `@./AGENT.md`)
- `CLAUDE.md` — a thin re-export: `@./AGENT.md`
- `AGENTS.md` — `agent_content + codeterm_rule + bridge_mem` (catch-all for tools that look here)
`bootstrap.md` is created **only on first run**; if it already exists, regen leaves it alone.
The system-prompt channel and generated General instruction files share a runtime capability-hints fragment. Its pure builder receives the granted plugin catalog snapshot used by `domios capabilities`, plus the clock, durable `general/state/first-seen` marker and `general_agent.capability_hints` setting. It emits at most 16 capability lines of 240 bytes within a 4096-byte fragment, only before seven days have elapsed and while the setting is on. Prompt tests pass this fragment as an opaque value.
### Skill rendering
`skills/domios/SKILL.md` is also a template. On daemon startup, `commands::skills::seed_bundled_skills` copies the bundled `skills/domios/` directory to `~/.domios/skills/domios/` (or `~/.domios-dev/skills/domios/` for dev), substituting each placeholder in `codeterm_skill_render_map()` as it writes:
| Placeholder | Source constant |
|---|---|
| `{codeterm_cli}` | `crate::prompts::CODETERM_CLI` (`prompts/codeterm_cli.md`) |
| `{agent_pad_rule}` | `crate::prompts::AGENT_PAD_RULE` (`prompts/agent_pad_rule.md`) |
That keeps the GA prompt and the project-agent skill in lock-step: both pull each fragment from one file. To give the skill another shared fragment, add a placeholder plus a render-map entry — never paste the text into `SKILL.md`.
If you change one of those prompt files:
- GA picks it up on next session start (because `instructions.rs::generate_instructions` regenerates AGENT.md).
- Project agents pick it up next time `seed_bundled_skills` runs (on daemon startup). The gate is content, not the revision tag: seed and mirror copy when the destination differs from the *rendered* source anywhere in the skill directory, so a changed constant or an edited `references/` file reinstalls at the same revision. `<!-- revision: N -->` is only a never-downgrade guard — a destination declaring a higher revision is left alone.
## Decision matrix — where does a new instruction belong?
When you're about to add or move a piece of prompt content, ask:
| Question | Where it goes |
|----------|---------------|
| Does it teach **CLI syntax** (commands, flags, examples) that's the same for the GA and project agents? | `prompts/codeterm_cli.md` (shared) |
| Is it a **safety rule** the GA must check on every turn (prefix routing, never-kill-prod, never-auto-commit)? | `prompts/general_agent.md` |
| Is it a **decision policy** that's GA-specific (implicit→ask, recon-before-action, mesh→Orchestrator, workspaces-are-commitments)? | `prompts/general_agent.md` |
| Is it a **lifecycle hook** that only the GA bridges (forward report to originating channel, init handshake, voice transcribe awareness)? | `prompts/general_agent.md` |
| Is it an **operational ladder** that fires rarely (Telegram bot setup, secrets store CLI, hook daemon config)? | `prod-docs/<TOPIC>.md` + register in `cli/src/cmd/docs.rs` |
| Is it **project-agent framing** (workspace/Team authority and the no-General-Agent fallback boundary)? | `skills/domios/SKILL.md` (the non-template intro and outro around `{codeterm_cli}`) |
| Is it **mem protocol** (English-only, search-first, no fabrication)? | `prompts/bridge_mem.md` (installed into provider rules dirs by `service::bridge_rule`) |
| Is it **a worker-task addendum** (must report, ack receipt, return exit code)? | `prompts/worker_suffix.md` / `orchestrator_suffix.md` |
| Is it **per-cron-task boilerplate** (run id, completion call, report hint)? | `prompts/cron_complete_suffix.md` / `cron_report_hint.md` |
| Is it a **headless worker prompt** (extraction, rerank, dream)? | `prompts/mem_extraction.md` / `mem_rerank.md` / `dreaming_rem.md` |
### Anti-patterns
- **Don't duplicate CLI syntax in both GA prompt and skill.** That's exactly what `{codeterm_cli}` substitution is for. If you find yourself writing `domios tab list` in `general_agent.md`, you're in the wrong file.
- **Don't bake operational ladders into the GA prompt.** If a procedure fires once a month (initial bot setup, vault unlock, hook daemon config), it's an on-demand playbook in `prod-docs/`, not a per-turn instruction.
- **Don't add per-turn safety to a playbook.** If a rule must fire on every inbound message (e.g. "trust `[Hook metadata:`, don't re-classify"), it lives in the GA prompt — one line referencing the playbook for the full how-to.
- **Don't write `{placeholder}` in the GA prompt without wiring it in `instructions.rs`.** Missing substitutions ship the literal `{placeholder}` text to the agent.
- **Don't paste the GA prompt into spawned agents' `--task`.** They get `bridge_mem.md` automatically via the per-provider rules path and that teaches `domios mem *`. The GA prompt is GA-only.
## Adding a new placeholder
1. Add the substitution in `instructions.rs::render_agent_md` — `.replace("{my_var}", value)`.
2. Reference it in `general_agent.md` where you want the value injected.
3. Add a unit test in `instructions.rs::tests` that asserts the placeholder doesn't survive into the rendered output (`assert!(!rendered.contains("{my_var}"))`).
4. Document the new placeholder in the table above.
## Adding a new on-demand playbook to `domios docs`
1. Write the playbook as `prod-docs/<TOPIC>.md`. Use a short, ALL-CAPS slug for the doc name (`TELEGRAM-SETUP`, not `telegram-setup`); the file name is the doc name. It needs exactly one H1 and must fit 240 lines and 24 KiB.
2. Register it in `cli/src/cmd/docs.rs` with a one-line purpose:
```rust
doc!("TOPIC", "What the playbook is for", "../../../prod-docs/TOPIC.md"),
```
Stable product behavior belongs in `essences/`; executable procedures belong in `.agents/skills/`. A doc about Domios's own source (prompt files, loaders, detection internals) is never embedded: a production agent cannot edit the binary. The membership test rejects unregistered files in `prod-docs/`.
3. Mention it in `general_agent.md` under the **Operational playbooks** section so the GA knows it exists. One line — name + when to use it.
4. Bump `<!-- revision: N -->` at the end of the playbook on every meaningful edit.
## Adding a new prompt file
1. Put it in `src-tauri/prompts/` and load it with `include_str!()` in the owning loader.
2. Add its filename to the list in `every_prompt_md_has_a_loader` (`src-tauri/src/prompts/tests.rs`); an unlisted file fails as an orphan.
3. Add its row to the prompt table in `.agents/skills/prompts/inventory.md`; `scripts/check-prompts-doc.sh` rejects a prompt file missing from it.
## Adding a new mem worker prompt
Mem workers (extraction, rerank, dream) are headless — they don't share context with the GA. Their prompts go in `prompts/<name>.md` and are loaded via `include_str!` in `prompts.rs`. Use `{placeholder}` style for inputs the worker code substitutes (e.g. `{query}`, `{items}`, `{intent}`, `{worker_id}`, `{task}`). Document the placeholders at the top of the prompt file as a comment.
## Revision tags
Files that ship as content (skills, docs, bundled prompts) carry a `<!-- revision: N -->` line at the bottom. Bump it on every change. The skill seeder uses revision tags to decide whether to overwrite a stale copy in data-dir.
GA prompt and codeterm_cli.md don't carry revision tags — they're not user-facing and get rebuilt on every binary release.
## Role preset composition
Which suffix a launch gets is decided by one resolver and one composition table,
never by a role literal: `service/role_preset.rs` resolves `(role, role_profile)`
to a `RolePreset`, and `service/persona/occasion.rs` places its fragments per
delivery occasion. Task personality, `role_guidance`, and `executor_role` enter
as that preset's task overlay, so a Worker subtype and a Manager kind compose the
same way. The full prompt file inventory is [inventory.md](inventory.md).
## Skill seeding, rendering and mirroring
Moved from the embedded `SKILLS` doc.
### Installation from a checkout
Domios installs the `domios` skill itself on every start — a manual copy is
only for a checkout you are not running. See *Seeding, rendering and mirroring*
below for what the app does.
```bash
cp -r skills/domios ~/.claude/skills/
```
Or symlink:
```bash
ln -s /path/to/codeterm/skills/domios ~/.claude/skills/domios
```
### Seeding, rendering and mirroring
`service/skill_mirror.rs` owns three steps, all on startup:
1. **Seed** — bundled `skills/<id>/` → the canonical dir
(`<data_dir>/skills/<id>/`), whole directory, `references/` included.
2. **Render** — the `domios` skill declares placeholders filled from the
in-binary prompt constants, so the skill and the General Agent prompt share
one source instead of two drifting copies:
| Placeholder | Source constant | Prompt file |
|---|---|---|
| `{codeterm_cli}` | `CODETERM_CLI` | `src-tauri/prompts/codeterm_cli.md` |
| `{agent_pad_rule}` | `AGENT_PAD_RULE` | `src-tauri/prompts/agent_pad_rule.md` |
Adding a fragment to the skill means adding a placeholder plus a render-map
entry — never pasting the text into `SKILL.md`. Rendering happens on copy, so
the canonical and provider copies are post-render.
3. **Mirror** — canonical `codeterm` → `~/.claude/skills/` and
`~/.agents/skills/`. Provider dirs hold exactly `{codeterm}`; every other
entry is pruned. All other skills stay canonical-only and are discovered
through `domios mem search`.
**The install gate is content, directory-scoped and render-aware.** Both the seed
and the mirror copy when the destination is missing or differs from the *rendered*
source anywhere in the skill directory — an edited `references/` file counts, and a
changed prompt constant reinstalls at the same revision. Comparing raw bundled
bytes would be permanently unequal (source pre-render, destination post-render),
which silently degrades the gate to always-true.
`<!-- revision: N -->` at the bottom of `SKILL.md` is a **never-downgrade guard
only**: a destination declaring a strictly newer revision is left alone. It is not
the copy decision, so bumping it is not how you ship an edit — though you should
still bump it when you change the file.
Every agent's own pad rule (write payloads to the pad, pass `--from-pad`) reaches
spawned agents through their launch prompt and reaches skill readers through
`{agent_pad_rule}`.
## Repository-only guidance
[Repository guidance](repository-guidance.md) retains debug protocol recovery
and the lane ancestry script moved out of embedded help.