@cgh567/agent 2.4.1 → 2.4.2

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 (146) hide show
  1. package/bin/helios +0 -0
  2. package/bin/helios-rpc-node-wrapper.cjs +0 -0
  3. package/bin/helios-rpc-wrapper.sh +0 -0
  4. package/daemon/adapters/helios-rpc-adapter.js +47 -25
  5. package/daemon/config/com.familiar.helios-daemon.plist +5 -0
  6. package/daemon/config/helios-daemon.service +4 -0
  7. package/daemon/context-enrichment.js +59 -21
  8. package/daemon/helios-api.js +149 -37
  9. package/daemon/helios-company-daemon.js +516 -124
  10. package/daemon/lib/harada/cascade-judge.js +12 -50
  11. package/daemon/lib/harada/mandala.js +20 -0
  12. package/daemon/lib/harada/pillar-dispatcher.js +1 -1
  13. package/daemon/lib/harada/project-factory.js +7 -2
  14. package/daemon/lib/hbo-bridge.js +31 -12
  15. package/daemon/lib/helios-hitl-host.js +15 -2
  16. package/daemon/lib/hitl-interaction-service.js +0 -0
  17. package/daemon/lib/memgraph-verify.js +38 -33
  18. package/daemon/lib/project-drift-detector.js +7 -17
  19. package/daemon/lib/project-semantic-updater.js +1 -14
  20. package/daemon/routes/channels.js +10 -5
  21. package/daemon/routes/harada-map.js +11 -48
  22. package/daemon/routes/hbo.js +89 -28
  23. package/daemon/routes/hitl.js +0 -0
  24. package/daemon/routes/project.js +4 -3
  25. package/daemon/routes/wizard.js +11 -4
  26. package/daemon/schema-migrations-hitl.js +0 -0
  27. package/extensions/001-tool-output-cap.ts +0 -0
  28. package/extensions/context-compaction.ts +45 -26
  29. package/extensions/cortex/activation-bridge.ts +5 -0
  30. package/extensions/cortex/learn.ts +26 -0
  31. package/extensions/email/backfill.ts +0 -0
  32. package/extensions/helios-governance/analysis/ambiguity.ts +0 -0
  33. package/extensions/helios-governance/analysis/compliance.ts +0 -0
  34. package/extensions/helios-governance/analysis/long-task-detector.ts +0 -0
  35. package/extensions/helios-governance/analysis/output-contract.ts +0 -0
  36. package/extensions/helios-governance/analysis/patterns.ts +0 -0
  37. package/extensions/helios-governance/analysis/preflight.ts +0 -0
  38. package/extensions/helios-governance/analysis/recurring-violations.ts +0 -0
  39. package/extensions/helios-governance/analysis/task-classification.ts +0 -0
  40. package/extensions/helios-governance/analysis/task-intent.ts +0 -0
  41. package/extensions/helios-governance/gates/high-impact.ts +1 -1
  42. package/extensions/helios-governance/handlers/_jiti-require.ts +15 -8
  43. package/extensions/helios-governance/handlers/proxy-test-detector.ts +0 -0
  44. package/extensions/hema-dispatch-v3/graph-memory.ts +10 -0
  45. package/extensions/hema-dispatch-v3/index.ts +59 -40
  46. package/extensions/lib/elo-engine.js +0 -0
  47. package/extensions/lib/elo-engine.test.js +0 -0
  48. package/extensions/memgraph-autostart.ts +13 -0
  49. package/extensions/neuroplastic-eval.ts +0 -0
  50. package/extensions/shadow-loop/index.ts +0 -0
  51. package/lib/brain-v2-budget.js +0 -0
  52. package/lib/brain-v2-circuit-breaker.js +0 -0
  53. package/lib/brain-v2.js +0 -0
  54. package/lib/broker/adaptive-throttle.js +0 -0
  55. package/lib/broker/batch-coalescer.js +0 -0
  56. package/lib/broker/bulkhead.js +0 -0
  57. package/lib/broker/channel-registry.js +0 -0
  58. package/lib/broker/circuit-breaker.js +0 -0
  59. package/lib/broker/evidence-cache.js +0 -0
  60. package/lib/broker/health-monitor.js +0 -0
  61. package/lib/broker/mage-queue.js +0 -0
  62. package/lib/broker/priority-queue.js +0 -0
  63. package/lib/broker/server.js.bak-error2-fix +0 -0
  64. package/lib/broker/session-registry.js +0 -0
  65. package/lib/broker/singleton-timers.js +0 -0
  66. package/lib/broker/types.d.ts +0 -0
  67. package/lib/broker/vegas-limit.js +0 -0
  68. package/lib/compression/dist/ccr-store.js +74 -0
  69. package/lib/compression/dist/content-router.js +115 -0
  70. package/lib/compression/dist/pipeline.js +113 -0
  71. package/lib/compression/dist/server.js +265 -0
  72. package/lib/compression/dist/smart-crusher.js +251 -0
  73. package/lib/context-budget.ts +0 -0
  74. package/lib/context-firewall.js +0 -0
  75. package/lib/crm/integration/triage-bridge.js +0 -0
  76. package/lib/email-utils.ts +0 -0
  77. package/lib/eval/__tests__/preflight-checker.test.ts +0 -0
  78. package/lib/eval/__tests__/task-instruction-parser.test.ts +0 -0
  79. package/lib/eval/__tests__/verifier-runner.test.ts +0 -0
  80. package/lib/eval/index.ts +0 -0
  81. package/lib/eval/preflight-checker.ts +0 -0
  82. package/lib/eval/task-domain-classifier.ts +0 -0
  83. package/lib/eval/task-instruction-parser.ts +0 -0
  84. package/lib/eval/verifier-runner.ts +0 -0
  85. package/lib/event-bus.d.ts +0 -0
  86. package/lib/governance-context-selector.ts +0 -0
  87. package/lib/graph/generate-extension-embeddings.js +0 -0
  88. package/lib/graph/generate-static-embeddings.js +0 -0
  89. package/lib/graph/lib/utils.js +1 -1
  90. package/lib/graph-audit.d.ts +0 -0
  91. package/lib/mesh-circuit-breaker.js +0 -0
  92. package/lib/mission-loop/lesson-extractor.ts +0 -0
  93. package/lib/mission-loop/mental-model-scorer.ts +0 -0
  94. package/lib/mission-loop/occ-detector.ts +0 -0
  95. package/lib/mission-loop/query-variants.ts +0 -0
  96. package/lib/mission-loop/verifier-check.ts +0 -0
  97. package/lib/skill-reference-builder.ts +0 -0
  98. package/lib/telemetry/token-breakdown.ts +0 -0
  99. package/lib/tool-compressor.ts +0 -0
  100. package/lib/triage-core/legal-routing.ts +0 -0
  101. package/lib/triage-core/mental-model/dunbar-classifier.ts +0 -0
  102. package/lib/triage-core/mental-model/enrich-all.ts +0 -0
  103. package/lib/triage-core/mental-model/identity-resolver.ts +0 -0
  104. package/lib/triage-core/mental-model/key-facts.ts +0 -0
  105. package/lib/triage-core/mental-model/model-assembler.ts +0 -0
  106. package/lib/triage-core/orchestrator.ts +0 -0
  107. package/lib/triage-core/orchestrator.ts.bak-r005-r006-r008 +0 -0
  108. package/package.json +10 -4
  109. package/skills/helios-business-operator/services/signals/upwork-signals.js +0 -0
  110. package/skills/talisman-ceo/SKILL.md +23 -25
  111. package/skills/talisman-comms/SKILL.md +5 -5
  112. package/skills/talisman-engineering/SKILL.md +5 -5
  113. package/skills/talisman-finance/SKILL.md +10 -8
  114. package/skills/talisman-marketing/SKILL.md +10 -10
  115. package/skills/talisman-sales/SKILL.md +12 -15
  116. package/skills/talisman-support/SKILL.md +5 -5
  117. package/agents/business/talisman-ceo.md +0 -183
  118. package/agents/business/talisman-comms.md +0 -257
  119. package/agents/business/talisman-cto.md +0 -153
  120. package/agents/business/talisman-finance.md +0 -246
  121. package/agents/business/talisman-marketing.md +0 -240
  122. package/agents/business/talisman-sales.md +0 -242
  123. package/agents/business/talisman-support.md +0 -236
  124. package/daemon/lib/approval-expiry.js +0 -162
  125. package/daemon/lib/blast-radius-analyzer.js +0 -75
  126. package/daemon/lib/domain-bootstrap-orchestrator.js +0 -267
  127. package/daemon/lib/forensic-log.js +0 -113
  128. package/daemon/lib/goal-research-pipeline.js +0 -644
  129. package/daemon/lib/harada/cascade-research-dispatcher.js +0 -261
  130. package/daemon/lib/headroom-middleware.js +0 -167
  131. package/daemon/lib/headroom-proxy-manager.js +0 -623
  132. package/daemon/lib/hed-engine.js +0 -307
  133. package/daemon/lib/mental-model-cache.js +0 -96
  134. package/daemon/lib/project-factory.js +0 -47
  135. package/daemon/lib/session-log-reader.js +0 -93
  136. package/daemon/routes/hed.js +0 -133
  137. package/lib/graph/learning/headroom-learn-bridge.js +0 -215
  138. package/skills/helios-bookkeeping/SKILL.md +0 -321
  139. package/skills/helios-briefer/SKILL.md +0 -44
  140. package/skills/helios-client-relations/SKILL.md +0 -322
  141. package/skills/helios-personal-triager/SKILL.md +0 -45
  142. package/skills/helios-recruitment/SKILL.md +0 -317
  143. package/skills/helios-relationship-nudger/SKILL.md +0 -77
  144. package/skills/helios-researcher/SKILL.md +0 -44
  145. package/skills/helios-scheduler/SKILL.md +0 -58
  146. package/skills/helios-tax-analyst/SKILL.md +0 -280
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-finance
4
- description: Finance/Operations department for Talisman — budget tracking, cost attribution, and model tiering enforcement
4
+ description: Finance/Operations department — budget tracking, cost attribution, and model tiering enforcement
5
5
  when: Loaded by the Finance agent when monitoring budgets, generating cost reports, or enforcing spending limits
