@orderful/droid 0.50.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.claude-plugin/plugin.json +1 -0
  2. package/CHANGELOG.md +20 -0
  3. package/dist/bin/droid.js +72 -4
  4. package/dist/commands/pack.d.ts +1 -0
  5. package/dist/commands/pack.d.ts.map +1 -1
  6. package/dist/lib/pack.d.ts +8 -0
  7. package/dist/lib/pack.d.ts.map +1 -1
  8. package/dist/tools/brain/.claude-plugin/plugin.json +1 -1
  9. package/dist/tools/brain/TOOL.yaml +1 -1
  10. package/dist/tools/brain/skills/brain/SKILL.md +4 -0
  11. package/dist/tools/brain/skills/brain/references/workflows.md +21 -7
  12. package/dist/tools/plan/.claude-plugin/plugin.json +1 -1
  13. package/dist/tools/plan/TOOL.yaml +1 -1
  14. package/dist/tools/plan/commands/plan.md +3 -2
  15. package/dist/tools/plan/skills/plan/SKILL.md +31 -10
  16. package/dist/tools/plan/skills/plan/references/workflows.md +44 -14
  17. package/dist/tools/project/.claude-plugin/plugin.json +1 -1
  18. package/dist/tools/project/TOOL.yaml +5 -1
  19. package/dist/tools/project/skills/project/SKILL.md +32 -1
  20. package/dist/tools/project/skills/project/references/loading.md +1 -0
  21. package/dist/tools/project/skills/project/references/pulling.md +57 -0
  22. package/dist/tools/project/skills/project/references/pushing.md +79 -0
  23. package/dist/tools/propose-plan/.claude-plugin/plugin.json +19 -0
  24. package/dist/tools/propose-plan/TOOL.yaml +17 -0
  25. package/dist/tools/propose-plan/skills/propose-plan/SKILL.md +190 -0
  26. package/dist/tools/propose-plan/skills/propose-plan/references/output-schema.json +85 -0
  27. package/package.json +1 -1
  28. package/src/bin/droid.ts +2 -1
  29. package/src/commands/pack.ts +32 -2
  30. package/src/lib/pack.test.ts +26 -1
  31. package/src/lib/pack.ts +66 -3
  32. package/src/tools/brain/.claude-plugin/plugin.json +1 -1
  33. package/src/tools/brain/TOOL.yaml +1 -1
  34. package/src/tools/brain/skills/brain/SKILL.md +4 -0
  35. package/src/tools/brain/skills/brain/references/workflows.md +21 -7
  36. package/src/tools/plan/.claude-plugin/plugin.json +1 -1
  37. package/src/tools/plan/TOOL.yaml +1 -1
  38. package/src/tools/plan/commands/plan.md +3 -2
  39. package/src/tools/plan/skills/plan/SKILL.md +31 -10
  40. package/src/tools/plan/skills/plan/references/workflows.md +44 -14
  41. package/src/tools/project/.claude-plugin/plugin.json +1 -1
  42. package/src/tools/project/TOOL.yaml +5 -1
  43. package/src/tools/project/skills/project/SKILL.md +32 -1
  44. package/src/tools/project/skills/project/references/loading.md +1 -0
  45. package/src/tools/project/skills/project/references/pulling.md +57 -0
  46. package/src/tools/project/skills/project/references/pushing.md +79 -0
  47. package/src/tools/propose-plan/.claude-plugin/plugin.json +19 -0
  48. package/src/tools/propose-plan/TOOL.yaml +17 -0
  49. package/src/tools/propose-plan/skills/propose-plan/SKILL.md +190 -0
  50. package/src/tools/propose-plan/skills/propose-plan/references/output-schema.json +85 -0
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: propose-plan
3
+ description: "Produce a structured plan with evidence and actions for human approval. Use when an agent must propose write operations, research current state before making changes, or produce actions that require human-in-the-loop review before execution."
4
+ globs: []
5
+ alwaysApply: false
6
+ allowed-tools: []
7
+ ---
8
+
9
+ # Propose Plan
10
+
11
+ Structure your findings into a plan for human approval. Use this skill when you've researched the current state, understand what needs to happen, and are ready to propose the specific actions to take.
12
+
13
+ This skill teaches you how to package what you've learned into structured evidence and discrete actions that a reviewer can approve, modify, or reject before anything is executed.
14
+
15
+ Never call write tools directly. Each proposed write is described as an **action** in your plan output. Approved actions are executed separately after human review.
16
+
17
+ ## Plan Structure
18
+
19
+ A plan has two parts:
20
+
21
+ 1. **Evidence** — your analysis of the gathered context: what it shows, why changes are needed, and what will happen if the plan is approved
22
+ 2. **Actions** — an ordered list of discrete operations to execute, each mapped to a specific tool call
23
+
24
+ The human reviewer sees your evidence first (the reasoning and impact), then reviews each action. Clear evidence builds trust; vague evidence gets rejected.
25
+
26
+ ## Output Format
27
+
28
+ Produce a single JSON object matching the schema in `references/output-schema.json`. The shape:
29
+
30
+ ```json
31
+ {
32
+ "name": "string — short human-readable plan name (optional)",
33
+ "category": "string — grouping category, e.g. org-provisioning (optional)",
34
+ "evidence": {
35
+ "reasoning": "string — your analysis of what needs to happen and why",
36
+ "sourceSummary": "string — concise summary of what you found during research",
37
+ "sourceRaw": "object — raw source data from research (optional)",
38
+ "impactSummary": "string — what will change if this plan is approved",
39
+ "caveats": ["string — anything uncertain, auto-generated, or requiring follow-up"]
40
+ },
41
+ "actions": [
42
+ {
43
+ "type": "mcp_call",
44
+ "config": {
45
+ "tool": "string — the tool name exactly as you see it in your available tools"
46
+ },
47
+ "description": "string — human-readable description of what this action does",
48
+ "payload": "object — arguments to pass to the tool"
49
+ }
50
+ ]
51
+ }
52
+ ```
53
+
54
+ ### Evidence Fields
55
+
56
+ | Field | Purpose | Reviewer Experience |
57
+ | --------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
58
+ | `reasoning` | Your analysis — what needs to happen and why. Cite actual data from your research, not assumptions. | First thing they read. Establishes trust. |
59
+ | `sourceSummary` | Concise summary of what you found. Include entity names, IDs, and states. | Quick scan to verify you looked at the right things. |
60
+ | `sourceRaw` | Optional. Raw API responses or data snapshots as a JSON object. | Expandable detail for reviewers who want to verify. |
61
+ | `impactSummary` | What changes if the plan is approved. Be specific — "creates org X with ISA ID Y" not "creates an org". | The core decision point. Reviewer approves based on this. |
62
+ | `caveats` | Optional. Flag anything uncertain, auto-generated, or needing manual follow-up. | Prevents surprises. Reviewers appreciate honesty about gaps. |
63
+
64
+ ### Action Fields
65
+
66
+ | Field | Purpose |
67
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
68
+ | `type` | Action category. Use `mcp_call` for MCP tool invocations. |
69
+ | `config` | Identifies which tool to call. For `mcp_call`: `{ "tool": "create_org" }`. Use the tool name exactly as it appears in your available tools. |
70
+ | `description` | Human-readable summary. The reviewer sees this before expanding the payload. Write it for someone who won't read the raw payload. |
71
+ | `payload` | Raw arguments passed directly to the tool. No wrapping or nesting — exactly what the tool expects. |
72
+
73
+ ## Building Evidence From What You Know
74
+
75
+ By the time you're writing a plan, you've already done the research — queried tools, read documents, collected the data you need. Your job now is to analyse what you found and structure it into a plan.
76
+
77
+ If read tools are still available, use them to **verify and fill gaps** — check for conflicts, confirm preconditions, resolve ambiguities. But the research phase is behind you. Focus on structuring what you know into clear evidence and precise actions.
78
+
79
+ When writing evidence:
80
+
81
+ 1. **Cite the gathered data** — reference specific entities, IDs, and values. A reviewer can't verify "the account exists" but they can verify "Salesforce account SF-001234 (Acme Corp) has no OrgID".
82
+ 2. **Flag conflicts** — if the gathered data reveals duplicates, collisions, or unexpected state, surface that prominently.
83
+ 3. **Note gaps** — if data is missing or ambiguous, say so in caveats rather than guessing. A plan with honest gaps is more useful than one with invented data.
84
+
85
+ ## Writing Actions
86
+
87
+ Each action represents one tool call. `config.tool` identifies which tool to call, and `payload` carries the arguments — both must be precise.
88
+
89
+ **Order matters.** List actions in dependency order — if action B depends on the result of action A, action A comes first. The execution step processes them sequentially.
90
+
91
+ **One action per tool call.** Don't batch multiple operations into a single action. If provisioning requires creating an org, then creating a billing customer, those are two separate actions.
92
+
93
+ **Only propose tools from your available list.** You've been given a set of write tools you can propose actions for. If a required operation isn't in that list, note it as a caveat — don't invent actions for tools that don't exist.
94
+
95
+ **Payloads must be complete.** Include every required field the tool expects. Don't leave placeholders or TODOs in payloads. For values that don't exist yet because they come from a prior action, use a template reference (see below). If you can't determine a value at all, flag it in caveats and omit the action.
96
+
97
+ ### Action Dependencies (Template References)
98
+
99
+ When an action needs a value produced by a prior action — like an org ID that doesn't exist until the org is created — use a Handlebars template reference in the payload value.
100
+
101
+ **Syntax:** `{{ actions.N.result.path }}` where `N` is the zero-based action index and `path` navigates the result object.
102
+
103
+ At execution time, the system resolves these references using the actual results from completed actions. The human reviewer sees the template expression and understands the data flow — they're approving the intent ("use the org ID from step 1"), not the literal runtime value.
104
+
105
+ **Rules:**
106
+
107
+ - Only reference actions that come _before_ the current action (lower index)
108
+ - Use dot-path navigation to reach nested values: `{{ actions.0.result.org.id }}`
109
+ - Static values and template references can coexist in the same payload
110
+ - Every other payload field should still use concrete values you already know
111
+
112
+ **Example:**
113
+
114
+ ```json
115
+ {
116
+ "type": "mcp_call",
117
+ "config": { "tool": "create_billing_customer" },
118
+ "description": "Create ChargeBee billing customer for Acme Corp using new org ID",
119
+ "payload": {
120
+ "orgId": "{{ actions.0.result.id }}",
121
+ "orgName": "Acme Corp",
122
+ "contactEmail": "jane@acme.com"
123
+ }
124
+ }
125
+ ```
126
+
127
+ Here `orgId` will be resolved at runtime from the result of action 0 (e.g., `create_org`). The reviewer sees that billing depends on the org creation step.
128
+
129
+ ## Example
130
+
131
+ Say you've been asked to provision an Orderful org for a new customer. You've queried Salesforce, searched for existing orgs, and gathered the relevant data. Your plan output might look like:
132
+
133
+ ```json
134
+ {
135
+ "evidence": {
136
+ "reasoning": "Salesforce account Acme Corp (SF-001234) was signed on 2026-03-01 and has no Orderful OrgID. No existing Orderful org matches by name or ISA ID. The account's primary contact is jane@acme.com. ISA ID derived from Customer_ISA_ID__c field: ACME001.",
137
+ "sourceSummary": "Salesforce: Acme Corp (SF-001234), signed 2026-03-01, no OrgID. Orderful: no org named 'Acme Corp', no ISA ID 'ACME001' in use.",
138
+ "sourceRaw": {
139
+ "salesforce_account": { "Id": "SF-001234", "Name": "Acme Corp", "OrgID__c": null, "Customer_ISA_ID__c": "ACME001" },
140
+ "orderful_org_search": { "results": [] }
141
+ },
142
+ "impactSummary": "Creates Orderful org 'Acme Corp' with ISA ID 'ACME001', creates billing customer in ChargeBee, and sends welcome email to jane@acme.com.",
143
+ "caveats": ["ARR not found in Salesforce — billing customer will be created without revenue data. Manual update may be needed."]
144
+ },
145
+ "actions": [
146
+ {
147
+ "type": "mcp_call",
148
+ "config": { "tool": "create_org" },
149
+ "description": "Create Orderful org 'Acme Corp' with ISA ID 'ACME001'",
150
+ "payload": {
151
+ "name": "Acme Corp",
152
+ "isaId": "ACME001",
153
+ "contactEmail": "jane@acme.com"
154
+ }
155
+ },
156
+ {
157
+ "type": "mcp_call",
158
+ "config": { "tool": "create_billing_customer" },
159
+ "description": "Create ChargeBee billing customer for Acme Corp using new org ID",
160
+ "payload": {
161
+ "orgId": "{{ actions.0.result.id }}",
162
+ "orgName": "Acme Corp",
163
+ "contactEmail": "jane@acme.com"
164
+ }
165
+ },
166
+ {
167
+ "type": "mcp_call",
168
+ "config": { "tool": "invite_user" },
169
+ "description": "Send welcome email to jane@acme.com for Acme Corp org",
170
+ "payload": {
171
+ "email": "jane@acme.com",
172
+ "orgId": "{{ actions.0.result.id }}"
173
+ }
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ ## What Not To Do
180
+
181
+ These are hard rules. Violating any of them will cause the plan to be rejected or produce incorrect results.
182
+
183
+ - **Don't call write tools directly.** Your job is to propose, not execute. Every write operation must be described as an action in your plan output. If you call a write tool yourself, the approval flow is bypassed and there is no audit trail.
184
+ - **Don't include read operations as actions.** Actions are for writes only — things that change state and need human approval. Reading data is research, not an action. If you need to look something up, use read tools directly during your research phase.
185
+ - **Don't fabricate data.** If a value wasn't in your research and you can't verify it with read tools, say so in caveats. Never guess IDs, names, emails, or configuration values. A plan with honest gaps gets sent back for more research. A plan with invented data gets approved and breaks things.
186
+ - **Don't produce actions for tools outside your available list.** You can only propose actions for tools you've been given. If an operation requires a tool you don't have, note it as a caveat — don't invent an action for it. The execution step will reject unknown tools.
187
+ - **Don't skip evidence.** A plan without evidence will be rejected. The reviewer needs to see what you found, what it means, and what will change. Evidence is not optional filler — it is how the reviewer decides whether to approve.
188
+ - **Don't combine multiple operations into one action.** Each action is one tool call. "Create org and set up billing" is two actions, not one. The execution step calls each action individually — a combined action will fail.
189
+ - **Don't hardcode values from actions that haven't run yet.** If action 2 needs the org ID from action 1, don't guess or invent a value — use a template reference: `"orgId": "{{ actions.0.result.id }}"`. The execution step resolves these at runtime. Never put a placeholder like `"TBD"` or `"<org-id>"` in a payload.
190
+ - **Don't use vague descriptions.** "Create org" tells the reviewer nothing. "Create Orderful org 'Acme Corp' with ISA ID 'ACME001'" tells them exactly what will happen. The description is what the reviewer reads before deciding whether to expand the payload.
@@ -0,0 +1,85 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "PlanOutput",
4
+ "description": "Structured plan output produced by an LLM agent for human review and approval",
5
+ "type": "object",
6
+ "required": ["evidence", "actions"],
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "Short human-readable name for the plan"
11
+ },
12
+ "category": {
13
+ "type": "string",
14
+ "description": "Grouping category for the plan (e.g. org-provisioning)"
15
+ },
16
+ "evidence": {
17
+ "type": "object",
18
+ "description": "Research findings and rationale supporting the plan",
19
+ "required": ["reasoning", "sourceSummary", "impactSummary"],
20
+ "properties": {
21
+ "reasoning": {
22
+ "type": "string",
23
+ "description": "Analysis of what needs to happen and why"
24
+ },
25
+ "sourceSummary": {
26
+ "type": "string",
27
+ "description": "Concise summary of research findings with entity names and IDs"
28
+ },
29
+ "sourceRaw": {
30
+ "type": "object",
31
+ "description": "Raw source data from research",
32
+ "additionalProperties": true
33
+ },
34
+ "impactSummary": {
35
+ "type": "string",
36
+ "description": "What changes if the plan is approved"
37
+ },
38
+ "caveats": {
39
+ "type": "array",
40
+ "items": { "type": "string" },
41
+ "description": "Risks or caveats to flag for review"
42
+ }
43
+ },
44
+ "additionalProperties": false
45
+ },
46
+ "actions": {
47
+ "type": "array",
48
+ "description": "Ordered list of MCP tool calls to execute",
49
+ "items": {
50
+ "type": "object",
51
+ "required": ["type", "config", "description", "payload"],
52
+ "properties": {
53
+ "type": {
54
+ "type": "string",
55
+ "const": "mcp_call",
56
+ "description": "Action category — v0 only supports mcp_call"
57
+ },
58
+ "config": {
59
+ "type": "object",
60
+ "description": "Configuration specifying which MCP tool to invoke",
61
+ "required": ["tool"],
62
+ "properties": {
63
+ "tool": {
64
+ "type": "string",
65
+ "description": "Tool name as it appears in the available tools"
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ },
70
+ "description": {
71
+ "type": "string",
72
+ "description": "Human-readable description of what this action does"
73
+ },
74
+ "payload": {
75
+ "type": "object",
76
+ "description": "Arguments to pass to the MCP tool",
77
+ "additionalProperties": true
78
+ }
79
+ },
80
+ "additionalProperties": false
81
+ }
82
+ }
83
+ },
84
+ "additionalProperties": false
85
+ }