@agent-native/core 0.34.0 → 0.35.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/agent/context-xray/actions/context-evict.d.ts +3 -0
  2. package/dist/agent/context-xray/actions/context-evict.d.ts.map +1 -0
  3. package/dist/agent/context-xray/actions/context-evict.js +35 -0
  4. package/dist/agent/context-xray/actions/context-evict.js.map +1 -0
  5. package/dist/agent/context-xray/actions/context-manifest-get.d.ts +3 -0
  6. package/dist/agent/context-xray/actions/context-manifest-get.d.ts.map +1 -0
  7. package/dist/agent/context-xray/actions/context-manifest-get.js +67 -0
  8. package/dist/agent/context-xray/actions/context-manifest-get.js.map +1 -0
  9. package/dist/agent/context-xray/actions/context-pin.d.ts +3 -0
  10. package/dist/agent/context-xray/actions/context-pin.d.ts.map +1 -0
  11. package/dist/agent/context-xray/actions/context-pin.js +35 -0
  12. package/dist/agent/context-xray/actions/context-pin.js.map +1 -0
  13. package/dist/agent/context-xray/actions/context-report.d.ts +3 -0
  14. package/dist/agent/context-xray/actions/context-report.d.ts.map +1 -0
  15. package/dist/agent/context-xray/actions/context-report.js +59 -0
  16. package/dist/agent/context-xray/actions/context-report.js.map +1 -0
  17. package/dist/agent/context-xray/actions/context-restore.d.ts +3 -0
  18. package/dist/agent/context-xray/actions/context-restore.d.ts.map +1 -0
  19. package/dist/agent/context-xray/actions/context-restore.js +33 -0
  20. package/dist/agent/context-xray/actions/context-restore.js.map +1 -0
  21. package/dist/agent/context-xray/actions/errors.d.ts +7 -0
  22. package/dist/agent/context-xray/actions/errors.d.ts.map +1 -0
  23. package/dist/agent/context-xray/actions/errors.js +15 -0
  24. package/dist/agent/context-xray/actions/errors.js.map +1 -0
  25. package/dist/agent/context-xray/apply-directives.d.ts +10 -0
  26. package/dist/agent/context-xray/apply-directives.d.ts.map +1 -0
  27. package/dist/agent/context-xray/apply-directives.js +100 -0
  28. package/dist/agent/context-xray/apply-directives.js.map +1 -0
  29. package/dist/agent/context-xray/directives-store.d.ts +26 -0
  30. package/dist/agent/context-xray/directives-store.d.ts.map +1 -0
  31. package/dist/agent/context-xray/directives-store.js +131 -0
  32. package/dist/agent/context-xray/directives-store.js.map +1 -0
  33. package/dist/agent/context-xray/identity.d.ts +5 -0
  34. package/dist/agent/context-xray/identity.d.ts.map +1 -0
  35. package/dist/agent/context-xray/identity.js +33 -0
  36. package/dist/agent/context-xray/identity.js.map +1 -0
  37. package/dist/agent/context-xray/manifest.d.ts +19 -0
  38. package/dist/agent/context-xray/manifest.d.ts.map +1 -0
  39. package/dist/agent/context-xray/manifest.js +115 -0
  40. package/dist/agent/context-xray/manifest.js.map +1 -0
  41. package/dist/agent/context-xray/migrations.d.ts +3 -0
  42. package/dist/agent/context-xray/migrations.d.ts.map +1 -0
  43. package/dist/agent/context-xray/migrations.js +31 -0
  44. package/dist/agent/context-xray/migrations.js.map +1 -0
  45. package/dist/agent/context-xray/plugin.d.ts +5 -0
  46. package/dist/agent/context-xray/plugin.d.ts.map +1 -0
  47. package/dist/agent/context-xray/plugin.js +15 -0
  48. package/dist/agent/context-xray/plugin.js.map +1 -0
  49. package/dist/agent/context-xray/schema.d.ts +249 -0
  50. package/dist/agent/context-xray/schema.d.ts.map +1 -0
  51. package/dist/agent/context-xray/schema.js +17 -0
  52. package/dist/agent/context-xray/schema.js.map +1 -0
  53. package/dist/agent/context-xray/segments.d.ts +19 -0
  54. package/dist/agent/context-xray/segments.d.ts.map +1 -0
  55. package/dist/agent/context-xray/segments.js +154 -0
  56. package/dist/agent/context-xray/segments.js.map +1 -0
  57. package/dist/agent/context-xray/tokenize.d.ts +10 -0
  58. package/dist/agent/context-xray/tokenize.d.ts.map +1 -0
  59. package/dist/agent/context-xray/tokenize.js +70 -0
  60. package/dist/agent/context-xray/tokenize.js.map +1 -0
  61. package/dist/agent/production-agent.d.ts +2 -0
  62. package/dist/agent/production-agent.d.ts.map +1 -1
  63. package/dist/agent/production-agent.js +45 -5
  64. package/dist/agent/production-agent.js.map +1 -1
  65. package/dist/cli/context-xray-local.d.ts +16 -0
  66. package/dist/cli/context-xray-local.d.ts.map +1 -0
  67. package/dist/cli/context-xray-local.js +738 -0
  68. package/dist/cli/context-xray-local.js.map +1 -0
  69. package/dist/cli/create.d.ts.map +1 -1
  70. package/dist/cli/create.js +1 -0
  71. package/dist/cli/create.js.map +1 -1
  72. package/dist/cli/skills.d.ts +3 -0
  73. package/dist/cli/skills.d.ts.map +1 -1
  74. package/dist/cli/skills.js +200 -73
  75. package/dist/cli/skills.js.map +1 -1
  76. package/dist/cli/templates-meta.js +5 -5
  77. package/dist/cli/templates-meta.js.map +1 -1
  78. package/dist/client/AssistantChat.d.ts.map +1 -1
  79. package/dist/client/AssistantChat.js +2 -1
  80. package/dist/client/AssistantChat.js.map +1 -1
  81. package/dist/client/components/ui/sheet.d.ts +16 -0
  82. package/dist/client/components/ui/sheet.d.ts.map +1 -0
  83. package/dist/client/components/ui/sheet.js +23 -0
  84. package/dist/client/components/ui/sheet.js.map +1 -0
  85. package/dist/client/context-xray/ContextMeter.d.ts +4 -0
  86. package/dist/client/context-xray/ContextMeter.d.ts.map +1 -0
  87. package/dist/client/context-xray/ContextMeter.js +76 -0
  88. package/dist/client/context-xray/ContextMeter.js.map +1 -0
  89. package/dist/client/context-xray/ContextSegmentRow.d.ts +9 -0
  90. package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -0
  91. package/dist/client/context-xray/ContextSegmentRow.js +22 -0
  92. package/dist/client/context-xray/ContextSegmentRow.js.map +1 -0
  93. package/dist/client/context-xray/ContextTreemap.d.ts +6 -0
  94. package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -0
  95. package/dist/client/context-xray/ContextTreemap.js +49 -0
  96. package/dist/client/context-xray/ContextTreemap.js.map +1 -0
  97. package/dist/client/context-xray/ContextXRayPanel.d.ts +11 -0
  98. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -0
  99. package/dist/client/context-xray/ContextXRayPanel.js +87 -0
  100. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -0
  101. package/dist/client/context-xray/SegmentProvenancePopover.d.ts +7 -0
  102. package/dist/client/context-xray/SegmentProvenancePopover.d.ts.map +1 -0
  103. package/dist/client/context-xray/SegmentProvenancePopover.js +7 -0
  104. package/dist/client/context-xray/SegmentProvenancePopover.js.map +1 -0
  105. package/dist/client/context-xray/format.d.ts +7 -0
  106. package/dist/client/context-xray/format.d.ts.map +1 -0
  107. package/dist/client/context-xray/format.js +47 -0
  108. package/dist/client/context-xray/format.js.map +1 -0
  109. package/dist/deploy/route-discovery.d.ts.map +1 -1
  110. package/dist/deploy/route-discovery.js +1 -0
  111. package/dist/deploy/route-discovery.js.map +1 -1
  112. package/dist/deploy/workspace-core.d.ts +1 -1
  113. package/dist/deploy/workspace-core.d.ts.map +1 -1
  114. package/dist/deploy/workspace-core.js +1 -0
  115. package/dist/deploy/workspace-core.js.map +1 -1
  116. package/dist/server/action-discovery.d.ts.map +1 -1
  117. package/dist/server/action-discovery.js +20 -0
  118. package/dist/server/action-discovery.js.map +1 -1
  119. package/dist/server/framework-request-handler.d.ts.map +1 -1
  120. package/dist/server/framework-request-handler.js +2 -0
  121. package/dist/server/framework-request-handler.js.map +1 -1
  122. package/dist/server/index.d.ts +1 -0
  123. package/dist/server/index.d.ts.map +1 -1
  124. package/dist/server/index.js +1 -0
  125. package/dist/server/index.js.map +1 -1
  126. package/dist/shared/context-xray.d.ts +58 -0
  127. package/dist/shared/context-xray.d.ts.map +1 -0
  128. package/dist/shared/context-xray.js +17 -0
  129. package/dist/shared/context-xray.js.map +1 -0
  130. package/dist/templates/default/package.json +3 -3
  131. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  132. package/dist/vite/action-types-plugin.js +20 -0
  133. package/dist/vite/action-types-plugin.js.map +1 -1
  134. package/package.json +15 -7
  135. package/src/templates/default/package.json +3 -3
