Files
crimson_leaf/templates/pulse_check.yml

81 lines
2.5 KiB
YAML

name: pulse_check
description: "Crimson Leaf holding company health scan -- Edgar checks all DB projects every 3 hours."
debug: true
model: power
system: agent_prompt
agent_prompt:
- "= identity.md"
sections:
- agent
- project
- rag
- message
- instructions
builders:
message: |
*** PORTFOLIO REPORT ***
{steps[0].text}
steps:
# Step 0: pull live data for ALL companies currently in the database
- type: tool
action: get_portfolio_report
output_key: portfolio_data
# Step 1: extract flat list of active projects across all subsidiaries
- type: think
max_tokens: 600
hint: |
You are Edgar, CEO of Crimson Leaf Holdings.
The portfolio report above lists every company and project registered in the system.
Extract every ACTIVE project from every subsidiary company (exclude "crimson_leaf" itself).
Exclude any project with status "completed" or "archived".
Output ONLY a JSON array on a single line. Each element must be an object with exactly
two keys: "company" (the company slug) and "project" (the project slug).
Example:
[{"company":"crimson_leaf_publishing","project":"cypress-bend"},{"company":"crimson_leaf_marketing","project":"book-marketing-agency"}]
If there are no active projects, output: []
# Step 2: package the array so foreach can source it
- type: package
schema: '{"projects": "array"}'
hint: |
The previous step produced a JSON array of project objects.
Package it as: {"projects": [...array of objects...]}
# Step 3: dispatch a project_review task to each active project
- type: foreach
source: projects
step:
type: tool
action: enqueue_strategy
optional: true
params:
company_slug: "{loop.item.company}"
project_slug: "{loop.item.project}"
task_type: "project_review"
content: "Pulse-check: Edgar requesting project review."
# Step 4: brief health summary to Discord
- type: think
max_tokens: 150
hint: |
Write a 2-line status update for Discord.
Line 1: "Pulse [HEALTHY/ATTENTION/IDLE] -- <N> projects reviewed"
Line 2: one sentence noting anything flagged (failures, idle projects, workers down) or "All systems nominal."
Use data from the portfolio report. 2 lines max. No extra commentary.
- type: reply
target: channel
channel_name: "crimson_leaf:general"
hint: |
Post the 2-line status summary above verbatim. No preamble.
adjudication:
enabled: false