orbitmap 0.3.0 → 0.4.1

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 (174) hide show
  1. package/README.md +546 -212
  2. package/dist/adapters/cloud.d.ts +367 -0
  3. package/dist/adapters/cloud.js +582 -0
  4. package/dist/adapters/cloud.js.map +1 -0
  5. package/dist/adapters/factory.d.ts +15 -0
  6. package/dist/adapters/factory.js +31 -0
  7. package/dist/adapters/factory.js.map +1 -0
  8. package/dist/adapters/local/adapter.d.ts +351 -0
  9. package/dist/adapters/local/adapter.js +346 -0
  10. package/dist/adapters/local/adapter.js.map +1 -0
  11. package/dist/adapters/local/context.d.ts +112 -0
  12. package/dist/adapters/local/context.js +137 -0
  13. package/dist/adapters/local/context.js.map +1 -0
  14. package/dist/adapters/local/entities/documents.d.ts +85 -0
  15. package/dist/adapters/local/entities/documents.js +251 -0
  16. package/dist/adapters/local/entities/documents.js.map +1 -0
  17. package/dist/adapters/local/entities/planning.d.ts +108 -0
  18. package/dist/adapters/local/entities/planning.js +540 -0
  19. package/dist/adapters/local/entities/planning.js.map +1 -0
  20. package/dist/adapters/local/entities/tasks.d.ts +95 -0
  21. package/dist/adapters/local/entities/tasks.js +442 -0
  22. package/dist/adapters/local/entities/tasks.js.map +1 -0
  23. package/dist/adapters/local/entities/work-items.d.ts +110 -0
  24. package/dist/adapters/local/entities/work-items.js +623 -0
  25. package/dist/adapters/local/entities/work-items.js.map +1 -0
  26. package/dist/adapters/local/rules.d.ts +172 -0
  27. package/dist/adapters/local/rules.js +319 -0
  28. package/dist/adapters/local/rules.js.map +1 -0
  29. package/dist/adapters/local/shapes.d.ts +209 -0
  30. package/dist/adapters/local/shapes.js +558 -0
  31. package/dist/adapters/local/shapes.js.map +1 -0
  32. package/dist/adapters/local/store.d.ts +200 -0
  33. package/dist/adapters/local/store.js +665 -0
  34. package/dist/adapters/local/store.js.map +1 -0
  35. package/dist/adapters/local/types.d.ts +226 -0
  36. package/dist/adapters/local/types.js +41 -0
  37. package/dist/adapters/local/types.js.map +1 -0
  38. package/dist/adapters/types.d.ts +332 -0
  39. package/dist/adapters/types.js +2 -0
  40. package/dist/adapters/types.js.map +1 -0
  41. package/dist/agent-instructions.d.ts +25 -9
  42. package/dist/agent-instructions.js +285 -237
  43. package/dist/agent-instructions.js.map +1 -1
  44. package/dist/api-client.d.ts +8 -239
  45. package/dist/api-client.js +8 -403
  46. package/dist/api-client.js.map +1 -1
  47. package/dist/commands/agents.d.ts +1 -1
  48. package/dist/commands/agents.js +10 -10
  49. package/dist/commands/agents.js.map +1 -1
  50. package/dist/commands/areas.d.ts +3 -0
  51. package/dist/commands/areas.js +29 -0
  52. package/dist/commands/areas.js.map +1 -0
  53. package/dist/commands/assign.d.ts +3 -2
  54. package/dist/commands/assign.js +52 -15
  55. package/dist/commands/assign.js.map +1 -1
  56. package/dist/commands/context.d.ts +1 -1
  57. package/dist/commands/context.js +18 -12
  58. package/dist/commands/context.js.map +1 -1
  59. package/dist/commands/create-area.d.ts +7 -0
  60. package/dist/commands/create-area.js +29 -0
  61. package/dist/commands/create-area.js.map +1 -0
  62. package/dist/commands/create.d.ts +3 -1
  63. package/dist/commands/create.js +5 -8
  64. package/dist/commands/create.js.map +1 -1
  65. package/dist/commands/dep.d.ts +2 -2
  66. package/dist/commands/dep.js +3 -3
  67. package/dist/commands/dep.js.map +1 -1
  68. package/dist/commands/doc-import.d.ts +1 -1
  69. package/dist/commands/doc-import.js +2 -2
  70. package/dist/commands/doc-import.js.map +1 -1
  71. package/dist/commands/doc-patch.d.ts +1 -1
  72. package/dist/commands/doc-patch.js +2 -2
  73. package/dist/commands/doc-patch.js.map +1 -1
  74. package/dist/commands/doc-share.d.ts +6 -6
  75. package/dist/commands/doc-share.js +13 -13
  76. package/dist/commands/doc-share.js.map +1 -1
  77. package/dist/commands/doc-update.d.ts +1 -1
  78. package/dist/commands/doc-update.js +2 -2
  79. package/dist/commands/doc-update.js.map +1 -1
  80. package/dist/commands/doc.d.ts +1 -1
  81. package/dist/commands/doc.js +5 -4
  82. package/dist/commands/doc.js.map +1 -1
  83. package/dist/commands/docs-cache.d.ts +2 -2
  84. package/dist/commands/docs-cache.js +3 -3
  85. package/dist/commands/docs-cache.js.map +1 -1
  86. package/dist/commands/docs.d.ts +1 -1
  87. package/dist/commands/docs.js +2 -2
  88. package/dist/commands/docs.js.map +1 -1
  89. package/dist/commands/get.d.ts +1 -1
  90. package/dist/commands/get.js +43 -3
  91. package/dist/commands/get.js.map +1 -1
  92. package/dist/commands/ideas.d.ts +4 -4
  93. package/dist/commands/ideas.js +6 -11
  94. package/dist/commands/ideas.js.map +1 -1
  95. package/dist/commands/init.d.ts +45 -3
  96. package/dist/commands/init.js +452 -104
  97. package/dist/commands/init.js.map +1 -1
  98. package/dist/commands/intent.d.ts +41 -0
  99. package/dist/commands/intent.js +237 -0
  100. package/dist/commands/intent.js.map +1 -0
  101. package/dist/commands/issues.d.ts +6 -5
  102. package/dist/commands/issues.js +8 -12
  103. package/dist/commands/issues.js.map +1 -1
  104. package/dist/commands/log.d.ts +1 -1
  105. package/dist/commands/log.js +2 -2
  106. package/dist/commands/log.js.map +1 -1
  107. package/dist/commands/mission.d.ts +42 -0
  108. package/dist/commands/mission.js +219 -0
  109. package/dist/commands/mission.js.map +1 -0
  110. package/dist/commands/orbit.d.ts +40 -3
  111. package/dist/commands/orbit.js +231 -58
  112. package/dist/commands/orbit.js.map +1 -1
  113. package/dist/commands/overview.d.ts +2 -2
  114. package/dist/commands/overview.js +25 -28
  115. package/dist/commands/overview.js.map +1 -1
  116. package/dist/commands/setup-agent.d.ts +27 -0
  117. package/dist/commands/setup-agent.js +85 -30
  118. package/dist/commands/setup-agent.js.map +1 -1
  119. package/dist/commands/setup-mcp.d.ts +1 -1
  120. package/dist/commands/setup-mcp.js +20 -49
  121. package/dist/commands/setup-mcp.js.map +1 -1
  122. package/dist/commands/start.d.ts +1 -1
  123. package/dist/commands/start.js +2 -2
  124. package/dist/commands/start.js.map +1 -1
  125. package/dist/commands/status.d.ts +2 -1
  126. package/dist/commands/status.js +3 -3
  127. package/dist/commands/status.js.map +1 -1
  128. package/dist/commands/subtask.d.ts +1 -1
  129. package/dist/commands/subtask.js +2 -2
  130. package/dist/commands/subtask.js.map +1 -1
  131. package/dist/commands/task-edit-content.d.ts +1 -1
  132. package/dist/commands/task-edit-content.js +2 -2
  133. package/dist/commands/task-edit-content.js.map +1 -1
  134. package/dist/commands/task.d.ts +10 -3
  135. package/dist/commands/task.js +19 -21
  136. package/dist/commands/task.js.map +1 -1
  137. package/dist/commands/tasks.d.ts +1 -1
  138. package/dist/commands/tasks.js +2 -2
  139. package/dist/commands/tasks.js.map +1 -1
  140. package/dist/commands/vibes.d.ts +4 -4
  141. package/dist/commands/vibes.js +5 -5
  142. package/dist/commands/vibes.js.map +1 -1
  143. package/dist/config.d.ts +69 -9
  144. package/dist/config.js +206 -23
  145. package/dist/config.js.map +1 -1
  146. package/dist/doc-cache.d.ts +23 -3
  147. package/dist/doc-cache.js +72 -12
  148. package/dist/doc-cache.js.map +1 -1
  149. package/dist/errors.d.ts +19 -2
  150. package/dist/errors.js +35 -0
  151. package/dist/errors.js.map +1 -1
  152. package/dist/id-resolve.d.ts +61 -0
  153. package/dist/id-resolve.js +87 -0
  154. package/dist/id-resolve.js.map +1 -0
  155. package/dist/index.js +477 -104
  156. package/dist/index.js.map +1 -1
  157. package/dist/mcp-config.d.ts +36 -0
  158. package/dist/mcp-config.js +51 -0
  159. package/dist/mcp-config.js.map +1 -0
  160. package/dist/oauth.d.ts +8 -0
  161. package/dist/oauth.js +54 -15
  162. package/dist/oauth.js.map +1 -1
  163. package/dist/output.js +7 -2
  164. package/dist/output.js.map +1 -1
  165. package/dist/paths.d.ts +97 -0
  166. package/dist/paths.js +178 -0
  167. package/dist/paths.js.map +1 -0
  168. package/dist/project-config.d.ts +75 -0
  169. package/dist/project-config.js +55 -0
  170. package/dist/project-config.js.map +1 -0
  171. package/dist/workspace-resolve.d.ts +158 -0
  172. package/dist/workspace-resolve.js +284 -0
  173. package/dist/workspace-resolve.js.map +1 -0
  174. package/package.json +53 -50
