@orchestrator-claude/definitions 3.31.1 → 3.32.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.
- package/agents/docs-guardian.md +13 -73
- package/hooks/dangling-guard.ts +148 -10
- package/hooks/gate-guardian.ts +177 -40
- package/hooks/lib/api-client.ts +419 -38
- package/hooks/lib/capability-scanner.ts +640 -0
- package/hooks/lib/finops-parser.ts +247 -0
- package/hooks/lib/gate-logic.ts +7 -7
- package/hooks/lib/git-checkpoint.ts +20 -20
- package/hooks/lib/observations-helper.ts +104 -0
- package/hooks/lib/sprint-context.ts +102 -0
- package/hooks/mailbox-listener.ts +139 -25
- package/hooks/post-compact.ts +137 -11
- package/hooks/post-implement.ts +88 -0
- package/hooks/session-start.ts +416 -47
- package/hooks/sprint-registry.ts +6 -5
- package/hooks/subagent-start.ts +27 -15
- package/hooks/subagent-stop.ts +72 -13
- package/hooks/user-prompt.ts +43 -15
- package/hooks/workflow-guard.ts +96 -37
- package/manifest.json +53 -29
- package/package.json +1 -1
- package/skills/backlog-synthesis/SKILL.md +1 -1
- package/skills/workflow-status/SKILL.md +1 -1
- package/hooks/pre-agent-dispatch.ts +0 -57
- package/hooks/verification-before-completion.ts +0 -97
|
@@ -18,7 +18,7 @@ cat .claude/agent-memory/orchestrator/MEMORY.md 2>/dev/null || echo "(empty)"
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
### Step 2: Query Active Workflows
|
|
21
|
-
Use MCP tool
|
|
21
|
+
Use MCP tool listWorkflowDefinitions or getStatus to check active workflow state.
|
|
22
22
|
|
|
23
23
|
### Step 3: Cross-Reference and Synthesize
|
|
24
24
|
Look for:
|
|
@@ -14,7 +14,7 @@ All workflow state is in **PostgreSQL** via MCP tools. NEVER read `.orchestrator
|
|
|
14
14
|
| Tool | What it returns |
|
|
15
15
|
|------|----------------|
|
|
16
16
|
| `getStatus` | Current workflow: phase, status, pending action |
|
|
17
|
-
| `
|
|
17
|
+
| `listWorkflowDefinitions` | All workflow type definitions (phases, modes) |
|
|
18
18
|
| `getNextAction` | Next pending action (agent + status) |
|
|
19
19
|
| `getInvocations` | Agent invocation history |
|
|
20
20
|
| `getMetrics` | Workflow metrics (duration, counts) |
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* pre-agent-dispatch.ts — PreToolUse hook for Agent tool (RFC-027 Sprint 4)
|
|
3
|
-
*
|
|
4
|
-
* Warns when dispatching known agents without subagent_type.
|
|
5
|
-
* Non-blocking: always exits 0.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { log, readStdin, getField, outputContext } from "./lib/api-client.js";
|
|
9
|
-
|
|
10
|
-
const HOOK = "PRE-AGENT-DISPATCH";
|
|
11
|
-
|
|
12
|
-
const KNOWN_AGENTS = [
|
|
13
|
-
"implementer",
|
|
14
|
-
"planner",
|
|
15
|
-
"specifier",
|
|
16
|
-
"reviewer",
|
|
17
|
-
"task-generator",
|
|
18
|
-
"researcher",
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const KNOWN_AGENTS_REGEX = new RegExp(
|
|
22
|
-
`\\b(${KNOWN_AGENTS.join("|")})\\b`,
|
|
23
|
-
"i"
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
async function main(): Promise<void> {
|
|
27
|
-
const stdin = await readStdin();
|
|
28
|
-
const toolInput = getField(stdin, "tool_input") || "";
|
|
29
|
-
const subagentType =
|
|
30
|
-
getField(stdin, "tool_input.subagent_type") ||
|
|
31
|
-
getField(stdin, "tool_input.subagentType") ||
|
|
32
|
-
"";
|
|
33
|
-
|
|
34
|
-
// If subagent_type is present, no warning needed
|
|
35
|
-
if (subagentType) {
|
|
36
|
-
log(HOOK, `Agent dispatched with subagent_type="${subagentType}", OK`);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Check if prompt mentions a known agent
|
|
41
|
-
const prompt =
|
|
42
|
-
getField(stdin, "tool_input.prompt") ||
|
|
43
|
-
getField(stdin, "tool_input.description") ||
|
|
44
|
-
(typeof toolInput === "string" ? toolInput : JSON.stringify(toolInput));
|
|
45
|
-
|
|
46
|
-
const match = prompt.match(KNOWN_AGENTS_REGEX);
|
|
47
|
-
if (match) {
|
|
48
|
-
const detected = match[1].toLowerCase();
|
|
49
|
-
outputContext(
|
|
50
|
-
HOOK,
|
|
51
|
-
`[WARN] Agent dispatched without subagent_type. Known agent detected: "${detected}". Add subagent_type for proper frontmatter loading.`
|
|
52
|
-
);
|
|
53
|
-
log(HOOK, `WARN: known agent "${detected}" without subagent_type`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
main().catch(() => process.exit(0));
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* verification-before-completion.ts — PreToolUse[Bash] hook
|
|
3
|
-
*
|
|
4
|
-
* Injects a verification reminder when the model is about to run
|
|
5
|
-
* `git commit` or `git push`. Does NOT block — only adds context.
|
|
6
|
-
*
|
|
7
|
-
* Principle: Evidence before claims, always.
|
|
8
|
-
* Source: verification-before-completion skill (superpowers 5.0.7)
|
|
9
|
-
*
|
|
10
|
-
* Flow:
|
|
11
|
-
* 1. readStdin() → extract bash command
|
|
12
|
-
* 2. commandMatchesGitOp() → check for commit/push
|
|
13
|
-
* 3. If match → output allow + context reminder
|
|
14
|
-
* 4. If no match → silent pass-through (no output)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { log, readStdin, getField, outputPreToolUse } from "./lib/api-client.js";
|
|
18
|
-
|
|
19
|
-
const HOOK = "VERIFICATION-REMINDER";
|
|
20
|
-
|
|
21
|
-
// ─────────────────────────────────────────────────────────────
|
|
22
|
-
// Dependency injection interface (enables testing without IO)
|
|
23
|
-
// ─────────────────────────────────────────────────────────────
|
|
24
|
-
|
|
25
|
-
export interface HookDeps {
|
|
26
|
-
readStdin: () => Promise<Record<string, unknown>>;
|
|
27
|
-
output: (opts: { decision: "allow" | "deny"; reason?: string; context?: string }) => void;
|
|
28
|
-
log: (prefix: string, msg: string) => void;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const defaultDeps: HookDeps = {
|
|
32
|
-
readStdin,
|
|
33
|
-
output: outputPreToolUse,
|
|
34
|
-
log,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// ─────────────────────────────────────────────────────────────
|
|
38
|
-
// Pure helpers (exported for testing)
|
|
39
|
-
// ─────────────────────────────────────────────────────────────
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Returns true when the bash command string contains a git commit or git push
|
|
43
|
-
* operation. Handles common variations: `git commit`, `git push`, multi-command
|
|
44
|
-
* pipelines (`&&`, `;`), and quoted forms.
|
|
45
|
-
*/
|
|
46
|
-
export function commandMatchesGitOp(command: string): boolean {
|
|
47
|
-
return /git\s+(commit|push)/.test(command);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// ─────────────────────────────────────────────────────────────
|
|
51
|
-
// Core logic (exported for testing)
|
|
52
|
-
// ─────────────────────────────────────────────────────────────
|
|
53
|
-
|
|
54
|
-
export async function mainWithDeps(deps: HookDeps): Promise<void> {
|
|
55
|
-
const { readStdin, output, log } = deps;
|
|
56
|
-
|
|
57
|
-
const stdin = await readStdin();
|
|
58
|
-
|
|
59
|
-
// Extract the bash command from the tool input envelope
|
|
60
|
-
const command =
|
|
61
|
-
(getField(stdin, "tool_input.command") as string | undefined) ||
|
|
62
|
-
(getField(stdin, "command") as string | undefined) ||
|
|
63
|
-
"";
|
|
64
|
-
|
|
65
|
-
if (!commandMatchesGitOp(command)) {
|
|
66
|
-
// Silent pass-through — not a git commit/push, nothing to do
|
|
67
|
-
log(HOOK, `PASS (no git op): ${command.slice(0, 60)}`);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
log(HOOK, `REMIND git op detected: ${command.slice(0, 80)}`);
|
|
72
|
-
|
|
73
|
-
// Allow the command but inject a verification reminder as context.
|
|
74
|
-
// This hook NEVER blocks — it only nudges the model to verify first.
|
|
75
|
-
output({
|
|
76
|
-
decision: "allow",
|
|
77
|
-
context: [
|
|
78
|
-
"[VERIFICATION-REMINDER] You are about to run a git commit/push.",
|
|
79
|
-
"Before proceeding, confirm:",
|
|
80
|
-
" 1. Tests pass — run the test command and paste the output.",
|
|
81
|
-
" 2. Lint clean — run the lint command and confirm 0 errors.",
|
|
82
|
-
" 3. Build succeeds — run the build command and confirm exit 0.",
|
|
83
|
-
" 4. All acceptance criteria have matching test evidence.",
|
|
84
|
-
"Evidence before claims. No shortcuts for verification.",
|
|
85
|
-
].join("\n"),
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// ─────────────────────────────────────────────────────────────
|
|
90
|
-
// Entry point (production use)
|
|
91
|
-
// ─────────────────────────────────────────────────────────────
|
|
92
|
-
|
|
93
|
-
async function main(): Promise<void> {
|
|
94
|
-
await mainWithDeps(defaultDeps);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
main().catch(() => process.exit(0));
|