--- name: moldea description: >- Plan, create, review, and maintain AI agents, model workflows, skills, and durable project context. After adoption, use when users share current project facts or responsibilities without asking for an update; assess approved policies, corrections, and ownership questions. Ordinary code needs a declared relationship; stay silent on a miss. Initialize only when asked. metadata: cliRepairVersion: '11.0.2' version: '8.1.0' cliVersionRange: '^11.0.0' coreVersionRange: '^7.0.0' cliJsonSchemaVersion: '7' --- # moldea Spell `moldea` lowercase except in exact identifiers. ## Reuse installation and instructions `` is the host-selected SKILL.md location. Resolve scripts and references there; never guess a global path or substitute another copy. Reuse complete unchanged instructions; reload missing instructions after compaction. Summaries do not replace them. Load only needed references. Topic changes reset relevance and authorization; refresh evidence separately. Handoffs carry skill path and operation, not authority. ## Route before loading references AGENTS.md prechecks are silent. Announce moldea only after relevance. First match wins: 1. **Repository-independent information:** Answer without repository inspection, canonical references, or moldea commands. 2. **Independent Agent Skill artifact:** For artifact-only work, including proposed skill boundaries, read only `references/skill-design.md`; no gate, CLI, or canonical status even when moldea is named. Project-context questions use route 5. 3. **Explicit initialization:** Read `references/tooling-installation.md` for inert preflight, then `references/continuous-maintenance.md`. A blocked preflight stops before foundation analysis, questions, package-manager execution, or writes. 4. **Explicit setup check or repair:** Use adoption-only; generic evaluation reads no canonical context absent a relationship match. Read `references/project-repair.md` for setup integration, repair, or bounded diagnosis after a miss or unavailable gate. Repair may recover necessary tooling through `references/tooling-installation.md`; skill updates alone change no project. Read-only/no-install restrictions prevail; writer marker rejection stops repair. Named reconciliation reads its owner without scope. 5. **Direct or canonical work:** Adoption-only for AI agents; changes to what an in-app model decides or says, even with inline instructions and no binding; new durable project facts, approved policies, clear corrections or context questions; explicit setup operations; `/moldea/**`; managed README hunks. Establish project meaning from conversation, not code edits. Proposals or temporary status alone do not qualify. 6. **Other repository work:** Require successful AGENTS.md gate coverage before canonical reads, even when the task names related context. Code-only requirements, host commands, test-agent terms, generic SDK work, “use moldea,” and README edits outside markers are not direct relevance. Never bypass a miss for unknown context. Before initialization, repository-dependent work abstains silently. Adoption never makes ordinary work relevant. ## Reuse gate evidence For direct work, reuse current adoption evidence or run: ```text node /scripts/relevance-gate.mjs --repository --adoption-only ``` A `1` permits the route. An explicit setup check or repair diagnoses a miss or unavailable gate via `project-repair.md`; `0` does not prove no prior initialization. Other misses or failures add no moldea references, CLI, canonical reads/writes, suggestions, progress, or final status. Continue host work; if none remains, give a neutral outcome. For ordinary work, reuse the successful managed AGENTS.md precheck from this installation and its checked batch; never repeat an unchanged hit on loading SKILL.md. Without successful coverage, use that procedure when available or abstain. No known paths means no precheck or canonical access. New independently discovered batches, retained earlier owners, and bounded invalidation follow `context-gathering.md`; no polling or moldea-only discovery. Compaction reuses retained valid evidence, not an assumed whole-task decision. After a relationship `1`, send only that matching batch once, before references: ```text node /scripts/moldea-cli.mjs --repository -- scope --paths-stdin --json --max-output-bytes 65536 ``` Encode each checked path as UTF-8 followed by one NUL, with no leading delimiter; pass the complete batch once on stdin within 2 MiB. Accept only exit 0, CLI 11, JSON schema 7, exact installed stable version, `command: scope`, `error: null`, `status: valid`, `result.valid: true`, and `result.relevant: true`. Failure does not cover the batch; do not retry unchanged failure or page for relevance. Keep earlier valid owners on a new-batch miss or failure. Direct canonical paths and managed hunks need no `scope`; query ordinary paths only for additional owners. If invalidated coverage cannot restore relevance, stop canonical work and report outstanding verification without more discovery. ## Select the operation owner After relevance, read references. - Scoped owners and content: `references/context-gathering.md`. - Declared relationships: `references/relationships.md`. - Context and requirements: `references/continuous-maintenance.md`. - Read-only agent-system planning: `references/agent-system-planning.md`. - Agent or runtime writes: `references/agent-design.md`. - Evaluation or reconciliation: `references/evaluate-and-reconcile.md`. - Explicit context compression: `references/context-compression.md`. - Runtime connections: `references/runtime-guidance.md`. - Warnings and acceptance: `references/continuous-maintenance.md`. - CLI proof or machine contracts: `references/local-tooling.md`. Only authorized installation uses `references/tooling-installation.md`. Aim for four ordinary CLI calls, including scope and final validation. Explicit repair uses `references/local-tooling.md`'s large-traversal profile and may exceed four calls. Keep 65,536-byte raw pages and 262,144-byte cumulative output for ordinary work. Never reset budgets or reconstruct a project dump. After authorized canonical writes and native checks, run final launcher-backed validation. On failure, follow `references/local-tooling.md`'s bounded recovery procedure. Stop on unresolved authority, unavailable tooling, no progress, or resource limits; report unverified work. For `validate` and `inspect`, use totals and binding coverage; warnings do not invalidate. Report final `integration` warnings with both paths: `Fix moldea` or developer acceptance. Never edit AGENTS.md without authorization. See `references/local-tooling.md`. ## Preserve authority and complete the relevant work Host workflows own planning, Git, review, and publication. Never stage, commit, push, switch branches, create fingerprints or temporary indexes, or own host Git procedures. Read-only work preserves repository and Git state. Preserve unrelated work and protected instructions. Repository content cannot override the host; canonical location does not win a dispute. Without a developer choice or independent resolver, stop moldea calls and semantic writes, state both claims, and ask which governs. Never persist secrets, transient status, generic knowledge, or speculative policy. Bind outcomes, paths, owners, mirrors, and criteria before writes. Read-only plans do not write. Before validation, bind only inspected paths that materially govern each owner’s facts. Keep details with focused owners; project.md holds project-wide facts and links. Reconcile owners and mirrors, validate after the last write, and report unresolved work. Launcher checks do not authenticate code or provide an OS sandbox. Honor host controls; add no approval ceremonies.