@@ -5,282 +5,330 @@
5
5
  // Equivalent of the MCP "system instructions" that are always
6
6
  // in the system prompt. Guarantees the agent always knows the
7
7
  // project uses OrbitMap and knows the workflow skeleton.
8
- // 2. CORE_INSTRUCTIONS — the deep, on-demand layer. Equivalent of the MCP tool
9
- // catalogue. Mirrors the MCP `full` profile 1:1, mapping all
10
- // 27 MCP tools onto CLI commands. Shipped two ways:
11
- // - Claude: installed as a `.claude/skills/orbitmap` skill,
8
+ // 2. The four skills — the deep, on-demand layer. Equivalent of the MCP tool
9
+ // catalogue (INSTRUCTIONS_FULL), split by topic:
10
+ // orbitmap — object model, context, command map
11
+ // orbitmap-working — task lifecycle, logging, git/delivery
12
+ // orbitmap-planning — missions, intents, ideas, issues
13
+ // orbitmap-docs — documents
14
+ // Shipped two ways:
15
+ // - Claude: one `.claude/skills/<name>/SKILL.md` per skill,
12
16
  // loaded on demand (zero per-turn context cost).
13
- // - non-Claude: inlined into the agent config file as a
14
- // markdown fallback (no skill ecosystem).
17
+ // - non-Claude: all four bodies concatenated into the agent
18
+ // config file (no skill ecosystem to lean on).
15
19
  //
16
- // Reference: the OrbitMap MCP document
17
- // `orbitmap-mcp-system-instructions-i-tools-full-lite-manager` (INSTRUCTIONS_FULL).
18
- export const SKILL_NAME = 'orbitmap';
20
+ // The content below is normative: it is transcribed from §8 of
21
+ // `docs/local-mode-poc-spec.md`, which is itself the MCP oracle
22
+ // (`orbitmap-mcp/src/orbitmap_mcp/instructions.py`, INSTRUCTIONS_FULL) translated into
23
+ // CLI-command vocabulary. Do not paraphrase it; change the spec first.
19
24
  export const MARKER_START = '<!-- ORBITMAP_START -->';
20
25
  export const MARKER_END = '<!-- ORBITMAP_END -->';
