@hybridlabor-api/aos 4.17.0 → 4.18.0

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 (88) hide show
  1. package/.claude/hooks/aos-bus.mjs +8 -4
  2. package/.claude/hooks/go-gate.mjs +1 -1
  3. package/.claude/hooks/go-token.mjs +17 -2
  4. package/.claude/hooks/memb-inject.mjs +61 -37
  5. package/.codex-plugin/plugin.json +1 -1
  6. package/.opencode/commands/bdb-aos-plan.md +1 -1
  7. package/README.md +1 -0
  8. package/THIRD_PARTY_NOTICES.md +2 -2
  9. package/bin/aos-acp.mjs +27 -1
  10. package/bin/aos-doctor.mjs +36 -1
  11. package/bin/aos-uninstall.mjs +16 -2
  12. package/bin/go-check.mjs +79 -0
  13. package/bin/guarded-patterns.json +106 -0
  14. package/commands/plan.md +1 -1
  15. package/docs/codenotch.md +44 -0
  16. package/docs/codex-gate-smoke.md +43 -0
  17. package/docs/delegation-routing.md +32 -0
  18. package/docs/go-check.md +60 -0
  19. package/docs/master-session-acp.md +2 -0
  20. package/docs/opencode-setup.md +18 -0
  21. package/installer.js +129 -70
  22. package/lib/codenotch.js +389 -0
  23. package/lib/retired-skills.js +101 -0
  24. package/mcps/mcsc/README.md +1 -1
  25. package/mcps/mcsc/packages/core/src/adapters/agy.js +3 -1
  26. package/mcps/mcsc/packages/core/src/adapters/codex.js +2 -1
  27. package/mcps/mcsc/packages/core/src/adapters/opencode.js +2 -1
  28. package/mcps/mcsc/packages/core/src/depth.js +16 -0
  29. package/mcps/mcsc/packages/mcp/server.js +15 -2
  30. package/package.json +2 -2
  31. package/plugin-commands.json +1 -2
  32. package/plugin.json +1 -4
  33. package/plugins/bdb-aos-codex/.codex-plugin/plugin.json +1 -1
  34. package/plugins/bdb-aos-codex/skills/plan/SKILL.md +1 -1
  35. package/scripts/codex-gate-smoke.mjs +73 -0
  36. package/skills/basic/master-session/SKILL.md +11 -0
  37. package/skills/global_config/agenttrail/SKILL.md +3 -1
  38. package/skills/global_config/agenttrail/bin/agenttrail.mjs +255 -117
  39. package/skills/global_config/agenttrail/bin/ensure.mjs +60 -40
  40. package/skills/global_config/agenttrail/bin/repoid.mjs +70 -0
  41. package/skills/global_config/agenttrail/public/index.html +9 -1
  42. package/skills/global_config/aos-setup/scripts/aos-doctor.mjs +1 -1
  43. package/skills/global_config/bdb-memb-mcp/SKILL.md +5 -4
  44. package/skills/global_config/bdb-visual-edit/SKILL.md +28 -32
  45. package/skills/global_config/bdb-visual-edit/references/vite-react-source-attr.md +2 -2
  46. package/skills/global_config/bdb-visual-edit/scripts/locate-source.mjs +135 -0
  47. package/skills/global_config/bdb-visual-edit/scripts/sanitize-element.mjs +30 -2
  48. package/skills/global_config/mcsc/SKILL.md +9 -1
  49. package/skills/global_config/plan-arbiter/SKILL.md +1 -1
  50. package/skills/global_config/plan-canvas/SKILL.md +42 -4
  51. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/README.md +1 -1
  52. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/render.js +2 -2
  53. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotate-client/geometry.js +76 -0
  54. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotate-client/index.js +596 -0
  55. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotate-client/model.js +192 -0
  56. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotate-client/toolbar.js +99 -0
  57. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotate-server.js +282 -0
  58. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/annotation-schema.js +210 -0
  59. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/route.js +10 -0
  60. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sdk.js +6 -230
  61. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/server.js +45 -4
  62. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/sessions.js +60 -21
  63. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/trail-on-approve.js +103 -0
  64. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +19 -7
  65. package/skills/global_config/plan-canvas/scripts/plan-canvas.js +118 -20
  66. package/skills/global_config/subagent-setup/SKILL.md +6 -0
  67. package/skills/global_config/subagent-setup/scripts/setup-subagents.mjs +20 -1
  68. package/skills/playbooks/pb-idea-to-launch/SKILL.md +2 -2
  69. package/skills/playbooks/pb-redesign-app/SKILL.md +3 -3
  70. package/skills/playbooks/pb-release-aos/SKILL.md +2 -2
  71. package/skills/playbooks/pb-ship/SKILL.md +2 -2
  72. package/skills/playbooks/pb-worktrees-land/SKILL.md +2 -2
  73. package/skills/global_config/bdb-visual-edit/scripts/pick-snippet.js +0 -27
  74. package/skills/global_config/visual-edit/README.md +0 -96
  75. package/skills/global_config/visual-edit/SKILL.md +0 -615
  76. package/skills/global_config/visual-plan/README.md +0 -93
  77. package/skills/global_config/visual-plan/SKILL.md +0 -544
  78. package/skills/global_config/visual-plan/references/canvas.md +0 -139
  79. package/skills/global_config/visual-plan/references/connection.md +0 -51
  80. package/skills/global_config/visual-plan/references/document-quality.md +0 -186
  81. package/skills/global_config/visual-plan/references/exemplar.md +0 -62
  82. package/skills/global_config/visual-plan/references/local-files.md +0 -99
  83. package/skills/global_config/visual-plan/references/wireframe.md +0 -319
  84. package/skills/global_config/visual-recap/README.md +0 -103
  85. package/skills/global_config/visual-recap/SKILL.md +0 -560
  86. package/skills/global_config/visual-recap/references/connection.md +0 -51
  87. package/skills/global_config/visual-recap/references/local-files.md +0 -99
  88. package/skills/global_config/visual-recap/references/wireframe.md +0 -319
