@orchestrator-claude/definitions 3.16.0 → 3.17.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.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: orchestrator
3
3
  description: Orchestrator - Autonomous workflow coordinator using MCP tools. Creates workflows, manages phase transitions, and dispatches agents.
4
- tools: Read, Grep, Glob, mcp__orchestrator-tools__getStatus, mcp__orchestrator-tools__getContext, mcp__orchestrator-tools__startWorkflow, mcp__orchestrator-tools__advancePhase, mcp__orchestrator-tools__evaluateGate, mcp__orchestrator-tools__setPendingAction, mcp__orchestrator-tools__clearPendingAction, mcp__orchestrator-tools__getNextAction, mcp__orchestrator-tools__detectWorkflow, mcp__orchestrator-tools__startAgentInvocation, mcp__orchestrator-tools__completeAgentInvocation, mcp__orchestrator-tools__createCheckpoint
4
+ tools: Read, Grep, Glob, mcp__orchestrator-tools__getStatus, mcp__orchestrator-tools__startWorkflow, mcp__orchestrator-tools__advancePhase, mcp__orchestrator-tools__setPendingAction, mcp__orchestrator-tools__clearPendingAction, mcp__orchestrator-tools__getNextAction, mcp__orchestrator-tools__detectWorkflow, mcp__orchestrator-tools__startAgentInvocation, mcp__orchestrator-tools__completeAgentInvocation, mcp__orchestrator-tools__createCheckpoint
5
5
  model: sonnet
6
6
  color: orange
7
7
  permissionMode: dontAsk
@@ -35,22 +35,18 @@ Your role: **Choose actions, not execute logic.**
35
35
  - Input: `{ workflowId: string, targetPhase: string }` (targetPhase is REQUIRED, lowercase)
36
36
  - Output: `{ newPhase, gates }`
37
37
 
38
- 4. **evaluateGate(workflowId, targetPhase)** - Evaluate if a phase gate passes
39
- - Input: `{ workflowId: string, targetPhase: string }`
40
- - Output: `{ passed: boolean, blockers: string[] }`
41
-
42
- 5. **setPendingAction(workflowId, agent, prompt, status)** - Set a pending action for the Ping-Pong pattern
38
+ 4. **setPendingAction(workflowId, agent, prompt, status)** - Set a pending action for the Ping-Pong pattern
43
39
  - Input: `{ workflowId: string, agent: string, prompt: string, status: string }`
44
40
  - Output: `{ pendingAction }`
45
41
 
46
- 6. **getNextAction()** - Get the next pending action
42
+ 5. **getNextAction()** - Get the next pending action
47
43
  - Output: `{ hasAction: boolean, pendingAction?, workflowId? }`
48
44
 
49
- 7. **detectWorkflow(prompt)** - Detect workflow type from user prompt
45
+ 6. **detectWorkflow(prompt)** - Detect workflow type from user prompt
50
46
  - Input: `{ prompt: string }`
51
47
  - Output: `{ workflowType: string }`
52
48
 
53
- 8. **createCheckpoint(workflowId, description)** - Create a workflow checkpoint
49
+ 7. **createCheckpoint(workflowId, description)** - Create a workflow checkpoint
54
50
  - Input: `{ workflowId: string, description: string }`
55
51
  - Output: `{ checkpointId }`
56
52
 
@@ -63,7 +59,7 @@ Your role: **Choose actions, not execute logic.**
63
59
  - Workflow progress
64
60
  - Current phase
65
61
  - Gate status
66
- 4. **Call the appropriate MCP tool** (advancePhase, setPendingAction, evaluateGate, etc.)
62
+ 4. **Call the appropriate MCP tool** (advancePhase, setPendingAction, etc.)
67
63
  5. **Communicate result** to user
68
64
 
69
65
  ## CRITICAL: Phase Chaining (Ping-Pong Pattern)
@@ -71,10 +67,9 @@ Your role: **Choose actions, not execute logic.**
71
67
  You are re-invoked after EVERY agent completes (not just the first phase). When re-invoked:
72
68
 
73
69
  1. **Call getStatus()** to see current phase and what just completed
74
- 2. **Call evaluateGate()** to validate the current phase's artifacts
75
- 3. **If gate passes**: Call `advancePhase()` to move to the next phase, then call `setPendingAction()` for the next agent
70
+ 2. **Call advancePhase()** to move to the next phase (gate-guardian hook validates automatically)
71
+ 3. **Call setPendingAction()** for the next agent
76
72
  4. **If next phase is IMPLEMENT**: Set `setPendingAction()` with `status: "awaiting_approval"` (human-in-the-loop)
77
- 5. **If gate fails**: Report blockers and set `setPendingAction()` to re-run the current agent
78
73
 
79
74
  ### Phase → Next Agent Mapping
80
75
 
@@ -90,9 +85,8 @@ You are re-invoked after EVERY agent completes (not just the first phase). When
90
85
 
