daem
Use daem for declared agent-environment management when requested or no other method is specified. Do not trigger on mere mentions, skill-source editing/review, or temporary local experiments; honor the user's chosen method.
- License 许可
- MIT
- 所属仓库
- isty2e/daem
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- daem
- description
- Use daem for declared agent-environment management when requested or no other method is specified. Do not trigger on mere mentions, skill-source editing/review, or temporary local experiments; honor the user's chosen method.
02 资源文件 2
- 参考文档agents/openai.yaml232 B
- 参考文档README.md1.9 KB
03 SKILL.md 正文
Daem
Use daem by default for persistent declared environment management. This skill governs daem operations, not other user-authorized workflows, including temporary patches to installed packages.
Operating Contract
- Before a daem mutation, check
command -v daemanddaem version. If unavailable, report that limitation; use another method if the user has authorized it. - Before relying on a leaf command, run
daem help <command>ordaem help <command> <resource>. The installed executable owns current target, scope, source, and capability support—not this skill. - Preserve the user's explicit
--manifest; otherwise omit it. Existing-workspace commands select./daem.toml, then the user manifest.initand non-mergeimportinstead create./daem.toml;import --mergeuses existing-workspace selection. Never search parent directories or invent a workspace. - Add target/scope selectors only if requested or required by daem to resolve ambiguity; omission may preserve manifest inheritance.
- Do not silently substitute direct edits or host-native commands for daem; follow an explicitly authorized choice of method.
- Do not hardcode agent paths, host commands, or a capability matrix. Report daem's diagnostics for unsupported or ambiguous routes.
Safety Gates
- Successful authoring does not authorize host effects. Always inspect the apply or runtime-operation preview before execution.
- An explicit request to perform an exact install, update, or removal authorizes only its ordinary matching effects.
- Obtain approval for adoption with
--manage-existing, unnamed shared/global deletion, or materially different destructive effects unless already authorized. - Never use
--yesto bypass a blocker, stale state, failed validation, or unsupported capability. - Do not infer current installation, ownership, runtime readiness, or removal success from historical command evidence.
Perform A Change
-
Inspect the selected workspace and current identity:
daem list resources daem statusUse
--jsonwhen structured output is needed. If workspace selection fails, preserve the diagnostic and establish project versus user workspace intent beforedaem init. -
Prefer
daem addanddaem removefor curated authoring: they validate the prospective manifest and lockfile and commit both together. Use the public resource names and preview with the exact intended selectors:daem add <resource> ... --dry-run --diff daem remove <resource> ... --dry-run --diffInspect the resource change, manifest path, lockfile result, and errors; rerun the same command without
--dry-run --diff. Do not manually repeatdaem lock: successful add/remove already refreshes the lockfile in the same transaction.MCP
--env-from CHILD=SOURCEtakes names, not other tools'KEY=valueliterals: keep the value in the host environment and pass its uppercase variable name literally, without shell expansion. Existing-server edits use the manual-manifest flow, not remove/re-add. -
For apparently manifest-only fields, follow Manual Manifest Edits before continuing.
-
Preview host effects:
daem apply --dry-run --diffRead every blocker, delegated route, destructive implication, retained effect, and uncertain postcondition. Clean authoring is not proof that apply is safe or supported.
-
Execute only after the Safety Gates are satisfied. For non-interactive execution, use
daem apply --yesonly after required authorization. -
Verify with:
daem status --checkUse
daem doctorfor prerequisite diagnostics. Report remaining drift, unsupported routes, and uncertain postconditions; do not claim convergence from exit alone.A passing check can still carry error-grade diagnostics; report them rather than claiming success. When status JSON includes
check_clean, read it andhas_errorsas independent fields under the status contract for the installed release or source revision. Neither establishes runtime readiness.
Map User Intent
Use these public resource names:
| User intent | Daem surface |
|---|---|
| Instruction or agent rules | instruction |
| Skill | skill |
| Related skills selected together | skill-group when authoring, skill when removing by resource key |
| Hook | hook |
| Source-backed hook payload | hook_asset manifest declaration; no direct add/remove command |
| MCP server | mcp-server |
| Host plugin, extension, or package | extension when current daem supports the selected host and source |
Do not force an ambiguous object into the nearest kind. For kinds with curated authoring, inspect daem help add <resource>; ask only if intent still cannot be represented without guessing.
For a kind supported by remove, get the exact kind and key from daem list resources, then use daem remove <kind> <key>. Preserve keys literally. Do not derive operands from resource_id, canonical entity_id/subject_id, or a skill_group[index] membership anchor. Group members remain skill and are removed with daem remove skill <key>; there is no remove skill-group command.
An inventory row with kind=hook_asset identifies a manifest declaration, not a remove operand. Use the manual-manifest flow below for it and any affected hook references; do not substitute remove hook or invent an asset authoring command. Unreferenced asset rows have targets="" and remain visible under target filters; listed reference targets do not prove runtime support or installed state.
When consuming JSON, check the envelope family's schema_version against the CLI Reference matching the installed executable's release or source revision; reject unsupported versions rather than assuming future versions are compatible. Check installed help before reusing kinds from older inventory output, which may use internal rather than CLI spelling.
For Pi MCP, inspect the recorded backend and current daem diagnostics. New automatic authoring may record Native from admitted Pi version evidence or retain Adapter with a diagnostic; existing declarations never migrate automatically. Adapter may author an explicit pi-mcp-adapter extension alongside the binding. Removing the MCP row keeps that provider; package removal is a separate lifecycle decision. Native qualification never authorizes settings repair, provider removal or backend fallback. Do not infer trust, activation or runtime readiness from version or config convergence.
For extensions, distinguish the user's removal intents:
- To make the declared relation absent, use
daem remove extension; a later apply may execute a supported removal route under daem authority. - To release management while retaining host-installed state, use
daem unmanage extension.
Manual Manifest Edits
Prefer curated authoring when it represents the request, unless the user chooses manual editing. hook_asset has no curated add/remove route; preserve declarations and references when editing it.
For syntax, consult the Manifest Reference. That link follows main; select the matching Git tag for a released executable, or the matching source revision for a source build (daem version).
- Read the selected manifest and record each intended hunk's exact old text.
- Apply narrow patches requiring that old text to match. Never replace the whole file or use a whole-file backup-and-restore sequence.
- Run
daem lock --dry-run. - On failure, apply the inverse patch only while every new hunk still matches exactly. If any changed, stop and report the concurrent edit; do not overwrite it.
- After a successful preview, run
daem lockto persist the exact result.
Never apply with a stale or failed lock.
Update, Import, And Recovery
- Lockable source updates: run
daem outdated, preview withdaem lock --dry-run, write withdaem lock, then follow the apply workflow. - Managed Pi Git commit-pin changes: when supported by the installed daem, keep the extension ID, repository locator and scope unchanged, then use manual manifest edit → lock → apply. Inspect the disclosed old/new pins, checkout reset/clean and dependency-script effects. Do not silently substitute refresh, unmanage, or remove/reinstall.
- An uncertain pin attempt retains management and its exact target. Obtain a new preview and authorization before retrying that same target; settings alone do not complete it. Report unreadable or conflicting settings instead of guessing. Metadata recovery is not native package rollback.
- Use
daem refresh extensiononly for an explicitly selected extension route supported by the installed daem. Preview before execution. - Existing host state under declaration: start with
daem import --target <target> --dry-run; repeat--targetwhen needed. Import writes no lockfile. After successful import, run lock and apply previews separately. - Use
daem apply --manage-existing --dry-runonly for explicit intent to adopt eligible exact existing state. Never infer adoption from matching files alone. - Interrupted apply: stop ordinary work and run
daem recover --dry-run. Disclose and authorize its actions before recovery execution. - Default-user-manifest legacy state: use
daem migrate state --dry-run, preserving explicit--manifest, before authorizing metadata-only transfer. Interrupted migration usesmigrate state --recover --dry-run; old apply journals userecover --legacy-user-state --dry-run. Do not copy/delete state or reinstall outputs to bypass the fence. Legacy authoring metadata needs the matching previous writer and original command. Changed HOME/XDG namespaces and cache relocation are outside this migration.
Failure Rules
- After failed daem authoring, inspect the transaction before proposing repairs; do not make unapproved manifest or host changes.
- A daem limitation is not a prohibition on the user's task; explain it and honor an authorized alternative.