21
- // Skill frontmatter `description` this is what Claude reads every turn to decide
22
- // whether to load the skill. Keep it dense with trigger words (mirrors the MCP
23
- // "when to use Orbitmap tools" guidance).
24
- export const SKILL_DESCRIPTION = 'Manage project work tracked in OrbitMap via the `orbitmap` CLI — tasks, ' +
25
- 'backlog, subtasks, work logs, issues, ideas, vibes, documents, orbits, and ' +
26
- 'delivery status. Use whenever the user mentions OrbitMap, "orbit", a task, the ' +
27
- 'backlog, or asks to start/resume/finish/log/assign work, create or update ' +
28
- 'tasks, or read/edit project docs. Covers the full task lifecycle, the ' +
29
- 'commit-message and delivery-status conventions, and the complete MCP-to-CLI ' +
30
- 'command mapping.';
31
- // ── The deep instruction body (single source for skill + markdown fallback) ──
32
- export const CORE_INSTRUCTIONS = `# OrbitMap (CLI)
33
-
34
- OrbitMap is an agentic project management platform. This project tracks its work in
35
- OrbitMap, and you reach it through the \`orbitmap\` CLI from the shell invoke it as
36
- \`npx orbitmap <command>\` (or \`orbitmap <command>\` if installed globally). This is the
37
- CLI equivalent of the OrbitMap MCP server's **full** profile: every command below maps
38
- to an MCP tool. Add \`--json\` to any command for machine-readable output.
26
+ /** The core skill name (entry point). Kept for backwards compatibility. */
27
+ export const SKILL_NAME = 'orbitmap';
28
+ // ── Skill: orbitmap (core) §8.3 ──────────────────────────────────────────────
29
+ export const SKILL_ORBITMAP_FRONTMATTER = `---
30
+ name: orbitmap
31
+ description: >
32
+ OrbitMap project management via the orbitmap CLI. Use when the user mentions OrbitMap,
33
+ orbit, tasks, backlog, missions, intents, ideas, issues, vibes, or asks to track,
34
+ plan, or log work. Entry point: object model, context resolution, command reference.
35
+ ---`;
36
+ export const SKILL_ORBITMAP_BODY = `# OrbitMap CLI core
37
+
38
+ OrbitMap is an agentic project management platform. You interact with it exclusively
39
+ through the \`orbitmap\` CLI (run with \`npx orbitmap …\` if not on PATH). The CLI works
40
+ identically in cloud mode and local-files mode never assume which one is active, and
41
+ never read or write the workspace's data files directly. The CLI is the only interface.
39
42
 
40
43
  ## General behaviour
41
44
  - Always prioritise the user's direct request. If the user asks you to do something
42
- (e.g. read a file, write code, answer a question), handle that request first.
43
- - Only interact with OrbitMap tasks when the user explicitly asks you to
44
- (e.g. "check my tasks", "start a task", "what's on my backlog", "update docs", "create subtasks").
45
- - When the user mentions "OrbitMap", "orbit", "task", "backlog", or project management
46
- concepts in the context of tracking work, use the \`orbitmap\` CLI to handle the request.
47
-
48
- ## Project context
49
- - The CLI resolves the active project automatically from \`~/.orbitmap/config.json\`
50
- (\`project_id\`) or the \`ORBITMAP_PROJECT_ID\` env var. You normally don't pass it.
51
- - Override it for a single command with \`--project <id-or-slug>\`.
52
- - If a command errors asking for project context, run \`orbitmap projects\` to discover
53
- your projects, then retry with \`--project <id>\`.
54
- - Priority: explicit \`--project\` flag > \`ORBITMAP_PROJECT_ID\` env var > config file > auto-detect (single project).
45
+ (read a file, write code, answer a question), handle that first.
46
+ - Only interact with OrbitMap when the user explicitly asks you to (e.g. "check my
47
+ tasks", "start a task", "what's on my backlog", "log this idea").
48
+ - When the user mentions OrbitMap, orbit, task, backlog, or project-management concepts
49
+ in the context of tracking work, use \`orbitmap\` commands to handle the request.
50
+
51
+ ## Object model
52
+ - Workspace = team level. Area = repo-level scope (formerly Project) — tasks, vibes and
53
+ most issues live in an area. Mission (MS-) = time-boxed workspace focus; at most one
54
+ active. Intent (IN-) = workspace-level goal grouping tasks/issues. Idea (ID-) = future
55
+ possibility, not a problem. Issue (IS-) = problem/bug. Vibe (VB-) = ad-hoc work log
56
+ outside a task. Task (TS-) = unit of work.
57
+ - Entity numbers (TS-xxxxxx etc.) are accepted by every command that takes an id.
58
+
59
+ ## Context
60
+ - Area resolves automatically (config/env). Override per call with \`--area <slug>\`.
61
+ - If a command fails asking for area context, run \`orbitmap areas\` to list areas, then
62
+ retry with \`--area\`.
63
+ - \`orbitmap context\` shows who you are, the workspace, and the active area. Run it when
64
+ unsure.
55
65
 
56
66
  ## Task statuses
57
- Valid task statuses: \`backlog\`, \`todo\`, \`in_progress\`, \`in_review\`, \`review_changes\`, \`done\`, \`blocked\`.
58
- The default filter for \`orbitmap tasks\` is \`todo,in_progress\`. Pass \`--status <value>\`
59
- when the user explicitly asks for something else (e.g. \`orbitmap tasks --status backlog\`).
67
+ backlog, todo, in_progress, in_review, review_changes, done, blocked.
68
+ \`orbitmap tasks\` defaults to todo,in_progress. Ask for others explicitly, e.g.
69
+ \`orbitmap tasks --status backlog\` when the user asks about the backlog.
70
+
71
+ ## Command reference (all commands accept --json)
72
+ - Context: \`orbitmap context\`, \`orbitmap areas\`, \`orbitmap overview\`
73
+ - Tasks: \`orbitmap tasks [--status s1,s2]\`, \`orbitmap task TS-x\`, \`orbitmap get <ID>\`,
74
+ \`orbitmap start [TS-x]\`, \`orbitmap status TS-x <status> [--delivery <d>]\`,
75
+ \`orbitmap create "title" [--intent IN-x|--mission MS-x] [--priority p]\`,
76
+ \`orbitmap subtask TS-parent "title"\`, \`orbitmap assign TS-x [agent]\`,
77
+ \`orbitmap dep add|remove TS-a TS-b\`, \`orbitmap log TS-x "msg" --type <t>\`
78
+ - Issues: \`orbitmap issue register|list|show|status|resolve\`
79
+ - Ideas: \`orbitmap idea add|list|show|status\`
80
+ - Vibes: \`orbitmap vibe log|list|show\`
81
+ - Missions: \`orbitmap mission list|show|create|update|status|link|unlink\`
82
+ - Intents: \`orbitmap intent list|show|create|update|link|unlink\`
83
+ - Documents: \`orbitmap docs\`, \`orbitmap doc <slug> [--section "## H"|--full]\`,
84
+ \`orbitmap doc-import\`, \`orbitmap doc-update\`
85
+
86
+ ## Error handling
87
+ - If OrbitMap is unreachable (network down / workspace directory unavailable), inform
88
+ the user and continue the primary work without logging. Do NOT retry failed orbitmap
89
+ calls in a loop — report the issue and proceed with the task.`;
90
+ // ── Skill: orbitmap-working — §8.4 ─────────────────────────────────────────────
91
+ export const SKILL_WORKING_FRONTMATTER = `---
92
+ name: orbitmap-working
93
+ description: >
94
+ Working on OrbitMap tasks: starting/resuming, logging work, decisions and blockers,
95
+ finishing with the correct status, git branches and delivery status. Use whenever
96
+ implementing, resuming, or finishing a tracked task.
97
+ ---`;
98
+ export const SKILL_WORKING_BODY = `# Working on OrbitMap tasks
60
99
 
61
100
  ## Task workflow (on user request)
62
101
  When the user asks you to work on tasks:
63
102
  1. \`orbitmap tasks --status in_progress\` — check for unfinished work.
64
- 2. If found → \`orbitmap task <id>\` → read the logs → resume.
65
- 3. If not → \`orbitmap start\` — auto-picks the first todo task, fetches context, sets status to in_progress.
103
+ 2. If found → \`orbitmap task TS-x\` → read the work log → resume from the resume point.
104
+ 3. If not → \`orbitmap start\` — auto-picks the first todo task, sets it in_progress and
105
+ prints full context (description, agent_instructions, logs).
66
106
  4. If no tasks → inform the user.
107
+ Use \`orbitmap start TS-x\` to begin a specific task; \`orbitmap task TS-x\` only inspects.
67
108
 
68
- Use \`orbitmap start [task-id]\` to begin work. Use \`orbitmap task <id>\` to inspect tasks you are not starting.
109
+ ## Rules
110
+ - Work on ONE task at a time.
111
+ - Always read agent_instructions from the task before implementing. Task-level
112
+ agent_instructions take precedence over area-level instructions.
113
+ - Only work on subtasks assigned to you; do not pick up other agents' subtasks.
114
+ - Do NOT mark a parent task done while it has unfinished subtasks, unless the user
115
+ explicitly asks.
69
116
 
70
117
  ## Logging
71
- - \`orbitmap log <task-id> "<message>" --type <type>\`for work WITHIN a task
72
- (types: \`note\`, \`code_change\`, \`decision\`, \`blocker\`).
73
- - \`orbitmap vibe log --content "<message>" --type <type>\` for ad-hoc work outside a
74
- task (vibe types: \`discovery\`, \`exploration\`, \`fix\`).
75
- - \`orbitmap idea add --content "<idea>"\` — for future possibilities, NOT problems
76
- (use \`orbitmap issue register\` for those).
77
- - To convert an idea into work: \`orbitmap create <title>\` → \`orbitmap idea status <id> --status used\`.
78
- - When starting to investigate an issue: \`orbitmap issue status <id> investigating\`.
118
+ - \`orbitmap log TS-x "" --type note|code_change|decision|blocker\` — work WITHIN a task.
119
+ - \`orbitmap vibe log "…" --type discovery|exploration|fix\` — ad-hoc work outside a task.
120
+ - Use \`--type decision\` when you pick between approaches, reject an alternative, or lock
121
+ in a non-obvious assumption record the choice AND the why, not just the outcome.
122
+ - \`orbitmap idea add\` — future possibilities, NOT problems (problems →
123
+ \`orbitmap issue register\`).
79
124
  - Keep log content concrete, concise, and useful for someone resuming work later.
80
125
 
81
- ## End of session or task
82
- - Task finished → **default to \`in_review\`** so a human can verify the work before closing:
83
- \`orbitmap log <id> "Ready for review: ..." --type note\` → \`orbitmap status <id> in_review\`.
84
- - Task finished AND the user's prompt or agent_instructions explicitly say to close/complete
85
- without review \`orbitmap log <id> "Summary: ..." --type note\` \`orbitmap status <id> done\`.
86
- - Task blocked by an external dependency you cannot resolve (waiting on another task, missing
87
- access/credentials, unclear requirements needing human input, a failing external service)
88
- \`orbitmap log <id> "Blocked: <reason>" --type blocker\` \`orbitmap status <id> blocked\`.
89
- - Session ending, task not done but NOT blocked \`orbitmap log <id> "Resume point: ..." --type note\`
90
- leave status as \`in_progress\`.
126
+ ## End of session or task — MANDATORY
127
+ - Task finished → default to **in_review** so a human verifies before closing:
128
+ \`orbitmap log TS-x "Ready for review: " --type note\` then
129
+ \`orbitmap status TS-x in_review\`.
130
+ - Task finished AND the user's prompt or the task's agent_instructions explicitly say to
131
+ close without review \`orbitmap log TS-x "Summary: …" --type note\` then
132
+ \`orbitmap status TS-x done\`.
133
+ - Blocked by an external dependency you cannot resolve (waiting on another task, missing
134
+ access/credentials, unclear requirements, failing external service)
135
+ \`orbitmap log TS-x "Blocked: <reason>" --type blocker\` then
136
+ \`orbitmap status TS-x blocked\`.
137
+ - Session ending, task not done but NOT blocked → \`orbitmap log TS-x "Resume point: …"
138
+ --type note\` — leave status in_progress.
91
139
  - NEVER leave a task without a final log entry.
92
140
 
93
141
  ### Status decision guide
94
- - Use \`in_review\` when work is finished. **This is the default for completed work.** The
95
- person who requested the task should verify the result before it is closed.
96
- - Use \`done\` only when the user's prompt or task-level agent_instructions explicitly allow
97
- closing without review (e.g. "auto-close", "mark as done", "no review needed"). A user
98
- saying "do this task" is NOT permission to auto-close — only explicit opt-in counts.
99
- - Use \`blocked\` when you cannot continue due to an external factor outside your control.
100
- Always log the specific blocker so the team knows what to unblock.
101
- - Keep \`in_progress\` when the session is ending but you can resume work autonomously next time.
142
+ - **in_review**: work is finished. THE DEFAULT for completed work. The requester should
143
+ verify before closing.
144
+ - **done**: only when the prompt or task agent_instructions explicitly allow closing
145
+ without review ("auto-close", "mark as done", "no review needed"). A user saying "do
146
+ this task" is NOT permission to auto-close.
147
+ - **blocked**: an external factor outside your control stops you. Always log the
148
+ specific blocker.
149
+ - **in_progress** (keep): session ends but you can resume autonomously next time.
102
150
 
103
151
  ## Git workflow
104
- - When the task has a \`branch_name\`, create or switch to it:
105
- \`git checkout -b <branch_name>\` (or \`git checkout <branch_name>\` if it already exists).
106
- - If the task has NO \`branch_name\`, work on the current branch — do not create one.
152
+ - When the task context contains a branch_name, create or switch to it:
153
+ \`git checkout -b <branch_name>\` (or \`git checkout <branch_name>\` if it exists).
154
+ - If the task has NO branch_name, work on the current branch — do not create one.
107
155
  - Do NOT work directly on main/master/develop unless the task has no branch_name and you
108
156
  are already on a feature branch.
109
157
 
110
158
  ## Delivery flow
111
- - **Commit messages**: prefix the entity number with its type tag: \`TS-\` (task), \`IS-\` (issue),
112
- \`ID-\` (idea), \`VB-\` (vibe). E.g. \`[TS-r5d8zf] Add delivery status field\`.
113
- - **Finishing a task with commits**: when you committed and/or pushed code during the task,
114
- add \`--delivery on_branch\`: \`orbitmap status <id> in_review --delivery on_branch\`.
115
- - **Branch scanning**: when the user asks what's in a branch or PR, run
116
- \`git log target..source --oneline\`, parse \`[TS-xxxxx]\`/\`[IS-xxxxx]\` tags, and report matched entities.
117
- - **Delivery updates**: when the user tells you about a merge or release, update delivery
118
- status: \`orbitmap status <id> done --delivery merged\` / \`orbitmap status <id> done --delivery released\`.
119
-
120
- ## Planning mode (Claude Code / agents with plan mode)
121
- When you create an implementation plan (e.g. entering plan mode), you MUST include OrbitMap
122
- lifecycle steps as explicit items in the plan:
123
- - **First step**: reference the OrbitMap task ID and title so the plan stays linked to the task.
124
- - **Last steps** (always include these):
125
- 1. \`orbitmap log <id> "..." --type code_change\` with a summary of all changes made.
126
- 2. \`orbitmap status <id> <status>\` — set \`done\`, \`in_review\`, or \`blocked\` per the status
127
- decision guide (or log a resume point if incomplete).
128
-
129
- ## Documents
130
- - List docs with \`orbitmap docs\` check each doc's \`context\` (when it's relevant) and
131
- \`sections_count\` (whether to read the TOC first or go straight to full).
132
- - **Token-efficient reading flow:**
133
- 1. \`orbitmap doc <id-or-slug>\` context + table of contents (TOC, cheap).
134
- 2. \`orbitmap doc <id-or-slug> --section "## Auth"\` → just that section.
135
- 3. \`orbitmap doc <id-or-slug> --full\` full content (for large docs, prints a download URL).
136
- Use the lightest mode that gives you what you need.
137
- - When \`--full\` returns a download URL for a large doc, download it locally
138
- (\`orbitmap docs pull <slug>\` caches it under \`.orbitmap/docs/\`) and read the local file.
139
- Do NOT paste full document content into the conversation.
140
- - **Section-based editing flow:**
141
- 1. \`orbitmap doc <id-or-slug>\` read the TOC to find the section heading.
142
- 2. \`orbitmap doc <id-or-slug> --section "## Auth"\` → read the section you want to edit.
143
- 3. \`orbitmap doc-patch <id-or-slug> --base-version <n> --replace-section "## Auth" --content "..."\`.
144
- Patch operations: \`--replace-section\`, \`--insert-section\`, \`--delete-section\`, \`--append\`.
145
- - For a full rewrite use \`orbitmap doc-update <id-or-slug> --file <path>\`. To update an
146
- OrbitMap document, ALWAYS use \`doc-update\`/\`doc-patch\` — NEVER edit the cached local file directly.
147
- - **Workspace documents**: \`orbitmap start\`/\`orbitmap task <id>\` may surface workspace-level
148
- knowledge (cross-project docs). Read them the same way as project docs.
149
-
150
- ## Rules
151
- - Work on ONE task at a time.
152
- - Always read \`agent_instructions\` from the task before implementing.
153
- - Task-level \`agent_instructions\` take precedence over project-level instructions.
154
- - When working on subtasks, only work on subtasks assigned to you (the current agent) — do
155
- not pick up subtasks assigned to other agents.
156
- - Do NOT mark a parent task as \`done\` if it still has unfinished subtasks, unless the user
157
- explicitly asks you to.
158
-
159
- ## Error handling
160
- - If the OrbitMap API is unreachable, inform the user and continue working without logging.
161
- - Do NOT retry failed OrbitMap commands in a loop report the issue and proceed with the task.
162
-
163
- ## Example workflows
164
-
165
- ### Completing a task (default in_review)
166
- User: "Work on my next task"
167
- 1. \`orbitmap tasks --status in_progress\` → empty list
168
- 2. \`orbitmap start\` returns task context (title, description, agent_instructions, ...)
169
- 3. Read agent_instructions, understand the task
170
- 4. [implement the work write code, edit files, run tests, commit & push]
171
- 5. \`orbitmap log <id> "Implemented X by doing Y..." --type code_change\`
172
- 6. \`orbitmap log <id> "Ready for review: completed task, all tests pass." --type note\`
173
- 7. \`orbitmap status <id> in_review --delivery on_branch\`
174
-
175
- ### Hitting a blocker
176
- 4. [start work, discover missing API credentials]
177
- 5. \`orbitmap log <id> "Blocked: need API key for service X, not in env vars or secrets." --type blocker\`
178
- 6. \`orbitmap status <id> blocked\`
179
-
180
- ## Command reference (MCP tool CLI command)
181
- All 27 MCP \`full\`-profile tools map onto these commands.
182
-
183
- ### Context & projects
184
- | MCP tool | CLI command |
185
- |----------|-------------|
186
- | \`get_my_context\` | \`orbitmap context\` |
187
- | \`get_my_projects\` | \`orbitmap projects\` |
188
- | \`create_project\` | \`orbitmap create-project <name> [--desc <text>] [--slug <slug>]\` |
189
- | \`list_project_members\` | \`orbitmap members <project-id>\` |
190
-
191
- ### Tasks
192
- | MCP tool | CLI command |
193
- |----------|-------------|
194
- | \`get_tasks\` (list) | \`orbitmap tasks [--status <s>] [--priority <p>] [--orbit <id-or-slug>]\` |
195
- | \`get_tasks\` (detail) | \`orbitmap task <id>\` (or \`orbitmap get TS-xxxxx\`) |
196
- | \`start_task\` | \`orbitmap start [task-id]\` |
197
- | \`update_task_status\` | \`orbitmap status <task-id> <status> [--delivery <on_branch\\|merged\\|released>]\` |
198
- | \`create_task\` | \`orbitmap create <title> [--desc] [--priority] [--status] [--effort] [--agent-id] [--branch] [--instructions] [--from-issue]\` |
199
- | \`create_subtasks\` | \`orbitmap subtask <parent-id> <title> [--desc] [--priority] [--effort]\` |
200
- | \`manage_task_dependencies\` | \`orbitmap dep add\\|remove <task-id> <target-task-id> [--type depends_on\\|related] [--note]\` |
201
- | \`edit_task_content\` | \`orbitmap task-edit-content <task-id> [--title] [--description] [--agent-instructions]\` |
202
- | \`assign_task\` | \`orbitmap assign <task-id> [agent-id] [--user-id <id>]\` |
203
-
204
- ### Work log
205
- | MCP tool | CLI command |
206
- |----------|-------------|
207
- | \`log_work\` (task-bound) | \`orbitmap log <task-id> "<message>" --type note\\|code_change\\|decision\\|blocker [--meta <json>]\` |
208
- | \`log_work\` (vibe) | \`orbitmap vibe log --content "<message>" --type discovery\\|exploration\\|fix [--title] [--task <id>]\` |
209
-
210
- ### Documents
211
- | MCP tool | CLI command |
212
- |----------|-------------|
213
- | \`get_project_docs\` | \`orbitmap docs [--type <t>] [--search <q>]\` |
214
- | \`get_document\` | \`orbitmap doc <id-or-slug> [--full] [--section "## Heading"]\` |
215
- | \`import_document\` | \`orbitmap doc-import <title> --type <t> --file <path> [--context] [--source-path] [--workspace-id]\` |
216
- | \`edit_document\` (replace) | \`orbitmap doc-update <id-or-slug> --file <path> [--changelog]\` |
217
- | \`edit_document\` (patch) | \`orbitmap doc-patch <id-or-slug> --base-version <n> --replace-section\\|--insert-section\\|--delete-section\\|--append [--content] [--after] [--changelog]\` |
218
- | \`manage_document_sharing\` | \`orbitmap doc-share <doc-id> <project-id> [--agents]\` · \`orbitmap doc-unshare <doc-id> <project-id>\` · \`orbitmap doc-visibility <doc-id> <project-id> [--agents]\` |
219
-
220
- ### Issues
221
- | MCP tool | CLI command |
222
- |----------|-------------|
223
- | \`register_issue\` | \`orbitmap issue register --title <t> --description <d> [--severity] [--related-task]\` |
224
- | \`get_issues\` (list) | \`orbitmap issues [--status] [--severity] [--limit]\` |
225
- | \`get_issues\` (detail) | \`orbitmap issue show <id-or-number>\` (or \`orbitmap get IS-xxxxx\`) |
226
- | \`update_issue_status\` | \`orbitmap issue status <id> <status>\` · \`orbitmap issue resolve <id> --status resolved\\|wont_fix\\|duplicate [--resolution] [--resolved-task]\` |
227
-
228
- ### Vibes
229
- | MCP tool | CLI command |
230
- |----------|-------------|
231
- | \`get_vibes\` (list) | \`orbitmap vibes [--type] [--since] [--limit]\` |
232
- | \`get_vibes\` (detail) | \`orbitmap vibe show <id>\` (or \`orbitmap get VB-xxxxx\`) |
233
-
234
- ### Ideas
235
- | MCP tool | CLI command |
236
- |----------|-------------|
237
- | \`log_idea\` | \`orbitmap idea add --content <text> [--title] [--priority]\` |
238
- | \`get_ideas\` (list) | \`orbitmap ideas [--status] [--priority] [--limit]\` |
239
- | \`get_ideas\` (detail) | \`orbitmap idea show <id-or-number>\` (or \`orbitmap get ID-xxxxx\`) |
240
- | \`update_idea_status\` | \`orbitmap idea status <id> --status pending\\|accepted\\|used\\|rejected\` |
241
-
242
- ### Orbits
243
- | MCP tool | CLI command |
244
- |----------|-------------|
245
- | \`manage_orbit_item\` | \`orbitmap orbit attach\\|detach <orbit-id-or-slug> --type task\\|issue\\|vibe\\|document --id <uuid> [--note]\` |
246
- | \`get_orbit_items\` | \`orbitmap orbit items <orbit-id-or-slug> [--type]\` |
247
-
248
- Run \`orbitmap --help\` (or \`orbitmap <command> --help\`) for exact flags.`;
249
- // ── The thin always-on hook (CLAUDE.md / AGENTS.md) ──
250
- // Claude variant: points at the on-demand skill instead of inlining the full body.
159
+ - Commit messages: prefix the entity number with its type tag
160
+ \`[TS-r5d8zf] Add delivery status field\` (also \`[IS-…]\`, \`[ID-…]\`, \`[VB-…]\`).
161
+ - When you committed/pushed code during the task, finish with
162
+ \`orbitmap status TS-x <status> --delivery on_branch\`.
163
+ - When the user asks what's in a branch/PR: \`git log target..source --oneline\`, parse
164
+ \`[TS-…]\`/\`[IS-…]\` tags, report the matched entities.
165
+ - When the user reports a merge or release: update the relevant tasks with
166
+ \`--delivery merged\` or \`--delivery released\`.
167
+
168
+ ## Planning mode (agents with a plan mode)
169
+ When you create an implementation plan for a tracked task, you MUST include OrbitMap
170
+ lifecycle steps as explicit plan items:
171
+ - First step: reference the OrbitMap task number and title.
172
+ - Last steps, always: (1) \`orbitmap log\` with a summary of all changes; (2)
173
+ \`orbitmap status\` set per the status decision guide (or a resume-point log if
174
+ incomplete).
175
+
176
+ ## Example: completing a task (default → in_review)
177
+ 1. \`orbitmap tasks --status in_progress\` → empty
178
+ 2. \`orbitmap start\` task context
179
+ 3. read agent_instructions; implement; run tests; commit with \`[TS-x]\` prefix
180
+ 4. \`orbitmap log TS-x "Implemented X by doing Y" --type code_change\`
181
+ 5. \`orbitmap log TS-x "Ready for review: all tests pass." --type note\`
182
+ 6. \`orbitmap status TS-x in_review --delivery on_branch\``;
183
+ // ── Skill: orbitmap-planning §8.5 ────────────────────────────────────────────
184
+ export const SKILL_PLANNING_FRONTMATTER = `---
185
+ name: orbitmap-planning
186
+ description: >
187
+ Planning with OrbitMap: missions (time-boxed focus), intents (goals grouping work),
188
+ promoting ideas to tasks, triaging issues, decomposing work into tasks and subtasks.
189
+ Use for "plan", "roadmap", "mission", "intent", "break this down", idea or issue
190
+ triage requests.
191
+ ---`;
192
+ export const SKILL_PLANNING_BODY = `# Planning in OrbitMap
193
+
194
+ ## Hierarchy
195
+ Mission (MS-) Intent (IN-) Task (TS-) / Issue (IS-). Missions and intents are
196
+ workspace-level; tasks live in areas. An intent groups the tasks/issues that realise one
197
+ goal; a mission time-boxes a set of intents (and directly-attached items) toward an
198
+ outcome. At most ONE mission is active at a time.
199
+
200
+ ## Missions
201
+ - \`orbitmap mission list\` / \`orbitmap mission show MS-x\`
202
+ - \`orbitmap mission create "name" [--outcome "…"] [--start d] [--end d]\`
203
+ - \`orbitmap mission status MS-x active|completed|cancelled\` activating fails while
204
+ another mission is active; complete or cancel it first.
205
+ - \`orbitmap mission link MS-x IN-y|TS-y|IS-y|ID-y\` / \`mission unlink\` — attach items.
206
+
207
+ ## Intents
208
+ - \`orbitmap intent create "name" [--mission MS-x]\`, statuses:
209
+ new design plan build done (or cancelled); update with
210
+ \`orbitmap intent update IN-x --status build\`.
211
+ - \`orbitmap intent link IN-x TS-y|IS-y\` attaches work items to the intent.
212
+ - RULE (intent-exclusive): an item linked to an intent gets its mission THROUGH the
213
+ intent never set a direct mission on a task/issue that has an intent. The CLI
214
+ enforces this; do not fight it.
215
+
216
+ ## Planning workflow (recommended when the user asks to plan a body of work)
217
+ 1. Clarify the outcome → \`orbitmap mission create\` (or pick the active mission).
218
+ 2. Split into goals \`orbitmap intent create\` per goal, \`mission link\` them.
219
+ 3. Decompose each intent into concrete tasks
220
+ \`orbitmap create "title" --intent IN-x [--priority p]\`, subtasks via
221
+ \`orbitmap subtask\`.
222
+ 4. Wire ordering constraints → \`orbitmap dep add TS-a TS-b\` (a depends on b).
223
+ 5. Review: \`orbitmap mission show MS-x\` and \`orbitmap overview\`.
224
+
225
+ ## Ideas (opportunities, not problems)
226
+ - Capture: \`orbitmap idea add "…" [--priority p]\`.
227
+ - Review: \`orbitmap idea list\` (default pending).
228
+ - Promote to work: analyse the codebase first, then \`orbitmap create "task title"
229
+ --intent …\` referencing the idea in the description, then
230
+ \`orbitmap idea status ID-x used\`. Reject with \`… rejected\`.
231
+
232
+ ## Issues (problems)
233
+ - Report: \`orbitmap issue register "title" --severity critical|high|medium|low
234
+ [--description "…"]\`.
235
+ - Start investigating: \`orbitmap issue status IS-x investigating\`.
236
+ - Convert to work: \`orbitmap create\` a fix task, link it, and resolve with
237
+ \`orbitmap issue resolve IS-x --task TS-y --resolution "…"\` (or status wont_fix /
238
+ duplicate with a reason).`;
239
+ // ── Skill: orbitmap-docs — §8.6 ────────────────────────────────────────────────
240
+ export const SKILL_DOCS_FRONTMATTER = `---
241
+ name: orbitmap-docs
242
+ description: >
243
+ Reading and updating OrbitMap documents (specs, architecture, guides, decisions).
244
+ Use when the user asks to read, import, or update project documentation tracked in
245
+ OrbitMap.
246
+ ---`;
247
+ export const SKILL_DOCS_BODY = `# OrbitMap documents
248
+
249
+ ## Choosing what to read
250
+ \`orbitmap docs\` lists documents with their \`context\` (when the doc is relevant) and
251
+ \`sections_count\`. Use context to pick the right document; use sections_count to decide
252
+ whether to fetch the TOC first (many sections) or go straight to full.
253
+
254
+ ## Token-efficient reading flow
255
+ 1. \`orbitmap doc <slug>\` context + table of contents (cheap).
256
+ 2. \`orbitmap doc <slug> --section "## Auth"\` just that section.
257
+ 3. \`orbitmap doc <slug> --full\` → full content (expensive — last resort).
258
+ Use the lightest mode that answers your question. When the CLI reports a local file path
259
+ for the full content, read that file instead of printing the content into the
260
+ conversation.
261
+
262
+ ## Editing
263
+ - Import a new document: \`orbitmap doc-import <file.md> --title "…" --type
264
+ spec|architecture|api|guide|decision|changelog|other [--context "…"]\`.
265
+ - Update: \`orbitmap doc-update <slug> --file <file.md>\` (replaces content, bumps
266
+ version).
267
+ - To change an OrbitMap document, ALWAYS go through these commands — NEVER edit files
268
+ inside the OrbitMap workspace/cache directories directly.`;
269
+ export const SKILLS = [
270
+ {
271
+ name: 'orbitmap',
272
+ frontmatter: SKILL_ORBITMAP_FRONTMATTER,
273
+ body: SKILL_ORBITMAP_BODY,
274
+ },
275
+ {
276
+ name: 'orbitmap-working',
277
+ frontmatter: SKILL_WORKING_FRONTMATTER,
278
+ body: SKILL_WORKING_BODY,
279
+ },
280
+ {
281
+ name: 'orbitmap-planning',
282
+ frontmatter: SKILL_PLANNING_FRONTMATTER,
283
+ body: SKILL_PLANNING_BODY,
284
+ },
285
+ {
286
+ name: 'orbitmap-docs',
287
+ frontmatter: SKILL_DOCS_FRONTMATTER,
288
+ body: SKILL_DOCS_BODY,
289
+ },
290
+ ];
291
+ // ── The thin always-on hook (CLAUDE.md / AGENTS.md) ────────────────────────────
292
+ // Claude variant — §8.2, verbatim (without the markers, which buildClaudeHook adds).
251
293
  export const THIN_HOOK_CLAUDE = `## OrbitMap
252
- This project tracks its work in **OrbitMap**, reached via the \`orbitmap\` CLI (\`npx orbitmap <command>\`).
253
- When the user mentions OrbitMap, a task, the backlog, issues, ideas, or asks to start/resume/finish/log work — use it.
254
-
255
- Core loop: \`orbitmap tasks --status in_progress\` (resume) → \`orbitmap start\` (next todo) → read the task's
256
- \`agent_instructions\` → implement → \`orbitmap log <id> "..." --type code_change\` → \`orbitmap status <id> in_review\`.
257
- One task at a time; always log before finishing. Commit messages: \`[TS-<task_number>] summary\`.
258
294
 
259
- For the full workflow, rules, and every command, **use the \`orbitmap\` skill** it loads on demand.`;
260
- // Non-Claude variant: same hook, but points at the inlined block below instead of a skill.
295
+ This project tracks work in OrbitMap via the \`orbitmap\` CLI (works the same whether data
296
+ is in the cloud or in local files). When the user mentions tasks, backlog, missions,
297
+ intents, ideas, issues, vibes, or asks you to work on / log / plan something, load the
298
+ matching skill: \`orbitmap\` (context & commands), \`orbitmap-working\` (doing tasks),
299
+ \`orbitmap-planning\` (missions/intents/ideas/issues), \`orbitmap-docs\` (documents).
300
+ Golden rules: work on ONE task at a time; NEVER finish a task session without a final
301
+ \`orbitmap log\` entry and an \`orbitmap status\` update; finished work defaults to
302
+ \`in_review\`, not \`done\`. NEVER edit files inside the OrbitMap workspace directory
303
+ directly — always go through \`orbitmap\` commands.`;
304
+ // Non-Claude variant: same rules, but points at the inlined sections below instead of
305
+ // skills that these agents cannot load.
261
306
  export const THIN_HOOK_GENERIC = `## OrbitMap
262
- This project tracks its work in **OrbitMap**, reached via the \`orbitmap\` CLI (\`npx orbitmap <command>\`).
263
- When the user mentions OrbitMap, a task, the backlog, issues, ideas, or asks to start/resume/finish/log work — use it.
264
-
265
- Core loop: \`orbitmap tasks --status in_progress\` (resume) → \`orbitmap start\` (next todo) → read the task's
266
- \`agent_instructions\` → implement → \`orbitmap log <id> "..." --type code_change\` → \`orbitmap status <id> in_review\`.
267
- One task at a time; always log before finishing. Commit messages: \`[TS-<task_number>] summary\`.
268
307
 
269
- The full workflow, rules, and command reference follow below.`;
270
- // ── Assembly helpers ──
271
- /** Build the full SKILL.md file (frontmatter + body) for Claude. */
272
- export function buildSkillFile() {
273
- return `---\nname: ${SKILL_NAME}\ndescription: ${SKILL_DESCRIPTION}\n---\n\n${CORE_INSTRUCTIONS}\n`;
308
+ This project tracks work in OrbitMap via the \`orbitmap\` CLI (works the same whether data
309
+ is in the cloud or in local files). When the user mentions tasks, backlog, missions,
310
+ intents, ideas, issues, vibes, or asks you to work on / log / plan something, follow the
311
+ sections below: core (context & commands), working on tasks, planning
312
+ (missions/intents/ideas/issues), and documents.
313
+ Golden rules: work on ONE task at a time; NEVER finish a task session without a final
314
+ \`orbitmap log\` entry and an \`orbitmap status\` update; finished work defaults to
315
+ \`in_review\`, not \`done\`. NEVER edit files inside the OrbitMap workspace directory
316
+ directly — always go through \`orbitmap\` commands.`;
317
+ // ── Assembly helpers ───────────────────────────────────────────────────────────
318
+ /** Build one SKILL.md file (frontmatter + body) for Claude. */
319
+ export function buildSkillFile(skill) {
320
+ return `${skill.frontmatter}\n\n${skill.body}\n`;
274
321
  }
275
322
  /** Build the thin always-on block for a Claude config file (CLAUDE.md). */
276
323
  export function buildClaudeHook() {
277
324
  return `${MARKER_START}\n${THIN_HOOK_CLAUDE}\n${MARKER_END}`;
278
325
  }
279
326
  /**
280
- * Build the markdown fallback block for non-Claude agents: the thin hook plus the
281
- * full inlined instructions (no skill ecosystem to lean on).
327
+ * Build the markdown fallback block for non-Claude agents: the thin hook plus all four
328
+ * skill bodies inlined (no skill ecosystem to lean on).
282
329
  */
283
330
  export function buildGenericBlock() {
284
- return `${MARKER_START}\n${THIN_HOOK_GENERIC}\n\n${CORE_INSTRUCTIONS}\n${MARKER_END}`;
331
+ const bodies = SKILLS.map((skill) => skill.body).join('\n\n---\n\n');
332
+ return `${MARKER_START}\n${THIN_HOOK_GENERIC}\n\n${bodies}\n${MARKER_END}`;
285
333
  }
286
334
  //# sourceMappingURL=agent-instructions.js.map