@@ -9,18 +9,20 @@ import path from "node:path";
9
9
  import { spawn } from "node:child_process";
10
10
  import { buildAppSkillPack, ensureAppSkill, loadAppSkillManifest, normalizeAppSkillManifest, } from "./app-skill.js";
11
11
  import { readConnectClientPreferences, resolveClients, writeConnectClientPreferences, } from "./connect.js";
12
+ import { CONTEXT_XRAY_SKILL_MD, installLocalContextXray, } from "./context-xray-local.js";
12
13
  import { CLIENTS } from "./mcp-config-writers.js";
13
14
  const HELP = `agent-native skills
14
15
 
15
16
  Usage:
16
17
  agent-native skills list
17
- agent-native skills add assets|design-exploration|contracts [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--yes] [--dry-run] [--json]
18
+ agent-native skills add assets|design-exploration|visual-plans|context-xray [--client codex|claude-code|claude-code-cli|cowork|all] [--scope user|project] [--mcp-url <url>] [--yes] [--dry-run] [--json]
18
19
  agent-native skills add <manifest-or-app-dir> [--client ...] [--yes]
19
20
 
20
21
  Examples:
21
22
  agent-native skills add assets
22
23
  agent-native skills add design-exploration
23
- agent-native skills add contracts
24
+ agent-native skills add visual-plans
25
+ agent-native skills add context-xray --client all
24
26
  agent-native skills add assets --client claude-code
25
27
  agent-native skills add assets --mcp-url https://my-app.ngrok-free.dev
26
28
  agent-native skills add ./dist/assets-skill --client codex
@@ -183,33 +185,37 @@ iteration, or a human-in-the-loop choice among design directions.
183
185
  - If you inspect local MCP config, redact \`Authorization\`, \`http_headers\`,
184
186
  and token values. Never paste bearer tokens into chat or logs.
185
187
  `;
