@hybridlabor-api/aos 4.13.2 → 4.14.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 (150) hide show
  1. package/.agents/AGENTS.md +8 -0
  2. package/.agents/nodes.json +5 -2
  3. package/.claude/hooks/conventional-commits.mjs +14 -15
  4. package/.claude/hooks/env-file-protection.mjs +14 -15
  5. package/.claude/hooks/go-gate.mjs +152 -10
  6. package/.claude/hooks/go-token.mjs +55 -0
  7. package/.claude/hooks/memb-inject.mjs +75 -62
  8. package/.claude/hooks/trail-autostart.mjs +27 -0
  9. package/.claude/settings.json +18 -0
  10. package/.claude/workflows/startcycle-dispatch.mjs +11 -4
  11. package/.opencode/plugins/bdb-aos.js +98 -121
  12. package/.opencode/plugins/lib/trail-autostart.js +38 -0
  13. package/CLAUDE.md +1 -1
  14. package/README.de.md +6 -6
  15. package/README.md +6 -6
  16. package/README.pt.md +6 -6
  17. package/THIRD_PARTY_NOTICES.md +19 -3
  18. package/assets/header-v5.png +0 -0
  19. package/bin/aos-acp.mjs +211 -0
  20. package/bin/aos-doctor.mjs +1 -1
  21. package/bin/aos-uninstall.mjs +2 -2
  22. package/docs/master-session-acp.md +51 -0
  23. package/installer.js +252 -35
  24. package/mcps/mcsc/packages/mcp/server.js +6 -7
  25. package/package.json +4 -3
  26. package/scripts/validate-skills.mjs +76 -0
  27. package/skills/basic/bdbmediastorm/SKILL.md +1 -1
  28. package/skills/basic/godmode-shipping/SKILL.md +3 -0
  29. package/skills/basic/master-session/SKILL.md +89 -0
  30. package/skills/basic/startcycle/SKILL.md +1 -1
  31. package/skills/basic/startcycle-graph/SKILL.md +2 -2
  32. package/skills/basic/startcycle-graph-user/SKILL.md +1 -1
  33. package/skills/basic/teamwork-preview/SKILL.md +1 -1
  34. package/skills/bdbrainstorm/SKILL.md +7 -1
  35. package/skills/global_config/agentic-harness-patterns/SKILL.md +257 -0
  36. package/skills/global_config/agentic-harness-patterns/metadata.json +10 -0
  37. package/skills/global_config/agentic-harness-patterns/references/agent-orchestration-pattern.md +97 -0
  38. package/skills/global_config/agentic-harness-patterns/references/bootstrap-sequence-pattern.md +106 -0
  39. package/skills/global_config/agentic-harness-patterns/references/context-engineering/compress-pattern.md +78 -0
  40. package/skills/global_config/agentic-harness-patterns/references/context-engineering/isolate-pattern.md +82 -0
  41. package/skills/global_config/agentic-harness-patterns/references/context-engineering/select-pattern.md +86 -0
  42. package/skills/global_config/agentic-harness-patterns/references/context-engineering-pattern.md +29 -0
  43. package/skills/global_config/agentic-harness-patterns/references/hook-lifecycle-pattern.md +111 -0
  44. package/skills/global_config/agentic-harness-patterns/references/memory-persistence-pattern.md +109 -0
  45. package/skills/global_config/agentic-harness-patterns/references/permission-gate-pattern.md +111 -0
  46. package/skills/global_config/agentic-harness-patterns/references/skill-runtime-pattern.md +104 -0
  47. package/skills/global_config/agentic-harness-patterns/references/task-decomposition-pattern.md +92 -0
  48. package/skills/global_config/agentic-harness-patterns/references/tool-registry-pattern.md +101 -0
  49. package/skills/global_config/agenttrail/SKILL.md +8 -0
  50. package/skills/global_config/agenttrail/bin/agenttrail.mjs +14 -0
  51. package/skills/global_config/agenttrail/bin/ensure.mjs +118 -0
  52. package/skills/global_config/aos-setup/scripts/aos-doctor.mjs +1 -1
  53. package/skills/global_config/bdb-visual-edit/SKILL.md +51 -0
  54. package/skills/global_config/bdb-visual-edit/references/vite-react-source-attr.md +59 -0
  55. package/skills/global_config/bdb-visual-edit/scripts/pick-snippet.js +27 -0
  56. package/skills/global_config/bdb-visual-edit/scripts/sanitize-element.mjs +123 -0
  57. package/skills/global_config/factory-collect/SKILL.md +74 -0
  58. package/skills/global_config/factory-human-digest/SKILL.md +92 -0
  59. package/skills/global_config/factory-lookback/SKILL.md +95 -0
  60. package/skills/global_config/factory-review-prs/SKILL.md +63 -0
  61. package/skills/global_config/git-pr-review/SKILL.md +3 -0
  62. package/skills/global_config/grilling/SKILL.md +2 -0
  63. package/skills/global_config/mcsc/SKILL.md +1 -1
  64. package/skills/global_config/plan-arbiter/SKILL.md +125 -0
  65. package/skills/global_config/plan-canvas/SKILL.md +62 -5
  66. package/skills/global_config/plan-canvas/scripts/lib/loopback-guard.js +19 -3
  67. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/README.md +285 -0
  68. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/agent-trail.js +129 -0
  69. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/board-client.js +124 -0
  70. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/demo-plan/canvas.mdx +19 -0
  71. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/demo-plan/plan.mdx +18 -0
  72. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/recap-demo/plan.mdx +72 -0
  73. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/README.md +29 -0
  74. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/architecture.json +30 -0
  75. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/builder/00_architecture.html +14950 -0
  76. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/builder/canvas.mdx +511 -0
  77. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/builder/plan.mdx +208 -0
  78. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/recap/plan.mdx +102 -0
  79. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/showcase/standard/plan.md +136 -0
  80. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/signup-storyboard/canvas.mdx +124 -0
  81. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/examples/signup-storyboard/plan.mdx +37 -0
  82. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/index.js +188 -0
  83. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/kit.js +123 -0
  84. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/mdx.js +411 -0
  85. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/render.js +1291 -0
  86. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/architecture/meta.json +1 -0
  87. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/architecture/plan.mdx +195 -0
  88. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/architecture/standard.md +95 -0
  89. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/bugfix/meta.json +1 -0
  90. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/bugfix/plan.mdx +105 -0
  91. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/bugfix/standard.md +76 -0
  92. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/feature/canvas.mdx +81 -0
  93. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/feature/meta.json +1 -0
  94. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/feature/plan.mdx +145 -0
  95. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/feature/standard.md +76 -0
  96. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/migration/meta.json +1 -0
  97. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/migration/plan.mdx +172 -0
  98. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/migration/standard.md +100 -0
  99. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap/meta.json +1 -0
  100. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap/plan.mdx +67 -0
  101. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap/standard.md +49 -0
  102. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-board/canvas.mdx +63 -0
  103. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-board/meta.json +1 -0
  104. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-board/plan.mdx +49 -0
  105. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-board/standard.md +39 -0
  106. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-review/meta.json +1 -0
  107. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-review/plan.mdx +118 -0
  108. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/recap-review/standard.md +57 -0
  109. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/release/meta.json +1 -0
  110. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/release/plan.mdx +173 -0
  111. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/release/standard.md +96 -0
  112. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/research/meta.json +1 -0
  113. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/research/plan.mdx +91 -0
  114. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/research/standard.md +54 -0
  115. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/show-control/canvas.mdx +53 -0
  116. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/show-control/meta.json +1 -0
  117. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/show-control/plan.mdx +225 -0
  118. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/templates/show-control/standard.md +111 -0
  119. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/theme.css +472 -0
  120. package/skills/global_config/plan-canvas/scripts/lib/plan-builder/trail.js +216 -0
  121. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/markdown.js +1 -1
  122. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/server.js +37 -4
  123. package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +125 -29
  124. package/skills/global_config/plan-canvas/scripts/plan-canvas.js +196 -8
  125. package/skills/global_config/pr-recap/SKILL.md +47 -0
  126. package/skills/global_config/pr-recap/scripts/pr-recap.mjs +200 -0
  127. package/skills/global_config/quick-recap/SKILL.md +55 -0
  128. package/skills/global_config/stay-within-limits/SKILL.md +85 -0
  129. package/skills/global_config/triage/SKILL.md +3 -0
  130. package/skills/global_config/visual-edit/README.md +96 -0
  131. package/skills/global_config/visual-edit/SKILL.md +615 -0
  132. package/skills/global_config/visual-plan/README.md +93 -0
  133. package/skills/global_config/visual-plan/SKILL.md +544 -0
  134. package/skills/global_config/visual-plan/references/canvas.md +139 -0
  135. package/skills/global_config/visual-plan/references/connection.md +51 -0
  136. package/skills/global_config/visual-plan/references/document-quality.md +186 -0
  137. package/skills/global_config/visual-plan/references/exemplar.md +62 -0
  138. package/skills/global_config/visual-plan/references/local-files.md +99 -0
  139. package/skills/global_config/visual-plan/references/wireframe.md +319 -0
  140. package/skills/global_config/visual-recap/README.md +103 -0
  141. package/skills/global_config/visual-recap/SKILL.md +560 -0
  142. package/skills/global_config/visual-recap/references/connection.md +51 -0
  143. package/skills/global_config/visual-recap/references/local-files.md +99 -0
  144. package/skills/global_config/visual-recap/references/wireframe.md +319 -0
  145. package/skills/playbooks/pb-ci-fix/SKILL.md +49 -0
  146. package/skills/playbooks/pb-event-tracker/SKILL.md +45 -0
  147. package/skills/playbooks/pb-meeting-actions/SKILL.md +42 -0
  148. package/skills/playbooks/pb-project-new/SKILL.md +48 -0
  149. package/skills/playbooks/pb-week-plan/SKILL.md +45 -0
  150. package/assets/header-v4.jpg +0 -0
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: factory-lookback
3
+ description: >-
4
+ Experimental workflow for auditing recurring feedback, telemetry, errors,
5
+ and brittle delivery paths to find systemic fixes. Use for periodic or
6
+ requested cross-source lookbacks, not routine single-item intake.
7
+ category: engineering-method
8
+ source: BuilderIO/skills
9
+ ---
10
+
11
+ # Factory Lookback
12
+
13
+ Read `.agent-factory/config.yaml` and apply the optional
14
+ `skill_prompts.factory-lookback` entry as additional project guidance. Use this
15
+ workflow when asked to look back across a bounded period or when an enabled
16
+ `workflows.lookback` automation runs. Its purpose is to find patterns that
17
+ normal item-by-item flows keep missing or fixing only temporarily.
18
+
19
+ ## Build a bounded evidence set
20
+
21
+ 1. Confirm the configured sources, scope, time window, comparison period, and
22
+ output policy before querying. Use only connected sources the host can read.
23
+ 2. Enumerate the full configured range, follow every page or cursor, and record
24
+ source filters, dates, counts, and unavailable or truncated sources. Do not
25
+ report a complete lookback when coverage is partial.
26
+ 3. Include relevant feedback, analytics or telemetry, runtime errors,
27
+ recurring CI or review failures, repeated recovery attempts, replies to
28
+ earlier information requests, and prior fixes marked shipped or verified
29
+ when those records are available.
30
+ 4. Cluster records by underlying symptom and affected boundary, not wording
31
+ alone. Keep event counts, affected users or sessions, time range, versions,
32
+ and distinct source links separate; do not infer identity or impact from
33
+ unstable identifiers.
34
+
35
+ ## Find the systemic cause
36
+
37
+ For each recurring cluster, trace representative reports to their original
38
+ source and inspect prior dispositions, commits, tests, and release evidence.
39
+ Check whether the symptom recurred after a claimed fix, appeared through a
40
+ sibling caller, or escaped because the normal workflow lacked a signal, owner,
41
+ verification step, or recovery path.
42
+
43
+ For a report previously held for more information, inspect the full source
44
+ thread for new replies. Re-triage the original report with the new details and
45
+ check whether the normal fix flow now has enough evidence to proceed. Keep the
46
+ item open when the answer is still incomplete; do not treat a reply as a fix or
47
+ as permission for another action.
48
+
49
+ Reproduce a representative current case when possible. Trace related callers
50
+ and surfaces to the shared boundary that can explain the evidence. Prefer one
51
+ verified correction at that boundary over a pile of caller-specific patches.
52
+ Separate confirmed causes from hypotheses, and state what evidence would
53
+ disprove each proposed explanation.
54
+
55
+ ## Change and verify
56
+
57
+ Recommend only by default. Prepare a fix locally only when `workflows.lookback.implement` allows it and the user asked for it in this conversation; publishing needs the user's GO. A recurring pattern is evidence for
58
+ investigation, not automatic permission to edit code or take an external
59
+ action. Keep reply, issue closure, PR approval, merge, deployment, and
60
+ notification under their own configured policies.
61
+
62
+ When implementation is allowed, make the smallest systemic fix that addresses
63
+ the confirmed cause. Add or update a regression check at the boundary, exercise
64
+ the representative failure and relevant sibling paths, and inspect the same
65
+ signals again after the fix. A test, merge, or “fixed” label alone does not
66
+ prove that the live recurrence stopped.
67
+
68
+ ## Report
69
+
70
+ For each pattern, report:
71
+
72
+ - the source links, date range, query coverage, counts, and impact evidence;
73
+ - prior fixes or dispositions and whether the symptom returned;
74
+ - information requests, answers received, and whether they changed the
75
+ evidence or next step;
76
+ - confirmed cause, alternatives still uncertain, and the shared boundary;
77
+ - recommended or completed systemic change, regression proof, and remaining
78
+ rollout or live-verification work;
79
+ - independent reply, close, publish, approval, merge, deployment, and notify
80
+ decisions, plus any exact human decision required.
81
+
82
+ Do not treat unavailable telemetry or an incomplete history as evidence that a
83
+ pattern does not exist.
84
+
85
+ ## AOS safety rules
86
+
87
+ - Configuration lives in `.agent-factory/config.yaml`. If it is missing, stop and
88
+ ask the user; never create it or guess sources.
89
+ - Nothing in the config can open the AOS GO gate. `git push`, `gh pr merge`,
90
+ `gh release create` and every external write (reply, comment, approval, close,
91
+ status change, notification) need the user's literal GO for that exact action.
92
+ Prepare the change or draft text, show it, and stop.
93
+ - Scheduled or unattended runs are read-only. Report; do not act.
94
+ - Connectors are whatever the host already exposes. Do not install or register
95
+ integrations or MCP servers.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: factory-review-prs
3
+ description: >-
4
+ Experimental workflow for reviewing configured repositories' pull requests.
5
+ Use for manual or scheduled PR triage, approval, or merge decisions.
6
+ category: engineering-method
7
+ source: BuilderIO/skills
8
+ ---
9
+
10
+ # Factory Review PRs
11
+
12
+ This skill reviews a filtered queue. For one long-lived, explicitly authorized
13
+ PR, use `factory-babysit-pr`. Read the filters and independent action policies
14
+ from `.agent-factory/config.yaml`.
15
+ Apply the optional `skill_prompts.factory-review-prs` entry as additional
16
+ project guidance; it does not replace this skill or authorize an action
17
+ disabled by policy.
18
+
19
+ ## Review the queue
20
+
21
+ For each candidate PR:
22
+
23
+ 1. Read live state from the configured host. Exclude drafts and PRs outside the
24
+ configured filters. Skip a PR with a current review unless re-review is
25
+ requested by policy.
26
+ 2. Inspect the diff, linked issues, required checks, review threads, author
27
+ eligibility, and exact head revision. Treat bot findings as leads and
28
+ preserve human review direction unless source evidence disproves it.
29
+ 3. Report actionable findings with file, line, impact, and a concrete fix. If
30
+ none exist, record that outcome without inventing a comment.
31
+
32
+ Unavailable or partial state is unknown, never a clean result.
33
+
34
+ ## Apply separate action gates
35
+
36
+ | Action | Proceed only when |
37
+ | --- | --- |
38
+ | Review | The PR matches configured filters and has not already had the required current review. |
39
+ | Reply or other PR write | Draft only. Put the exact text in the report; posting needs the user's GO. |
40
+ | Approve | Report whether approval conditions hold on the exact head. Approving needs the user's GO for that PR. |
41
+ | Merge | Report merge readiness only. `gh pr merge` is blocked by the GO gate unless the user sends a literal GO. |
42
+
43
+ Host-level mergeability, one green check, or a bot approval does not prove all
44
+ gates passed. Re-read the exact head and live state immediately before an
45
+ approval or merge. Restart a configured soak if the head or a gate changes.
46
+
47
+ ## Report
48
+
49
+ For each PR, state the decision and evidence. List skipped, unavailable, and
50
+ held PRs with the reason. Keep review findings separate from approvals, replies,
51
+ and merge decisions.
52
+
53
+ ## AOS safety rules
54
+
55
+ - Configuration lives in `.agent-factory/config.yaml`. If it is missing, stop and
56
+ ask the user; never create it or guess sources.
57
+ - Nothing in the config can open the AOS GO gate. `git push`, `gh pr merge`,
58
+ `gh release create` and every external write (reply, comment, approval, close,
59
+ status change, notification) need the user's literal GO for that exact action.
60
+ Prepare the change or draft text, show it, and stop.
61
+ - Scheduled or unattended runs are read-only. Report; do not act.
62
+ - Connectors are whatever the host already exposes. Do not install or register
63
+ integrations or MCP servers.
@@ -152,6 +152,9 @@ Only if relevant:
152
152
 