@@ -1,93 +0,0 @@
1
- # /visual-plan
2
-
3
- Turn ordinary implementation plans into rich interactive visual review surfaces.
4
-
5
- `/visual-plan` turns the plan an agent would normally write in chat into a
6
- human-optimized MDX document. In local-files mode, it writes and serves the MDX locally rather than publishing to the hosted Plan database. Instead of a long wall of prose, reviewers get
7
- custom components built for understanding: architecture diagrams, wireframes,
8
- interactive prototypes, file maps, annotated code, OpenAPI-style API specs,
9
- visual schema maps, open questions, and comments.
10
-
11
- It solves for plans that are too important to bury in chat. The output is
12
- scannable, commentable, and intuitive enough for a human to approve before code
13
- changes start.
14
-
15
- <picture>
16
- <img alt="Visual plan review surface" src="../../media/visual-plan.png">
17
- </picture>
18
-
19
- Visual plans are MDX, customizable with your own components, and viewed with the
20
- [Agent-Native plans app](https://www.agent-native.com/docs/template-plan). The
21
- hosted app is 100% free and open source; local-files mode writes
22
- MDX locally, starts a localhost bridge, and opens the hosted Plan UI with no
23
- sharing.
24
- [Source here](https://github.com/BuilderIO/agent-native/).
25
-
26
- ## What It Does
27
-
28
- - Grounds plans in real repo files, schemas, actions, and symbols.
29
- - Chooses the right visual surface: document-only, wireframe canvas, prototype,
30
- design direction, or visual intake.
31
- - Uses MDX and custom components for diagrams, UI flows, API specs, schema maps,
32
- diffs, code annotations, and reviewer questions.
33
- - Publishes the result as an interactive review document instead of inline chat Markdown.
34
- - Keeps the plan as the approval gate before source edits begin.
35
-
36
- ## When To Use It
37
-
38
- Use it for multi-file, ambiguous, risky, architecture-heavy, data-heavy, or
39
- UI-heavy work where the wrong direction would be expensive. It is also useful
40
- when a pasted text plan needs a richer review surface.
41
-
42
- Skip it for trivial fixes, single-line changes, or anything whose diff is easier
43
- to review than a plan.
44
-
45
- ## What Reviewers Get
46
-
47
- Reviewers get a plan link that is built for scanning. Decisions, files,
48
- diagrams, contracts, UI states, prototype behavior, schema shape, API boundaries,
49
- and unresolved questions live in one consumable place.
50
-
51
- For teams wiring visual plans into their review flow, the
52
- [Plan app documentation](https://www.agent-native.com/docs/template-plan)
53
- explains how the review surface is rendered and shared.
54
-
55
- The point is not just prettier planning. It is a better medium for human review:
56
- visual where visuals help, structured where structure helps, and grounded in the
57
- actual codebase.
58
-
59
- ## Modes
60
-
61
- `/visual-plan` can run in three modes:
62
-
63
- - **Hosted Plans, shareable links (recommended):** uses the free, open-source
64
- Agent-Native plans app at plan.agent-native.com for shareable links, comments,
65
- and the browser editor.
66
- - **Local files only:** writes a local MDX folder, starts a localhost bridge,
67
- and opens the hosted Plan UI against that local source. No sharing, all local,
68
- and no plan content is written to the hosted database. The skill must not
69
- create a hosted Plan first and export it back to local files.
70
- - **Self-hosted/custom URL:** connects the skill to your own Plan app or local
71
- development tunnel.
72
-
73
- Use hosted mode when you want comments and shareable links. Use local files mode
74
- when the plan itself should live in source control or stay on your machine. Use
75
- `plans/<slug>/` when you want to check the files in, or a temp/ignored folder
76
- when you do not. The bridge URL works on the machine running it and is not a
77
- share link.
78
-
79
- ## Install
80
-
81
- ```sh
82
- npx @agent-native/skills@latest add --skill visual-plan
83
- ```
84
-
85
- The interactive installer asks whether to use hosted Plans or local files. To
86
- force the no-sharing local path:
87
-
88
- ```sh
89
- npx @agent-native/skills@latest add --skill visual-plan --mode local-files
90
- ```
91
-
92
- The skill expects the [Plan MCP connector](https://www.agent-native.com/docs/template-plan)
93
- to be available when hosted mode is used.
@@ -1,544 +0,0 @@
1
- ---
2
- name: visual-plan
3
- description: Turn ordinary text plans into rich interactive visual plans with diagrams, file maps, annotated code, open questions, and UI/prototype review when useful.
4
- category: design-ui-ux
5
- source: BuilderIO/skills
6
- ---
7
-
8
- # Agent-Native Plans
9
-
10
- Agent-Native Plans is structured visual planning mode for coding agents. Build
11
- the plan you would normally write in Markdown, but as a scannable document with
12
- editable blocks mixed in: inline diagrams, code snippets,
13
- open questions, and an optional top visual review area (wireframe canvas, live
14
- prototype, or both in tabs). Architecture and backend plans stay document-only;
15
- UI and product plans start with the top canvas/prototype (the Visual Surface
16
- Choice section owns that rule).
17
-
18
- `/visual-plan` is the packaged command and main entry point. Choose the review
19
- mode from the task: UI-first when the work is primarily product UI and review
20
- should start with screens, prototype-first when review should start with a
21
- functional live prototype, design-first when review needs full-fidelity branded
22
- screens, or visual-intake when the user explicitly wants a questionnaire before
23
- planning. When a Codex, Claude Code, Markdown, or pasted plan already exists,
24
- `/visual-plan` uses that source plan as the starting point and builds the review
25
- surface from it instead of starting over.
26
-
27
- ## When To Use
28
-
29
- Create or adapt a visual plan whenever the plan would be better as a reviewable
30
- artifact than a chat paragraph. This includes modest work such as a single UI
31
- surface with states, a small workflow, a before/after product change, or a
32
- component/API/data-shape decision that needs alignment, plus larger multi-file,
33
- ambiguous, long-running, risky, or UI-heavy work. Use it when architecture /
34
- data flow / UI direction / options / open questions would benefit from inline
35
- diagrams or structured blocks, when the user needs to react to a direction
36
- before you implement, or when an existing text plan needs a richer review
37
- surface.
38
-
39
- ## Plan Discipline
40
-
41
- - **Gate thoughtfully.** A visual plan is a richer review surface, not only a
42
- tool for giant projects. Use it when the user needs to see, compare, comment
43
- on, or approve a direction before code, even for a modest UI/state/workflow
44
- change. Skip it for truly trivial, unambiguous work — typos, one-line fixes, a
45
- single well-specified function, anything whose diff you could describe in one
46
- sentence — and just make the change. Never pad a plan with filler and never
47
- ship a single-step plan.
48
- - **Research before you draft.** Read the real files, actions, schema, and
49
- patterns first; name actual files, symbols, and data shapes instead of
50
- inventing them. Check existing `actions/` before proposing endpoints and prefer
51
- named client helpers over raw fetch. Delegate wide exploration to a sub-agent.
52
- Lead with reuse: for each step, name what it reuses — existing actions, schema,
53
- components, helpers — before what it adds, so the plan explains the genuinely new
54
- delta instead of redescribing what already exists.
55
- - **Decide the hard-to-reverse bets first.** For non-trivial backend, data, or API
56
- work, sketch where the feature is headed, then call out the decisions that are
57
- expensive to undo once data or callers depend on them — wire format, public ids,
58
- data-model shape, auth and ownership boundaries — and get those right in the plan
59
- even if most of the feature ships later. Then scope to the smallest first cut that
60
- proves the approach without foreclosing it, stating both what is in and what is
61
- explicitly deferred.
62
- - **Keep examples at the right altitude.** When the user's idea is a broad
63
- framework, product, or operating-model change, do not collapse it into the
64
- first concrete example, provider, or sync path they mention. Separate the core
65
- abstraction from motivating examples and app/provider adapters. Use examples
66
- to make the plan legible, but label them as examples unless they are the whole
67
- requested scope.
68
- - **Publish standalone plans.** If the user pasted, referenced, or already has a
69
- Codex / Claude Code / Markdown plan, treat it as source material, but rewrite
70
- the published plan as a clean standalone proposal. Preserve the source plan's
71
- useful intent and codebase facts, label inferred visuals as inferred, and avoid
72
- revision language such as "preserve the prior plan", "do not drop the old
73
- idea", "unlike the previous version", or "this revision changes...". A reader
74
- who never saw the chat or earlier drafts should understand the plan.
75
- - **Make the first read concrete.** If the plan is meant to be shared with
76
- someone outside the chat, or if the concept is abstract, lead near the top with
77
- one concrete product example before mode tables, architecture, or roadmaps. For
78
- UI-capable concepts, that usually means a top-canvas app state that shows the
79
- real user workflow in product terms. Do not rely on phrases that only make
80
- sense in conversation, and do not frame the plan as "not the old idea"; state
81
- the positive model directly.
82
- - **Planning is read-only.** Make no source edits while building or reviewing the
83
- plan. Start editing only after the user approves the direction.
84
- - **Clarify vs. assume.** Do not ask how to build it — explore and present the
85
- approach and options in the plan. Ask a clarifying question only when an
86
- ambiguity would change the design and you cannot resolve it from the code; use
87
- the host agent's normal ask-user-question flow and batch 2-4 high-leverage
88
- questions before finalizing. Do not call `create-visual-questions` for
89
- ordinary clarification or preflight; reserve it for the visual-intake mode when
90
- the user explicitly asks for a visual intake questionnaire. Otherwise state the
91
- assumption explicitly and proceed, and keep anything unresolved in the plan's
92
- single bottom `question-form` Open Questions block. For complex plans, do a
93
- final open-question pass before handoff: if a decision would affect
94
- architecture, scope, UX, data shape, or rollout, either decide it in the plan
95
- with rationale or put it in that bottom form with a recommended default.
96
- - **The plan is the approval gate.** After surfacing it, ask the user to review
97
- and approve before you write code, and name which files/areas the work touches.
98
- Presenting the plan and requesting sign-off is the approval step — do not ask a
99
- separate "does this look good?" question.
100
- - **The document is the source of truth, not the chat.** When scope shifts,
101
- update the plan with `update-visual-plan` rather than only changing course in
102
- chat, and make the updated document stand alone. Do not describe the update as
103
- a correction to an earlier draft inside the plan itself. Re-read the approved
104
- plan before major steps.
105
-
106
- ## Create A Structured Agent-Native Plan — Never Inline
107
-
108
- The deliverable is ALWAYS a structured Agent-Native Plan, not a chat-only plan.
109
- The hosted Plan MCP connector (`plan` server, or legacy `agent-native-plans`) is
110
- the default collaboration and commenting surface; it is not a reason to reject
111
- the planning pattern as an external dependency or rented layer. Plans are
112
- portable source artifacts (`plan.mdx`, optional `canvas.mdx` /
113
- `prototype.mdx`, JSON, and HTML export), and ownership-sensitive workflows can
114
- use local-files mode or a self-hosted/custom Plan app URL without abandoning the
115
- skill's review discipline. Do not advise the user to skip `/visual-plan` because
116
- the default surface is hosted; choose the right Plan mode for the user's
117
- ownership, privacy, sharing, and branding needs.
118
-
119
- By default, create the plan via the Plan MCP connector and NEVER hand it over as
120
- inline chat content — no Markdown prose, ASCII sketch, table, or fenced
121
- wireframe. If the `plan` (or legacy `agent-native-plans`) tools are not visible,
122
- discover them through the host's `tool_search` first; if they are still missing,
123
- STOP and give the user the client-specific reconnect step rather than improvising
124
- an inline plan. Before publishing, or whenever a connector or auth error appears,
125
- READ `references/connection.md` in this skill directory — it is the single source
126
- of truth for the never-inline rule, connector discovery, and the per-client
127
- reconnect steps. Local-files privacy mode (after Tool Guidance) is the exception.
128
-
129
- ## Core Workflow
130
-
131
- This section describes the default hosted Plan MCP workflow. If
132
- `AGENT_NATIVE_PLANS_MODE=local-files` is set, or the user asks for fully local
133
- files/no hosted Plan writes, use **Local-Files Privacy Mode** instead; carry
134
- forward only the code-research and plan-composition guidance here.
135
-
136
- 1. Follow the host agent's normal planning flow: inspect the codebase, delegate
137
- wide exploration when useful, gather the info needed, and ask native
138
- clarifying questions as needed before generating the plan. If a source plan
139
- already exists, gather its exact text from the user's paste, a referenced
140
- file, or recent visible agent context; do not invent source text.
141
- 2. Call `get-plan-blocks` for the authoritative block catalog — do not author
142
- from memorized tags. Then call the mode-matched create tool:
143
- `create-visual-plan` for document-first plans (architecture, backend, data,
144
- refactor, API), `create-ui-plan` for UI-first plans, `create-prototype-plan`
145
- for prototype-first plans, `create-plan-design` for design-first plans,
146
- `create-visual-questions` only when the user explicitly asks for a visual
147
- intake questionnaire. When a source plan already exists,
148
- pass it as `planText` and preserve the original plan's useful intent while
149
- producing a standalone plan document, not a revision memo.
150
- 3. For UI/product plans, compose the top canvas first with the primary
151
- wireframes and annotated states, then write the document with native blocks
152
- (see `references/canvas.md` and `references/document-quality.md`). For
153
- broad product architecture plans with a user-facing implication, add a
154
- concrete "what this looks like in the app" visual before the abstract
155
- architecture or mode tables. Keep the document close to the standalone
156
- Markdown plan the agent would normally output. If an existing plan was
157
- provided, carry forward the right facts and decisions without referring to
158
- the previous draft or explaining how this version differs. For non-visual
159
- plans, skip the top visual surface (Visual Surface Choice below owns the rule)
160
- and put `diagram`, `data-model`,
161
- `api-endpoint`, `diff`, `file-tree`, `code`, and `annotated-code` blocks
162
- directly next to the relevant prose.
163
- Wide document layout is renderer-owned and intentionally allowlisted: only
164
- literal code-review surfaces (`diff`, `annotated-code`) and `tabs` blocks
165
- with vertical orientation or diff-like children break out wider than prose.
166
- Keep `api-endpoint`, `openapi-spec`, `data-model`, `json-explorer`,
167
- `wireframe`, question, and `custom-html` blocks in normal document flow unless
168
- their own renderer says otherwise.
169
- 4. Surface the returned Plans link or inline MCP App and ask the user to review.
170
- Always include the actual URL in chat so the next step is a click in CLI or
171
- other text-only hosts. When the host exposes an embedded browser/preview panel
172
- and a tool can open arbitrary URLs there, open the returned plan URL
173
- automatically for convenient review — a convenience and smoke test, never the
174
- only handoff or the access
175
- model. Plans should load out of the box for the local agent and local browser
176
- session; if a signed-in embedded browser cannot read a local plan that an
177
- anonymous/tool check can read, fix the app/action ownership or access path
178
- rather than patching one plan by hand. For high-stakes plans (architecture,
179
- backend, data, multi-file, or risky), also kick off the self-review pass in
180
- **Self-Review Before Handoff** while the user reads, instead of blocking the
181
- handoff on it.
182
- 5. For hosted plans, call `get-plan-feedback` before editing, after review,
183
- after any long pause,
184
- and before the final response. Treat `anchorDetails`, resolver intent, recent
185
- review events, and any focused screenshots from browser handoff as the source
186
- of truth for exactly what changed and exactly what each comment points at.
187
- 6. For hosted plans, apply changes with `update-visual-plan`, preferring
188
- targeted `contentPatches`.
189
- Treat the top-level `content` payload as a full replacement, not a merge; do
190
- not send a partial `content` object to add a canvas or one block. If a full
191
- replacement or `replace-blocks` is unavoidable, call `get-visual-plan`
192
- immediately before the write, pass its `plan.updatedAt` as
193
- `expectedUpdatedAt`, and carry forward every existing block and visual
194
- surface. Never reuse a revision from an earlier read or feedback payload.
195
- For source-control friendly edits, use granular `patch-visual-plan-source`
196
- operations against the MDX files instead of regenerating the plan;
197
- `replace-file` is also destructive and requires the same fresh
198
- `expectedUpdatedAt` fence.
199
- 7. After every hosted-plan write, call `get-visual-plan` again and compare the
200
- persisted text, block IDs/counts, canvas frames, and prototype with the
201
- intended result. A successful mutation response is not proof that unrelated
202
- content survived. If the edit addressed agent-targeted feedback, only after
203
- this verification call `resolve-plan-comment` for the thread and
204
- `consume-plan-feedback` for its comments; do both so addressed feedback is
205
- neither visibly open nor returned as pending work.
206
- 8. For hosted plans, export with `export-visual-plan` only when the user wants a
207
- shareable receipt or repo-check-in artifacts.
208
-
209
- ## Self-Review Before Handoff
210
-
211
- This adversarial self-review pass is opt-in, not default: run it only for
212
- high-stakes plans — irreversible migrations, security-sensitive work, or when
213
- the user explicitly asks for extra rigor — and skip it otherwise. It roughly
214
- doubles the cost of plan generation, so the default for small, UI-only,
215
- single-decision, or ordinary plans is to skip it, not to run it. Keep the pass
216
- cheap and non-blocking when it does run:
217
-
218
- - **Surface the plan first, review concurrently.** Post the link and let the user
219
- start reading, then run the review in parallel — never make the user wait on it.
220
- - **Review the written plan; do not re-research.** Critique the plan text and its
221
- own blocks. The grounding was already done while drafting, so the review checks
222
- the output instead of re-exploring the repo.
223
- - **Spawn one skeptical reviewer** whose only job is to find what is weak, missing,
224
- or wrong — not to praise. Point it at: hard-to-reverse decisions made implicitly
225
- or not at all (wire format, public ids, data-model shape, auth, ownership); steps
226
- not anchored in real files or symbols; a menu of options where the plan should
227
- commit to one; obvious missing decisions ("what happens when X?", "why not Y?");
228
- and padding or single-step filler.
229
- - **Fix vs. ask.** Apply clear-cut fixes yourself with `update-visual-plan`
230
- `contentPatches` — vague non-goals, unanchored claims, an obvious missing
231
- decision. Route genuine judgment calls back to the user instead: add them to the
232
- bottom `question-form` Open Questions block or batch them into the normal
233
- ask-user-question flow. Do not silently decide them.
234
- - **Do not surprise the user mid-read.** On a large plan, apply the patches before
235
- the editor loads; otherwise note briefly that a self-review is running so the
236
- plan changing under them is expected. When you next respond, summarize what the
237
- review changed and what it surfaced for the user to decide.
238
-
239
- ## Visual Surface Choice
240
-
241
- Choose the surface before creating the plan or after reading the source plan. Do
242
- not add visual chrome by default:
243
-
244
- For UI/product plans, the top canvas is usually the primary review surface. Put
245
- the first meaningful wireframes there, not buried as document-body blocks. Use
246
- multiple canvas artboards when states matter, such as the default view, an
247
- overflow menu or popover, a side panel, loading, or error. Put short annotations
248
- beside frames with `targetId` plus `placement`; keep implementation details,
249
- tradeoffs, file maps, data contracts, risks, and verification in the document
250
- body below the canvas.
251
-
252
- When the user asks for a flow, storyboard, journey, wireframe, canvas, or "what
253
- this looks like", treat that as a canvas-first request. Make one artboard per
254
- user-visible state, connect only adjacent transitions, and use short canvas
255
- annotations for the product notes. Do not substitute a document-body `diagram`
256
- block for the requested storyboard just because HTML diagrams are faster to
257
- write; diagrams belong below the canvas for backend mechanics, architecture, or
258
- data-flow explanation.
259
-
260
- Keep product wireframes and explanatory/meta diagrams separate. Start with pure
261
- screens that look like the app state under discussion, without callout prose or
262
- architecture notes embedded inside the UI. Put arrows, labels, contracts, data
263
- flow, and mode explanations in separate annotations, separate canvas diagrams,
264
- or the document body.
265
-
266
- When the plan touches an existing app, inspect the current shell/components
267
- before drawing. The first artboard should look like the real app at the same
268
- density: existing sidebars, toolbar placement, overflow menus, app chrome, and
269
- framework agent chrome stay in their real places. Model secondary surfaces as
270
- separate states, such as a top-right overflow popover, sheet, panel, loading
271
- state, or separate AgentSidebar, rather than inventing a permanent inspector or
272
- folding framework chrome into the product UI.
273
-
274
- - **No visual surface** for architecture-only, backend-only, data migration,
275
- copy-only, or otherwise non-visual plans. Do not use the top canvas for
276
- architecture diagrams, dependency maps, file plans, API contracts, or
277
- data-flow-only reviews. Use a strong document with local inline diagrams
278
- only when relationships need a visual explanation, usually one spatial diagram
279
- per recommendation or decision. Prefer grouped regions, layers, quadrants,
280
- matrices, or before/after panels over a single-axis chain unless the
281
- relationship is truly sequential.
282
- - **Canvas only** for one static screen, a before/after comparison, a component
283
- state, a small popover, or a visual direction that does not require clicking.
284
- Put those wireframes in `content.canvas` and omit `content.prototype`.
285
- - **Canvas + prototype** for multi-step UI flows, onboarding, wizards,
286
- review/approval flows, navigation changes, or anything where the reviewer
287
- needs to operate the behavior. Keep the static wireframes in
288
- `content.canvas`, add the aligned functional prototype in
289
- `content.prototype`, and rely on the top visual tabs to switch between them.
290
- When both surfaces are present, open the Wireframes tab by default; the
291
- prototype remains available as the interactive follow-up view.
292
- - **Default to wireframes.** A clean, minimal UI, a high UX bar, or references
293
- to Linear/Vercel describe the content and density bar; they do not request
294
- full-fidelity design mode. Use renderer-owned wireframes unless the user
295
- explicitly asks for branded, pixel-accurate, production-like, or full visual
296
- design. This keeps every canvas screen inspectable and its full content visible.
297
- - **Prototype-first** when the user asks to operate the UI or when interaction is
298
- the main question. Use `create-prototype-plan`, which still preserves static
299
- mocks where useful.
300
-
301
- For mixed canvas + prototype plans, reuse labels and IDs; patch surfaces
302
- together unless explicitly single-surface. For output audits, read the
303
- observability skill: support single-app and workspace tables, preserve app
304
- previews, and keep audit, synthesis, diffs, and applying changes admin-gated.
305
-
306
- Treat “higher fidelity,” “pixel-accurate,” “polished mockup,” “production-like,”
307
- “real design,” and “not a sketch/wireframe” as design-first language even when
308
- the request also says “mockup.” For a new plan, use `create-plan-design`. For
309
- an existing plan, keep the same plan id and call `update-visual-plan` with a
310
- `set-visual-render-mode` patch using `renderMode: "design"` plus the upgraded
311
- screen HTML/CSS in the same update. Ground the result in the real app shell,
312
- tokens, typography, spacing, and states, and add stable `data-design-id`
313
- targets. Put scoped styles in each screen's `css` field, never in a `<style>`
314
- tag. The viewer-local Clean toggle only changes one browser's wireframe
315
- preference; it is not a fidelity upgrade. Do not create a duplicate plan to
316
- handle a fidelity follow-up.
317
-
318
- ## Wireframe quality — read `references/wireframe.md`
319
-
320
- UI recap/plan wireframes must meet a strict quality bar — full-width chrome,
321
- pinned bottom bars, real product content, before/after comparability, the right
322
- `surface` preset, `--wf-*` tokens instead of hex, and no `<html>`/`<style>`/font
323
- tags. Before authoring ANY wireframe / `<Screen>` / `WireframeBlock`, READ
324
- `references/wireframe.md` in this skill directory — it is the single source of
325
- truth for HTML wireframe quality, shared word for word with `/visual-plan`
326
- and `/visual-recap`. Do not author wireframes from memory.
327
-
328
- ## Canvas — read `references/canvas.md`
329
-
330
- The canvas is the single source of truth for static UI mockups: the `surface`
331
- locks each artboard's footprint, mixed surfaces lay out
332
- in lanes, annotations are plain-text designer notes anchored by
333
- `targetId`/`placement`, and edits are surgical `contentPatches`. Before
334
- authoring or editing ANY canvas, artboard, or annotation, READ
335
- `references/canvas.md` in this skill directory — it is the single source of truth
336
- for canvas/artboard mechanics. Do not author canvas layouts from memory.
337
- Canvas artboards use the same HTML wireframe path as document-body
338
- `WireframeBlock` screens: author `<Screen surface="..." html={...} />` with a
339
- semantic HTML fragment. Do not author fresh kit-tree children such as
340
- `<FrameScreen>`, `<Card>`, `<Row>`, or `<Btn>` inside canvas `<Screen>` tags;
341
- those are legacy compatibility markup for old plans and produce brittle canvas
342
- layouts.
343
-
344
- ## Document quality — read `references/document-quality.md`
345
-
346
- The document is a serious technical plan, not marketing: outcome-first,
347
- prose-first, self-contained, built from the right native blocks, with open
348
- questions in a single bottom `question-form` and a pre-handoff visual check.
349
- Before authoring the plan document, READ `references/document-quality.md` in this
350
- skill directory — it is the single source of truth for the document quality bar.
351
- Do not write the document from memory.
352
-
353
- ## Good vs. bad exemplar — read `references/exemplar.md`
354
-
355
- For a worked example of the bar — a great UI-first plan and `/visual-plan`, plus
356
- the anti-patterns to avoid — READ `references/exemplar.md` in this skill
357
- directory before authoring a plan.
358
-
359
- ## Authoring invariants
360
-
361
- Treat these as data-integrity checks, not optional polish:
362
-
363
- - `content` is a complete replacement. Pass either `content` or the mode's
364
- convenience arrays (`screens`/`transitions` or `states`/`components`),
365
- never both. The create actions reject mixed sources so a second payload cannot
366
- silently discard CSS, frames, or document blocks.
367
- - A design screen's scoped `css` is part of the artifact. Keep it on both the
368
- prototype screen and its matching canvas frame, and use renderer-owned
369
- `--wf-*` tokens for portable color and typography.
370
- - Rich-text `data.markdown` must contain actual runtime line breaks. Do not
371
- hand a plan a one-line Markdown value containing literal `\n` escape text,
372
- which renders the whole section as one heading. Escaped newlines are fine in
373
- code examples when the surrounding Markdown still has real line breaks.
374
- - Canvas artboards do not scroll. Keep wireframe HTML in natural flow and set a
375
- larger frame `height` when a screen exceeds the surface preset; preserve the
376
- surface width and inspect the bottom edge at default zoom before handoff.
377
- - After every hosted write, re-read the structured content and inspect the live
378
- Plan surface. A valid JSON payload is not proof that CSS loaded or Markdown
379
- rendered into the intended heading, paragraph, and list structure.
380
-
381
- ## Tool Guidance
382
-
383
- - `create-visual-plan`: start one structured visual plan per agent task/run, or
384
- import an existing text plan by passing `planText`; `content` may include no
385
- visual surface, canvas only, or canvas + prototype.
386
- - `create-ui-plan`: start a UI-first plan when the work is primarily product UI.
387
- - `create-prototype-plan`: start a prototype-first plan with a functional top
388
- review surface. If the interaction itself must also be high fidelity, set each
389
- screen's `renderMode` to `design` and pass scoped styles through `css`;
390
- otherwise use `create-plan-design` for design-first review.
391
- - `create-plan-design`: start a full-fidelity branded Design-tab plan with an
392
- optional matching Prototype tab.
393
- - `convert-visual-plan-to-prototype`: convert an existing HTML wireframe canvas
394
- into a prototype plan.
395
- - `create-visual-questions`: use only when the user explicitly asks for a visual
396
- intake questionnaire, not as `/visual-plan` preflight.
397
- - `update-visual-plan`: revise content, status, or comments with targeted
398
- `contentPatches` (see Core Workflow steps 6-7). Use
399
- `set-visual-render-mode` with `renderMode: "design"` when promoting an
400
- existing plan to high fidelity, together with deliberate screen HTML/CSS;
401
- render mode alone only removes sketch treatment. `replace-blocks` and full
402
- `content` replacement require `expectedUpdatedAt` from a fresh
403
- `get-visual-plan` call.
404
- - `read-visual-plan-source`: read the normalized plan as `plan.mdx`,
405
- optional `canvas.mdx`, optional `.plan-state.json`, and JSON.
406
- - `patch-visual-plan-source`: apply granular MDX AST patches by stable block,
407
- artboard, annotation, component, or wireframe-node id. Prefer those targeted
408
- operations; `replace-file` requires `expectedUpdatedAt` from a fresh
409
- `get-visual-plan` call.
410
- - `import-visual-plan-source`: create or replace a plan from an MDX folder.
411
- - `get-visual-plan`: read the current structured plan, exported HTML,
412
- annotations, and `plan.updatedAt`; it also returns the MDX folder for source
413
- workflows. Re-read immediately before a destructive write for its concurrency
414
- fence and again after every write to verify persisted state.
415
- - `get-plan-feedback`: read unconsumed human feedback. Use it frequently; it
416
- returns grouped threads, exact anchor details, expected resolver, and recent
417
- review-event payloads so agents can act only on the comments meant for them.
418
- - `get-plan-blocks`: resolve block tags before authoring — do not memorize tags;
419
- call this first to get the authoritative tag names, required fields, and prop
420
- shapes from the live block registry.
421
- - `export-visual-plan`: export HTML, Markdown fallback, structured JSON, and MDX
422
- files for repo check-in.
423
-
424
- When the user critiques a plan's look or structure, fix the renderer or this
425
- skill — never hand-edit one stored plan. Turn feedback into better guidance.
426
-
427
- ## Local-Files Privacy Mode — read `references/local-files.md`
428
-
429
- When the user wants no hosted Plan database writes — no DB writes, no Plan MCP
430
- publish, fully local/offline/private planning, repo-owned source-controlled
431
- artifacts, or `AGENT_NATIVE_PLANS_MODE=local-files` — do not call any hosted Plan
432
- tool except the schema-only `get-plan-blocks` catalog lookup. Author a local MDX
433
- folder and
434
- preview it with `plan local check` / `plan local serve` / `plan local verify`.
435
- Before using local-files mode, READ `references/local-files.md` in this skill
436
- directory — it is the single source of truth for the full contract (catalog
437
- lookup, MDX folder layout, the local bridge commands, and the hosted tools you
438
- must not call). Carry forward only the code-research and plan-composition
439
- guidance from Core Workflow; everything hosted is replaced by the local bridge.
440
-
441
- ## Interpreting comment anchors
442
-
443
- This section applies to hosted plans with `get-plan-feedback` /
444
- `update-visual-plan`. In local-files mode, do not call hosted feedback or update
445
- tools; interpret file/chat feedback directly, edit the MDX files, rerun the
446
- local bridge check/serve/verify command, and report the new local URL.
447
-
448
- `get-plan-feedback` returns rich anchors — read them before acting on any comment.
449
-
450
- - **Coordinate frames.** `targetX`/`targetY` are percentages *within* the
451
- element named by `targetSelector`/`targetKind`. Bare `x`/`y` are percentages
452
- of the whole plan document. `canvasX`/`canvasY` are raw board-world pixels on
453
- the design canvas (board size given when available).
454
- - **Wireframe pins.** Anchors on wireframes include `targetNodeId` and
455
- `targetNodePath` (e.g. `card > list > listItem "Acme Inc"`) identifying the
456
- exact kit node. Use `targetNodeId` directly with wireframe node patch ops;
457
- use `data-design-id` values from design artboards with
458
- `update-design-element-style`. Prefer the node id/path over raw coordinates;
459
- fall back to coordinates plus the focused screenshot (red ring marks the exact
460
- point) only when no node id is present.
461
- - **Text quotes.** Resolve `textQuote` against current prose using
462
- `contextBefore`/`contextAfter` for disambiguation. If `ambiguous: true`, ask
463
- the user — do not guess which occurrence is meant.
464
- - **Detached comments.** `get-plan-feedback` flags threads whose quoted text no
465
- longer exists as `detached` (in `detachedThreads`). Reconcile these against
466
- rewritten content — never silently drop them.
467
- - **Routing.** `resolutionTarget` is the only routing signal: act on `agent`,
468
- treat `human` as context only. `@mentions` are people to notify, never a
469
- routing signal.
470
- - **Two-axis state.** Mark every ingested comment as consumed
471
- (`consumedCommentIds` on `update-visual-plan`). Set `status=resolved` only on
472
- agent-targeted comments you actually addressed; leave human-targeted comments
473
- open. When an edit addresses feedback, first re-read the persisted plan and
474
- verify the requested change. Only then call `resolve-plan-comment` for the
475
- addressed thread and `consume-plan-feedback` for its comments; never mark
476
- addressed feedback along only one axis.
477
-
478
- ## Visibility & Sharing
479
-
480
- Use `set-resource-visibility` to change who can see a plan (e.g. public, login,
481
- or org-scoped). Use `share-resource` to grant specific users or roles access
482
- by email or role. Gate visibility before sharing any plan that covers
483
- unreleased or private work — default to the narrowest scope that meets the
484
- review need.
485
-
486
- ## Setup & Authentication
487
-
488
- There are two ways into Plans.
489
-
490
- **Coding agent (CLI).** Install once with the Agent-Native CLI. The command
491
- installs the Plans skills, registers the hosted Plans MCP connector, and runs
492
- auth/setup for the selected local client(s) in the same step (a one-time browser
493
- sign-in at setup — this is intended), so the first tool call in that client does
494
- not hit an OAuth wall:
495
-
496
- ```bash
497
- npx @agent-native/core@latest skills add visual-plans
498
- ```
499
-
500
- After that, `/visual-plan`, `/visual-recap`, and Builder's visualize-repo (not part of AOS) are the
501
- installed slash commands. If you only need one command, use
502
- `skills add visual-plan`, `skills add visual-recap`, or
503
- `skills add visualize-repo` instead. The other planning modes
504
- (`create-ui-plan`, `create-prototype-plan`, `create-plan-design`,
505
- `create-visual-questions`) are MCP tools reachable from `/visual-plan`, not
506
- separate slash commands. Pass `--no-connect` to register the connector without
507
- authenticating, then run
508
- `npx @agent-native/core@latest connect https://plan.agent-native.com --client all`
509
- whenever you are ready, or choose a narrower `--client`. Auth and MCP tool
510
- loading are per client config/session.
511
-
512
- **Browser (people you share with).** Open the Plans editor and create & edit
513
- with no sign-up — you work as a guest. Sign in only when you want to save or
514
- share; signing in claims the plans you made as a guest into your account.
515
-
516
- Sharing and commenting require an account: public/shared plans are viewable by
517
- anyone with the link, but commenting on them needs an agent-native account.
518
-
519
- For fully offline, no-account use, run the Plans app locally and sync plans to
520
- your repo as MDX. This local mode is a separate advanced path, not the default
521
- hosted flow.
522
-
523
- For repo-wide visual docs, run
524
- `npx @agent-native/core@latest visualize-repo --open` to create/update
525
- `agent-native.json`, seed `.agent-native/visual-docs/repo-overview`, and open
526
- the local bridge.
527
-
528
- If a Plans tool returns `needs auth`, `Unauthorized`, or `Session terminated`, do
529
- not keep retrying it — stop and give the user the per-client reconnect step from
530
- `references/connection.md`, then continue once the connector is available.
531
-
532
- Hosted default: connect `https://plan.agent-native.com/mcp`. Do
533
- not put shared secrets in skill files.
534
-
535
- ## AOS notes
536
-
537
- This skill is optional and drives the Agent-Native Plan service through an MCP
538
- connector named `plan` that AOS does NOT register or install — you connect it
539
- yourself. It may point at a self-hosted or local Plan app URL. Do not run any
540
- `npx @agent-native/...@latest` command from this skill unless you explicitly
541
- approved the network access in this conversation. Hosted publishing, posting to
542
- GitHub, merging, and any other external write need your literal GO (AOS go-gate).
543
- When the optional local BDB Plan Builder is installed, it can serve the same tool
544
- names locally (planned, not yet built; say so).