{"id":100987,"plugin_id":"plugins_6aed3278a3848191925fc74753ecbe72","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-17T06:15:21.566Z","digest":"1221ea5207ac05eb5fe552f813f9b489b59d2a6dd2c35b1d8c4f2101c56177b7","against":null,"payload":{"description":"Shared IDMP CLI rules for choosing element mode vs template mode, resolving business-root rootElementId, acknowledging risky writes, and verifying results.","included_files":[{"relative_path":"references/chart-type-guide.md","size_in_bytes":3124},{"relative_path":"references/error-recovery.md","size_in_bytes":3169},{"relative_path":"references/expression-rules.md","size_in_bytes":3602},{"relative_path":"references/idmp-agent-quick-start.md","size_in_bytes":1897},{"relative_path":"references/idmp-safety-rules.md","size_in_bytes":8550},{"relative_path":"references/preflight-checklist.md","size_in_bytes":3044}],"name":"idmp-shared","skill_md_contents":"---\nname: idmp-shared\ndescription: \"Shared IDMP CLI rules for choosing element mode vs template mode, resolving business-root rootElementId, acknowledging risky writes, and verifying results.\"\nmetadata:\n  author: \"TAOS Data\"\n  version: \"0.4.1\"\n  owner_team: \"AI\"\n  requires:\n    bins:\n      - idmp-cli\n  cliHelp: \"idmp-cli --help\"\n---\n\n# Shared IDMP CLI rules\n\n## 🛑 Destructive op confirmation (mandatory)\n\nBefore executing any `DELETE`, non-readonly `POST` / `PUT` / `PATCH`, `--ack-risk` command, or local destructive helper (`config remove` / `profile remove` / `auth logout --clear`), the agent MUST print the 4 items below and then **wait for an explicit user `yes`** before running the command:\n\n1. **Target** — resource type + id + name + owning element / template / profile.\n2. **Action** — HTTP method + path + `schemaPath` + param summary (mask secrets).\n3. **Reason** — why this operation is needed (trace it back to the user's request; if it is a rollback of a failed previous step, say so).\n4. **Blast radius** — dependent analyses / panels / dashboards / alerts / notifications; whether the action is reversible; whether sub-objects are deleted transitively; cross-profile impact.\n\nRead-only commands (`get`, `list`, `search`, `path`, `tree`, `new-name`, `*-search`, `*-query`, `forecast`) do not require this confirmation. For detailed wording and the ready-to-use template, see `references/idmp-safety-rules.md`.\n\n## Two working modes\n\n| Mode | CLI families | Use when |\n| --- | --- | --- |\n| element mode | `idmp-cli element ...`, `attribute ...`, `analysis ...`, `panel ...`, `dashboard ...`, `event ...` | The target is a real element, live data, a live dashboard, or a live event. |\n| template mode | `idmp-cli template ...`, `attr-template ...`, `analysis-template ...`, `panel-template ...` | The target is a reusable template, template attribute, or template analysis. |\n\nPick the mode first. Do not mix `elementId` and `elementTemplateId`.\n\n## Preflight\n\n```bash\nidmp-cli config init --server http://your-idmp:6042 --username admin@example.com\nidmp-cli doctor --offline\nidmp-cli auth check\nidmp-cli auth list\nidmp-cli doctor\n```\n\nIf login is required:\n\n```bash\nprintf '%s\\n' \"$IDMP_E2E_PASSWORD\" | idmp-cli auth login --username \"$IDMP_E2E_USERNAME\" --password-stdin\n```\n\n## Recommended shared references\n\n- [`preflight checklist`](references/preflight-checklist.md)\n- [`expression rules`](references/expression-rules.md)\n- [`chart-type guide`](references/chart-type-guide.md)\n- [`error recovery`](references/error-recovery.md)\n\n## Missing context to resolve first\n\n| Context | Why it must be explicit |\n| --- | --- |\n| Working mode | Every create and update path depends on choosing `element mode` or `template mode` first. |\n| Owner | You need the final `elementId` or `elementTemplateId` before you can discover names, trigger types, or related objects. |\n| Business root | Element-mode writes often need a higher `rootElementId` from `element path`, even when the real write must move to a leaf owner. Treat `rootElementId` as the business-root ancestor, not as a synonym for the final leaf owner. |\n| Candidate name seed | `analysis.analyses.new-name`, `panel.panels.new-name`, and `dashboard.dashboards.new-name` all need a proposed `name`; do not call them with only the owner ID. |\n| Scope details | Decide `applyOnSelf`, child-template scope, and whether the workflow targets a real data-bearing leaf before any mutating request. |\n| Verification target | Decide which `get`, `list`, runtime state, event, or delivery reread will prove that the workflow really finished. |\n\n## Constrained live behaviors\n\n- Treat every write as incomplete until a follow-up `get`, `list`, runtime check, or delivery reread proves the backend kept the change.\n- Do not assume a historical `demo` root exists. Start from the currently visible first-level root that owns the shared leaf fixtures, then create any temporary middle-scope owners under that real tree.\n- If `trigger-types list` is empty on the current owner, move the create flow to a data-bearing leaf element and keep the business root as `rootElementId`.\n- Use `new-name` only with the correct payload shape. Analyses, panels, and dashboards need both the owner and a candidate `name`; attribute `new-name` only needs the owner scope. `analysis.analyses.new-name` is a POST reserve call and still requires `--ack-risk`, while panel/dashboard/attribute `new-name` commands remain readonly.\n- Shared environments often require fixture reuse. Notify rules are typically updated in place because the documented create and update paths do not come with a matching delete flow here.\n- For alert validation, `event.events.list --params '{\"analysisId\":...}'` is more reliable than filtering only by `status=Unack` in a noisy shared environment.\n- Successful config writes do not prove runtime behavior. Analyses can remain `Ready`, alerts can need `fill-history`, and notification history can lag behind resend or new-event creation.\n\n## Evidence of completion\n\n- A CLI success line is not proof by itself.\n- For create flows, reread the object and confirm the final `id`, owner scope, reserved name, and expected status bits.\n- For update flows, reread the same object and confirm the changed field persisted on the backend.\n- For delete flows, prove absence through a scoped `list` reread or a structured not-found `get`.\n- For element-mode writes, prove the business-root boundary with `element elements path` plus `element fullpath get` before you reuse `rootElementId`.\n\n## Standard read-before-write flow\n\n1. Locate the target with `search`, `list`, or `path`.\n2. Read the current state with `get`, `attributes`, `analyses list`, or the relevant list endpoint.\n3. Resolve dependencies such as `new-name`, `sub-templates`, `trigger-types`, and any contact-point or event-template prerequisites.\n4. Inspect the schema, preview with `--dry-run`, and add `--ack-risk` for non-read-only generated commands.\n5. Verify with `get` or `list`; resume the object if the product expects a running state.\n\n## Key product rules\n\n- In element mode, `rootElementId` comes from the business root in the element path, not from the current leaf element. The leaf owner and the business root are separate write inputs.\n- `applyOnSelf=false` means the configuration depends on child-template or hierarchical scope; read `sub-templates` and `trigger-types` first.\n- Use `new-name` before creating attributes, analyses, panels, or dashboards when that helper exists, and provide the correct payload shape for that helper.\n- Keep credentials in profiles, environment variables, or stdin only.\n- Prefer generated service commands; use `idmp-cli api` only when no structured command is sufficient.\n\n## Key commands\n\n```bash\nidmp-cli schema element.elements.sub-templates\nidmp-cli schema analysis.analyses.create\nidmp-cli schema attribute.elements.attributes-post\nidmp-cli element elements search --params '{\"keyword\":\"beijing\",\"current\":1,\"limitSize\":20}'\nidmp-cli element elements path --params '{\"elementId\":123}'\nidmp-cli analysis analyses list --params '{\"elementId\":123,\"current\":1,\"size\":20}'\n```\n\n## Exception and failure handling\n\n- If `idmp-cli auth check` or `idmp-cli doctor` fails, stop mutating work until the session and connectivity are healthy again.\n- If the task starts with a template but the command expects `elementId` (or the reverse), switch modes instead of forcing the request.\n- If the path lookup does not clearly show the business root, do not reuse the leaf element as `rootElementId`; resolve the path first. An unclear path is one where `element elements path`, `element fullpath get`, and `element by-path list` do not round-trip to the same root-to-leaf chain.\n- If a create flow reserves a temporary output attribute or default name and the main object is canceled or rejected, clean up the temporary artifact before retrying.\n- If a write reports success but the follow-up `get` or `list` does not show the change, treat the workflow as incomplete and re-read before sending another mutation.\n\n## Live test environment variables\n\nOnly use:\n\n- `IDMP_E2E_ENABLED`\n- `IDMP_BASE_URL`\n- `IDMP_E2E_USERNAME`\n- `IDMP_E2E_PASSWORD`\n\n## Validation scenarios\n\n1. Confirm local readiness with `idmp-cli doctor --offline`.\n2. Confirm the active session with `idmp-cli auth check`.\n3. Validate the chosen mode by comparing `idmp-cli schema element.elements.search` and `idmp-cli schema template.elements.get`.\n4. Resolve the business root before a write with `idmp-cli element elements path --params '{\"elementId\":123}'`.\n5. Preview and verify a mutating workflow with `idmp-cli schema analysis.analyses.create` followed by `idmp-cli analysis analyses list --params '{\"elementId\":123,\"current\":1,\"size\":20}'`.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}