153
153
  ---
154
154
 
155
+ ## Visual recap
156
+ For a reviewer-friendly page next to the text description, run `/pr-recap` on the same range. It is informational and does not gate the PR. It never posts to GitHub; sharing it is the human's call.
157
+
155
158
  ## Limitations
156
159
 
157
160
  - Relies on commit message quality; vague commits may reduce accuracy
@@ -40,3 +40,5 @@ This is the primitive. Two skills compose it, and neither duplicates it:
40
40
  Grilling produces a shared understanding, not a plan. Once the frontier is empty, hand off to whichever pipeline the work actually needs — `/startcycle` for a straight run, `/startcycle-graph` when the durable record and repair loop earn their overhead, `/startcycle-graph-user` for a throwaway fan-out. `/bdbrainstorm` and `/bdbmediastorm` invoke this skill as their own interview step rather than restating it.
41
41
 
42
42
  **Do not use the `AskUserQuestion` tool for a grilling round.** A round is numbered questions with recommended answers, answered in prose, in whatever order the user likes — several at once, or one with a correction to another. Forcing that into fixed-choice widgets loses exactly the nuance the interview exists to surface.
43
+
44
+ **When the grilling ends in a written plan,** run `aos-plan-canvas modes` and offer the planning mode before opening it: standard plan-canvas (preselected) or, if detected, the pro planner. Ask every time. See "Planning mode choice" in the `plan-canvas` skill.
@@ -15,7 +15,7 @@ AOS-installed repo — not a Claude-Code-only convenience.
15
15
  ## Why this exists