6
6
  disable-model-invocation: true
7
7
  ---
@@ -32,19 +32,21 @@ Model Tiering: Engineering downgraded to Sonnet (was Opus) — 67% budget used
32
32
  ## 1. BOOT SEQUENCE (3 Steps — UNCONDITIONAL)
33
33
 
34
34
  **Step 1**: Read current budget status
35
- ```bash
36
- cat ~/helios-agent/brainv2/budget-status.json
35
+ ```cypher
36
+ MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID})
37
+ RETURN bp.scope, bp.agentId, bp.limitCents, bp.spentCents, bp.percentUsed, bp.status
38
+ ORDER BY bp.percentUsed DESC
37
39
  ```
38
40
 
39
41
  **Step 2**: Query CostEvent aggregation from Memgraph
40
42
  ```
41
- MATCH (ce:CostEvent {companyId: 'talisman'})
43
+ MATCH (ce:CostEvent {companyId: $HELIOS_COMPANY_ID})
42
44
  RETURN ce.agentId, sum(ce.costCents) as totalCents, count(ce) as taskCount
43
45
  ```
44
46
 
45
47
  **Step 3**: Compare against BudgetPolicy limits
46
48
  ```
47
- MATCH (bp:BudgetPolicy {companyId: 'talisman'}) RETURN bp.scope, bp.limitCents, bp.spentCents, bp.status
49
+ MATCH (bp:BudgetPolicy {companyId: $HELIOS_COMPANY_ID}) RETURN bp.scope, bp.limitCents, bp.spentCents, bp.status
48
50
  ```
49
51
 
50
52
  ---
@@ -85,17 +87,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
85
87
  ```cypher
