@aopslabs/aops 0.3.31 → 0.3.32

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 (147) hide show
  1. package/README.md +11 -3
  2. package/aops-assets-release/aops-assets.json.gz +0 -0
  3. package/aops-assets-release/disciplines/build-review-chat/SKILL.md +33 -0
  4. package/aops-assets-release/disciplines/coordinator-loop/SKILL.md +33 -0
  5. package/aops-assets-release/disciplines/design-first-consensus/SKILL.md +30 -0
  6. package/aops-assets-release/disciplines/solo-pm-loop/SKILL.md +31 -0
  7. package/aops-assets-release/docs/user-guides/agentspace-user-guide.md +384 -0
  8. package/aops-assets-release/docs/user-guides/aops-cli-user-guide.md +2067 -0
  9. package/aops-assets-release/docs/user-guides/chatv3-user-guide.md +500 -0
  10. package/aops-assets-release/docs/user-guides/docman-user-guide.md +1009 -0
  11. package/aops-assets-release/docs/user-guides/projectman-user-guide.md +763 -0
  12. package/aops-assets-release/docs/user-guides/tasker-user-guide.md +244 -0
  13. package/aops-assets-release/release.json +6 -0
  14. package/aops-assets-release/roles/coordinator/ROLE.md +28 -0
  15. package/aops-assets-release/roles/implementer/ROLE.md +27 -0
  16. package/aops-assets-release/roles/reviewer/ROLE.md +27 -0
  17. package/aops-assets-release/skills/aops/SKILL.md +112 -0
  18. package/aops-assets-release/skills/aops-bootstrapper-authoring/SKILL.md +245 -0
  19. package/aops-assets-release/skills/aops-cli-agentspace/SKILL.md +186 -0
  20. package/aops-assets-release/skills/aops-cli-board-lifecycle/SKILL.md +64 -0
  21. package/aops-assets-release/skills/aops-cli-chat/SKILL.md +204 -0
  22. package/aops-assets-release/skills/aops-cli-collab/SKILL.md +42 -0
  23. package/aops-assets-release/skills/aops-cli-core/SKILL.md +219 -0
  24. package/aops-assets-release/skills/aops-cli-discuss/SKILL.md +172 -0
  25. package/aops-assets-release/skills/aops-cli-docman/SKILL.md +192 -0
  26. package/aops-assets-release/skills/aops-cli-fileman/SKILL.md +169 -0
  27. package/aops-assets-release/skills/aops-cli-mission/SKILL.md +128 -0
  28. package/aops-assets-release/skills/aops-cli-operator-brief/SKILL.md +67 -0
  29. package/aops-assets-release/skills/aops-cli-projectman/SKILL.md +235 -0
  30. package/aops-assets-release/skills/aops-cli-sugar-authoring/SKILL.md +188 -0
  31. package/aops-assets-release/skills/aops-cli-tasker/SKILL.md +108 -0
  32. package/aops-assets-release/skills/aops-cli-tooling-agent/SKILL.md +112 -0
  33. package/aops-assets-release/skills/aops-cli-view/SKILL.md +210 -0
  34. package/aops-assets-release/skills/aops-collaborative-work/SKILL.md +304 -0
  35. package/aops-assets-release/skills/aops-interactive/SKILL.md +70 -0
  36. package/aops-assets-release/skills/aops-loop-interactive/SKILL.md +314 -0
  37. package/aops-assets-release/skills/aops-working-disciplines/SKILL.md +310 -0
  38. package/aops-assets-release/skills/feature-retirement-flow/SKILL.md +126 -0
  39. package/assets/skills/aops-install/SKILL.md +18 -17
  40. package/dist/commands/assets.js +93 -1264
  41. package/dist/commands/community-server.js +27 -8
  42. package/dist/commands/community-setup.js +1 -2
  43. package/dist/commands/discuss.js +1 -1
  44. package/dist/commands/doc.js +88 -27
  45. package/dist/commands/docs.js +68 -0
  46. package/dist/commands/global-update.js +28 -0
  47. package/dist/commands/init.js +3 -1
  48. package/dist/commands/loop.js +6379 -0
  49. package/dist/commands/memory.js +2 -1
  50. package/dist/commands/pm/index.js +11 -9
  51. package/dist/commands/pm/projectman.js +33 -2
  52. package/dist/commands/project.js +6 -6
  53. package/dist/commands/prompt.js +1 -1
  54. package/dist/commands/repo-sync.js +92 -27
  55. package/dist/commands/runner.js +257 -0
  56. package/dist/commands/skill.js +1 -1
  57. package/dist/commands/start.js +1 -1
  58. package/dist/commands/tasker.js +361 -0
  59. package/dist/commands/view.js +53 -9
  60. package/dist/lib/commercial-setup-readiness-adapter.js +0 -1
  61. package/dist/lib/community-migration-snapshot.js +7 -9
  62. package/dist/lib/community-native-database-recovery.js +5 -14
  63. package/dist/lib/community-native-lifecycle.js +13 -0
  64. package/dist/lib/setup-agent-assets-bridge.js +28 -148
  65. package/dist/lib/setup-agent-assets-release.js +16 -44
  66. package/dist/lib/setup-init-orchestrator.js +11 -15
  67. package/dist/lib/simple-agent-assets.js +447 -0
  68. package/dist/lib/user-guide-sections.js +488 -0
  69. package/dist/main.js +10 -2
  70. package/dist/seeds/agents-md.js +3 -3
  71. package/dist/utils/agents-md.js +1 -1
  72. package/dist/utils/guide-paths.js +7 -7
  73. package/dist/utils/hosted-workspace.js +2 -1
  74. package/dist/utils/repo-first-storage.js +26 -1
  75. package/dist/utils/session-state.js +2 -7
  76. package/launchers/aops-cockpit.sh +0 -0
  77. package/launchers/aops-server.sh +0 -0
  78. package/package.json +67 -35
  79. package/THIRD_PARTY_NOTICES +0 -16169
  80. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/SKILL.md +0 -47
  81. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/agentspace/SKILL.md +0 -72
  82. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/aops-cli-core/SKILL.md +0 -110
  83. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/chatv3/SKILL.md +0 -59
  84. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/collaborative-work/SKILL.md +0 -81
  85. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/discuss/SKILL.md +0 -66
  86. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/docman/SKILL.md +0 -75
  87. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/projectman/SKILL.md +0 -92
  88. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/sys/SKILL.md +0 -36
  89. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/view/SKILL.md +0 -58
  90. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/working-disciplines/SKILL.md +0 -66
  91. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agent-assets.md +0 -81
  92. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agentspace.md +0 -183
  93. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-cli.md +0 -1108
  94. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-system.md +0 -102
  95. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/chatv3.md +0 -113
  96. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/docman.md +0 -223
  97. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/projectman.md +0 -233
  98. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/sys.md +0 -94
  99. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/working-disciplines.md +0 -482
  100. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/manifest.json +0 -117
  101. package/agent-assets-release/agent-assets/gateway/aops/SKILL.md +0 -14
  102. package/agent-assets-release/agent-assets/inventory.json +0 -29
  103. package/agent-assets-release/agent-assets/projection.json +0 -8
  104. package/agent-assets-release/agent-assets-release.json +0 -171
  105. package/agent-assets-release/agent-assets-release.sigstore.json +0 -67
  106. package/assets/agent-assets/core/SKILL.md +0 -47
  107. package/assets/agent-assets/core/references/agentspace/SKILL.md +0 -72
  108. package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +0 -110
  109. package/assets/agent-assets/core/references/chatv3/SKILL.md +0 -59
  110. package/assets/agent-assets/core/references/collaborative-work/SKILL.md +0 -81
  111. package/assets/agent-assets/core/references/discuss/SKILL.md +0 -66
  112. package/assets/agent-assets/core/references/docman/SKILL.md +0 -75
  113. package/assets/agent-assets/core/references/projectman/SKILL.md +0 -92
  114. package/assets/agent-assets/core/references/sys/SKILL.md +0 -36
  115. package/assets/agent-assets/core/references/view/SKILL.md +0 -58
  116. package/assets/agent-assets/core/references/working-disciplines/SKILL.md +0 -66
  117. package/assets/agent-assets/core/user-guides/agent-assets.md +0 -81
  118. package/assets/agent-assets/core/user-guides/agentspace.md +0 -183
  119. package/assets/agent-assets/core/user-guides/aops-cli.md +0 -1108
  120. package/assets/agent-assets/core/user-guides/aops-system.md +0 -102
  121. package/assets/agent-assets/core/user-guides/chatv3.md +0 -113
  122. package/assets/agent-assets/core/user-guides/docman.md +0 -223
  123. package/assets/agent-assets/core/user-guides/projectman.md +0 -233
  124. package/assets/agent-assets/core/user-guides/sys.md +0 -94
  125. package/assets/agent-assets/core/user-guides/working-disciplines.md +0 -482
  126. package/assets/agent-assets/gateway/aops/SKILL.md +0 -14
  127. package/dist/lib/agent-assets/gateway.js +0 -15
  128. package/dist/lib/agent-assets/guards.js +0 -23
  129. package/dist/lib/agent-assets/hosted-discovery.js +0 -148
  130. package/dist/lib/agent-assets/hosted-package-input.js +0 -154
  131. package/dist/lib/agent-assets/legacy-pointer-migration.js +0 -677
  132. package/dist/lib/agent-assets/native-fs.js +0 -589
  133. package/dist/lib/agent-assets/roots.js +0 -45
  134. package/dist/lib/agent-assets/runtime-binding-reader.js +0 -545
  135. package/dist/lib/agent-assets/runtime-targets.js +0 -50
  136. package/dist/lib/agent-assets/store-reader.js +0 -1212
  137. package/dist/lib/agent-assets/store-writer.js +0 -1484
  138. package/native/bin/darwin-arm64/aops-agent-assets-fs +0 -0
  139. package/native/bin/darwin-x64/aops-agent-assets-fs +0 -0
  140. package/native/bin/linux-arm64/aops-agent-assets-fs +0 -0
  141. package/native/bin/linux-x64/aops-agent-assets-fs +0 -0
  142. package/native/bin/win32-x64/aops-agent-assets-fs.exe +0 -0
  143. package/native/manifest.json +0 -49
  144. package/native/qualifications/win32-x64.json +0 -23
  145. package/native/tui/darwin-arm64/aops-tui +0 -0
  146. package/native/tui/linux-x64/aops-tui +0 -0
  147. package/native/tui/win32-x64/aops-tui.exe +0 -0
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: aops-cli-collab
3
+ version: 31
4
+ description: "DEPRECATED — the repo-first collab command surface is retired. Routes agents to aops-cli-discuss (decision/consensus), aops-cli-chat (coordination/wake via hosted rooms), and aops-cli-projectman (review + issues). `aops-cli start` multi-agent mode is now chat-room, not full-collab. Kept one release for compatibility."
5
+ metadata:
6
+ supersedes: "v30"
7
+ short-description: "Deprecation pointer: collab split into discuss + chat + PM"
8
+ tags:
9
+ - cli
10
+ - agentspace
11
+ - deprecated
12
+ - pointer
13
+ - discuss
14
+ - chat
15
+ - projectman-review-request
16
+ ---
17
+
18
+ # AOPS CLI Collab (deprecated)
19
+
20
+ The repo-first `collab` command surface (`aops-cli collab ...`, the collab session ledger, and collab chat) is **retired**. Coordination, decision, and review now live in three separate surfaces — pick the one that matches the need:
21
+
22
+ - **`aops-cli-discuss`** — decision / consensus: standalone discussion topics, the design-decision ritual, the two-agent turn protocol, and deterministic `conclude` outputs.
23
+ - **`aops-cli-chat`** — coordination / wake: hosted Agentspace rooms and DMs, members, bindings, and `inbox`/`listen`/`catchup` read loops.
24
+ - **`aops-cli-projectman`** — review + execution truth: `pm review-request` create/result, re-review (`--parent`), `pm issue`, and `pm feedback`.
25
+
26
+ `aops-cli start`'s multi-agent mode is now **`chat-room`** (the `full-collab` mode was removed). There is **no automatic decision bridge**: `discuss conclude` writes only its own outputs; surfacing a decision to PM or chat is explicit (a PM feedback/issue carrying the discussion-topic ref, or a chat `agentspace.discussion-topic` binding).
27
+
28
+ This pointer is kept for **one release** for compatibility; new instructions should reference the three skills above directly. The full v30 collab playbook lives on in this skill's version history.
29
+
30
+ ## Old → new mapping
31
+
32
+ | Old (retired collab) | New |
33
+ |----------------------|-----|
34
+ | `collab start` / session ledger / `collab event` / `collab status` / `collab close` | Hosted **`aops-cli chat`** room for coordination + **`aops-cli pm`** for review/issue/closeout truth (`aops-cli-chat`, `aops-cli-projectman`) |
35
+ | `collab chat` (repo-first session chat) | **`aops-cli chat`** hosted rooms/DMs (`aops-cli-chat`) |
36
+ | `collab review request` / `collab review result` (session review composite) | **`aops-cli pm review-request create` / `... result`** + `pm review-request create --parent <rr-id>` for re-review (`aops-cli-projectman`) |
37
+ | Session-bound discuss (`discuss start --session ...`) | **Standalone `aops-cli discuss`** (no `--session`) (`aops-cli-discuss`) |
38
+ | `collab listen` / `collab chat daemon` listener patterns | **`aops-cli chat listen` / `chat catchup`** read loop (`aops-cli-chat`) |
39
+ | `collab close` + post-collab memory | Operator-approved **`pm board closeout`** + `aops-cli mem` closeout note (`aops-cli-projectman`, `aops-cli-agentspace`) |
40
+ | `start --mode full-collab` | `start --mode chat-room` |
41
+
42
+ If `--help` and this pointer disagree, `--help` wins.
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: aops-cli-core
3
+ version: 17
4
+ description: "Use when an AI agent needs AOPS CLI core operator playbook: help-first discovery, guard flags, project registry/project selection, partitioned sync, archive lifecycle, server-canonical vs local cache rules, hosted invoke fallback, doc-reading ladder, and schema fallback. Thin guide; .aops/docman/aops-guides/aops-cli-user-guide.md and command --help are authoritative."
5
+ metadata:
6
+ supersedes: "v16"
7
+ short-description: "AOPS CLI core operator thin discipline guide"
8
+ tags:
9
+ - cli
10
+ - tooling
11
+ - operators
12
+ - discovery
13
+ - guard-pattern
14
+ - sync
15
+ - hosted-mirror
16
+ - help-first
17
+ - schema-first
18
+ - project-registry
19
+ - archive
20
+ ---
21
+
22
+ # AOPS CLI Core
23
+
24
+ `aops-cli` is the operator plane. It routes agents to domain owners; it is not the semantic owner of planning, memory, documents, files, or execution.
25
+
26
+ This is a thin discipline guide. Deep mechanics live in `.aops/docman/aops-guides/aops-cli-user-guide.md`; exact command shape lives in live `--help`. If this skill conflicts with either, `--help` and the user guide win.
27
+
28
+ ## Use This Skill For
29
+
30
+ 1. Help-first command discovery.
31
+ 2. Guard flags: `--preview`, `--apply`, `--confirm`, `--idempotency-key`, `--json`, `--yes`.
32
+ 3. Server-canonical truth vs local cache routing.
33
+ 4. Raw hosted invoke fallback when sugar is absent.
34
+ 5. Doc/guide reading ladder and schema fallback discipline.
35
+ 6. Repo project registry routing: `aops-cli project link`, `aops-cli project links list`, `aops-cli project migrate-local-root`, and `pm --project-slug` project selection.
36
+ 7. Partitioned sync (read/mirror): `sync --project-slug` and `sync --all-projects`.
37
+ 8. Hosted PM archive lifecycle: `archive create`, `archive verify`, `archive delete`, and `archive decommission-check`.
38
+
39
+ Use the family skills for domain work: projectman for PM (including review-request/result and re-review), agentspace for memory/assets, discuss for decision/consensus, chat for hosted-room coordination/wake, docman for docs, fileman for snapshots, tasker for runner/tasker, view for read-only cockpit surfaces.
40
+
41
+ ## Canonical Sources
42
+
43
+ 1. `.aops/docman/aops-guides/aops-cli-user-guide.md`, read by section name/keyword, not by fragile section number.
44
+ 2. `aops-cli --help`, `aops-cli <family> --help`, and nested `--help`.
45
+ 3. Domain user guides: `domains/<domain>/USER_GUIDE.md` for semantic rules.
46
+ 4. Hosted prompt/skill truth through `aops-cli prompt|skill ...`; `.aops/hosted/**` is only a mirror.
47
+ 5. Hosted Docman guide truth through `aops-cli doc ...`; `.aops/docman/**` is only a mirror.
48
+ 6. Repo project registry truth: `.aops/aops.config.json`, inspected with `aops-cli project links list --json`.
49
+
50
+ ## Help-First Workflow
51
+
52
+ ```bash
53
+ aops-cli --help
54
+ aops-cli <family> --help
55
+ aops-cli <family> <subcommand> --help
56
+ ```
57
+
58
+ Decision chain:
59
+
60
+ 1. Use sugar if help exposes it.
61
+ 2. Inspect a compact hosted catalog: `aops-cli agent tools --domain <domain> --summary --json`.
62
+ 3. Narrow noisy domains with `--q` and `--limit`: `aops-cli agent tools --domain <domain> --q <keyword> --limit 20 --summary --json`.
63
+ 4. Inspect compact schema first: `aops-cli agent schema --tool <domain>.<operation> --summary --json`.
64
+ 5. Invoke exact payload: `aops-cli agent invoke --tool <toolId> --input '@payload.json' --apply --json`.
65
+ 6. Use `aops-cli api call` only as an explicit escape hatch.
66
+
67
+ ## Agent Tool Catalog Ladder
68
+
69
+ Use compact discovery before dumping whole catalogs:
70
+
71
+ ```bash
72
+ aops-cli agent tools --domain agentspace --summary --json
73
+ aops-cli agent tools --domain agentspace --q memory --limit 20 --summary --json
74
+ aops-cli agent schema --tool agentspace.memory-item.search-memory-items --summary --json
75
+ ```
76
+
77
+ `agent tools --json` without `--summary` returns the full gateway payload and can be very large. `--summary` returns compact resource/tool rows plus next-step hints. `--examples` adds the first invoke example only when you explicitly need it; otherwise prefer `agent schema` for payload authoring.
78
+
79
+ ## Guard Flags
80
+
81
+ | Flag | Meaning |
82
+ |---|---|
83
+ | `--preview` | validate/planning output without write effects when the command supports preview |
84
+ | `--apply` | execute a guarded write |
85
+ | `--confirm` | confirm destructive overwrite/delete/restore/cleanup |
86
+ | `--idempotency-key <id>` | make retries deterministic |
87
+ | `--json` | scriptable output |
88
+ | `--yes` | non-interactive/fail-fast; not a substitute for `--apply` or `--confirm` |
89
+
90
+ Common default: reads need no guard, writes need `--apply`, destructive writes need `--apply --confirm`.
91
+
92
+ ## Server-Canonical Truth And Local Caches
93
+
94
+ The hosted AOPS server is the source of truth for planning and Agentspace state. Create, write, and read all go through the hosted gateway:
95
+
96
+ 1. Projectman (`aops-cli pm ...`) — server-canonical.
97
+ 2. Agentspace memory (`aops-cli mem ...`) — server-canonical.
98
+ 3. Discussion topics (`aops-cli discuss ...`) — server-canonical (hosted discuss authoring).
99
+ 4. Experience (`aops-cli exp ...`) — server-canonical.
100
+
101
+ Read-only local caches (refreshed by `sync pull`, never an authoring source):
102
+
103
+ 1. `.aops/projectman/**`, `.aops/agentspace/memory/items/**`, `.aops/agentspace/discussions/**`, `.aops/agentspace/collabs/**`: a local cache of server state for offline/read inspection.
104
+ 2. `.aops/hosted/prompts/**` and `.aops/hosted/skills/**`: hosted prompt/skill mirrors; refresh after a hosted prompt/skill publish with `aops-cli sync pull --apply --hosted-project-slug aops --json`.
105
+ 3. `.aops/docman/**`: Docman guide mirrors; refresh with `aops-cli doc mirror pull ... --apply --json`. `sync pull` does not refresh Docman guide mirrors.
106
+
107
+ Do not hand-edit a read-only cache or mirror as canonical truth; change hosted truth through the hosted CLI and refresh the cache.
108
+
109
+ ## Project Registry And Project Selection
110
+
111
+ The repo project registry lets one repo bind more than one hosted project so `pm --project-slug <slug>` (and the other family commands) can target the intended hosted project. Authoring is always hosted; the registry only controls selection and where the read-only local cache lives.
112
+
113
+ ```bash
114
+ aops-cli project link --slug aops --mode local --local-root .aops/projects/aops --apply --json
115
+ aops-cli project link --slug cockpit --mode hosted-only --apply --json
116
+ aops-cli project links list --json
117
+ aops-cli project migrate-local-root --project-slug aops --local-root .aops/projects/aops --dry-run --json
118
+ aops-cli project migrate-local-root --project-slug aops --local-root .aops/projects/aops --apply --confirm --json
119
+ ```
120
+
121
+ Operational facts:
122
+
123
+ 1. `project link` mutates only `.aops/aops.config.json` after verifying the hosted project exists and is not archived/deleted.
124
+ 2. `local-root` names the repo-relative path where that project's read-only cache (PM/memory/discuss mirrors) is materialized by `sync pull`.
125
+ 3. `project link --mode` records the link mode metadata; PM/memory/discuss authoring routes to the hosted server regardless, so inspect a project through hosted/project views or read its local cache.
126
+ 4. `migrate-local-root` is repo-local and only moves the local cache root. Run `--dry-run` first; the real move requires `--apply --confirm` because the prior root is moved to an archive.
127
+ 5. `ownerRepo` and `parentProjectSlug` are metadata on the registry link; they do not change domain ownership.
128
+
129
+ ## Partitioned Sync
130
+
131
+ Sync is a read/mirror operation that refreshes the local cache from the hosted server; it is not a PM authoring path. Use project selection when a repo has more than one linked project:
132
+
133
+ ```bash
134
+ aops-cli sync status --project-slug aops --json
135
+ aops-cli sync diff --project-slug aops --json
136
+ aops-cli sync pull --project-slug aops --apply --json
137
+ aops-cli sync status --all-projects --json
138
+ aops-cli sync pull --all-projects --apply --json
139
+ ```
140
+
141
+ Shipped behavior:
142
+
143
+ 1. `sync --project-slug <slug>` resolves the project link from `.aops/aops.config.json` and scopes the cache refresh to that project's `localRoot`.
144
+ 2. `sync --all-projects` runs `status`, `diff`, `pull`, or `bootstrap` once per runnable local project, skips ambiguous local projects without `localRoot` when multiple local projects exist, and reports project-level errors without fail-fast.
145
+ 3. `sync pull` and `sync bootstrap` are project-level mirror commands. Use `--hosted-project-id|--hosted-project-name|--hosted-project-slug` to refresh hosted prompt/skill mirrors for additional hosted projects.
146
+ 4. To author PM records, use the hosted `pm --project-slug` CRUD path described in `aops-cli-projectman`; sync does not write server records.
147
+
148
+ ## Archive Lifecycle
149
+
150
+ Archive is currently documented in `aops-cli-core` rather than a separate skill because the shipped surface is a core CLI cleanup lifecycle over existing Projectman/Agentspace tools. Split it into `aops-cli-archive` only if it grows into a broader domain with its own guide and workflows.
151
+
152
+ ```bash
153
+ aops-cli archive create --project-slug aops --apply --json
154
+ aops-cli archive verify --manifest .aops/archive/aops/<ts>/manifest.json --apply --json
155
+ aops-cli archive delete --manifest .aops/archive/aops/<ts>/manifest.json --json
156
+ aops-cli archive delete --manifest .aops/archive/aops/<ts>/manifest.json --apply --confirm --json
157
+ aops-cli archive decommission-check --manifest .aops/archive/aops/<ts>/manifest.json --json
158
+ ```
159
+
160
+ Shipped behavior:
161
+
162
+ 1. `archive create` downloads the hosted Projectman graph to `.aops/archive/<slug>/<timestamp>` and writes a local bundle. It does not delete hosted records.
163
+ 2. New manifests are intentionally partial: `partial: true`, `decommissionSafe: false`, and non-empty `pendingDomains` for `agentspace.memory`, `agentspace.discussions`, `agentspace.chat`, and hosted reusable assets. This blocks full project/scope decommission until other domains are handled.
164
+ 3. `archive verify` re-fetches the hosted PM graph and compares local files to remote counts/checksums. With `--apply`, it persists `verification.status: passed` into the manifest.
165
+ 4. `archive delete` requires a verified manifest. Without `--apply`, it is a preview. Destructive hosted deletion requires `--apply --confirm`.
166
+ 5. Delete order is children-before-parents: review requests, feedback, issues, microtasks, sprints, tasks, board-column links, columns, boards. The manifest records per-action deletion state so reruns skip already `deleted` or `missing` actions.
167
+ 6. `archive decommission-check` allows full project/scope decommission only when `decommissionSafe === true` and `pendingDomains` is empty. The current create flow leaves this blocked by design.
168
+ 7. Archive uses existing hosted tools (`agentspace.project.get-by-id`, Projectman list/get/delete tools). There is no new hosted archive tool in the agent catalog.
169
+
170
+ ## Doc Reading Ladder
171
+
172
+ Use this ladder when a skill points to docs:
173
+
174
+ ```bash
175
+ # broad project guide search, local mirror when available
176
+ aops-cli doc scope search --project-slug aops --q "<keyword>" --local --json
177
+
178
+ # search within a known saved document version
179
+ aops-cli doc search --document-version-id <docver-id> --q "<keyword>" --local --json
180
+
181
+ # hosted structure/id probe; can still be large on big docs
182
+ aops-cli doc outline get --document-version-id <docver-id> --titles-only --depth 0 --json
183
+
184
+ # actual mirrored section body
185
+ aops-cli view doc-page <document-slug>#<section-slug> --max-bytes 6000
186
+ ```
187
+
188
+ `doc scope search` is broad and can rank source docs above guide docs. `doc search --local` is retrieval/search, not guaranteed full section body. `doc outline get --titles-only` drops page bodies but still returns link/section/page metadata, so use it for ids rather than as a compact table of contents. `view doc-page` selectors use `<document-slug-or-uid>#<exact-heading-or-heading-slug>`; partial keywords and group paths do not resolve. There is no `aops-cli docman ... --slug` command.
189
+
190
+ ## Schema Fallback Ladder
191
+
192
+ Before direct hosted payloads:
193
+
194
+ ```bash
195
+ aops-cli agent schema --tool <domain>.<operation> --summary --json
196
+ ```
197
+
198
+ `--summary` flattens nested fields into compact `path`, `type`, `required`, and enum rows, plus next-step hints. Use full `--json` only when you need the complete JSON Schema.
199
+
200
+ If the compact summary marks `opaque: true`, or if full schema only exposes a flexible envelope such as `{ "data": { "additionalProperties": true } }`, use this order:
201
+
202
+ 1. Matching sugar `--help`, if sugar exists.
203
+ 2. Existing read shape from list/get/detail commands.
204
+ 3. Domain `USER_GUIDE.md` and architecture docs.
205
+ 4. `aops-cli agent openapi --domain <domain> --json` or the HTTP detail endpoint `GET /api/agent/tools/{toolId}`.
206
+ 5. Source Zod/schema only when authoring direct invoke or debugging a wrapper bug.
207
+
208
+ If sugar returns 400/validation errors, stop retrying random flag variants. Compare sugar payload with `agent schema --summary` and then full schema/OpenAPI as needed; use raw `agent invoke` as a temporary bypass only after the contract is known, or file a wrapper bug.
209
+
210
+ ## Anti-Patterns
211
+
212
+ 1. Guessing flags or payload fields from memory.
213
+ 2. Treating `aops-cli` as the domain owner.
214
+ 3. Hand-editing `.aops/hosted/**` or `.aops/docman/**` mirrors, or the `.aops/projectman/**` / `.aops/agentspace/**` local cache, as canonical truth.
215
+ 4. Assuming `sync pull` refreshes Docman guide mirrors.
216
+ 5. Treating `--yes` as the missing write guard.
217
+ 6. Reading whole guides when a targeted search plus `view doc-page` is enough.
218
+ 7. Treating `sync` as a way to write server records; sync only refreshes the read-only local cache, while PM/memory/discuss authoring is hosted (`pm|mem|discuss --project-slug`).
219
+ 8. Using `archive delete` before `archive verify --apply`, or treating `decommission-check` as passed while `pendingDomains` is non-empty.
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: aops-cli-discuss
3
+ version: 3
4
+ description: "Use when an AI agent runs a standalone server-canonical AI discussion topic with aops-cli: the design-decision ritual (independent research, two-agent turn protocol, kind=final-stance, deterministic conclude outputs), slug-first selectors, and JSON-driven stop-state reads. discuss = the decision/consensus surface only; coordinate/wake via aops-cli-chat, track review + execution truth via aops-cli-projectman. Thin discipline guide; canonical mechanics live in .aops/docman/domain-guides/agentspace-user-guide.md and command --help."
5
+ metadata:
6
+ supersedes: "v2"
7
+ short-description: "AOPS CLI standalone discuss / decision-ritual guide"
8
+ tags:
9
+ - cli
10
+ - agentspace
11
+ - discussion
12
+ - discuss
13
+ - decision-ritual
14
+ - consensus-gate
15
+ - two-agent-protocol
16
+ - conclude-outputs
17
+ - standalone
18
+ ---
19
+
20
+ # AOPS CLI Discuss
21
+
22
+ `aops-cli discuss` manages **standalone AI discussion topics** that are server-canonical (hosted discuss authoring): create, append turns, and read through the hosted gateway. `.aops/agentspace/discussions/**` is a read-only local cache of that server state, refreshed by `sync pull`. discuss is the decision/consensus surface in the AOPS coordination triad:
23
+
24
+ - **`aops-cli chat`** (hosted rooms/channels) = coordination, wake, catch-up → `aops-cli-chat`.
25
+ - **`aops-cli pm`** (review-request/result, issue, feedback) = review + execution truth → `aops-cli-projectman`.
26
+ - **`aops-cli discuss`** (standalone) = consensus / decision protocol → this skill.
27
+
28
+ There is **no automatic decision bridge**: `discuss conclude` only writes its own conclude outputs. Surfacing a concluded decision to PM or a chat room is an **explicit** step (see "Explicit linking" below). `discuss` is standalone-only — there is no `--session` flag and no session ledger.
29
+
30
+ This skill is a **thin discipline guide**: discovery, the design-decision ritual, the two-agent automation protocol, slug-first selectors, anti-patterns, and pointers. Deep mechanics, full exit-code matrices, and troubleshooting live in the canonical Agentspace User Guide. When this skill conflicts with `aops-cli discuss --help` or the user guide, **those win**.
31
+
32
+ ## Roles are operator-only (read first)
33
+
34
+ Participant roles for any discussion — initiator/driver, peer, primary, reviewer — are **operator-driven**. Do not auto-default by agent name (`codex`, `claude`), runtime brand (Codex CLI, Claude Code), or prior-session convention; the literal `codex`/`claude` ids in the examples below are illustrative pairs, **not defaults**. If the operator did not specify who plays which role, **ASK** before starting the topic or writing the first turn.
35
+
36
+ ## Use another skill for
37
+
38
+ | Need | Skill |
39
+ |------|-------|
40
+ | Coordination / wake / catch-up (hosted rooms, DMs) | `aops-cli-chat` |
41
+ | Review-request/result, re-review, issues, feedback | `aops-cli-projectman` |
42
+ | CLI guard flags, sync, hosted mirror mechanics | `aops-cli-core` |
43
+ | Document graph authoring/search | `aops-cli-docman` |
44
+ | Memory / project / prompt / resource / skill assets | `aops-cli-agentspace` |
45
+ | File snapshots / diff / restore | `aops-cli-fileman` |
46
+
47
+ ## Canonical sources (authoritative)
48
+
49
+ When this skill is silent, ambiguous, or out of date, **defer to these**:
50
+
51
+ 1. `.aops/docman/domain-guides/agentspace-user-guide.md` — semantics for discuss topics, turns, the decision ritual, and loop discipline. Reference sections by name (numbers drift), e.g.:
52
+ - "Coordination semantics (loop discipline and exit codes)" (search: exit code, loop discipline, wait, self-wakeup)
53
+ - "Coordination semantics (review-request reply pairing)" (search: review-result, projectman.review-request, discussion-topic ref)
54
+ - "Anti-patterns appendix" (search: anti-patterns, lifecycle, decision ledger)
55
+ - "Troubleshooting" (search: troubleshooting, ready-to-conclude, open question block)
56
+ 2. `aops-cli discuss --help` and nested subcommand help — flag-level detail and the current argument schema.
57
+ 3. Section-focused reading via the doc discovery ladder (see **Pointers** below).
58
+ 4. Read-only local cache: `.aops/agentspace/discussions/topics/<slug>-<topic-slug>/` (`topic.md`, `turns/*.md`, `outputs/*.md`) mirrors server state for offline reads; author through the hosted CLI, not by hand-editing the cache.
59
+
60
+ ## Discovery: which command for what
61
+
62
+ | Need | Command |
63
+ |------|---------|
64
+ | Start a standalone decision topic | `aops-cli discuss start --title <t> --slug <topic-slug> --agent <a> --agent <b> --question <q> --apply --json` |
65
+ | Child topic referencing a prior one (parent unchanged) | `aops-cli discuss follow-up --from <topic-slug> ... --apply --json` |
66
+ | Branch/alternative from an existing topic (parent unchanged) | `aops-cli discuss fork --from <topic-slug> ... --apply --json` |
67
+ | Child-topic lineage tree for one root | `aops-cli discuss lineage --id <topic-slug> --json` |
68
+ | List topics (filter by status/scope/agent/subject) | `aops-cli discuss list --status active --scope standalone --json` |
69
+ | Full topic with turns + outputs | `aops-cli discuss get --id <topic-slug> --json` |
70
+ | Append one turn | `aops-cli discuss turn --topic <topic-slug> --agent <a> --kind <kind> --from-file <path> --apply --json` |
71
+ | Deterministic state (next speaker, open questions, guards) | `aops-cli discuss status --id <topic-slug> --json` |
72
+ | Poll until your turn / block / ready | `aops-cli discuss wait --id <topic-slug> --for <a> --timeout-sec <s> --interval-sec <s> --json` |
73
+ | Persistent automation loop prompt | `aops-cli discuss loop-prompt --id <topic-slug> --for <a> --json` |
74
+ | Non-interpretive context pack | `aops-cli discuss digest --id <topic-slug> --json` |
75
+ | Write conclude scaffolds, move to `concluding` | `aops-cli discuss conclude --topic <topic-slug> --apply --json` |
76
+ | Mark an invalid/unwanted topic abandoned | `aops-cli discuss abandon --topic <topic-slug> --apply --json` |
77
+
78
+ Turn kinds: `statement | question | answer | objection | concession | proposal | final-stance`. Discuss topics are server-canonical (hosted authoring); `.aops/agentspace/discussions/**` is a read-only cache refreshed by `sync pull`. There is no auto-promote into memory/experience — promotion stays explicit.
79
+
80
+ ## Mandatory design-decision ritual (standalone)
81
+
82
+ Use this whenever the operator asks for a collaborative architecture/design discussion before implementation, a peer consensus, or implementation only after another agent has independently argued/reviewed the design.
83
+
84
+ 1. **Start the topic** with at least two unique operator-assigned participants; give the operator the topic slug and a paste-ready peer join prompt (`discuss status --id <slug> --prompt-for-next --json`) before waiting.
85
+ 2. **Independent research before the first substantive turn.** Tell the peer to research and form its own position, not merely validate the opener's plan. Each participant grounds its opening turn in its own reading.
86
+ 3. **At least four substantive non-final turns** (analysis / proposal / objection / question / answer / concession). `final-stance` turns, bare acknowledgements, and operator-addressed questions do **not** count toward that floor. A `--require-question-answer` topic blocks other turn kinds while an operator/peer question is open — answer it first.
87
+ 4. **Each participant files a `kind=final-stance` turn.** This append-only turn under `turns/*.md` is the canonical final stance — not the `outputs/<agent>-final-stance.md` scaffold that `conclude` later writes.
88
+ 5. **Confirm completeness from JSON, never prose.** Read `discuss status --id <slug> --json`: check `lifecycleState` and `missingTurnFinalStances` (and `outputs.missingFinalStances` when present). Do not infer "everyone is done" from turn text or shell wrapper wording.
89
+ 6. **Only after all final stances exist, run `discuss conclude`.** It scaffolds `outputs/<agent>-final-stance.md`, `consensus.md`, `disagreement.md`, `open-questions.md` and moves the topic to `concluding`. `conclude` is **blocked while an open question remains**. It does **not** finalize the discussion — the **initiator/driver** (the recorded output owner) then reviews and finalizes `consensus.md` / `disagreement.md` / `open-questions.md` with **no `_TBD_` placeholders**. Either agent may run `conclude`; running it does not lock ownership.
90
+ 7. **Implementation stays blocked** until the operator explicitly approves the consensus or grants a recorded override. If the operator changes the ritual mid-discussion, treat the stricter rule as binding even if the topic opened with a weaker `--min-turns-before-conclude`.
91
+
92
+ ## Workflow: standalone discuss → conclude
93
+
94
+ ```bash
95
+ aops-cli discuss start --title "<decision>" --slug <topic-slug> \
96
+ --agent codex --agent claude --question "<architecture question>" \
97
+ --min-turns-before-conclude 4 --apply --json
98
+ aops-cli discuss turn --topic <topic-slug> --agent claude --kind statement --from-file ./context.md --apply --json
99
+ aops-cli discuss wait --id <topic-slug> --for codex --timeout-sec 540 --interval-sec 5 --json
100
+ # iterate substantive turns (statement/proposal/objection/question/answer/concession),
101
+ # reading `discuss status --json` between waits, until >=4 non-final turns exist
102
+ aops-cli discuss turn --topic <topic-slug> --agent claude --kind final-stance --from-file ./final-claude.md --apply --json
103
+ aops-cli discuss turn --topic <topic-slug> --agent codex --kind final-stance --from-file ./final-codex.md --apply --json
104
+ aops-cli discuss status --id <topic-slug> --json # confirm missingTurnFinalStances is empty
105
+ aops-cli discuss conclude --topic <topic-slug> --apply --json
106
+ # then the initiator/driver finalizes outputs/consensus.md|disagreement.md|open-questions.md (no _TBD_)
107
+ ```
108
+
109
+ Read `lifecycleState`, `nextTurn`, `missingTurnFinalStances`, and `outputs.missingFinalStances` from JSON; never infer stop state from prose. Output ownership defaults to the discussion **driver** (often, but not always, the topic initiator — the driver may differ from a participant who merely ran `conclude`).
110
+
111
+ ## Two-agent automation protocol
112
+
113
+ When two agents drive a topic on their own, each loops on `discuss wait` keyed to its own id. Read the structured `exitCode` (same value as the process exit code and as `result.wait.exitCode`):
114
+
115
+ | Exit | Meaning | Do |
116
+ |------|---------|----|
117
+ | `0` | Requested agent may write the next turn | Write `discuss turn ... --agent <you> --expect-next <you> ...`, then re-`wait`. |
118
+ | `20` | Blocked by an operator-addressed open question/block | **Stop and return to the operator** — an agent cannot clear an operator block. |
119
+ | `21` | Ready to conclude / concluding / concluded / abandoned | Do **not** write more turns; proceed to `conclude` (or stop if already concluded/abandoned). |
120
+ | `22` | Timeout, no change | Re-poll (`wait` again) if still waiting; otherwise do other non-overlapping work. |
121
+
122
+ `--expect-next` is a race guard and **must equal `--agent`**: it requires that the deterministic next turn already allows that agent, so two automated writers never collide. On a sequence collision, re-read `discuss status` and retry. `discuss loop-prompt --id <slug> --for <agent>` prints a ready-made persistent loop for operator-started automation.
123
+
124
+ ## Explicit linking (no auto bridge)
125
+
126
+ A concluded decision does **not** propagate anywhere by itself. Surface it explicitly:
127
+
128
+ - **To Projectman** — carry the discussion-topic ref into a PM record so review/execution truth references the decision:
129
+
130
+ ```bash
131
+ aops-cli pm feedback create --title "<decision applied>" \
132
+ --description "Consensus from discussion-topic <topic-slug>: <decision summary>" --apply --json
133
+ aops-cli pm issue create --title "<follow-up from decision>" --severity <sev> \
134
+ --description "Per discussion-topic <topic-slug> consensus" --apply --json
135
+ ```
136
+
137
+ - **To a chat room** — bind the topic so the room shows where the decision lives (rooms are FLOW, not the decision ledger):
138
+
139
+ ```bash
140
+ aops-cli chat binding add --room-id <id> --binding-type agentspace.discussion-topic \
141
+ --ref-id <topic-uid> --title "<decision>" --created-by <agent> --apply --json
142
+ ```
143
+
144
+ This replaces the retired `collab start --from-discuss` / conclude-writeback path. There is no implicit promotion into memory either — write a memory item with a `agentspace.discussion-topic` source-ref if the decision is durable (see `aops-cli-agentspace`).
145
+
146
+ ## Slug-first selector contract
147
+
148
+ 1. Operator text, handoffs, and links use the **topic slug** (`--id` / `--topic`), not raw UUIDs; raw UUIDs stay in JSON/debug.
149
+ 2. A legacy folder-name or implicit short-id match emits `cliDeprecationWarnings` in JSON — treat that as a signal to rewrite future instructions to the slug.
150
+ 3. If a slug is ambiguous, run `aops-cli discuss list --status active --agent <agent> --limit <n> --json` and retry with `--short-id <8char>` from the matching row. Use `--prefer-active` only when an ambiguous selector has exactly one active match.
151
+
152
+ ## Pointers
153
+
154
+ - **Agentspace User Guide** by document title + **section name** + keywords (not bare numbers): "Coordination semantics (loop discipline and exit codes)" (search: exit code, wait, loop discipline), "Coordination semantics (review-request reply pairing)" (search: discussion-topic ref, review-result), "Anti-patterns appendix" (search: decision ledger, lifecycle), "Troubleshooting" (search: ready-to-conclude, open question block).
155
+ - **Help is canonical:** `aops-cli discuss --help`, then `aops-cli discuss start|turn|wait|status|conclude|list|follow-up|fork|lineage|loop-prompt|digest|abandon --help`.
156
+ - **Doc discovery ladder** (section-focused reading, no id needed): `aops-cli doc scope search --project-slug aops --q "<keyword>" --local --json`, then targeted `aops-cli doc search --document-version-id <docver-id> --q "<keyword>" --local --json` and `aops-cli doc outline get --document-version-id <docver-id> --json`. There is no `aops-cli docman … --slug` command — use the ladder; reference sections by title + section name + keywords, not bare numbers.
157
+ - **Tool Input Schema:** before authoring `--data`/`--input`/`--patch` payloads for any hosted write, fetch the live JSON Schema first (`aops-cli agent schema --tool <domain>.<operation>`). Full explanation in `aops-cli-core` (Tool Input Schema section).
158
+
159
+ ## Top anti-patterns
160
+
161
+ 1. **Implementing before the operator approves the consensus** (or before a recorded override).
162
+ 2. **Inferring stop-state from prose** instead of reading JSON `lifecycleState` / `missingTurnFinalStances` / `wait` `exitCode`.
163
+ 3. **Leaving `_TBD_` placeholders** in `consensus.md` / `disagreement.md` / `open-questions.md` after `conclude`; the output owner must finalize them.
164
+ 4. **Concluding before all `kind=final-stance` turns exist**, or treating the `outputs/<agent>-final-stance.md` scaffold as the canonical stance instead of the `turns/*.md` final-stance record.
165
+ 5. **Treating a chat room (or chat in general) as the decision ledger** — the durable decision is the discuss topic + its conclude outputs; bind it into chat, do not decide only in chat.
166
+ 6. **Auto-defaulting participant roles** by agent name / runtime brand / convention instead of taking them from the operator.
167
+ 7. **Setting `--expect-next` to a different agent than `--agent`**, or ignoring a `20` (operator block) by trying to write through it.
168
+ 8. **Hand-editing the `.aops/agentspace/discussions/**` cache** as if it were authoring truth; it is a read-only mirror of server state — author through the hosted CLI and refresh with `sync pull`.
169
+
170
+ ---
171
+
172
+ If `--help` and this skill disagree, **`--help` wins** (canonical command surface). If the user guide and this skill disagree, **the user guide wins**.
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: aops-cli-docman
3
+ version: 14
4
+ description: "Use when an AI agent needs the AOPS CLI Docman playbook: composable document authoring, CRUD-first edits, guarded import, safe delete, publish and mirror refresh, and index/summary/search/answer retrieval gates."
5
+ metadata:
6
+ supersedes: "v13"
7
+ short-description: "AOPS CLI Docman thin discipline guide"
8
+ tags:
9
+ - cli
10
+ - docman
11
+ - documents
12
+ - composable
13
+ - retrieval
14
+ - crud-first
15
+ - safe-delete
16
+ - publish
17
+ - mirror
18
+ - help-first
19
+ ---
20
+
21
+ # AOPS CLI Docman
22
+
23
+ Docman owns canonical written knowledge as a composable graph:
24
+ document -> document version -> section -> page -> page version -> links.
25
+
26
+ This is a thin agent guide. Deep mechanics live in the current `Docman User Guide`; exact flags live in `aops doc ... --help`. Help wins for flags, the guide wins for normative workflow, and the running server schema wins for raw payloads.
27
+
28
+ ## Start Here
29
+
30
+ 1. Read `aops doc --help`, then the smallest nested `--help` surface.
31
+ 2. Refresh the repo mirror when freshness matters:
32
+ `aops doc mirror pull --project-slug <slug> --apply --json`.
33
+ 3. Find the smallest relevant guide section with local search or `view doc-page`.
34
+ 4. Inspect the current document/version/outline before any write.
35
+ 5. Prefer section/page CRUD for a targeted change; do not rebuild a whole document unnecessarily.
36
+ 6. After a published content change, rebuild index and summary, test search and answer, then refresh the mirror.
37
+
38
+ The installed launcher may be `aops`; the package launcher is `aops-cli`.
39
+
40
+ ## Use This Skill For
41
+
42
+ - creating and reading document groups, documents, and versions;
43
+ - composable section/page authoring and targeted page-version edits;
44
+ - guarded Markdown import when the whole structure changes;
45
+ - publishing a current version and refreshing mirrors;
46
+ - index, summary, search, answer, source, and materialization reads;
47
+ - guarded deletion of a disposable document.
48
+
49
+ Use `aops-cli-core` for repo context and guard flags, `aops-cli-projectman` for execution/review truth, `aops-cli-discuss` for design decisions, and `aops-cli-agentspace` for durable memory and reusable assets.
50
+
51
+ ## Canonical Sources
52
+
53
+ 1. Hosted `Docman User Guide` in `slug:aops` for deep mechanics.
54
+ 2. `domains/docman/USER_GUIDE.md` for domain-development source parity.
55
+ 3. `domains/docman/architecture.md` for ownership boundaries.
56
+ 4. Live help: `aops doc <group> <command> --help`.
57
+ 5. Live discovery: `aops agent tools --domain docman --summary --json`.
58
+ 6. Raw schema: `aops agent schema --tool docman.<operation> --summary --json`.
59
+
60
+ `.aops/docman/**` is a read-only cache. Never hand-edit it as canonical truth.
61
+
62
+ ## Command Map
63
+
64
+ | Need | Primary surface |
65
+ |---|---|
66
+ | Find ids and structure | `doc list`, `doc version list`, `doc outline get`, `doc source` |
67
+ | Edit one page body | `doc version create --init-mode clone_all`, `doc page draft-save`, `doc page-version update` |
68
+ | Edit metadata | `doc section update`, `doc page update` |
69
+ | Add or reorder graph nodes | `doc section create`, `doc page create`, `doc link`, `doc order` |
70
+ | Import a complete Markdown structure | `doc import --baseline --guard-target --dry-run` |
71
+ | Publish current truth | `doc set-current-version --publish-now` |
72
+ | Retrieval gates | `doc index build`, `doc summary build`, `doc search`, `doc answer` |
73
+ | Refresh local cache | `doc mirror pull` |
74
+ | Delete a disposable document | `doc delete --id --confirm-name --preview`, then reviewed `--apply --confirm` |
75
+ | Raw fallback | `agent schema`, then `agent invoke` only when sugar is insufficient |
76
+
77
+ ## Composable Authoring Rule
78
+
79
+ All durable guides, ADR logs, specs, and comparable knowledge documents should be structured as meaningful sections and pages. Avoid one giant page when independent sections can preserve meaning and be retrieved separately.
80
+
81
+ Every new published version should support this read path:
82
+
83
+ ```bash
84
+ aops doc index build --document-version-id <docver-id> --json
85
+ aops doc summary build --document-version-id <docver-id> --json
86
+ aops doc search --document-version-id <docver-id> --q "<known fact>" --remote --json
87
+ aops doc answer --document-version-id <docver-id> --q "<question>" --remote --json
88
+ aops doc mirror pull --project-slug <slug> --document-slug <slug> --apply --json
89
+ ```
90
+
91
+ Review citations as well as the generated answer. Retrieval is deterministic assistance, not authority to ignore the cited source.
92
+
93
+ ## Safe Targeted Page Edit
94
+
95
+ ```bash
96
+ aops doc version create --document-id <doc-id> --version <next-n> \
97
+ --status draft --init-mode clone_all --source-version-id <current-docver-id> \
98
+ --apply --json
99
+
100
+ aops doc outline get --document-version-id <new-docver-id> \
101
+ --titles-only --depth 3 --json
102
+
103
+ aops doc page draft-save --page-version-id <pagever-id> \
104
+ --document-link-id <section-page-link-id> --content '@./target-page.md' \
105
+ --apply --json
106
+
107
+ aops doc page-version update --id <new-pagever-id> --status published --apply --json
108
+ aops doc set-current-version --document-id <doc-id> --version-id <new-docver-id> \
109
+ --expected-previous-version-id <old-docver-id> --publish-now --apply --json
110
+ ```
111
+
112
+ Use a real file or JSON encoder for multiline content. Do not pass literal `\\n` text and assume it became a newline.
113
+
114
+ ## Full Import Guard
115
+
116
+ Use full import only when the complete document structure truly changes:
117
+
118
+ ```bash
119
+ aops doc import --from-markdown --document-version-id <docver-id> \
120
+ --source ./candidate.md \
121
+ --baseline ./.aops/docman/<group>/<document>.md \
122
+ --guard-target "<intended heading path or title>" \
123
+ --dry-run --json
124
+ ```
125
+
126
+ Apply only after reviewing the baseline guard and unrelated deltas. If the plan reports `section-direct-body-ignored`, stop; use the documented overview-page synthesis only when direct section prose must become leaf pages.
127
+
128
+ ## Safe Disposable Delete
129
+
130
+ Read back the exact document id and title. Preview first:
131
+
132
+ ```bash
133
+ aops doc delete --project-slug <slug> --id <document-id> \
134
+ --confirm-name '<exact current title>' --preview --json
135
+ ```
136
+
137
+ Apply only to the verified disposable record:
138
+
139
+ ```bash
140
+ aops doc delete --project-slug <slug> --id <document-id> \
141
+ --confirm-name '<exact current title>' --apply --confirm --json
142
+ ```
143
+
144
+ An exact-title mismatch is a `confirmName` validation error and must not delete the record. After a successful delete, a hosted get should return not found. A repo mirror may remain stale until the next mirror pull; stale mirror bytes do not mean the canonical record still exists.
145
+
146
+ ## Reading Ladder
147
+
148
+ ```bash
149
+ # broad local discovery
150
+ aops doc scope search --project-slug aops --q "<topic>" --local --json
151
+
152
+ # known-version retrieval
153
+ aops doc search --document-version-id <docver-id> --q "<topic>" --local --json
154
+
155
+ # structure and ids
156
+ aops doc outline get --document-version-id <docver-id> --titles-only --depth 2 --json
157
+
158
+ # exact mirrored section body
159
+ aops view doc-page <document-slug>#<exact-heading-or-slug> --max-bytes 6000
160
+ ```
161
+
162
+ Use `doc search --remote` or `doc answer --remote` after canonical changes and before mirror refresh. Use `--local` only when the mirror is known to be current or hosted access is unavailable.
163
+
164
+ ## Schema Fallback
165
+
166
+ Before raw writes:
167
+
168
+ ```bash
169
+ aops agent schema --tool docman.<operation> --summary --json
170
+ ```
171
+
172
+ Sugar option names may differ from raw schema fields. Sugar help wins for `aops doc`; schema wins for `agent invoke`. Do not guess payload fields or retry with invented flags.
173
+
174
+ ## Anti-Patterns
175
+
176
+ 1. Hand-editing `.aops/docman/**` as canonical truth.
177
+ 2. Full import for a one-page edit.
178
+ 3. Publishing without current-version and expected-previous guards.
179
+ 4. Skipping index/summary/search/answer after a guide or ADR change.
180
+ 5. Reviewing a stale mirror after a hosted write.
181
+ 6. Treating `--confirm` as routine instead of a reviewed destructive gate.
182
+ 7. Deleting by broad selector, guessed title, or an unverified id.
183
+ 8. Copying the entire user guide into this skill.
184
+
185
+ ## Done When
186
+
187
+ - the intended current version is published;
188
+ - index and summary builds succeed;
189
+ - a known-fact search and citation-first answer reach the new section;
190
+ - the targeted mirror reports the current version id;
191
+ - any public asset is regenerated from canonical output;
192
+ - temporary records and files are removed without touching unrelated state.