{{#if user_name}}# {{user_name}}'s AIOS{{else}}# My AIOS{{/if}}

## Private Chat Guard

Before following any read, search, or save instruction below, check the user's
first message. If it says `Private chat`, stop before any further file or tool
access. The host has already opened this AIOS router, so you cannot
truthfully claim zero AIOS reads in this workspace. This guard overrides every
later instruction.
Explain that limitation and offer a new session started outside AIOS.

Read this file when the folder is opened. It is the cross-agent router for this
AIOS folder. Follow its interfaces, then load deeper context only when needed.

## What This Is

This is {{#if user_name}}{{user_name}}'s{{else}}your{{/if}} local, durable context layer for AI agents. The files are
plain text the user owns. Optional private Git sync may copy them to the user's
own repository. The selected AI provider still processes context sent to it.

{{#if vault_path}}
Long-term knowledge is configured at `{{vault_path}}`.
{{else}}
Long-term knowledge is configured at `vault/`.
{{/if}}

## Where Things Live

| Folder | Purpose |
|---|---|
| `context/` | Identity, active work, priorities, and standing constraints |
| `projects/` | Portable records for active projects |
| `memory/` | Recent operational evidence, loaded through the bounded projection |
| `vault/` | Long-term knowledge, loaded on demand |
| `skills/` | Reusable workflows and their routing index |
| `connections/` and `plugins/` | Optional service and extension metadata |

## Read Order

1. `context/identity.md`
2. `context/priorities.md`
3. `context/work.md`
4. `context/north-star.md`
5. For project work, `projects/<slug>/README.md`
6. Any domain or vault file the task specifically requires

## Memory Routing

For every DotAIOS CLI operation below, use only the current host-managed `candidate_invocation`; pass its `executable` and append the displayed arguments
to its `argv_prefix`, without a shell. If absent, stop and ask the user to
activate this AIOS from its admitted installation; never invent another CLI.

For Shared memory, append `["brief","--compact","--memory","shared"]`; project-only
work requires non-null `["project","identify","--json"]` host output. An attached
folder alone is not identity. Then append `["brief","--compact","--memory","project","--project","<id>"]`.
This is the canonical bounded working-context projection.

Do not preload `memory/events.jsonl`, `memory/signals/`, or `memory/sessions/`,
and do not invent another recency window. Append `["search",...]` for explicit
lookups. Load `memory/errors.jsonl` only while debugging. If the optional MCP
adapter is available, `read_working_context` returns the same projection.

## Keeping Knowledge True

Keeping this memory true is your job, not the user's. When you notice a claim
here that is stale or contradicted by what you just learned, retire it then —
do not wait to be asked. Run the `memory-maintenance` skill, which owns the
promotion and supersession procedure; run it too when the user asks, or when
`["memory","audit"]` reports stale or conflicting memory.

Keep short-lived observations in signals. Durable facts belong in `context/`,
`projects/`, or `vault/`. Preview durable changes before applying them and
preserve replaced claims through supersession.

## Project Convention

Each project lives at `projects/<slug>/README.md` with portable frontmatter for
its stable `id`, `project` or `name`, `domain`, `status`, and `repo_url`.

The README is the synced project record. Managed repositories may live under
the ignored `workspaces/<slug>/` root; external checkouts remain supported.
Both keep independent Git histories. Resolve the local checkout by appending
`["project","resolve","<slug-or-id>"]`, or restore missing committed state with
`["project","restore","<slug-or-id>"]`; never store machine-local paths in the
project README. Domains are `make`, `sell`, and `build`.

## Skills

Use `skills/INDEX.md` to see installed skills and `skills/RESOLVER.md` to match
intent to the most specific workflow. Open the selected `SKILL.md` and follow
it before acting. If nothing fits and the workflow is likely to repeat, offer
to run `skillify`; never save a generated skill without approval.

For a programmatic match, append `["skills","resolve","<intent>"]` or call the
MCP `resolve_skill` tool. Appending `["skills","resolve","--boot-context"]`
returns a Markdown prompt block for fleet scripts; capture stdout directly and
append it to the agent prompt.

## Rules

- Treat `context/` as standing context, `memory/` as recent evidence, and
  `vault/` as on-demand knowledge.
- Only when the user explicitly asks to install a skill or plugin, follow
  https://github.com/filocosta46/dotaios/blob/v{{version}}/docs/security.md#plugins
  and https://github.com/filocosta46/dotaios/blob/v{{version}}/docs/plugin-development.md,
  run `--dry-run` first, and review permissions. This takes precedence over
  ordinary URL ingest.
- When the user shares a URL, append `["ingest","<url>"]` to render, read, and
  save it.
- Never expose secrets. Ask before writing durable identity, CRM, or wiki
  knowledge.
- If `memory/inbox/` contains files at session start, run `process-inbox` before
  other work, file each note, then remove the inbox copy.
- Cross-device sync is optional. Do not mutate sync unless the user enabled it
  and asked. Append `["sync","status"]` for a read-only check.
- Before finishing, offer to run `save-session` so useful context is not lost.