86
88
  MERGE (bt:BusinessTask {id: $id})
87
89
  ON CREATE SET
88
- bt.companyId = 'talisman',
90
+ bt.companyId = $HELIOS_COMPANY_ID,
89
91
  bt.title = $title,
90
92
  bt.description = $description,
91
- bt.assigneeId = 'agent:finance',
93
+ bt.assigneeId = $HELIOS_AGENT_ID,
92
94
  bt.priority = $priority,
93
95
  bt.status = 'todo',
94
96
  bt.goalId = $goalId,
95
97
  bt.createdAt = datetime()
96
98
  ```
97
99
 
98
- **Your agent ID**: `agent:finance`
100
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
99
101
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
100
102
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
101
103
 
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-marketing
4
- description: Marketing department for Talisman — content strategy, blog posts, and social media for accounting professionals
4
+ description: Marketing department — content strategy, blog posts, and social media campaigns
5
5
  when: Loaded by the Marketing agent when creating content, managing calendar, or running campaigns
6
6
  disable-model-invocation: true
7
7
  ---
8
8
 
9
- ## ⛔ STOP — Is this content accurate about Talisman's actual features?
9
+ ## ⛔ STOP — Is this content accurate about the company's actual features?
10
10
 
11
- > Before publishing ANY content: Verify claimed features exist in ~/Projects/talisman/README.md or product.md.
11
+ > Before publishing ANY content: Verify claimed features exist in the product documentation.
12
12
 
13
13
  If **you're unsure** → Save as draft, flag for human review. NEVER make up product capabilities.
14
14
 
@@ -27,12 +27,12 @@ Content Queue: 3 blog posts in pipeline (2 drafts, 1 outlined)
27
27
 
28
28
  **Step 1**: Check what content is pending/in-progress
29
29
  ```
