@orchestrator-claude/definitions 3.36.0 → 3.37.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.
- package/agents/adversarial-reviewer.md +6 -1
- package/agents/api-extractor.md +6 -0
- package/agents/azure-devops-engineer.md +1 -2
- package/agents/business-rule-miner.md +6 -0
- package/agents/cicd-platform-engineer.md +1 -2
- package/agents/ciclo-engineer.md +15 -2
- package/agents/code-archaeologist.md +6 -0
- package/agents/debug-sidecar.md +6 -0
- package/agents/doc-sidecar.md +6 -0
- package/agents/docs-guardian.md +9 -3
- package/agents/frontend-engineer.md +1 -2
- package/agents/{ai-architect.md → harness-architect.md} +26 -5
- package/agents/implementer.md +6 -1
- package/agents/legacy-discoverer.md +6 -0
- package/agents/legacy-synthesizer.md +6 -0
- package/agents/methodology-researcher.md +6 -1
- package/agents/operational-artifact-builder.md +6 -1
- package/agents/orchestrator.md +27 -87
- package/agents/planner.md +6 -1
- package/agents/presentation-engineer.md +5 -4
- package/agents/python-data-engineer.md +0 -1
- package/agents/researcher.md +6 -0
- package/agents/reviewer.md +6 -1
- package/agents/schema-extractor.md +6 -0
- package/agents/software-architect.md +30 -7
- package/agents/specifier.md +6 -1
- package/agents/task-generator.md +6 -1
- package/agents/test-sidecar.md +6 -0
- package/dist/scripts/generate-hooks-matcher.d.ts +106 -0
- package/dist/scripts/generate-hooks-matcher.d.ts.map +1 -0
- package/dist/scripts/generate-hooks-matcher.js +153 -0
- package/dist/scripts/generate-hooks-matcher.js.map +1 -0
- package/dist/scripts/generate-manifest.d.ts +22 -0
- package/dist/scripts/generate-manifest.d.ts.map +1 -1
- package/dist/scripts/generate-manifest.js +67 -2
- package/dist/scripts/generate-manifest.js.map +1 -1
- package/hooks/agent-git-guard.mjs +63 -11
- package/hooks/dangling-guard.mjs +42 -12
- package/hooks/gate-guardian.mjs +38 -8
- package/hooks/hooks.json +3 -9
- package/hooks/lib/api-client.ts +128 -9
- package/hooks/lib/capability-scanner.ts +391 -55
- package/hooks/lib/dispatch-marker.ts +214 -0
- package/hooks/lib/git-checkpoint.ts +34 -37
- package/hooks/lib/observations-helper.ts +14 -1
- package/hooks/mailbox-listener.mjs +69 -17
- package/hooks/playwright-output-guard.mjs +40 -10
- package/hooks/post-implement.mjs +38 -8
- package/hooks/pre-agent-dispatch.mjs +137 -16
- package/hooks/pre-agent-dispatch.ts +82 -15
- package/hooks/session-start.mjs +274 -103
- package/hooks/session-start.ts +250 -69
- package/hooks/subagent-start.mjs +7665 -22
- package/hooks/subagent-start.ts +367 -16
- package/hooks/subagent-stop.mjs +102 -62
- package/hooks/subagent-stop.ts +124 -28
- package/hooks/user-prompt.mjs +43 -13
- package/hooks/verification-before-completion.mjs +63 -11
- package/hooks/workflow-guard.mjs +45 -11
- package/hooks-settings-template.json +1 -7
- package/manifest.json +62 -62
- package/package.json +4 -2
- package/skills/checkpoint-protocol/SKILL.md +19 -4
- package/skills/ciclo-lane-dispatch/SKILL.md +24 -0
- package/skills/fase-1b-projecao/SKILL.md +146 -0
- package/skills/orchestrator/SKILL.md +11 -3
- package/skills/workflow-coordination/SKILL.md +3 -3
- package/hooks/post-compact.mjs +0 -7931
- package/hooks/post-compact.ts +0 -170
package/hooks/post-compact.ts
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* post-compact.ts — PostCompact hook (RFC-022 Phase 2)
|
|
3
|
-
* NEW hook: re-injects workflow state after context compaction
|
|
4
|
-
* so Claude doesn't lose track of active workflow.
|
|
5
|
-
* Enhanced (RFC-027 S3): also re-injects capability matrix + memory context.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
9
|
-
import { join, dirname } from 'node:path';
|
|
10
|
-
import { fileURLToPath } from 'node:url';
|
|
11
|
-
import { parse as parseYaml } from 'yaml';
|
|
12
|
-
import { log, getActiveWorkflow, getNextAction, outputContext } from './lib/api-client.js';
|
|
13
|
-
import {
|
|
14
|
-
needsRescan,
|
|
15
|
-
buildCapabilityIndex,
|
|
16
|
-
writeCapabilitiesToVault,
|
|
17
|
-
readCapabilitiesFromVault,
|
|
18
|
-
scanAgentDefinitions,
|
|
19
|
-
formatCapabilityMatrix,
|
|
20
|
-
readMemoryIndex,
|
|
21
|
-
filterRelevantMemories,
|
|
22
|
-
formatMemoryContext,
|
|
23
|
-
} from './lib/capability-scanner.js';
|
|
24
|
-
|
|
25
|
-
const HOOK = 'POST-COMPACT';
|
|
26
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
27
|
-
const __dirname = dirname(__filename);
|
|
28
|
-
const PROJECT_ROOT = join(__dirname, '..', '..');
|
|
29
|
-
|
|
30
|
-
// ─── Capability Matrix paths (mirror session-start.ts constants) ────────────
|
|
31
|
-
const HOME = process.env.HOME ?? process.env.USERPROFILE ?? '/home/user';
|
|
32
|
-
const INSTALLED_PLUGINS_PATH = join(HOME, '.claude', 'plugins', 'installed_plugins.json');
|
|
33
|
-
const AGENTS_DIR = join(PROJECT_ROOT, '.claude', 'agents');
|
|
34
|
-
const VAULT_CONFIG_PATH = join(PROJECT_ROOT, 'project-guidelines', '.vault-config.yaml');
|
|
35
|
-
const PROFILES_PATH = join(PROJECT_ROOT, '.claude', 'plugin-profiles.yaml');
|
|
36
|
-
const MEMORY_INDEX_PATH = join(
|
|
37
|
-
PROJECT_ROOT,
|
|
38
|
-
'.claude',
|
|
39
|
-
'agent-memory',
|
|
40
|
-
'orchestrator',
|
|
41
|
-
'memory-index.yaml'
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Build [CAPABILITY-MATRIX] + [MEMORY-CONTEXT] lines for injection.
|
|
46
|
-
* Fail-open: returns empty string on any error.
|
|
47
|
-
* Pattern copied from session-start.ts buildCapabilityMatrixContext().
|
|
48
|
-
*/
|
|
49
|
-
function buildCapabilityMatrixContext(): string {
|
|
50
|
-
try {
|
|
51
|
-
let index = readCapabilitiesFromVault(VAULT_CONFIG_PATH);
|
|
52
|
-
const cachedMtime = index?.installedPluginsMtime ?? '';
|
|
53
|
-
|
|
54
|
-
if (!index || needsRescan(INSTALLED_PLUGINS_PATH, cachedMtime)) {
|
|
55
|
-
log(HOOK, 'Capability rescan triggered');
|
|
56
|
-
index = buildCapabilityIndex({
|
|
57
|
-
installedPluginsPath: INSTALLED_PLUGINS_PATH,
|
|
58
|
-
agentsDir: AGENTS_DIR,
|
|
59
|
-
vaultConfigPath: VAULT_CONFIG_PATH,
|
|
60
|
-
profilesPath: PROFILES_PATH,
|
|
61
|
-
});
|
|
62
|
-
writeCapabilitiesToVault(VAULT_CONFIG_PATH, index);
|
|
63
|
-
} else {
|
|
64
|
-
// Agents are always scanned fresh (fast, <10ms)
|
|
65
|
-
index.agents = scanAgentDefinitions(AGENTS_DIR);
|
|
66
|
-
log(HOOK, 'Using cached capability index');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const matrixLine = formatCapabilityMatrix(index);
|
|
70
|
-
|
|
71
|
-
// Memory context
|
|
72
|
-
const memoryEntries = readMemoryIndex(MEMORY_INDEX_PATH);
|
|
73
|
-
let memoryLine = '';
|
|
74
|
-
if (memoryEntries) {
|
|
75
|
-
const filtered = filterRelevantMemories(memoryEntries);
|
|
76
|
-
memoryLine = formatMemoryContext(filtered);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return [matrixLine, memoryLine].filter(Boolean).join('\n');
|
|
80
|
-
} catch (err) {
|
|
81
|
-
log(HOOK, `Capability matrix failed: ${err}`);
|
|
82
|
-
return '';
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Read version — try project-state.yaml first (RFC-033 Phase 1),
|
|
88
|
-
* fall back to legacy BACKLOG.md regex on any failure.
|
|
89
|
-
*/
|
|
90
|
-
function readVersion(): string {
|
|
91
|
-
// Primary: project-state.yaml
|
|
92
|
-
try {
|
|
93
|
-
const statePath = join(PROJECT_ROOT, 'project-guidelines', 'project-state.yaml');
|
|
94
|
-
if (existsSync(statePath)) {
|
|
95
|
-
const raw = readFileSync(statePath, 'utf-8');
|
|
96
|
-
const doc = parseYaml(raw) as Record<string, unknown>;
|
|
97
|
-
const version = doc?.version as string | undefined;
|
|
98
|
-
if (version && typeof version === 'string' && /^v\d+\.\d+\.\d+/.test(version)) {
|
|
99
|
-
log(HOOK, `project-state.yaml version=${version}`);
|
|
100
|
-
return version;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
} catch {
|
|
104
|
-
// fall through to BACKLOG.md
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Fallback: BACKLOG.md regex (original logic, preserved)
|
|
108
|
-
try {
|
|
109
|
-
const backlogPath = join(PROJECT_ROOT, 'project-guidelines', 'BACKLOG.md');
|
|
110
|
-
if (!existsSync(backlogPath)) return 'v?.?.?';
|
|
111
|
-
const content = readFileSync(backlogPath, 'utf-8');
|
|
112
|
-
const lines = content.split('\n').slice(0, 40);
|
|
113
|
-
const versionLine = lines.find((l) => /release atual|current release/i.test(l));
|
|
114
|
-
const match = versionLine?.match(/v(\d+\.\d+\.\d+)/);
|
|
115
|
-
log(HOOK, 'BACKLOG.md fallback version');
|
|
116
|
-
return match ? `v${match[1]}` : 'v?.?.?';
|
|
117
|
-
} catch {
|
|
118
|
-
return 'v?.?.?';
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
async function main(): Promise<void> {
|
|
123
|
-
log(HOOK, 'PostCompact hook triggered');
|
|
124
|
-
|
|
125
|
-
const version = readVersion();
|
|
126
|
-
const capabilityContext = buildCapabilityMatrixContext();
|
|
127
|
-
const workflow = await getActiveWorkflow();
|
|
128
|
-
|
|
129
|
-
if (!workflow) {
|
|
130
|
-
log(HOOK, 'No active workflow — injecting capability context only');
|
|
131
|
-
outputContext(
|
|
132
|
-
'PostCompact',
|
|
133
|
-
[
|
|
134
|
-
`[ORCHESTRATOR] Context was compacted. version=${version} | workflow=none`,
|
|
135
|
-
`Remember: YOU are the orchestrator (RFC-022). Dispatch sub-agents directly via Agent tool.`,
|
|
136
|
-
capabilityContext,
|
|
137
|
-
]
|
|
138
|
-
.filter(Boolean)
|
|
139
|
-
.join('\n')
|
|
140
|
-
);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const parts: string[] = [
|
|
145
|
-
`[ORCHESTRATOR] Context was compacted. Active workflow state:`,
|
|
146
|
-
`Workflow: ${workflow.id}`,
|
|
147
|
-
`Type: ${workflow.type}`,
|
|
148
|
-
`Phase: ${workflow.currentPhase}`,
|
|
149
|
-
`Status: ${workflow.status}`,
|
|
150
|
-
];
|
|
151
|
-
|
|
152
|
-
const action = await getNextAction(workflow.id);
|
|
153
|
-
if (action?.hasAction && action.pendingAction) {
|
|
154
|
-
parts.push(`Next: invoke '${action.pendingAction.agent}' (${action.pendingAction.status})`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
parts.push(
|
|
158
|
-
'',
|
|
159
|
-
'Remember: YOU are the orchestrator (RFC-022). Dispatch sub-agents directly via Agent tool.'
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
if (capabilityContext) {
|
|
163
|
-
parts.push(capabilityContext);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
log(HOOK, `Re-injecting workflow state + capability context (wf=${workflow.id})`);
|
|
167
|
-
outputContext('PostCompact', parts.join('\n'));
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
main().catch(() => process.exit(0));
|