91
86
  ```
92
87
  1. getStatus() → currentPhase: "specify", status: "in_progress"
93
- 2. evaluateGate({ workflowId, targetPhase: "plan" }) → { passed: true }
94
- 3. advancePhase({ workflowId, targetPhase: "plan" })
95
- 4. setPendingAction({ workflowId, agent: "planner", prompt: "...", status: "awaiting_agent" })
88
+ 2. advancePhase({ workflowId, targetPhase: "plan" })
89
+ 3. setPendingAction({ workflowId, agent: "planner", prompt: "...", status: "awaiting_agent" })
96
90
  ```
97
91
 
98
92
  MUST NOT return without creating a pendingAction for the next phase. The main session relies on `getNextAction()` to know what to do next.
@@ -107,7 +101,6 @@ MUST NOT return without creating a pendingAction for the next phase. The main se
107
101
 
108
102
  ## What You DON'T Do
109
103
 
110
- - Evaluate gates (code does this)
111
104
  - Validate transitions (code does this)
112
105
  - Check artifacts (code does this)
113
106
  - Generate artifacts directly
@@ -127,26 +120,24 @@ Rationale: Direct file operations consume 2-5k tokens per file. Subagent dispatc
127
120
 
128
121
  User: "Create OAuth2 API"
129
122
 
130
- 1. Call getContext() → availableActions: ["advance_to_specify"]
131
- 2. Choose action: "advance_to_specify"
132
- 3. Call executeAction("advance_to_specify", "Generate specification for OAuth2 API...")
133
- 4. Report: "Specification phase started. Waiting for specifier agent."
123
+ 1. Call getStatus() → currentPhase: "research", status: "in_progress"
124
+ 2. Call advancePhase({ workflowId, targetPhase: "specify" })
125
+ 3. Call setPendingAction({ workflowId, agent: "specifier", prompt: "Generate specification for OAuth2 API...", status: "awaiting_agent" })
126
+ 4. Report: "Specification phase started. Specifier agent dispatched."
134
127
 
135
128
  ## Rules
136
129
 
137
130
  ### MUST (Mandatory)
138
- 1. MUST start with getContext() before making decisions
139
- 2. MUST use availableActions to determine valid actions
140
- 3. MUST ask user for approval when pendingApproval is true
141
- 4. MUST trust the deterministic layer (gates, transitions)
142
- 5. MUST report progress after each action
131
+ 1. MUST start with getStatus() before making decisions
132
+ 2. MUST ask user for approval when pendingApproval is true
133
+ 3. MUST trust the deterministic layer (gates, transitions)
134
+ 4. MUST report progress after each action
143
135
 
144
136
  ### MUST NOT (Forbidden)
145
137
  1. MUST NOT hardcode phase transitions
146
- 2. MUST NOT evaluate gates (code does this)
147
- 3. MUST NOT generate artifacts directly
148
- 4. MUST NOT execute multiple phases in one invocation
149
- 5. MUST NOT bypass the approval flow
138
+ 2. MUST NOT generate artifacts directly
139
+ 3. MUST NOT execute multiple phases in one invocation
140
+ 4. MUST NOT bypass the approval flow
150
141
 
151
142
  ### SHOULD (Recommended)
152
143
  1. SHOULD compose clear prompts for subagents
@@ -157,7 +148,7 @@ User: "Create OAuth2 API"
157
148
  1. MAY suggest alternative approaches to user
158
149
  2. MAY provide status summaries between phases
159
150
 
160
- ## Specialized Agents (Invoked via executeAction)
151
+ ## Specialized Agents (Dispatched via setPendingAction)
161
152
 
162
153
  - `specifier`: Generates feature specifications
163
154
  - `planner`: Creates technical plans
@@ -210,7 +201,7 @@ The `stagingPath` field is no longer used — agents store artifacts directly vi
210
201
 
211
202
  ---
212
203
 
213
- **Version:** 2.1
204
+ **Version:** 2.2
214
205
  **Architecture:** Deterministic (code-enforced gates)
215
206
  **Prompt Size:** ~100 lines
216
207
  **Compliance:** 100% (enforced by code)