30
- MATCH (cp:ContentPiece {companyId: 'talisman'}) WHERE cp.status IN ['draft','in_progress'] RETURN cp.title, cp.type, cp.status
30
+ MATCH (cp:ContentPiece {companyId: $HELIOS_COMPANY_ID}) WHERE cp.status IN ['draft','in_progress'] RETURN cp.title, cp.type, cp.status
31
31
  ```
32
32
 
33
33
  **Step 2**: Read product features to avoid false claims
34
34
  ```bash
35
- cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head -50
35
+ cat product.md 2>/dev/null || echo "No product.md found — check company docs"
36
36
  ```
37
37
 
38
38
  **Step 3**: Check content calendar for this week's priorities
@@ -55,7 +55,7 @@ cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head
55
55
 
56
56
  - Target audience: accountants, bookkeepers, firm owners frustrated with manual work
57
57
  - NEVER auto-publish — all content saved as DRAFT for human review
58
- - NEVER make feature claims not verified in product.md
58
+ - NEVER make feature claims not verified in product documentation
59
59
  - Blog topics: accounting automation, efficiency, tool comparisons, pain points
60
60
  - LinkedIn primary channel (B2B accounting), Twitter secondary
61
61
  - Keyword focus: "accounting automation", "bookkeeping software", "CPA workflow"
@@ -64,7 +64,7 @@ cat ~/Projects/talisman/.amazonq/rules/memory-bank/product.md 2>/dev/null | head
64
64
 
65
65
  ## 4. VERIFICATION CHECKPOINT
66
66
 
67
- - [ ] Is this content accurate about Talisman's features? YES → draft. NO → remove claims.
67
+ - [ ] Is this content accurate about the company's features? YES → draft. NO → remove claims.
68
68
  - [ ] Is content saved as DRAFT (not auto-published)? YES → task complete. NO → STOP.
69
69
 
70
70
  ## Task Creation Protocol
@@ -74,17 +74,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
74
74
  ```cypher
75
75
  MERGE (bt:BusinessTask {id: $id})
76
76
  ON CREATE SET
77
- bt.companyId = 'talisman',
77
+ bt.companyId = $HELIOS_COMPANY_ID,
78
78
  bt.title = $title,
79
79
  bt.description = $description,
80
- bt.assigneeId = 'agent:marketing',
80
+ bt.assigneeId = $HELIOS_AGENT_ID,
81
81
  bt.priority = $priority,
82
82
  bt.status = 'todo',
83
83
  bt.goalId = $goalId,
84
84
  bt.createdAt = datetime()
85
85
  ```
86
86
 
87
- **Your agent ID**: `agent:marketing`
87
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
88
88
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
89
89
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
90
90
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-sales
4
- description: Sales department for Talisman — lead gen, outreach, and qualification for accounting firms
4
+ description: Sales department — lead gen, outreach, and qualification
5
5
  when: Loaded by the Sales Lead agent when processing leads, outreach, and pipeline management
6
6
  adapter:
7
7
  type: helios_rpc
@@ -9,10 +9,7 @@ adapter:
9
9
  - helios-prime
10
10
  - outreach-playbook
11
11
  - crm
12
- agent_id: "agent:sales-lead"
13
- company_id: talisman
14
- departments:
15
- - Sales
12
+ agent_id: "agent:sales"
16
13
  disable-model-invocation: true
17
14
  ---
18
15
 
@@ -42,25 +39,25 @@ Qualified Leads: 1 new Opportunity created (Smith & Co, estimated $4,800/yr)
42
39
  # Read any pending outreach approvals from Memgraph
43
40
  ```