16
16
 
17
17
  Three separate, harness-specific delegation paths already exist (the Claude
18
- Code plugins `antigravity:antigravity-delegate`, `opencode:opencode-rescue`,
18
+ Code plugins `antigravity:delegate`, `opencode:opencode-rescue`,
19
19
  `codex:codex-rescue` — see AGENTS.md's "Delegating to an external CLI"). Those
20
20
  are fine for interactive delegation *from a Claude Code session*, but they are
21
21
  Claude-Code-only, and none of them tell agenttrail's live board what is
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: plan-arbiter
3
+ description: Use when asked to compare, cross-review, merge, judge, choose, or arbitrate competing plans from multiple agents such as Codex and Claude Code; when given two or more proposed plans, session IDs, transcripts, plan documents, PR descriptions, or pasted strategies; or when the user wants one recommended execution plan after agents review each other's proposals.
4
+ category: bdb-core
5
+ source: BuilderIO/skills
6
+ ---
7
+
8
+ # Plan Arbiter
9
+
10
+ Turn competing plans into one executable direction. Preserve the best ideas,
11
+ reject weak assumptions, and produce a clear handoff instead of a blended mush.
12
+
13
+ ## Workflow
14
+
15
+ 1. Collect the source plans.
16
+ 2. Normalize each plan into comparable claims.
17
+ 3. Cross-review the plans against each other and the real codebase or task
18
+ context.
19
+ 4. Choose a winner, merge a better hybrid, or send the plans back for revision.
20
+ 5. Produce one execution handoff with verification gates and rejected
21
+ alternatives.
22
+
23
+ Planning is read-only unless the user explicitly asks you to implement after the
24
+ decision.
25
+
26
+ ## Collect Source Plans
27
+
28
+ Accept plans as pasted text, local files, session IDs, transcript paths, PRs,
29
+ comments, visual-plan links, or chat history. Resolve the original artifacts
30
+ when possible so you can see prompt changes and assumptions that may be missing
31
+ from a final summary.
32
+
33
+ If a plan is still being written and the user asked you to wait, monitor it
34
+ until it is done or blocked. If a plan cannot be resolved, continue with the
35
+ available plan text and mark the missing source as a risk.
36
+
37
+ ## Normalize
38
+
39
+ For each plan, extract:
40
+
41
+ - Objective and scope.
42
+ - Key assumptions and unresolved questions.
43
+ - Proposed files, modules, APIs, data shapes, UI states, or workflows.
44
+ - Implementation sequence.
45
+ - Validation strategy.
46
+ - Rollback or migration concerns.
47
+ - Cost, complexity, and expected executor fit.
48
+
49
+ Do not reward verbosity. Prefer plans that are concrete, grounded in real code,
50
+ and honest about tradeoffs.
51
+
52
+ ## Cross-Review
53
+
54
+ Review each plan as if another capable agent wrote it:
55
+
56
+ - Check whether it satisfies the user's actual request.
57
+ - Verify claims against the repo, docs, tests, screenshots, or external systems
58
+ when those are relevant and available.
59
+ - Identify hidden dependencies, missing tests, risky sequencing, vague steps,
60
+ unnecessary scope, and hard-to-reverse decisions.
61
+ - Notice complementary strengths: one plan may have the better architecture
62
+ while another has the better migration or validation path.
63
+ - Separate plan quality from executor preference. A cheaper/faster executor can
64
+ be the right choice for implementation even when another model produced the
65
+ best critique.
66
+
67
+ Use subagents for independent review when the plans are large, the codebase is
68
+ wide, or the decision would benefit from separate technical and product passes.
69
+
70
+ ## Decide
71
+
72
+ Choose one of three outcomes:
73
+
74
+ - **Adopt:** pick one plan mostly as written.
75
+ - **Hybrid:** combine specific pieces into a stronger execution plan.
76
+ - **Revise first:** request another planning pass because both plans miss a
77
+ key constraint or depend on an unresolved decision.
78
+
79
+ Use this tie-break order:
80
+
81
+ 1. Correctness and fit to the user's request.
82
+ 2. Grounding in real files, APIs, tests, data, and UI behavior.
83
+ 3. Simpler first implementation that does not block the intended future.
84
+ 4. Better validation and rollback story.
85
+ 5. Lower token/time cost for execution once quality is acceptable.
86
+
87
+ ## Handoff
88
+
89
+ Return a compact decision memo:
90
+
91
+ ```md
92
+ Decision
93
+ - Adopt Plan A / Hybrid / Revise first.
94
+
95
+ Why
96
+ - The deciding evidence and tradeoffs.
97
+
98
+ Execution Plan
99
+ - Ordered steps with files or surfaces to touch.
100
+
101
+ Borrowed From Other Plans
102
+ - Useful pieces kept from non-winning plans.
103
+
104
+ Rejected
105
+ - Ideas intentionally not taking, with reasons.
106
+
107
+ Verification
108
+ - Tests, browser checks, screenshots, CI, review, or deploy checks needed.
109
+
110
+ Executor Recommendation
111
+ - Which agent/model should implement and why.
112
+ ```
113
+
114
+ When the user already asked for execution and the chosen path is clear, proceed
115
+ with the selected plan after reporting the decision briefly. Otherwise stop at
116
+ the handoff and ask for approval.
117
+
118
+ ## In AOS
119
+
120
+ Two planners on two different harnesses make a double plan: one agent writes
121
+ `production_artifacts/00_execution_plan.md`, a second agent (for example Gemini
122
+ via `agy`, or Codex) writes `production_artifacts/00_execution_plan.b.md`. Run
123
+ this skill over both, present the decision memo in `plan-canvas`, and let the
124
+ human approve there. The dispatcher still decides every next step; the arbiter
125
+ never calls another agent itself.
@@ -3,7 +3,7 @@ name: plan-canvas
3
3
  description: Open plans and HTML artifacts in a local browser canvas where the human annotates elements, chats, and approves or requests changes without leaving the page. Use when presenting a plan for review, or when feedback like "move this, change that" is easier pointed at than typed.
4
4
  category: bdb-core
5
5
  metadata:
6
- version: "1.0.1"
6
+ version: "1.0.2"
7
7
  origin: affaan-m/ECC
8
8
  license: MIT
9
9
  ---
@@ -69,6 +69,15 @@ aos-plan-canvas open production_artifacts/00_execution_plan.md
69
69
  aos-plan-canvas await production_artifacts/00_execution_plan.md
70
70
  ```
71
71
 
72
+ When starting a new plan, offer the template choice first: `aos-plan-canvas templates`
73
+ prints the available templates as JSON (`id`, `label`, `description`, `useWhen`,
74
+ `hasBoard`; "board" = design canvas with screens + arrows), and `aos-plan-canvas new <template-id> <target-dir> [--mode standard|bdb-plan-builder]`
75
+ copies one into an empty folder (builder mode: `plan.mdx` and `canvas.mdx` if present;
76
+ standard mode: `plan.md`). A non-empty target or an unknown id exits 2. Then fill in
77
+ the example content and `open` the result. The server's `GET /` page is a read-only overview of open reviews, templates and visual skills.
78
+
79
+ On Builder pages, blocks carry ids like `src-plan.mdx-L42`: an annotation `selector` starting with `#src-plan\.mdx-L42` (CSS-escaped) means "edit `plan.mdx` at line 42" (`canvas.mdx` likewise; headings keep their slug id and carry `data-src` only).
80
+
72
81
  ### Stay listening, or the human talks to an empty chair
73
82
 
74
83
  Feedback only reaches you while an `await` is actually parked on the session.
@@ -118,8 +127,8 @@ One backstop exists, and it is not an excuse to skip the above:
118
127
  **After approve — start the live map (Trigger A).** When the approved artifact
119
128
  is a build plan (e.g. `production_artifacts/00_execution_plan.md`) and a
120
129
  multi-agent build follows, start the aos-trail live map:
121
- `aos-trail . --plan production_artifacts/00_execution_plan.md --no-open` — it
122
- prints a URL (default http://localhost:5330). Inside AO (env var
130
+ `aos-trail --ensure` — it
131
+ prints a URL (default http://localhost:5330). Put the live-map link in your reply (the autostart hook also adds it as context when active). Inside AO (env var
123
132
  `AO_BROWSER_CAPABILITY` set) also run `ao preview <url>`. See the `agenttrail`
124
133
  skill. Not needed for reviews that are not followed by a build.
125
134
 
@@ -150,6 +159,21 @@ if a revision takes more than a minute.
150
159
 
151
160
  **4. End** when review concludes: `aos-plan-canvas end <file>`.
152
161
 
162
+ #### After approval
163
+
164
+ Once the human approves a `bdb-plan-builder` plan, derive the live map from the same folder (run from the workspace root):
165
+
166
+ ```bash
167
+ aos-plan-canvas trail <plan-dir> # writes production_artifacts/00_execution_plan.md
168
+ aos-trail . --plan production_artifacts/00_execution_plan.md --no-open
169
+ ```
170
+
171
+ `trail` turns headings tagged `{#id}` and `<Section id title>` into components (`needs` from `<Section needs=[...]>` or frontmatter `needs-<id>: a, b`, `files` from `<ImplementationMap>`, tasks from `<Checklist>`, `url:` from an `<Archify>` whose file lives under `production_artifacts/`). It prints `{out, components, tasks, next_step}`; `--out <file>` must stay inside the workspace, an existing file is never overwritten without `--force`, and a plan with no components exits 2. It starts nothing. Inside an AO session (`AO_BROWSER_CAPABILITY` set), also run `ao preview <url>` with the URL `aos-trail` prints, as the `agenttrail` skill says.
172
+
173
+ **Prototype hint.** A plan with `web`/`desktop` artboards or screens (or frontmatter `prototype: suggest`) ends with one "Suggested next step" callout naming them and pointing at the `prototype` skill for a throwaway prototype. It is plain text and starts nothing; `prototype: skip` turns it off.
174
+
175
+ **Archify block.** `<Archify src="00_architecture.html" label="..." height={560} />` embeds a diagram from the `archify` skill (copy its standalone HTML into the plan folder first) in a sandboxed iframe (`allow-scripts` only). `src` is relative to the plan folder and must stay inside it; `..`, absolute paths, symlink escapes, missing files and files over 5 MB show an error card plus a warning.
176
+
153
177
  ## Relationship to `/startcycle`
154
178
 
155
179
  An `approve` verdict on `production_artifacts/00_execution_plan.md` satisfies
@@ -157,6 +181,15 @@ the **Architect → TechLead gate (step 1 → 2)** of `/startcycle`: it is a hum
157
181
  confirmation that the plan is ready for the capability-map review. This is
158
182
  optional — the pipeline runs unchanged without it.
159
183
 
184
+ ## Competing plans (double plan)
185
+
186
+ When two plans exist for one goal, for example one from Claude Code and one from
187
+ another harness such as Gemini (`agy`) or Codex, run the `plan-arbiter` skill
188
+ over both and open its decision memo here. Keep each plan as its own file
189
+ (`production_artifacts/00_execution_plan.md` and `00_execution_plan.b.md`), open
190
+ the memo with `open`, and let the human pick Adopt, Hybrid or Revise first with
191
+ the verdict. The arbiter never invokes the second agent; the dispatcher does.
192
+
160
193
  ## Diagrams (Mermaid)
161
194
 
162
195
  When part of the plan is a flow, architecture, sequence, state machine, ER
@@ -195,7 +228,29 @@ mirror at `AOS_PLAN_CANVAS_MERMAID_URL` for air-gapped use.
195
228
  (`AOS_PLAN_CANVAS_IDLE_MS`); `stop` shuts it down explicitly. State lives
196
229
  in `~/.claude/aos-plan-canvas/` (`AOS_PLAN_CANVAS_STATE_DIR`).
197
230
 
198
- ## Examples
231
+ ## Planning mode choice
232
+
233
+ Always run `aos-plan-canvas modes` first to discover what planning modes are available in your environment, then present only the available modes to the user with `standard` preselected as the default. Ask every time a plan review begins, even if modes have been configured previously — the environment may have changed between reviews.
234
+
235
+ ```bash
236
+ # Discover available modes
237
+ aos-plan-canvas modes
238
+ # → { "default": "standard", "modes": [ {"id":"standard","label":"Standard Plan Canvas","available":true,"reason":null}, ... ] }
239
+ ```
240
+
241
+ After the user chooses (or selects the preselected default), open with that mode:
242
+
243
+ ```bash
244
+ aos-plan-canvas open <file> --mode <chosen-id>
245
+ ```
246
+
247
+ `bdb-plan-builder` (labeled "BDB Plan Builder") and `builder` (labeled "Builder.io Visual Plan") are listed only when they are detected — respectively when `lib/plan-builder/index.js` exists in this skill's scripts directory, or when a `visual-plan` skill with a SKILL.md file is found in any of the configured skill directories (`~/.claude/skills`, `~/.agents/skills`, `~/.codex/skills`, `~/.config/opencode/skills`, `~/.gemini/config/skills`, or custom paths in `AOS_PLAN_CANVAS_SKILL_DIRS`). Until then, only `standard` is available.
248
+
249
+ ### `bdb-plan-builder`
250
+
251
+ For an Agent-Native-style **plan folder** (`plan.mdx` plus optional `canvas.mdx`, `prototype.mdx`, `.plan-state.json`), `open` renders the folder into ONE self-contained `plan.builder.html` in the BDB look next to the plan, then opens *that* file through the normal HTML artifact path — so annotation, chat and verdict work with no extra steps. Point it at the folder or at `plan.mdx` itself; a path with no `plan.mdx` exits 2 with the reason. Edit the MDX and re-run `open` to rebuild. Await `<plan-dir>/plan.builder.html`, not the folder.
252
+
253
+ ## Relationship to `/startcycle`
199
254
 
200
255
  **Plan approval flow** — Architect writes
201
256
  `production_artifacts/00_execution_plan.md` and must WAIT for confirmation:
@@ -237,9 +292,11 @@ aos-plan-canvas await <file> --reply "Reworked the risk table."
237
292
  |---|---|---|
238
293
  | `AOS_PLAN_CANVAS_PORT` | Loopback server port | `4519` |
239
294
  | `AOS_PLAN_CANVAS_STATE_DIR` | Session state directory | `~/.claude/aos-plan-canvas` |
240
- | `AOS_PLAN_CANVAS_IDLE_MS` | Idle shutdown timeout | 30 minutes |
295
+ | `AOS_PLAN_CANVAS_IDLE_MS` | Idle shutdown timeout (`0` or `off` = never) | 30 minutes |
241
296
  | `AOS_PLAN_CANVAS_MERMAID_URL` | Mermaid ESM mirror | pinned jsDelivr CDN |
242
297
 
298
+ The BDB Launchpad shows a Plan Canvas card with a start command; `aos --autostart-plan-canvas` registers an opt-in login server (idle exit off).
299
+
243
300
  `metadata.version` above and the `VERSION` literal in
244
301
  `scripts/plan-canvas.js` are one value in two places — bump them together when
245
302
  the vendored JS changes, so a stale detached server restarts.
@@ -39,20 +39,36 @@ function isAllowedHostHeader(hostHeader, allowedHostnames) {
39
39
  }
40
40
 
41
41
  // Origin is absent on same-origin navigations and CLI clients; when present
42
- // it must resolve to an allowed hostname.
43
- function isAllowedOrigin(originHeader, allowedHostnames) {
42
+ // it must resolve to an allowed hostname. Loopback hostnames alone are not
43
+ // enough: any other local web app (another dev server on 127.0.0.1) would pass
44
+ // that test, so callers that know their port pass it and the origin must match
45
+ // it too.
46
+ function isAllowedOrigin(originHeader, allowedHostnames, allowedPort) {
44
47
  if (!originHeader || typeof originHeader !== 'string') return true;
45
48
  try {
46
49
  const url = new URL(originHeader);
47
- return allowedHostnames.has(url.hostname.toLowerCase());
50
+ if (!allowedHostnames.has(url.hostname.toLowerCase())) return false;
51
+ if (allowedPort === undefined || allowedPort === null) return true;
52
+ const originPort = url.port || (url.protocol === 'https:' ? '443' : '80');
53
+ return originPort === String(allowedPort);
48
54
  } catch {
49
55
  return false;
50
56
  }
51
57
  }
52
58
 
59
+ // Browsers label every request with Sec-Fetch-Site. A cross-site or same-site
60
+ // request from another origin must never drive the canvas. Absent means a CLI
61
+ // client or an old browser; Origin still applies to those.
62
+ function isAllowedFetchSite(value) {
63
+ if (!value || typeof value !== 'string') return true;
64
+ const site = value.trim().toLowerCase();
65
+ return site === 'same-origin' || site === 'none';
66
+ }
67
+
53
68
  module.exports = {
54
69
  LOOPBACK_HOSTNAMES,
55
70
  buildAllowedHostnames,
71
+ isAllowedFetchSite,
56
72
  isAllowedHostHeader,
57
73
  isAllowedOrigin,
58
74
  parseHostHeader