186
- const CONTRACTS_SKILL_MD = `---
187
- name: contracts
188
+ const VISUAL_PLANS_SKILL_MD = `---
189
+ name: visual-plans
188
190
  description: >-
189
- Use Contracts for coding-agent work that needs assumption review, mid-flight
190
- feedback, acceptance criteria, evidence capture, and proof-before-done
191
- through the hosted Contracts MCP app.
191
+ Use Visual Plans for coding-agent work that needs an interactive HTML plan,
192
+ diagrams, wireframes, prototype options, annotations, implementation tasks,
193
+ feedback, and proof gates through the hosted Visual Plans MCP app.
192
194
  metadata:
193
195
  visibility: exported
194
196
  ---
195
197
 
196
- # Contracts
198
+ # Visual Plans
197
199
 
198
- Use Contracts as the trust layer for non-trivial coding work. It records what
199
- the agent is assuming, lets a human correct those assumptions before they become
200
- code, and keeps acceptance criteria separate from verified evidence.
200
+ Use Visual Plans as HTML plan mode for coding work. The point is not to create a
201
+ prettier Markdown plan. The point is to give the user something visual to react
202
+ to before the agent edits code: diagrams, wireframes, option cards, clickable
203
+ prototype sketches, assumptions, tasks, annotations, and proof gates.
204
+
205
+ Text is the fallback layer. Default to visual artifacts.
201
206
 