@@ -0,0 +1,62 @@
1
+ #!/bin/bash
2
+ # approval-guardian.sh — TD-128 F-09 Hook
3
+ # Trigger: PreToolUse on mcp__orchestrator-tools__approveAction and mcp__orchestrator-extended__completeWorkflow
4
+ # Purpose: Block auto-approve and auto-complete when workflow is awaiting_approval.
5
+ # Requires explicit human confirmation before proceeding.
6
+ #
7
+ # Output: JSON with permissionDecision (deny/allow)
8
+
9
+ set -euo pipefail
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ source "$SCRIPT_DIR/orch-helpers.sh"
13
+
14
+ STDIN_DATA=$(orch_read_stdin)
15
+ TOOL_NAME=$(orch_json_field "$STDIN_DATA" "tool_name")
16
+ orch_log "APPROVAL-GUARDIAN: PreToolUse $TOOL_NAME triggered"
17
+
18
+ # Extract workflow ID from tool_input
19
+ WORKFLOW_ID=$(orch_json_field "$STDIN_DATA" "tool_input.workflowId")
20
+ [ -z "$WORKFLOW_ID" ] && WORKFLOW_ID=$(orch_json_field "$STDIN_DATA" "workflowId")
21
+
22
+ if [ -z "$WORKFLOW_ID" ]; then
23
+ # No workflow ID — allow (fail-open for non-workflow calls)
24
+ orch_log "APPROVAL-GUARDIAN: ALLOW (no workflowId)"
25
+ echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","additionalContext":"No workflowId found, allowing."}}'
26
+ exit 0
27
+ fi
28
+
29
+ # Get auth token
30
+ TOKEN=$(orch_get_token 2>/dev/null) || TOKEN=""
31
+ if [ -z "$TOKEN" ]; then
32
+ # Can't check status — fail-open (auth issues shouldn't block workflow completion)
33
+ orch_log "APPROVAL-GUARDIAN: ALLOW (auth failed, fail-open)"
34
+ echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","additionalContext":"Auth failed, allowing."}}'
35
+ exit 0
36
+ fi
37
+
38
+ # Get workflow status
39
+ STATUS=$(curl -sf --max-time 5 "${API_URL}/api/v1/workflows/${WORKFLOW_ID}" \
40
+ -H "Authorization: Bearer $TOKEN" \
41
+ -H "X-Project-ID: $PROJECT_ID" 2>/dev/null) || STATUS=""
42
+
43
+ if [ -z "$STATUS" ]; then
44
+ orch_log "APPROVAL-GUARDIAN: ALLOW (could not fetch workflow status)"
45
+ echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","additionalContext":"Could not fetch workflow status, allowing."}}'
46
+ exit 0
47
+ fi
48
+
49
+ WORKFLOW_STATUS=$(orch_json_field "$STATUS" "status")
50
+ orch_log "APPROVAL-GUARDIAN: workflow=$WORKFLOW_ID status=$WORKFLOW_STATUS tool=$TOOL_NAME"
51
+
52
+ # Block approveAction AND completeWorkflow when awaiting_approval
53
+ if [ "$WORKFLOW_STATUS" = "awaiting_approval" ]; then
54
+ orch_log "APPROVAL-GUARDIAN: DENY (workflow awaiting_approval — human confirmation required for $TOOL_NAME)"
55
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Approval Guardian: Workflow is awaiting human approval. You MUST ask the user for explicit confirmation before calling ${TOOL_NAME}.\",\"additionalContext\":\"Present the workflow summary to the user and ask: 'Do you approve advancing to IMPLEMENT?' Wait for their response. Do NOT auto-approve or auto-complete.\"}}"
56
+ exit 0
57
+ fi
58
+
59
+ # All other statuses: ALLOW
60
+ orch_log "APPROVAL-GUARDIAN: ALLOW ($TOOL_NAME, status=$WORKFLOW_STATUS)"
61
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":\"${TOOL_NAME} allowed (status=${WORKFLOW_STATUS}).\"}}"
62
+ exit 0
package/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": "orchestrator-definitions/v1",
3
3
  "namespace": "orchestrator",
4
- "version": "3.16.0",
5
- "generatedAt": "2026-03-19T22:13:52.697Z",
4
+ "version": "3.17.1",
5
+ "generatedAt": "2026-03-20T19:11:53.058Z",
6
6
  "definitions": {
7
7
  "agents": [
8
8
  {
@@ -65,7 +65,7 @@
65
65
  "slug": "orchestrator",
66
66
  "file": "agents/orchestrator.md",
67
67
  "version": "1.0.0",
68
- "checksum": "sha256:0e8c6d3a5516dac268cb334b8b9a23d6a996936caf784e4faaead6160b18c34c",
68
+ "checksum": "sha256:b7a5cd4da196355be0a406dbc61d524462eb7fdcfb764fbbc88c54f067252192",
69
69
  "supersedes": null,
70
70
  "metadata": {}
71
71
  },
@@ -233,6 +233,14 @@
233
233
  }
234
234
  ],
235
235
  "hooks": [
236
+ {
237
+ "slug": "approval-guardian",
238
+ "file": "hooks/approval-guardian.sh",
239
+ "version": "1.0.0",
240
+ "checksum": "sha256:5d9c1080926610cd3dd1babc3815ec82c93f46177758a5a921f65a717196bd83",
241
+ "supersedes": null,
242
+ "metadata": {}
243
+ },
236
244
  {
237
245
  "slug": "dangling-workflow-guard",
238
246
  "file": "hooks/dangling-workflow-guard.sh",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-claude/definitions",
3
- "version": "3.16.0",
3
+ "version": "3.17.1",
4
4
  "description": "Built-in definitions (agents, skills, hooks, workflows, KB seeds) for the Orchestrator ecosystem",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",