@monoes/monomindcli 2.9.7 → 2.9.9
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/.claude/agents/design/design-monodesign.md +1 -2
- package/.claude/agents/engineering/engineering-ai-data-remediation-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-ai-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-autonomous-optimization-architect.md +0 -1
- package/.claude/agents/engineering/engineering-backend-architect.md +1 -2
- package/.claude/agents/engineering/engineering-code-reviewer.md +1 -2
- package/.claude/agents/engineering/engineering-data-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-database-optimizer.md +1 -2
- package/.claude/agents/engineering/engineering-devops-automator.md +1 -2
- package/.claude/agents/engineering/engineering-embedded-firmware-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-feishu-integration-developer.md +1 -2
- package/.claude/agents/engineering/engineering-frontend-developer.md +1 -2
- package/.claude/agents/engineering/engineering-git-workflow-master.md +1 -2
- package/.claude/agents/engineering/engineering-incident-response-commander.md +0 -1
- package/.claude/agents/engineering/engineering-mobile-app-builder.md +1 -2
- package/.claude/agents/engineering/engineering-rapid-prototyper.md +1 -2
- package/.claude/agents/engineering/engineering-security-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-senior-developer.md +1 -2
- package/.claude/agents/engineering/engineering-software-architect.md +1 -2
- package/.claude/agents/engineering/engineering-solidity-smart-contract-engineer.md +1 -2
- package/.claude/agents/engineering/engineering-sre.md +0 -1
- package/.claude/agents/engineering/engineering-technical-writer.md +1 -2
- package/.claude/agents/engineering/engineering-threat-detection-engineer.md +0 -1
- package/.claude/agents/engineering/engineering-wechat-mini-program-developer.md +1 -2
- package/.claude/agents/github/code-review-swarm.md +0 -1
- package/.claude/agents/github/github-modes.md +0 -1
- package/.claude/agents/github/issue-tracker.md +0 -1
- package/.claude/agents/github/multi-repo-swarm.md +0 -1
- package/.claude/agents/github/pr-manager.md +0 -1
- package/.claude/agents/github/project-board-sync.md +0 -1
- package/.claude/agents/github/release-manager.md +0 -1
- package/.claude/agents/github/repo-architect.md +0 -1
- package/.claude/agents/github/swarm-issue.md +0 -1
- package/.claude/agents/github/swarm-pr.md +0 -1
- package/.claude/agents/github/sync-coordinator.md +0 -1
- package/.claude/agents/github/workflow-automation.md +0 -1
- package/.claude/agents/marketing/marketing-competitive-content.md +1 -2
- package/.claude/agents/marketing/marketing-cro-specialist.md +1 -2
- package/.claude/agents/marketing/marketing-email-specialist.md +1 -2
- package/.claude/agents/marketing/marketing-launch-strategist.md +1 -2
- package/.claude/agents/marketing/marketing-pricing-strategist.md +1 -2
- package/.claude/agents/specialized/agentic-identity-trust.md +0 -1
- package/.claude/agents/specialized/agents-orchestrator.md +1 -2
- package/.claude/agents/specialized/automation-governance-architect.md +1 -2
- package/.claude/agents/specialized/blockchain-security-auditor.md +1 -2
- package/.claude/agents/specialized/compliance-auditor.md +1 -2
- package/.claude/agents/specialized/identity-graph-operator.md +0 -1
- package/.claude/agents/specialized/lsp-index-engineer.md +1 -2
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -1
- package/.claude/agents/specialized/specialized-cultural-intelligence-strategist.md +0 -1
- package/.claude/agents/specialized/specialized-developer-advocate.md +1 -2
- package/.claude/agents/specialized/specialized-document-generator.md +1 -2
- package/.claude/agents/specialized/specialized-mcp-builder.md +1 -2
- package/.claude/agents/specialized/specialized-model-qa.md +0 -1
- package/.claude/agents/specialized/specialized-workflow-architect.md +1 -2
- package/.claude/agents/specialized/zk-steward.md +1 -2
- package/.claude/agents/testing/production-validator.md +0 -1
- package/.claude/agents/testing/tdd-london-swarm.md +0 -1
- package/.claude/agents/testing/testing-accessibility-auditor.md +0 -1
- package/.claude/agents/testing/testing-api-tester.md +1 -2
- package/.claude/agents/testing/testing-evidence-collector.md +1 -2
- package/.claude/agents/testing/testing-performance-benchmarker.md +1 -2
- package/.claude/agents/testing/testing-test-results-analyzer.md +1 -2
- package/.claude/agents/testing/testing-tool-evaluator.md +1 -2
- package/.claude/agents/testing/testing-workflow-optimizer.md +1 -2
- package/.claude/commands/hooks/README.md +1 -1
- package/.claude/commands/memory/README.md +6 -7
- package/.claude/commands/monitoring/README.md +1 -1
- package/.claude/helpers/control-start.cjs +37 -8
- package/.claude/helpers/handlers/route-handler.cjs +22 -3
- package/.claude/helpers/handlers/session-handler.cjs +43 -0
- package/.claude/helpers/intelligence.cjs +27 -6
- package/.claude/helpers/statusline.cjs +45 -11
- package/.claude/skills/agentic-jujutsu/SKILL.md +17 -15
- package/.claude/skills/hive-mind-advanced/SKILL.md +212 -559
- package/.claude/skills/hooks-automation/SKILL.md +1 -1
- package/.claude/skills/mastermind-adapters/SKILL.md +0 -11
- package/.claude/skills/mastermind-agents/SKILL.md +0 -11
- package/.claude/skills/mastermind-backup/SKILL.md +0 -11
- package/.claude/skills/mastermind-bootstrap/SKILL.md +0 -11
- package/.claude/skills/mastermind-delegation/SKILL.md +14 -12
- package/.claude/skills/mastermind-idea/SKILL.md +0 -5
- package/.claude/skills/mastermind-monitor/SKILL.md +0 -15
- package/.claude/skills/mastermind-org-settings/SKILL.md +0 -11
- package/.claude/skills/mastermind-plugins/SKILL.md +0 -11
- package/.claude/skills/mastermind-protocol/SKILL.md +6 -124
- package/.claude/skills/mastermind-repeat/SKILL.md +0 -25
- package/.claude/skills/mastermind-review/SKILL.md +1 -1
- package/.claude/skills/mastermind-stoporg/SKILL.md +0 -19
- package/.claude/skills/memory-toolkit/SKILL.md +12 -11
- package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +8 -1
- package/.claude/skills/pair-programming/SKILL.md +1 -1
- package/.claude/skills/performance-analysis/SKILL.md +228 -484
- package/.claude/skills/specialagent/SKILL.md +31 -133
- package/.claude/skills/swarm-advanced/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +220 -150
- package/.claude/skills/verification-quality/SKILL.md +247 -571
- package/README.md +3 -3
- package/dist/src/commands/agent-lifecycle.js +3 -3
- package/dist/src/commands/agent-lifecycle.js.map +1 -1
- package/dist/src/commands/autopilot.d.ts.map +1 -1
- package/dist/src/commands/autopilot.js +7 -1
- package/dist/src/commands/autopilot.js.map +1 -1
- package/dist/src/commands/doc.d.ts.map +1 -1
- package/dist/src/commands/doc.js +14 -3
- package/dist/src/commands/doc.js.map +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts +1 -1
- package/dist/src/commands/doctor-env-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +3 -37
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +30 -1
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.js +75 -67
- package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
- package/dist/src/commands/hooks-workers.d.ts.map +1 -1
- package/dist/src/commands/hooks-workers.js +41 -10
- package/dist/src/commands/hooks-workers.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/index.d.ts +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +20 -4
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +80 -7
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +78 -2
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/neural-optimize.d.ts.map +1 -1
- package/dist/src/commands/neural-optimize.js +27 -5
- package/dist/src/commands/neural-optimize.js.map +1 -1
- package/dist/src/commands/org-observe.d.ts.map +1 -1
- package/dist/src/commands/org-observe.js +37 -30
- package/dist/src/commands/org-observe.js.map +1 -1
- package/dist/src/commands/org.d.ts.map +1 -1
- package/dist/src/commands/org.js +129 -2
- package/dist/src/commands/org.js.map +1 -1
- package/dist/src/commands/performance.js +1 -1
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/security-cve.d.ts.map +1 -1
- package/dist/src/commands/security-cve.js +1 -11
- package/dist/src/commands/security-cve.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +0 -9
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +33 -54
- package/dist/src/commands/security-misc.js.map +1 -1
- package/dist/src/commands/security-scan.d.ts.map +1 -1
- package/dist/src/commands/security-scan.js +3 -11
- package/dist/src/commands/security-scan.js.map +1 -1
- package/dist/src/commands/swarm.d.ts.map +1 -1
- package/dist/src/commands/swarm.js +7 -2
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/ui.d.ts +8 -0
- package/dist/src/commands/ui.d.ts.map +1 -0
- package/dist/src/commands/ui.js +94 -0
- package/dist/src/commands/ui.js.map +1 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +7 -9
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +13 -3
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/kimi-generator.d.ts +3 -2
- package/dist/src/init/kimi-generator.d.ts.map +1 -1
- package/dist/src/init/kimi-generator.js +45 -13
- package/dist/src/init/kimi-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +1 -1
- package/dist/src/init/statusline-generator.js +1 -1
- package/dist/src/init/write-capabilities.js +7 -7
- package/dist/src/init/write-capabilities.js.map +1 -1
- package/dist/src/knowledge/document-pipeline.d.ts.map +1 -1
- package/dist/src/knowledge/document-pipeline.js +1 -0
- package/dist/src/knowledge/document-pipeline.js.map +1 -1
- package/dist/src/knowledge/eval/golden-set.d.ts.map +1 -1
- package/dist/src/knowledge/eval/golden-set.js +21 -32
- package/dist/src/knowledge/eval/golden-set.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +2 -2
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-intelligence.js +29 -3
- package/dist/src/mcp-tools/hooks-intelligence.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +32 -19
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph/query-tools.js +48 -18
- package/dist/src/mcp-tools/monograph/query-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +15 -10
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/memory/embedding-operations.d.ts +4 -0
- package/dist/src/memory/embedding-operations.d.ts.map +1 -1
- package/dist/src/memory/embedding-operations.js +125 -32
- package/dist/src/memory/embedding-operations.js.map +1 -1
- package/dist/src/memory/hnsw-operations.d.ts +1 -1
- package/dist/src/memory/hnsw-operations.js +1 -1
- package/dist/src/memory/memory-bridge.d.ts +8 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +37 -8
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-read.d.ts +1 -1
- package/dist/src/memory/memory-read.js +2 -2
- package/dist/src/memory/memory-read.js.map +1 -1
- package/dist/src/orgrt/antigravity-runner.d.ts.map +1 -1
- package/dist/src/orgrt/antigravity-runner.js +6 -6
- package/dist/src/orgrt/antigravity-runner.js.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts +11 -1
- package/dist/src/orgrt/checkpoint-ops.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint-ops.js +18 -86
- package/dist/src/orgrt/checkpoint-ops.js.map +1 -1
- package/dist/src/orgrt/checkpoint.d.ts +1 -1
- package/dist/src/orgrt/checkpoint.d.ts.map +1 -1
- package/dist/src/orgrt/checkpoint.js +3 -3
- package/dist/src/orgrt/checkpoint.js.map +1 -1
- package/dist/src/orgrt/daemon.d.ts +9 -1
- package/dist/src/orgrt/daemon.d.ts.map +1 -1
- package/dist/src/orgrt/daemon.js +267 -139
- package/dist/src/orgrt/daemon.js.map +1 -1
- package/dist/src/orgrt/decisions.d.ts +13 -0
- package/dist/src/orgrt/decisions.d.ts.map +1 -1
- package/dist/src/orgrt/decisions.js +95 -0
- package/dist/src/orgrt/decisions.js.map +1 -1
- package/dist/src/orgrt/forwarder.d.ts.map +1 -1
- package/dist/src/orgrt/forwarder.js +148 -15
- package/dist/src/orgrt/forwarder.js.map +1 -1
- package/dist/src/orgrt/kimicode-runner.js +1 -1
- package/dist/src/orgrt/kimicode-runner.js.map +1 -1
- package/dist/src/orgrt/opencode-runner.js +1 -1
- package/dist/src/orgrt/opencode-runner.js.map +1 -1
- package/dist/src/orgrt/session.d.ts +27 -1
- package/dist/src/orgrt/session.d.ts.map +1 -1
- package/dist/src/orgrt/session.js +67 -6
- package/dist/src/orgrt/session.js.map +1 -1
- package/dist/src/orgrt/task-dag.d.ts +11 -1
- package/dist/src/orgrt/task-dag.d.ts.map +1 -1
- package/dist/src/orgrt/task-dag.js +93 -2
- package/dist/src/orgrt/task-dag.js.map +1 -1
- package/dist/src/orgrt/templates.d.ts.map +1 -1
- package/dist/src/orgrt/templates.js +26 -2
- package/dist/src/orgrt/templates.js.map +1 -1
- package/dist/src/orgrt/types.d.ts +77 -1
- package/dist/src/orgrt/types.d.ts.map +1 -1
- package/dist/src/orgrt/types.js +28 -2
- package/dist/src/orgrt/types.js.map +1 -1
- package/dist/src/orgrt/vercel-providers.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-providers.js +9 -4
- package/dist/src/orgrt/vercel-providers.js.map +1 -1
- package/dist/src/orgrt/vercel-runner.d.ts +0 -23
- package/dist/src/orgrt/vercel-runner.d.ts.map +1 -1
- package/dist/src/orgrt/vercel-runner.js +38 -7
- package/dist/src/orgrt/vercel-runner.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/.claude/commands/mastermind/approvev1.md +0 -94
- package/.claude/commands/mastermind/architect.md +0 -52
- package/.claude/commands/mastermind/autodev.md +0 -28
- package/.claude/commands/mastermind/build.md +0 -23
- package/.claude/commands/mastermind/finish.md +0 -17
- package/.claude/commands/mastermind/runorgv1.md +0 -159
- package/.claude/commands/mastermind/taskdev.md +0 -23
- package/.claude/commands/mastermind/tdd.md +0 -19
- package/.claude/commands/mastermind/verify.md +0 -19
- package/.claude/skills/mastermind-approvev1/SKILL.md +0 -191
- package/.claude/skills/mastermind-architect/SKILL.md +0 -862
- package/.claude/skills/mastermind-autodev/SKILL.md +0 -360
- package/.claude/skills/mastermind-build/SKILL.md +0 -169
- package/.claude/skills/mastermind-companies/SKILL.md +0 -256
- package/.claude/skills/mastermind-content/SKILL.md +0 -197
- package/.claude/skills/mastermind-costs/SKILL.md +0 -151
- package/.claude/skills/mastermind-finance/SKILL.md +0 -166
- package/.claude/skills/mastermind-finish/SKILL.md +0 -251
- package/.claude/skills/mastermind-heartbeatv1/SKILL.md +0 -167
- package/.claude/skills/mastermind-instance-settings/SKILL.md +0 -315
- package/.claude/skills/mastermind-marketing/SKILL.md +0 -228
- package/.claude/skills/mastermind-marketing/references/copywriting-frameworks.md +0 -181
- package/.claude/skills/mastermind-marketing/references/persuasion-psychology.md +0 -158
- package/.claude/skills/mastermind-ops/SKILL.md +0 -168
- package/.claude/skills/mastermind-org-chart/SKILL.md +0 -209
- package/.claude/skills/mastermind-project-detail/SKILL.md +0 -249
- package/.claude/skills/mastermind-project-workspace/SKILL.md +0 -244
- package/.claude/skills/mastermind-projects/SKILL.md +0 -167
- package/.claude/skills/mastermind-runorgv1/SKILL.md +0 -731
- package/.claude/skills/mastermind-sales/SKILL.md +0 -170
- package/.claude/skills/mastermind-taskdev/SKILL.md +0 -377
- package/.claude/skills/mastermind-taskdev/code-quality-reviewer-prompt.md +0 -60
- package/.claude/skills/mastermind-taskdev/final-reviewer-prompt.md +0 -144
- package/.claude/skills/mastermind-taskdev/implementer-prompt.md +0 -114
- package/.claude/skills/mastermind-taskdev/spec-reviewer-prompt.md +0 -80
- package/.claude/skills/mastermind-tdd/SKILL.md +0 -424
- package/.claude/skills/mastermind-verify/SKILL.md +0 -196
- package/.claude/skills/mastermind-wiki/SKILL.md +0 -314
- package/.claude/skills/monolean-review/SKILL.md +0 -57
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mastermind-finance
|
|
3
|
-
description: Mastermind finance domain — invoicing, budget tracking, financial forecasting. Spawns a Finance Manager coordinating financial tracking and analysis agents.
|
|
4
|
-
type: domain-skill
|
|
5
|
-
default_mode: confirm
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Mastermind Finance Domain
|
|
9
|
-
|
|
10
|
-
This skill is invoked by `mastermind:master` or directly via `/mastermind:finance`.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Inputs
|
|
15
|
-
|
|
16
|
-
- `brain_context`: BRAIN CONTEXT block (injected by master, or loaded standalone via mastermind-protocol/SKILL.md brain load)
|
|
17
|
-
- `prompt`: the finance goal for this run
|
|
18
|
-
- `project_name`: monotask space name
|
|
19
|
-
- `board_id`: monotask board ID (set by master, or created standalone)
|
|
20
|
-
- `mode`: auto | confirm
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Complexity Assessment
|
|
25
|
-
|
|
26
|
-
Assess the prompt to determine execution mode:
|
|
27
|
-
|
|
28
|
-
**Simple (direct execution):** Single calculation or single document:
|
|
29
|
-
- "Calculate total revenue for Q1 from these figures: ..."
|
|
30
|
-
- "Draft an invoice for project X at $5,000"
|
|
31
|
-
→ Use a single Finance Tracker agent. Skip manager delegation.
|
|
32
|
-
|
|
33
|
-
**Complex (spawn Finance Manager agent):** Any of these:
|
|
34
|
-
- Full financial forecast (revenue + costs + runway)
|
|
35
|
-
- Budget analysis across multiple cost centers
|
|
36
|
-
- Batch invoice processing
|
|
37
|
-
- P&L or cash flow modeling
|
|
38
|
-
→ Spawn Finance Manager agent with full briefing.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Standalone Execution (when called without master)
|
|
43
|
-
|
|
44
|
-
If this skill is invoked directly (not by master):
|
|
45
|
-
|
|
46
|
-
1. Load brain context following mastermind-protocol/SKILL.md Brain Load Procedure (namespace: `finance`)
|
|
47
|
-
2. Run intake from mastermind-intake/SKILL.md if prompt is vague
|
|
48
|
-
3. Follow mastermind-protocol/SKILL.md Monotask Space+Board Setup Procedure:
|
|
49
|
-
```bash
|
|
50
|
-
project_name="${project_name:-$(basename "$PWD")}"
|
|
51
|
-
space_id=$(monotask space list 2>/dev/null | awk -F' \| ' -v n="$project_name" '$2==n{print $1}' | head -1)
|
|
52
|
-
[ -z "$space_id" ] && space_id=$(monotask space create "$project_name" 2>&1 | grep -oE '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')
|
|
53
|
-
[ -z "$space_id" ] && { echo "ERROR: Could not find or create space '$project_name'"; exit 1; }
|
|
54
|
-
board_id=$(monotask board create "finance" --json | jq -r '.id // empty')
|
|
55
|
-
[ -z "$board_id" ] && { echo "ERROR: Failed to create finance board"; exit 1; }
|
|
56
|
-
monotask space boards add "$space_id" "$board_id" >/dev/null 2>&1 || true
|
|
57
|
-
todo_col=$(monotask column create "$board_id" "Todo" --json | jq -r '.id')
|
|
58
|
-
doing_col=$(monotask column create "$board_id" "Doing" --json | jq -r '.id')
|
|
59
|
-
done_col=$(monotask column create "$board_id" "Done" --json | jq -r '.id')
|
|
60
|
-
```
|
|
61
|
-
4. Proceed with complexity assessment below
|
|
62
|
-
5. At end: follow mastermind-protocol/SKILL.md Brain Write Procedure (namespace: `finance`)
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Complex Execution — Finance Manager Agent
|
|
67
|
-
|
|
68
|
-
Spawn a Finance Manager agent via Task tool:
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
Task({
|
|
72
|
-
subagent_type: "coordinator",
|
|
73
|
-
description: `You are the Finance Manager for project <project_name>.
|
|
74
|
-
|
|
75
|
-
CONTEXT: <date> | Project: <project_name> | Spawned by: mastermind:finance
|
|
76
|
-
|
|
77
|
-
BRAIN CONTEXT:
|
|
78
|
-
<brain_context>
|
|
79
|
-
|
|
80
|
-
YOUR BOARD: <board_id>
|
|
81
|
-
YOUR GOAL: <prompt>
|
|
82
|
-
|
|
83
|
-
STEP 1 — PLAN
|
|
84
|
-
Decompose the finance goal into discrete workstreams. For each workstream, identify:
|
|
85
|
-
- What financial domain it covers (invoicing, tracking, forecasting, analysis)
|
|
86
|
-
- What input data is needed
|
|
87
|
-
- What deliverable is produced (report, model, invoice batch)
|
|
88
|
-
- Dependencies between workstreams
|
|
89
|
-
|
|
90
|
-
STEP 2 — CREATE TASKS
|
|
91
|
-
For each workstream, create a monotask card on the project board. First look up column IDs and assign shell variables:
|
|
92
|
-
```bash
|
|
93
|
-
columns=$(monotask column list "$BOARD_ID" --json)
|
|
94
|
-
COL_TODO_ID=$(echo "$columns" | jq -r '.[] | select(.title == "Todo" or .title == "Backlog") | .id' | head -1)
|
|
95
|
-
COL_DONE_ID=$(echo "$columns" | jq -r '.[] | select(.title == "Done") | .id' | head -1)
|
|
96
|
-
```
|
|
97
|
-
Then create the card:
|
|
98
|
-
```bash
|
|
99
|
-
result=$(monotask card create "$BOARD_ID" "$COL_TODO_ID" "<short summary of workstream goal, ≤80 chars>" --json)
|
|
100
|
-
CARD_ID=$(echo "$result" | jq -r '.id // empty')
|
|
101
|
-
monotask card set-description "$BOARD_ID" "$CARD_ID" "[specific financial workstream goal]"
|
|
102
|
-
monotask card comment add "$BOARD_ID" "$CARD_ID" "CONTEXT: <date> | Project: <project_name> | Created by: Finance Manager
|
|
103
|
-
BRAIN MEMORY: [paste most relevant 3-5 brain context excerpts]
|
|
104
|
-
SCOPE: [time period, accounts, cost centers, currencies in scope]
|
|
105
|
-
CONSTRAINTS: [accounting standards, tax requirements, rounding rules, approval thresholds]
|
|
106
|
-
SUCCESS CRITERIA:
|
|
107
|
-
- [ ] [checkable item — e.g. \"forecast covers 12-month runway\"]
|
|
108
|
-
AGENT: [Finance Tracker | Analytics Reporter]
|
|
109
|
-
SWARM: hierarchical 3 raft
|
|
110
|
-
DEPENDENCIES: [task IDs or \"none\"]
|
|
111
|
-
OUTPUT FORMAT: unified output schema"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
STEP 3 — EXECUTE
|
|
115
|
-
Spawn one Task agent per workstream:
|
|
116
|
-
- Financial tracking and invoicing: subagent_type "Finance Tracker"
|
|
117
|
-
- Analysis and reporting: subagent_type "Analytics Reporter"
|
|
118
|
-
|
|
119
|
-
Also run /mastermind:do --board <board_id> to track execution.
|
|
120
|
-
|
|
121
|
-
STEP 4 — COLLECT AND RETURN
|
|
122
|
-
Collect all financial outputs. Return to caller:
|
|
123
|
-
|
|
124
|
-
domain: finance
|
|
125
|
-
status: complete | partial | blocked
|
|
126
|
-
artifacts:
|
|
127
|
-
- path: [financial reports, invoices, forecast models]
|
|
128
|
-
type: report
|
|
129
|
-
decisions:
|
|
130
|
-
- what: [financial decisions or recommendations made]
|
|
131
|
-
why: [reasoning — cost drivers, runway implications, risk factors]
|
|
132
|
-
confidence: [0.0-1.0]
|
|
133
|
-
outcome: pending | shipped
|
|
134
|
-
lessons:
|
|
135
|
-
- what_worked: [what data sources or models were most accurate]
|
|
136
|
-
- what_didnt: [what required manual correction or more data]
|
|
137
|
-
next_actions:
|
|
138
|
-
- [e.g. "run mastermind:ops to automate invoice generation"]
|
|
139
|
-
- [e.g. "run mastermind:review on the financial model assumptions"]
|
|
140
|
-
board_url: monotask://<project_name>/finance
|
|
141
|
-
run_id: <ISO8601-timestamp>`,
|
|
142
|
-
run_in_background: true
|
|
143
|
-
})
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Simple Execution
|
|
149
|
-
|
|
150
|
-
For simple tasks (single agent, single output):
|
|
151
|
-
|
|
152
|
-
1. Spawn one Task agent with the finance request as a self-contained briefing
|
|
153
|
-
2. Collect output
|
|
154
|
-
3. Return unified output schema with `status: complete`
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Domain Swarm Defaults
|
|
159
|
-
|
|
160
|
-
| Task Type | Agent | Swarm |
|
|
161
|
-
|---|---|---|
|
|
162
|
-
| Full financial forecast | coordinator + tracker + analyst | hierarchical 3 raft specialized |
|
|
163
|
-
| Budget analysis | Finance Tracker + Analytics Reporter | hierarchical 3 raft specialized |
|
|
164
|
-
| Invoice batch | Finance Tracker | hierarchical 3 raft specialized |
|
|
165
|
-
| P&L report | Analytics Reporter | single agent |
|
|
166
|
-
| Single invoice or calculation | Finance Tracker | single agent |
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mastermind-finish
|
|
3
|
-
description: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work — guides completion of development work by presenting structured options for merge, PR, or cleanup
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Finishing a Development Branch
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Guide completion of development work by presenting clear options and handling the chosen workflow.
|
|
11
|
-
|
|
12
|
-
**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
|
|
13
|
-
|
|
14
|
-
**Announce at start:** "I'm using the mastermind:finish skill to complete this work."
|
|
15
|
-
|
|
16
|
-
## The Process
|
|
17
|
-
|
|
18
|
-
### Step 1: Verify Tests
|
|
19
|
-
|
|
20
|
-
**Before presenting options, verify tests pass:**
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Run project's test suite
|
|
24
|
-
npm test / cargo test / pytest / go test ./...
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**If tests fail:**
|
|
28
|
-
```
|
|
29
|
-
Tests failing (<N> failures). Must fix before completing:
|
|
30
|
-
|
|
31
|
-
[Show failures]
|
|
32
|
-
|
|
33
|
-
Cannot proceed with merge/PR until tests pass.
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Stop. Don't proceed to Step 2.
|
|
37
|
-
|
|
38
|
-
**If tests pass:** Continue to Step 2.
|
|
39
|
-
|
|
40
|
-
### Step 2: Detect Environment
|
|
41
|
-
|
|
42
|
-
**Determine workspace state before presenting options:**
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
46
|
-
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
This determines which menu to show and how cleanup works:
|
|
50
|
-
|
|
51
|
-
| State | Menu | Cleanup |
|
|
52
|
-
|-------|------|---------|
|
|
53
|
-
| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 4 options | No worktree to clean up |
|
|
54
|
-
| `GIT_DIR != GIT_COMMON`, named branch | Standard 4 options | Provenance-based (see Step 6) |
|
|
55
|
-
| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
|
|
56
|
-
|
|
57
|
-
### Step 3: Determine Base Branch
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Try common base branches
|
|
61
|
-
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Or ask: "This branch split from main — is that correct?"
|
|
65
|
-
|
|
66
|
-
### Step 4: Present Options
|
|
67
|
-
|
|
68
|
-
**Normal repo and named-branch worktree — present exactly these 4 options:**
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
Implementation complete. What would you like to do?
|
|
72
|
-
|
|
73
|
-
1. Merge back to <base-branch> locally
|
|
74
|
-
2. Push and create a Pull Request
|
|
75
|
-
3. Keep the branch as-is (I'll handle it later)
|
|
76
|
-
4. Discard this work
|
|
77
|
-
|
|
78
|
-
Which option?
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Detached HEAD — present exactly these 3 options:**
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
Implementation complete. You're on a detached HEAD (externally managed workspace).
|
|
85
|
-
|
|
86
|
-
1. Push as new branch and create a Pull Request
|
|
87
|
-
2. Keep as-is (I'll handle it later)
|
|
88
|
-
3. Discard this work
|
|
89
|
-
|
|
90
|
-
Which option?
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Don't add explanation** — keep options concise.
|
|
94
|
-
|
|
95
|
-
### Step 5: Execute Choice
|
|
96
|
-
|
|
97
|
-
#### Option 1: Merge Locally
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Get main repo root for CWD safety
|
|
101
|
-
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
102
|
-
cd "$MAIN_ROOT"
|
|
103
|
-
|
|
104
|
-
# Merge first — verify success before removing anything
|
|
105
|
-
git checkout <base-branch>
|
|
106
|
-
git pull
|
|
107
|
-
git merge <feature-branch>
|
|
108
|
-
|
|
109
|
-
# Verify tests on merged result
|
|
110
|
-
<test command>
|
|
111
|
-
|
|
112
|
-
# Only after merge succeeds: cleanup worktree (Step 6), then delete branch
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Then: Cleanup worktree (Step 6), then delete branch:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
git branch -d <feature-branch>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
#### Option 2: Push and Create PR
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
# Push branch
|
|
125
|
-
git push -u origin <feature-branch>
|
|
126
|
-
|
|
127
|
-
# Create PR
|
|
128
|
-
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
|
129
|
-
## Summary
|
|
130
|
-
<2-3 bullets of what changed>
|
|
131
|
-
|
|
132
|
-
## Test Plan
|
|
133
|
-
- [ ] <verification steps>
|
|
134
|
-
EOF
|
|
135
|
-
)"
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Do NOT clean up worktree** — user needs it alive to iterate on PR feedback.
|
|
139
|
-
|
|
140
|
-
#### Option 3: Keep As-Is
|
|
141
|
-
|
|
142
|
-
Report: "Keeping branch <name>. Worktree preserved at <path>."
|
|
143
|
-
|
|
144
|
-
**Don't cleanup worktree.**
|
|
145
|
-
|
|
146
|
-
#### Option 4: Discard
|
|
147
|
-
|
|
148
|
-
**Confirm first:**
|
|
149
|
-
```
|
|
150
|
-
This will permanently delete:
|
|
151
|
-
- Branch <name>
|
|
152
|
-
- All commits: <commit-list>
|
|
153
|
-
- Worktree at <path>
|
|
154
|
-
|
|
155
|
-
Type 'discard' to confirm.
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
Wait for exact confirmation.
|
|
159
|
-
|
|
160
|
-
If confirmed:
|
|
161
|
-
```bash
|
|
162
|
-
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
163
|
-
cd "$MAIN_ROOT"
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Then: Cleanup worktree (Step 6), then force-delete branch:
|
|
167
|
-
```bash
|
|
168
|
-
git branch -D <feature-branch>
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Step 6: Cleanup Workspace
|
|
172
|
-
|
|
173
|
-
**Only runs for Options 1 and 4.** Options 2 and 3 always preserve the worktree.
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
177
|
-
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
178
|
-
WORKTREE_PATH=$(git rev-parse --show-toplevel)
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
**If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
|
|
182
|
-
|
|
183
|
-
**If worktree path is under `.worktrees/`, `worktrees/`, or `~/.config/monomind/worktrees/`:** Mastermind created this worktree — we own cleanup.
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
|
|
187
|
-
cd "$MAIN_ROOT"
|
|
188
|
-
git worktree remove "$WORKTREE_PATH"
|
|
189
|
-
git worktree prune # Self-healing: clean up any stale registrations
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
**Otherwise:** The host environment (harness) owns this workspace. Do NOT remove it. If your platform provides a workspace-exit tool, use it. Otherwise, leave the workspace in place.
|
|
193
|
-
|
|
194
|
-
## Quick Reference
|
|
195
|
-
|
|
196
|
-
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
|
197
|
-
|--------|-------|------|---------------|----------------|
|
|
198
|
-
| 1. Merge locally | yes | - | - | yes |
|
|
199
|
-
| 2. Create PR | - | yes | yes | - |
|
|
200
|
-
| 3. Keep as-is | - | - | yes | - |
|
|
201
|
-
| 4. Discard | - | - | - | yes (force) |
|
|
202
|
-
|
|
203
|
-
## Common Mistakes
|
|
204
|
-
|
|
205
|
-
**Skipping test verification**
|
|
206
|
-
- **Problem:** Merge broken code, create failing PR
|
|
207
|
-
- **Fix:** Always verify tests before offering options
|
|
208
|
-
|
|
209
|
-
**Open-ended questions**
|
|
210
|
-
- **Problem:** "What should I do next?" is ambiguous
|
|
211
|
-
- **Fix:** Present exactly 4 structured options (or 3 for detached HEAD)
|
|
212
|
-
|
|
213
|
-
**Cleaning up worktree for Option 2**
|
|
214
|
-
- **Problem:** Remove worktree user needs for PR iteration
|
|
215
|
-
- **Fix:** Only cleanup for Options 1 and 4
|
|
216
|
-
|
|
217
|
-
**Deleting branch before removing worktree**
|
|
218
|
-
- **Problem:** `git branch -d` fails because worktree still references the branch
|
|
219
|
-
- **Fix:** Merge first, remove worktree, then delete branch
|
|
220
|
-
|
|
221
|
-
**Running git worktree remove from inside the worktree**
|
|
222
|
-
- **Problem:** Command fails silently when CWD is inside the worktree being removed
|
|
223
|
-
- **Fix:** Always `cd` to main repo root before `git worktree remove`
|
|
224
|
-
|
|
225
|
-
**Cleaning up harness-owned worktrees**
|
|
226
|
-
- **Problem:** Removing a worktree the harness created causes phantom state
|
|
227
|
-
- **Fix:** Only clean up worktrees under `.worktrees/`, `worktrees/`, or `~/.config/monomind/worktrees/`
|
|
228
|
-
|
|
229
|
-
**No confirmation for discard**
|
|
230
|
-
- **Problem:** Accidentally delete work
|
|
231
|
-
- **Fix:** Require typed "discard" confirmation
|
|
232
|
-
|
|
233
|
-
## Red Flags
|
|
234
|
-
|
|
235
|
-
**Never:**
|
|
236
|
-
- Proceed with failing tests
|
|
237
|
-
- Merge without verifying tests on result
|
|
238
|
-
- Delete work without confirmation
|
|
239
|
-
- Force-push without explicit request
|
|
240
|
-
- Remove a worktree before confirming merge success
|
|
241
|
-
- Clean up worktrees you didn't create (provenance check)
|
|
242
|
-
- Run `git worktree remove` from inside the worktree
|
|
243
|
-
|
|
244
|
-
**Always:**
|
|
245
|
-
- Verify tests before offering options
|
|
246
|
-
- Detect environment before presenting menu
|
|
247
|
-
- Present exactly 4 options (or 3 for detached HEAD)
|
|
248
|
-
- Get typed confirmation for Option 4
|
|
249
|
-
- Clean up worktree for Options 1 & 4 only
|
|
250
|
-
- `cd` to main repo root before worktree removal
|
|
251
|
-
- Run `git worktree prune` after removal
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mastermind-heartbeatv1
|
|
3
|
-
description: "LEGACY-ORG-V1 (2026-07): v2: send the role a chat message from the dashboard, or inspect with `monomind org logs <name>` — no skill needed. Mastermind heartbeatv1 — trigger a manual heartbeat for a specific agent in a running v1 (prompt-orchestrated) org. The agent wakes, checks its task queue, executes pending work, and reports back. Reach it only via `/mastermind:heartbeatv1`."
|
|
4
|
-
type: domain-skill
|
|
5
|
-
default_mode: auto
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Mastermind Heartbeat (v1, legacy)
|
|
9
|
-
|
|
10
|
-
> **LEGACY-ORG-V1 — manual task-board wake-up for prompt-orchestrated v1 orgs. Reach it only via `/mastermind:heartbeatv1`.**
|
|
11
|
-
> v2 roles run as live SDK sessions with no poll/wake cycle to trigger — send the role a chat message from the dashboard, or inspect activity with `monomind org logs <name>`. This skill remains only for orgs not yet migrated off the v1 `board_id`/`topology` config shape.
|
|
12
|
-
|
|
13
|
-
This skill is invoked by `mastermind:heartbeatv1` or directly via `/mastermind:heartbeatv1`.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Inputs
|
|
18
|
-
|
|
19
|
-
- `brain_context`: BRAIN CONTEXT block
|
|
20
|
-
- `org_name`: org the agent belongs to
|
|
21
|
-
- `agent_id`: role id of the agent to wake (e.g. `content-writer`)
|
|
22
|
-
- `context`: optional additional context/instructions to pass to the agent during this heartbeat
|
|
23
|
-
- `source`: timer | on_demand | assignment | automation (default: on_demand)
|
|
24
|
-
- `timeout_min`: minutes to wait for completion (default: 10)
|
|
25
|
-
- `caller`: command | master
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Step 0 — Brain Load (standalone only)
|
|
30
|
-
|
|
31
|
-
If `caller` is not "command", load brain context following mastermind-protocol/SKILL.md Brain Load Procedure with namespace: `ops`.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Step 1 — Load Org Config
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
orgFile=".monomind/orgs/${org_name}.json"
|
|
39
|
-
stateFile=".monomind/orgs/${org_name}-state.json"
|
|
40
|
-
|
|
41
|
-
[ ! -f "$orgFile" ] && { echo "ERROR: Org '${org_name}' not found. Run /mastermind:createorg first."; exit 1; }
|
|
42
|
-
|
|
43
|
-
board_id=$(jq -r '.board_id // empty' "$orgFile")
|
|
44
|
-
todo_col=$(jq -r '.todo_col_id // empty' "$orgFile")
|
|
45
|
-
doing_col=$(jq -r '.doing_col_id // empty' "$orgFile")
|
|
46
|
-
done_col=$(jq -r '.done_col_id // empty' "$orgFile")
|
|
47
|
-
memNs="org:${org_name}"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Step 2 — Validate Agent
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
agentConfig=$(jq --arg id "$agent_id" '(.roles // [])[] | select(.id == $id)' "$orgFile")
|
|
56
|
-
[ -z "$agentConfig" ] && { echo "ERROR: Agent '$agent_id' not found in org '$org_name'."; exit 1; }
|
|
57
|
-
|
|
58
|
-
agentTitle=$(echo "$agentConfig" | jq -r '.title')
|
|
59
|
-
agentType=$(echo "$agentConfig" | jq -r '.agent_type')
|
|
60
|
-
agentResp=$(echo "$agentConfig" | jq -r '.responsibilities | join("; ")')
|
|
61
|
-
reportsTo=$(echo "$agentConfig" | jq -r '.reports_to // "none"')
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Step 3 — Update State and Emit heartbeat:start
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
[ ! -f "$stateFile" ] && echo '{"agents":{}}' > "$stateFile"
|
|
70
|
-
tmp="${stateFile}.tmp"
|
|
71
|
-
jq --arg id "$agent_id" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg source "${source:-on_demand}" \
|
|
72
|
-
'.agents[$id].last_heartbeat = $ts | .agents[$id].status = "running" | .agents[$id].heartbeat_source = $source' \
|
|
73
|
-
"$stateFile" > "$tmp" && mv "$tmp" "$stateFile"
|
|
74
|
-
|
|
75
|
-
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
76
|
-
CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$REPO_ROOT/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
|
|
77
|
-
curl -s -X POST "${CTRL_URL}/api/mastermind/event" -H "x-monomind-token: $(cat "${REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}/.monomind/dashboard-token" 2>/dev/null || true)" \
|
|
78
|
-
-H "Content-Type: application/json" \
|
|
79
|
-
-d "$(jq -cn \
|
|
80
|
-
--arg org "$org_name" \
|
|
81
|
-
--arg role "$agent_id" \
|
|
82
|
-
--arg title "$agentTitle" \
|
|
83
|
-
--arg source "${source:-on_demand}" \
|
|
84
|
-
'{type:"org:heartbeat:start",org:$org,role:$role,title:$title,source:$source,ts:(now*1000|floor)}')" || true
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Step 4 — Spawn Agent for One Heartbeat Cycle
|
|
90
|
-
|
|
91
|
-
```javascript
|
|
92
|
-
Task({
|
|
93
|
-
subagent_type: agentType,
|
|
94
|
-
description: `Heartbeat for ${agentTitle} in org "${org_name}"`,
|
|
95
|
-
run_in_background: false,
|
|
96
|
-
prompt: `You are ${agentTitle} in the autonomous organization "${org_name}".
|
|
97
|
-
|
|
98
|
-
This is a HEARTBEAT CYCLE — a single work session triggered ${source || "on_demand"}.
|
|
99
|
-
|
|
100
|
-
YOUR ROLE: ${agentTitle}
|
|
101
|
-
YOUR RESPONSIBILITIES: ${agentResp}
|
|
102
|
-
REPORTS TO: ${reportsTo}
|
|
103
|
-
MEMORY NAMESPACE: ${memNs}
|
|
104
|
-
|
|
105
|
-
${context ? `CONTEXT / INSTRUCTIONS FOR THIS HEARTBEAT:\n${context}\n\n` : ""}
|
|
106
|
-
|
|
107
|
-
TASK BOARD:
|
|
108
|
-
- board_id: ${board_id}
|
|
109
|
-
- Todo column: ${todo_col}
|
|
110
|
-
- Doing column: ${doing_col}
|
|
111
|
-
- Done column: ${done_col}
|
|
112
|
-
|
|
113
|
-
HEARTBEAT PROCEDURE:
|
|
114
|
-
1. Check your task queue — unclaimed cards with "role:${agent_id}" label in Todo:
|
|
115
|
-
monotask card list ${board_id} --col ${todo_col} --json | jq '[.[] | select((.labels // []) | index("role:${agent_id}")) | select((.labels // []) | index("claimed") | not)]'
|
|
116
|
-
|
|
117
|
-
2. For each unclaimed task:
|
|
118
|
-
a. Move to Doing: monotask card move ${board_id} $CARD_ID ${doing_col}
|
|
119
|
-
b. Add "claimed" label: monotask card label add ${board_id} $CARD_ID "claimed"
|
|
120
|
-
c. Execute the work described in the task title
|
|
121
|
-
d. Store output: npx monomind@latest memory store --key "${memNs}:output:${agent_id}:$CARD_ID" --namespace "${memNs}" --value "<your output>"
|
|
122
|
-
e. Move to Done: monotask card move ${board_id} $CARD_ID ${done_col}
|
|
123
|
-
|
|
124
|
-
3. If no tasks, check memory for any pending instructions:
|
|
125
|
-
npx monomind@latest memory search --query "instruction ${agent_id}" --namespace "${memNs}"
|
|
126
|
-
|
|
127
|
-
4. Report completion — emit heartbeat:complete event:
|
|
128
|
-
CTRL_URL=$(jq -r '.url // "http://localhost:4242"' "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
|
|
129
|
-
curl -s -X POST "${CTRL_URL}/api/mastermind/event" -H "x-monomind-token: $(cat "${REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}/.monomind/dashboard-token" 2>/dev/null || true)" -H "Content-Type: application/json" \
|
|
130
|
-
-d "$(jq -cn --arg org "${org_name}" --arg role "${agent_id}" --arg title "${agentTitle}" \
|
|
131
|
-
'{type:"org:heartbeat:complete",org:$org,role:$role,title:$title,ts:(now*1000|floor)}')" || true
|
|
132
|
-
|
|
133
|
-
Complete your tasks then exit. This is a single heartbeat cycle, not a persistent loop.`
|
|
134
|
-
})
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Step 5 — Update State After Completion
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
tmp="${stateFile}.tmp"
|
|
143
|
-
jq --arg id "$agent_id" --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
144
|
-
'.agents[$id].status = "idle" | .agents[$id].last_heartbeat_complete = $ts' \
|
|
145
|
-
"$stateFile" > "$tmp" && mv "$tmp" "$stateFile"
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Step 6 — Return Output
|
|
151
|
-
|
|
152
|
-
```yaml
|
|
153
|
-
domain: ops
|
|
154
|
-
status: complete
|
|
155
|
-
org: <org_name>
|
|
156
|
-
agent_id: <agent_id>
|
|
157
|
-
agent_title: <agentTitle>
|
|
158
|
-
heartbeat_source: <source>
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Print: "Heartbeat complete for <agentTitle>. Check outputs with: npx monomind@latest memory search --namespace org:<org_name>"
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Step 7 — Brain Write (standalone only)
|
|
166
|
-
|
|
167
|
-
If `caller` is not "command", follow mastermind-protocol/SKILL.md Brain Write Procedure for domain `ops`.
|