mastermind-env
Mastermind env — audit an org's runtime environment (LLM provider, memory backend, agent JWT, logging, storage) and flag missing or misconfigured values.
- License 许可
- Apache-2.0
- 所属仓库
- monoes/monomind
- 最近更新
- 2026-11-14
- Stars
- ★ 23
- Forks
- 2
01 前言 Front Matter
- name
- mastermind-env
- pick
- low
- type
- domain-skill
- description
- Mastermind env — audit an org's runtime environment (LLM provider, memory backend, agent JWT, logging, storage) and flag missing or misconfigured values.
- default_mode
- auto
03 SKILL.md 正文
Mastermind Env
This skill is invoked directly via /mastermind-env.
Inputs
brain_context: BRAIN CONTEXT blockorg_name: org to inspect env foraction: show | set | validatekey: env var key to set (for set action)value: value to set (for set action — use env var reference, not inline secrets)section: llm | memory | jwt | logging | storage | all (default: all)caller: command | master
Step 0 — Brain Load (standalone only)
If caller is not "command", load brain context following mastermind-protocol/SKILL.md Brain Load Procedure with namespace: ops.
Step 1 — Load Org Config
orgFile=".monomind/orgs/${org_name}.json"
[ ! -f "$orgFile" ] && { echo "ERROR: Org '$org_name' not found."; exit 1; }
memNs="org:${org_name}"
Step 2 — Execute Action
show (default)
Collect and display environment configuration for this org's agents:
echo "╔══════════════════════════════════════════════════════╗"
echo "║ ENV AUDIT — org: ${org_name}"
echo "╚══════════════════════════════════════════════════════╝"
echo ""
# LLM / Adapter config
echo "LLM PROVIDER"
echo "────────────"
ceo_model=$(jq -r '.run_config.ceo_adapter // "claude-sonnet-5"' "$orgFile")
echo " CEO adapter model: $ceo_model"
jq -r '(.roles // [])[] | " \(.id): \(.adapter_config.model // "inherited from CEO")"' "$orgFile" 2>/dev/null
echo ""
# API key availability (check env vars, never print values)
echo "API KEYS (present/missing)"
echo "──────────────────────────"
for key in ANTHROPIC_API_KEY OPENAI_API_KEY GOOGLE_API_KEY; do
if [ -n "${!key}" ]; then
echo " $key: ✓ present (${!key:0:6}***)"
elif [ -f ".monomind/orgs/.secrets/${org_name}/${key}" ]; then
echo " $key: ✓ in org secrets"
else
echo " $key: ✗ MISSING"
fi
done
echo ""
# Memory config
echo "MEMORY"
echo "──────"
echo " namespace: org:${org_name}"
npx monomind@latest memory list --namespace "org:${org_name}" 2>/dev/null | wc -l | xargs echo " stored entries:"
echo ""
# Run config
echo "RUN CONFIG"
echo "──────────"
jq -r '.run_config | to_entries[] | " \(.key): \(.value)"' "$orgFile" 2>/dev/null
echo ""
# Governance
echo "GOVERNANCE"
echo "──────────"
jq -r '" policy: \(.governance.policy // "auto")"' "$orgFile" 2>/dev/null
echo ""
# Dashboard
echo "DASHBOARD"
echo "─────────"
CTRL_URL=$(jq -r '.url // "http://localhost:4242"' ".monomind/control.json" 2>/dev/null || echo "http://localhost:4242")
echo " url: $CTRL_URL"
curl -s "${CTRL_URL}/api/health" >/dev/null 2>&1 && echo " status: ✓ reachable" || echo " status: ✗ not reachable"
validate
Run a preflight check before starting an org run:
echo "PREFLIGHT CHECK — org: $org_name"
errors=0
# Check all required env vars
for key in ANTHROPIC_API_KEY; do
if [ -z "${!key}" ] && [ ! -f ".monomind/orgs/.secrets/${org_name}/${key}" ]; then
echo " ✗ MISSING: $key"
errors=$((errors + 1))
else
echo " ✓ $key"
fi
done
# Check the config against the runtime schema and structural invariants
npx -y monomind@latest org validate "$org_name" >/dev/null 2>&1 \
&& echo " ✓ config valid (monomind org validate)" \
|| { echo " ✗ INVALID config — run: monomind org validate $org_name"; errors=$((errors + 1)); }
# Check roles
role_count=$(jq '.roles | length' "$orgFile")
[ "$role_count" -eq 0 ] && { echo " ✗ MISSING: no roles defined"; errors=$((errors + 1)); } || echo " ✓ $role_count roles"
# Summary
echo ""
if [ "$errors" -eq 0 ]; then
echo "✓ All checks passed — org is ready to run."
else
echo "✗ $errors issue(s) found — resolve before running."
fi
set
Update a run_config key or governance field in the org JSON:
# Only allow safe keys — never set arbitrary JSON to prevent injection
allowed_keys="checkpoint_interval_min max_concurrent_agents budget_tokens alert_threshold ceo_adapter"
echo "$allowed_keys" | grep -qw "$key" || { echo "ERROR: Key '$key' not settable via this command. Edit $orgFile directly."; exit 1; }
tmp="${orgFile}.tmp"
jq --arg key "$key" --arg value "$value" \
'.run_config[$key] = ($value | if test("^[0-9]+$") then tonumber else . end)' \
"$orgFile" > "$tmp" && mv "$tmp" "$orgFile"
echo "Set run_config.$key = $value"
Agent Environment Template
When spawning agents, include this env block in their prompt:
# CEO/boss agent env block (prepend to all boss prompts):
echo "ENVIRONMENT:
Memory namespace: org:${orgName}
Dashboard: ${CTRL_URL}
Budget: $(jq -r '.run_config.budget_tokens // "unlimited"' "$orgFile") tokens
Governance: $(jq -r '.governance.policy // "auto"' "$orgFile")
ANTHROPIC_API_KEY: $([ -n "$ANTHROPIC_API_KEY" ] && echo "present" || echo "missing — check org secrets")
"
Step 3 — Return Output
domain: ops
status: complete
action: <action>
org: <org_name>
validation_errors: <N>
Step 4 — Brain Write (standalone only)
If caller is not "command", follow mastermind-protocol/SKILL.md Brain Write Procedure for domain ops.
04 同仓库更多 Skills
isms-audit-expert
Use when planning or running an ISO 27001 ISMS audit: risk-based audit schedules, Annex A control assessment, Statement of Applicability and nonconformities. Auditor-side procedures, versus compliance-auditor, which is org role guidance across SOC 2, HIPAA and PCI-DSS.
instrument-data-to-allotrope
Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full ASM JSON, flattened CSV for easy import, and exportable Python code for data engineers. Common triggers include converting instrument files, standardizing lab data, preparing data for upload to LIMS/ELN systems, or generating parser code for production pipelines.
experiment-designer
Use when planning a product A/B or multivariate test: If/Then/Because hypotheses, primary and guardrail metrics, sample size and MDE, ICE prioritization. For logging and reproducing ML runs use experiment-tracker; for scientific study design use experimental-design.
digest
Generate a daily or weekly digest of activity across all connected sources. Use when catching up after time away, starting the day and wanting a summary of mentions and action items, or reviewing a week's decisions and document updates grouped by project.
design-critique
Get structured design feedback on usability, hierarchy, and consistency. Trigger with "review this design", "critique this mockup", "what do you think of this screen?", or when sharing a Figma link or screenshot for feedback at any stage from exploration to final polish.
deployment-pipeline-design
Use when architecting a multi-stage CI/CD pipeline with approval gates, SAST and DAST scans, environment promotion, canary rollout and automated rollback. Design-level; for concrete Dockerfile and health check patterns use deployment-patterns.