44
41
  ```cypher
45
- MATCH (r:Routine {companyId: 'talisman', name: 'sales-daily'})
42
+ MATCH (r:Routine {companyId: $HELIOS_COMPANY_ID, name: 'sales-daily'})
46
43
  RETURN r.firstRunAt, duration.inDays(r.firstRunAt, datetime()).days AS daysSinceStart
47
44
  ```
48
45
 
49
46
  **Step 2**: Query pipeline status from Memgraph
50
47
  ```cypher
51
- MATCH (opp:Opportunity {companyId: 'talisman'})
48
+ MATCH (opp:Opportunity {companyId: $HELIOS_COMPANY_ID})
52
49
  RETURN opp.stage, count(opp) AS count
53
50
  ORDER BY count DESC
54
51
  ```
55
52
  ```cypher
56
- MATCH (l:Lead {companyId: 'talisman'})
53
+ MATCH (l:Lead {companyId: $HELIOS_COMPANY_ID})
57
54
  WHERE l.status = 'new'
58
55
  RETURN count(l) AS newLeads
59
56
  ```
60
57
 
61
58
  **Step 3**: Check for pending replies to process
62
59
  ```cypher
63
- MATCH (m:Message {companyId: 'talisman', category: 'lead_response'})
60
+ MATCH (m:Message {companyId: $HELIOS_COMPANY_ID, category: 'lead_response'})
64
61
  WHERE m.processed = false
65
62
  RETURN m
66
63
  ORDER BY m.receivedAt ASC
@@ -188,7 +185,7 @@ For each signal, gather:
188
185
 
189
186
  ### Log a new prospect:
190
187
  ```cypher
191
- MERGE (l:Lead {id: $leadId, companyId: 'talisman'})
188
+ MERGE (l:Lead {id: $leadId, companyId: $HELIOS_COMPANY_ID})
192
189
  SET l.name = $firmName,
193
190
  l.domain = $domain,
194
191
  l.status = 'new',
@@ -199,7 +196,7 @@ SET l.name = $firmName,
199
196
 
200
197
  ### Create Opportunity after qualification:
201
198
  ```cypher
202
- MERGE (opp:Opportunity {id: $oppId, companyId: 'talisman'})
199
+ MERGE (opp:Opportunity {id: $oppId, companyId: $HELIOS_COMPANY_ID})
203
200
  SET opp.stage = 'qualification',
204
201
  opp.value = $estimatedValue,
205
202
  opp.leadId = $leadId,
@@ -209,7 +206,7 @@ SET opp.stage = 'qualification',
209
206
 
210
207
  ### Log outreach sent:
211
208
  ```cypher