202
207
  ## When To Use
203
208
 
204
- Create or update a contract when:
209
+ Create or update a visual plan when:
205
210
 
206
- - the user asks for Contracts, specs, proof, review, acceptance criteria, or a
207
- structured plan;
208
- - work is multi-file, ambiguous, long-running, or risky;
211
+ - the user asks for a plan, visual plan, HTML plan, plannotate-style review,
212
+ diagrams, wireframes, mockups, prototype options, comments, or annotations;
213
+ - work is multi-file, ambiguous, long-running, risky, or UI-heavy;
214
+ - the user needs to react quickly to direction rather than read prose;
209
215
  - the task touches auth, billing, migrations, public APIs, tests, production
210
216
  config, data, security, permissions, or deploy behavior;
211
217
  - you would otherwise proceed on a material assumption;
212
- - you are about to claim the work is complete.
218
+ - you are about to claim the work is complete and need proof gates checked.
213
219
 
214
220
  Do not log every trivial inference. An assumption is material when changing it
215
221
  would affect user-visible behavior, data model, permissions, billing, public API
@@ -218,52 +224,60 @@ deployment/configuration, file scope, or the definition of done.
218
224
 
219
225
  ## Core Workflow
220
226
 
221
- 1. Call \`create-contract\` with the goal, source, repo path, and initial
222
- assumptions/criteria before risky implementation.
223
- 2. Surface the returned Contracts UI link or inline MCP App. In CLI hosts, tell
224
- the user to open the link and review the queue.
225
- 3. Call \`get-feedback\` before risky edits, after review, after any long pause,
227
+ 1. Call \`create-visual-plan\` with the goal, source, repo path, and initial
228
+ plan nodes before implementation.
229
+ 2. Surface the returned Visual Plans link or inline MCP App. In CLI hosts, tell
230
+ the user to open the link and review the visual plan.
231
+ 3. Prefer diagrams, wireframes, UI mockups, option cards, and small interactive
232
+ prototypes over paragraphs.
233
+ 4. Call \`get-plan-feedback\` before editing, after review, after any long pause,
226
234
  and before the final response.
227
- 4. If the user accepts, rejects, corrects, or requests evidence, consume the
228
- structured feedback and change your plan accordingly.
229
- 5. If new facts require a change after approval, create an \`amendment\` or
230
- \`deviation\` item with \`upsert-contract-items\` instead of drifting silently.
231
- 6. Attach command/test/log/diff/screenshot evidence with \`record-evidence\`.
232
- 7. Do not treat your own claim as proof. Agent attestation is low trust.
233
- Criteria are done only when verified by human, CI, deterministic checks, or
234
- an independent verifier.
235
- 8. Export a JSON/Markdown receipt with \`export-contract\` when the user wants a
236
- shareable summary.
235
+ 5. If the user comments, accepts, rejects, corrects, or requests proof, consume
236
+ the structured feedback and update the implementation plan accordingly.
237
+ 6. If new facts require a change after approval, create an amendment or
238
+ deviation with \`update-visual-plan\` instead of drifting silently.
239
+ 7. Attach command/test/log/diff/screenshot/design artifacts with
240
+ \`record-plan-evidence\`. Agent claims are not proof.
241
+ 8. Export an HTML/JSON/Markdown receipt with \`export-visual-plan\` when the
242
+ user wants a shareable summary.
243
+
244
+ ## Visual Defaults
245
+
246
+ - UI work gets wireframes or prototype options before coding.
247
+ - Backend/refactor work gets architecture and data-flow diagrams.
248
+ - Complex tradeoffs get two or three option cards with consequences.
249
+ - Assumptions are shown as reviewable visual callouts, not hidden prose.
250
+ - Proof gates stay compact: what must pass, current evidence, and missing proof.
251
+ - Long prose is collapsed behind the visual plan.
237
252
 
238
253
  ## Tool Guidance
239
254
 
240
- - \`create-contract\`: start one contract per agent task/run.
241
- - \`upsert-contract-items\`: bulk add/update assumptions, decisions, criteria,
242
- risks, deviations, open questions, and amendments.
243
- - \`get-contract\` and \`get-review-queue\`: read current structured state.
244
- - \`get-feedback\`: read unconsumed human feedback. Use it frequently.
245
- - \`record-progress\`: update phase/status and mark feedback consumed only after
246
- you incorporated it.
247
- - \`record-evidence\`: attach artifacts and provenance. Use high trust for
255
+ - \`create-visual-plan\`: start one visual plan per agent task/run.
256
+ - \`update-visual-plan\`: bulk add/update plan nodes, options, assumptions,
257
+ decisions, tasks, risks, deviations, annotations, and proof gates.
258
+ - \`get-visual-plan\` and \`get-plan-review-queue\`: read current plan state.
259
+ - \`get-plan-feedback\`: read unconsumed human feedback. Use it frequently.
260
+ - \`record-plan-progress\`: update phase/status and mark feedback consumed only
261
+ after you incorporated it.
262
+ - \`record-plan-evidence\`: attach artifacts and provenance. Use high trust for
248
263
  captured commands/tests/CI, human_confirmed for explicit human confirmation,
249
264
  and low trust for agent-only statements.
250
- - \`analyze-plan\`: import pasted plan text and let Contracts create possible
251
- assumptions/criteria. Treat detections as possible, not authoritative.
265
+ - \`analyze-visual-plan\`: import pasted Markdown/text and create possible
266
+ visual plan nodes. Treat detections as possible, not authoritative.
252
267
 
253
268
  ## Guardrails
254
269
 
270
+ - Keep it simple. Do not build a ten-tab dashboard unless the user asks.
255
271
  - Before high-risk actions, create a blocking review item or ask the user
256
272
  directly.
257
- - Never modify tests merely to make implementation pass unless the contract
273
+ - Never modify tests merely to make implementation pass unless the visual plan
258
274
  explicitly approves test expectation changes.
259
275
  - If proof is missing, say so. Do not call the task complete just because code
260
276
  was changed.
261
- - If evidence contains secrets or tokens, rely on Contracts redaction and avoid
262
- pasting raw output into chat.
263
277
  - Do not hand-roll MCP HTTP requests with curl. Use host-exposed tools after
264
278
  restart/reload, or use the returned browser/deep-link fallback.
265
279
  - Hosted default: connect
266
- \`https://contracts.agent-native.com/_agent-native/mcp\`. Do not put shared
280
+ \`https://plans.agent-native.com/_agent-native/mcp\`. Do not put shared
267
281
  secrets in skill files.
268
282
  `;