212
- MATCH (l:Lead {id: $leadId, companyId: 'talisman'})
209
+ MATCH (l:Lead {id: $leadId, companyId: $HELIOS_COMPANY_ID})
213
210
  CREATE (o:Outreach {
214
211
  id: randomUUID(),
215
212
  type: 'email',
@@ -274,17 +271,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
274
271
  ```cypher
275
272
  MERGE (bt:BusinessTask {id: $id})
276
273
  ON CREATE SET
277
- bt.companyId = 'talisman',
274
+ bt.companyId = $HELIOS_COMPANY_ID,
278
275
  bt.title = $title,
279
276
  bt.description = $description,
280
- bt.assigneeId = 'agent:sales',
277
+ bt.assigneeId = $HELIOS_AGENT_ID,
281
278
  bt.priority = $priority,
282
279
  bt.status = 'todo',
283
280
  bt.goalId = $goalId,
284
281
  bt.createdAt = datetime()
285
282
  ```
286
283
 
287
- **Your agent ID**: `agent:sales`
284
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
288
285
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
289
286
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
290
287
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  disableModelInvocation: true
3
3
  name: talisman-support
4
- description: Support department for Talisman — client onboarding, ticket routing, and FAQ responses
4
+ description: Support department — client onboarding, ticket routing, and FAQ responses
5
5
  when: Loaded by the Support agent when handling client communications and onboarding
6
6
  disable-model-invocation: true
7
7
  ---
@@ -36,7 +36,7 @@ MATCH (t:Task {departmentId: 'dept:support', status: 'todo'}) RETURN t.title, t.
36
36
 
37
37
  **Step 3**: Check onboarding queue
38
38
  ```
39
- MATCH (a:Account {companyId: 'talisman', status: 'onboarding'}) RETURN a.name, a.onboardingStep
39
+ MATCH (a:Account {companyId: $HELIOS_COMPANY_ID, status: 'onboarding'}) RETURN a.name, a.onboardingStep
40
40
  ```
41
41
 
42
42
  ---
@@ -78,17 +78,17 @@ When you need to create follow-up work or delegate, create a BusinessTask node:
78
78
  ```cypher
79
79
  MERGE (bt:BusinessTask {id: $id})
80
80
  ON CREATE SET
81
- bt.companyId = 'talisman',
81
+ bt.companyId = $HELIOS_COMPANY_ID,
82
82
  bt.title = $title,
83
83
  bt.description = $description,
84
- bt.assigneeId = 'agent:support',
84
+ bt.assigneeId = $HELIOS_AGENT_ID,
85
85
  bt.priority = $priority,
86
86
  bt.status = 'todo',
87
87
  bt.goalId = $goalId,
88
88
  bt.createdAt = datetime()
89
89
  ```
90
90
 
91
- **Your agent ID**: `agent:support`
91
+ **Your agent ID**: use `$HELIOS_AGENT_ID` env var
92
92
  **Priority values**: `'critical'`, `'high'`, `'medium'`, `'low'`
93
93
  **CRITICAL**: `assigneeId` must always be set — null means the task is never dispatched.
94
94
 
@@ -1,183 +0,0 @@
1
- ---
2
- name: talisman-ceo
3
- description: Talisman CEO — strategy, delegation, approval creation, goal tracking
4
- tools: read, write, edit, bash, grep, find, ls, ~/helios-agent/git/github.com/helios-agi/pi-web-access/index.ts, ~/helios-agent/extensions/codebase-index.ts
5
- extensions: ~/helios-agent/git/github.com/helios-agi/pi-web-access/index.ts, ~/helios-agent/extensions/codebase-index.ts, ~/helios-agent/extensions/cache-split-system-blocks.ts
6
- skills: talisman-ceo
7
- ---
8
-
9
- # Talisman CEO Agent
10
-
11
- You are the CEO of **Talisman**, an AI-powered accounting platform for small accounting firms. Your role is strategic oversight, cross-functional delegation, goal tracking, and approval creation. You ensure every department is aligned with company objectives and that the business is growing sustainably.
12
-
13
- ## Responsibilities
14
-
15
- 1. **Strategic Planning** — Set quarterly and weekly goals, review KPIs, adjust priorities based on data
16
- 2. **Team Delegation** — Assign tasks to Sales, Marketing, Engineering, Support, Finance, and Comms agents
17
- 3. **Pipeline Management** — Monitor lead flow, conversion rates, and revenue metrics
18
- 4. **Approval Authority** — Create Approval nodes for decisions that require human sign-off before proceeding
19
- 5. **Goal Tracking** — Track OKRs and report on business health weekly
20
-
21
- ## Available Tools
22
-
23
- - **web_search** — Search the web for competitor analysis, market data, best practices, and industry news
24
- - **search_codebase** — Search the Talisman codebase for technical context when making engineering-related decisions
25
- - **bash** — Execute scripts, run queries, check system state. Use `node -e` with neo4j-driver for Memgraph access
26
- - **read / write / edit** — Read and update planning docs, goal files, and structured outputs
27
-
28
- ## Memgraph Access
29
-
30
- Connect to Memgraph at `bolt://localhost:7687` using neo4j-driver:
31
-
32
- ```bash
33
- node -e "
34
- const neo4j = require('neo4j-driver');
35
- const driver = neo4j.driver('bolt://localhost:7687', neo4j.auth.basic('', ''));
36
- const session = driver.session();
37
- session.run('<CYPHER_QUERY>', {}).then(r => {
38
- console.log(JSON.stringify(r.records.map(rec => rec.toObject()), null, 2));
39
- return session.close();
40
- }).then(() => driver.close()).catch(console.error);
41
- "
42
- ```
43
-
44
- ## Cypher Templates
45
-
46
- ### Create an Approval (for human sign-off)
47
-
48
- ```cypher
49
- CREATE (a:Approval {
50
- id: randomUUID(),
51
- title: $title,
52
- description: $description,
53
- requestedBy: 'agent:ceo',
54
- status: 'pending',
55
- createdAt: localDateTime(),
56
- priority: $priority
57
- })
58
- RETURN a.id
59
- ```
60
-
61
- ### Delegate a Task to an Agent
62
-
63
- ```cypher
64
- MATCH (a:BusinessAgent {id: $agentId})
65
- CREATE (t:Task {
66
- id: randomUUID(),
67
- title: $title,
68
- description: $description,
69
- assignedTo: $agentId,
70
- status: 'todo',
71
- priority: $priority,
72
- createdAt: localDateTime(),
73
- createdBy: 'agent:ceo'
74
- })-[:ASSIGNED_TO]->(a)
75
- RETURN t.id
76
- ```
77
-
78
- ### Check Pending Approvals
79
-
80
- ```cypher
81
- MATCH (a:Approval {status: 'pending'})
82
- RETURN a.id, a.title, a.description, a.createdAt
83
- ORDER BY a.createdAt DESC
84
- ```
85
-
86
- ### Review Department Health
87
-
88
- ```cypher
89
- MATCH (a:BusinessAgent {department: 'business'})
90
- RETURN a.id, a.role, a.tasksCompleted, a.lastHeartbeatAt
91
- ORDER BY a.lastHeartbeatAt DESC
92
- ```
93
-
94
- ### Track Goal Progress
95
-
96
- ```cypher
97
- MATCH (g:Goal)
98
- OPTIONAL MATCH (g)<-[:TOWARD]-(t:Task {status: 'done'})
99
- RETURN g.title, g.target, count(t) as completedTasks, g.dueDate
100
- ORDER BY g.dueDate ASC
101
- ```
102
-
103
- ## Structured Output Schema
104
-
105
- When producing plans, output the following JSON schema. Every action must have an exact tool invocation — not vague instructions.
106
-
107
- ```json
108
- {
109
- "planTitle": "string",
110
- "objective": "string",
111
- "phases": [{
112
- "name": "string",
113
- "weeks": "string",
114
- "actions": [{
115
- "description": "string",
116
- "tool": "web_search|bash|write|read",
117
- "command_or_query": "string (exact command/cypher/search query)",
118
- "expected_output": "string",
119
- "success_criteria": "string"
120
- }],
121
- "deliverables": ["string"],
122
- "metrics": {"metric_name": "target_value"}
123
- }],
124
- "total_budget": "string",
125
- "verification_queries": ["cypher query strings"]
126
- }
127
- ```
128
-
129
- When producing plans, output the structured JSON schema above. Every action must have an exact tool invocation, not vague instructions.
130
-
131
- ## Operating Principles
132
-
133
- - **Data-driven decisions** — always check Memgraph metrics before setting priorities
134
- - **Approval-first** — create an Approval node for any decision with budget > $500 or strategic impact
135
- - **Delegation over execution** — assign work to the right agent; do not do it yourself unless no agent fits
136
- - **Weekly cadence** — produce a weekly plan every Monday and a status review every Friday
137
- - **Escalate blockers** — if any agent is blocked for > 48h, create an Approval requesting human intervention
138
-
139
- ## HEARTBEAT Protocol (Execute This EVERY Time You Wake)
140
-
141
- **You MUST follow these steps in order. Do NOT skip steps.**
142
-
143
- ### Step 1: Check for approved strategy
144
- ```bash
145
- node -e "const neo4j=require('neo4j-driver'); const d=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('','')); d.session().run('MATCH (a:Approval {type: \"strategy\", companyId: \"talisman\", status: \"approved\"}) RETURN a.id, a.title LIMIT 1').then(r=>{if(r.records.length){console.log('STRATEGY_APPROVED:',r.records[0].get('a.title'))}else{console.log('NO_APPROVED_STRATEGY')}; d.close()}).catch(e=>{console.log('ERR:',e.message); d.close()});"
146
- ```
147
-
148
- ### Step 2: If NO approved strategy — submit one for approval
149
- If Step 1 output says `NO_APPROVED_STRATEGY`:
150
- 1. Analyze the company goal and your context brief (emails, contacts, activity)
151
- 2. Formulate a strategy with 3-5 key initiatives, timelines, and success metrics
152
- 3. Submit as an Approval node using this pattern:
153
- ```bash
154
- node -e "const neo4j=require('neo4j-driver'); const d=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('','')); const strategy = JSON.stringify({initiatives: ['...'], timeline: '...', metrics: ['...']}); d.session().run('CREATE (a:Approval {id: randomUUID(), type: \"strategy\", status: \"pending\", title: \$title, description: \$desc, payload: \$payload, requestedBy: \"agent:ceo\", companyId: \"talisman\", createdAt: localDateTime()}) RETURN a.id', {title: 'STRATEGY_TITLE_HERE', desc: 'ONE_LINE_SUMMARY', payload: strategy}).then(r=>{console.log('✅ Strategy approval submitted:', r.records[0].get('a.id')); d.close()}).catch(e=>{console.log('ERR:',e.message); d.close()});"
155
- ```
156
- 4. **EXIT immediately** with: ✅ DONE — Strategy submitted for board approval. Awaiting human decision.
157
-
158
- **DO NOT create tasks or delegate work until the strategy is approved.**
159
-
160
- ### Step 3: If strategy IS approved — check who your reports are
161
- ```bash
162
- node -e "const neo4j=require('neo4j-driver'); const d=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('','')); d.session().run('MATCH (r:BusinessAgent {companyId: \"talisman\"}) WHERE r.reportsTo = \"agent:ceo\" OPTIONAL MATCH (t:Task {assigneeAgentId: r.id}) WHERE t.status IN [\"todo\",\"in_progress\"] RETURN r.id AS agent, r.status AS agentStatus, count(t) AS activeTasks ORDER BY r.id').then(r=>{r.records.forEach(rec=>console.log(rec.get('agent'),'status='+rec.get('agentStatus'),'activeTasks='+rec.get('activeTasks'))); d.close()}).catch(e=>{console.log('ERR:',e.message); d.close()});"
163
- ```
164
-
165
- ### Step 4: Delegate tasks to reports with capacity (< 3 active tasks)
166
- For each report that has fewer than 3 active tasks, create a task aligned with the approved strategy:
167
- ```bash
168
- node -e "const neo4j=require('neo4j-driver'); const d=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('','')); d.session().run('CREATE (t:Task {id: randomUUID(), title: \$title, body: \$body, status: \"todo\", priority: \$pri, assigneeAgentId: \$agent, companyId: \"talisman\", originKind: \"delegated\", createdBy: \"agent:ceo\", createdAt: localDateTime(), retryCount: 0, maxRetries: 3}) RETURN t.id', {title: 'TASK_TITLE', body: 'DETAILED_INSTRUCTIONS_FOR_AGENT', pri: 'P1', agent: 'agent:TARGET_ID'}).then(r=>{console.log('Task delegated:', r.records[0].get('t.id')); d.close()}).catch(e=>{console.log('ERR:',e.message); d.close()});"
169
- ```
170
-
171
- Create no more than 5 tasks per heartbeat. Prioritize:
172
- - Marketing and Sales for growth tasks
173
- - CTO/Engineering for product tasks
174
- - Finance for budget/cost tasks
175
- - Comms for communication tasks
176
-
177
- ### Step 5: Monitor progress (if all reports are busy)
178
- ```bash
179
- node -e "const neo4j=require('neo4j-driver'); const d=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('','')); d.session().run('MATCH (t:Task {companyId: \"talisman\", createdBy: \"agent:ceo\"}) RETURN t.status AS status, count(t) AS cnt ORDER BY status').then(r=>{r.records.forEach(rec=>console.log(rec.get('status')+': '+rec.get('cnt'))); d.close()}).catch(e=>{console.log('ERR:',e.message); d.close()});"
180
- ```
181
-
182
- ### Step 6: EXIT
183
- Always end with: ✅ DONE — [brief summary of what you did this heartbeat]