269
283
  const BUILT_IN_APP_SKILLS = {
@@ -353,34 +367,34 @@ const BUILT_IN_APP_SKILLS = {
353
367
  }),
354
368
  skillMarkdown: DESIGN_EXPLORATION_SKILL_MD,
355
369
  },
356
- contracts: {
357
- skillName: "contracts",
370
+ "visual-plans": {
371
+ skillName: "visual-plans",
358
372
  manifest: normalizeAppSkillManifest({
359
373
  schemaVersion: 1,
360
- id: "contracts",
361
- displayName: "Contracts",
362
- description: "Review coding-agent assumptions, feedback, acceptance criteria, and proof before work is called done.",
374
+ id: "visual-plans",
375
+ displayName: "Visual Plans",
376
+ description: "Review coding-agent plans as interactive HTML with diagrams, wireframes, annotations, and proof gates.",
363
377
  hosted: {
364
- url: "https://contracts.agent-native.com",
365
- mcpUrl: "https://contracts.agent-native.com/_agent-native/mcp",
378
+ url: "https://plans.agent-native.com",
379
+ mcpUrl: "https://plans.agent-native.com/_agent-native/mcp",
366
380
  },
367
- mcp: { serverName: "agent-native-contracts" },
381
+ mcp: { serverName: "agent-native-visual-plans" },
368
382
  auth: {
369
383
  mode: "oauth",
370
- setup: "Authenticate with the Contracts MCP connector in the host app. No shared secrets are stored in skill files.",
384
+ setup: "Authenticate with the Visual Plans MCP connector in the host app. No shared secrets are stored in skill files.",
371
385
  },
372
386
  surfaces: [
373
387
  {
374
- id: "review-inbox",
375
- action: "create-contract",
376
- path: "/contracts",
388
+ id: "visual-plan",
389
+ action: "create-visual-plan",
390
+ path: "/plans",
377
391
  },
378
392
  ],
379
393
  skills: [
380
394
  {
381
- path: "skills/contracts",
395
+ path: "skills/visual-plans",
382
396
  visibility: "exported",
383
- exportAs: "contracts",
397
+ exportAs: "visual-plans",
384
398
  },
385
399
  ],
386
400
  hostAdapters: [
@@ -393,7 +407,38 @@ const BUILT_IN_APP_SKILLS = {
393
407
  "generic-mcp",
394
408
  ],
395
409
  }),
396
- skillMarkdown: CONTRACTS_SKILL_MD,
410
+ skillMarkdown: VISUAL_PLANS_SKILL_MD,
411
+ },
412
+ "context-xray": {
413
+ skillName: "context-xray",
414
+ localOnly: true,
415
+ manifest: normalizeAppSkillManifest({
416
+ schemaVersion: 1,
417
+ id: "context-xray",
418
+ displayName: "Context X-Ray",
419
+ description: "Visualize local Codex and Claude Code context usage with warnings and optimization tips.",
420
+ hosted: {
421
+ url: "https://context-xray.agent-native.com",
422
+ mcpUrl: "https://context-xray.agent-native.com/_agent-native/mcp",
423
+ },
424
+ mcp: { serverName: "agent-native-context-xray" },
425
+ auth: { mode: "none" },
426
+ surfaces: [
427
+ {
428
+ id: "context-xray-report",
429
+ path: "/",
430
+ },
431
+ ],
432
+ skills: [
433
+ {
434
+ path: "skills/context-xray",
435
+ visibility: "exported",
436
+ exportAs: "context-xray",
437
+ },
438
+ ],
439
+ hostAdapters: ["plain-skill", "claude-skill"],
440
+ }),
441
+ skillMarkdown: CONTEXT_XRAY_SKILL_MD,
397
442
  },
398
443
  };
399
444
  const BUILT_IN_APP_SKILL_ALIASES = {
@@ -412,12 +457,27 @@ const BUILT_IN_APP_SKILL_ALIASES = {
412
457
  "ux-exploration": "design",
413
458
  "agent-native-design": "design",
414
459
  "agent-native-design-exploration": "design",
415
- contracts: "contracts",
416
- contract: "contracts",
417
- proof: "contracts",
418
- "proof-check": "contracts",
419
- "assumption-review": "contracts",
420
- "agent-native-contracts": "contracts",
460
+ "visual-plans": "visual-plans",
461
+ "visual-plan": "visual-plans",
462
+ plans: "visual-plans",
463
+ plan: "visual-plans",
464
+ "html-plan": "visual-plans",
465
+ "plan-mode": "visual-plans",
466
+ plannotate: "visual-plans",
467
+ plannotator: "visual-plans",
468
+ contracts: "visual-plans",
469
+ contract: "visual-plans",
470
+ proof: "visual-plans",
471
+ "proof-check": "visual-plans",
472
+ "assumption-review": "visual-plans",
473
+ "agent-native-contracts": "visual-plans",
474
+ "agent-native-visual-plans": "visual-plans",
475
+ "context-xray": "context-xray",
476
+ "local-context-xray": "context-xray",
477
+ xray: "context-xray",
478
+ "context-window": "context-xray",
479
+ "context-usage": "context-xray",
480
+ "agent-native-context-xray": "context-xray",
421
481
  };
422
482
  const BUILT_IN_APP_SKILL_DISPLAY_ALIASES = {
423
483
  assets: ["images", "image-generation", "agent-native-images"],
@@ -426,7 +486,14 @@ const BUILT_IN_APP_SKILL_DISPLAY_ALIASES = {
426
486
  "ux-exploration",
427
487
  "agent-native-design-exploration",
428
488
  ],
429
- contracts: ["contract", "proof-check", "assumption-review"],
489
+ "visual-plans": [
490
+ "plans",
491
+ "html-plan",
492
+ "plannotate",
493
+ "contracts",
494
+ "proof-check",
495
+ ],
496
+ "context-xray": ["xray", "context-window", "context-usage"],
430
497
  };
431
498
  const CLIENT_LABELS = {
432
499
  "claude-code": "Claude Code",
@@ -449,6 +516,9 @@ function normalizeKnownSkillTarget(value) {
449
516
  function isKnownSkill(value) {
450
517
  return Boolean(normalizeKnownSkillTarget(value));
451
518
  }
519
+ function isLocalOnlyBuiltInSkill(entry) {
520
+ return Boolean(entry && "localOnly" in entry && entry.localOnly);
521
+ }
452
522
  function normalizeClientIds(values) {
453
523
  if (!Array.isArray(values))
454
524
  return [];
@@ -823,6 +893,49 @@ export async function addAgentNativeSkill(parsed, options = {}) {
823
893
  if (!knownTarget && !fs.existsSync(path.resolve(target))) {
824
894
  throw new Error(`Unknown skill or manifest path: ${target}. Run "agent-native skills list".`);
825
895
  }
896
+ const knownBuiltIn = knownTarget ? BUILT_IN_APP_SKILLS[knownTarget] : null;
897
+ if (isLocalOnlyBuiltInSkill(knownBuiltIn)) {
898
+ if (parsed.mcpUrl) {
899
+ throw new Error("Context X-Ray is installed locally and does not use --mcp-url yet.");
900
+ }
901
+ if (!parsed.instructions && parsed.mcp) {
902
+ throw new Error("Context X-Ray does not need MCP config yet. Run without --mcp-only.");
903
+ }
904
+ const clients = parsed.clients ?? resolveClients(parsed.client);
905
+ const skillsAgents = skillsAgentsForClients(clients);
906
+ if (parsed.dryRun) {
907
+ return {
908
+ id: knownBuiltIn.manifest.id,
909
+ displayName: knownBuiltIn.manifest.displayName,
910
+ skillNames: [knownBuiltIn.skillName],
911
+ skillsAgents,
912
+ mcpUrl: "",
913
+ mcpClients: [],
914
+ dryRun: true,
915
+ local: true,
916
+ commands: [dryRunInstallCommand(parsed, target)],
917
+ };
918
+ }
919
+ const localInstall = installLocalContextXray({
920
+ baseDir: options.baseDir ?? process.cwd(),
921
+ clients,
922
+ scope: parsed.scope,
923
+ });
924
+ return {
925
+ id: knownBuiltIn.manifest.id,
926
+ displayName: knownBuiltIn.manifest.displayName,
927
+ instructionSource: localInstall.scriptPath,
928
+ skillNames: [knownBuiltIn.skillName],
929
+ skillsAgents,
930
+ mcpUrl: "",
931
+ mcpClients: [],
932
+ dryRun: false,
933
+ local: true,
934
+ scriptPath: localInstall.scriptPath,
935
+ written: localInstall.written,
936
+ commands: localInstall.commands,
937
+ };
938
+ }
826
939
  let installTarget = loadSkillTarget(target);
827
940
  if (parsed.mcpUrl) {
828
941
  installTarget = withMcpUrlOverride(installTarget, parsed.mcpUrl);
@@ -916,7 +1029,8 @@ function listSkills() {
916
1029
  aliases: BUILT_IN_APP_SKILL_DISPLAY_ALIASES[entry.manifest.id] ?? [],
917
1030
  name: entry.manifest.displayName,
918
1031
  description: entry.manifest.description,
919
- mcpUrl: entry.manifest.hosted.mcpUrl,
1032
+ mcpUrl: isLocalOnlyBuiltInSkill(entry) ? "" : entry.manifest.hosted.mcpUrl,
1033
+ local: isLocalOnlyBuiltInSkill(entry),
920
1034
  }));
921
1035
  }
922
1036
  export async function runSkills(argv, options = {}) {
@@ -939,7 +1053,8 @@ export async function runSkills(argv, options = {}) {
939
1053
  const aliases = skill.aliases.length
940
1054
  ? ` Aliases: ${skill.aliases.join(", ")}.`
941
1055
  : "";
942
- process.stdout.write(`${skill.id.padEnd(12)} ${description}${aliases} (${skill.mcpUrl})\n`);
1056
+ const target = skill.local ? "local command" : skill.mcpUrl;
1057
+ process.stdout.write(`${skill.id.padEnd(12)} ${description}${aliases} (${target})\n`);
943
1058
  }
944
1059
  return;
945
1060
  }
@@ -976,15 +1091,27 @@ export async function runSkills(argv, options = {}) {
976
1091
  const mcpClients = [
977
1092
  ...new Set(results.flatMap((result) => result.mcpClients)),
978
1093
  ];
979
- const mcpUrls = [...new Set(results.map((result) => result.mcpUrl))];
1094
+ const mcpUrls = [
1095
+ ...new Set(results.map((result) => result.mcpUrl).filter(Boolean)),
1096
+ ];
1097
+ const localCommands = [
1098
+ ...new Set(results
1099
+ .filter((result) => result.local)
1100
+ .flatMap((result) => result.commands)),
1101
+ ];
980
1102
  process.stdout.write([
981
1103
  `Installed ${installedNames} skill${results.length === 1 ? "" : "s"}.`,
982
1104
  skillsAgents.length
983
1105
  ? `Skill instructions: ${skillsAgents.join(", ")}.`
984
1106
  : "Skill instructions: skipped.",
985
- `MCP config: ${mcpClients.join(", ")}.`,
986
- `MCP URL${mcpUrls.length === 1 ? "" : "s"}: ${mcpUrls.join(", ")}.`,
987
- "Restart or reload selected agent clients if the tools are not visible yet.",
1107
+ mcpClients.length
1108
+ ? `MCP config: ${mcpClients.join(", ")}.`
1109
+ : "MCP config: not required.",
1110
+ mcpUrls.length
1111
+ ? `MCP URL${mcpUrls.length === 1 ? "" : "s"}: ${mcpUrls.join(", ")}.`
1112
+ : "",
1113
+ localCommands.length ? `Local command: ${localCommands.join(", ")}.` : "",
1114
+ "Restart or reload selected agent clients if the skill is not visible yet.",
988
1115
  parsed.clientExplicit
989
1116
  ? ""
990
1117
  : `To add another client later, rerun with --client <client> (for example: --client claude-code).`,