AGENT SKILL

mastermind-activity

Mastermind activity — an org's activity feed (up to 200 recent issue, project, goal, agent and routine events) with event-type filters and actor/entity names.

License 许可
Apache-2.0
所属仓库
monoes/monomind
最近更新
2026-11-14
Stars
★ 23
Forks
2

01 前言 Front Matter

name
mastermind-activity
pick
low
type
domain-skill
description
Mastermind activity — an org's activity feed (up to 200 recent issue, project, goal, agent and routine events) with event-type filters and actor/entity names.
default_mode
auto

03 SKILL.md 正文

Mastermind Activity

This skill is invoked directly via /mastermind-activity.


Inputs

  • brain_context: BRAIN CONTEXT block (injected by command, or loaded below if standalone)
  • org_name: org to query (required)
  • action: list | filter | export | stats
  • entity_type: issue | project | goal | agent | routine | all (default: all)
  • actor_id: filter by agent or user id (optional)
  • limit: max events to show (default: 50, max: 200)
  • since: ISO timestamp — show events after this time (optional)
  • output_file: file path to export JSONL (for export action)
  • caller: command | master

Event Entity Types

Type Description
issue Issue created, status changed, assigned, closed
project Project created, updated, archived
goal Goal created, progress updated, closed
agent Agent started, stopped, errored, completed
routine Routine triggered, run started, run completed
approval Approval requested, approved, rejected
workspace Workspace provisioned, teardown

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 Activity Log

orgFile=".monomind/orgs/${org_name}.json"
[ ! -f "$orgFile" ] && { echo "ERROR: Org '${org_name}' not found."; exit 1; }

activityFile=".monomind/orgs/${org_name}-activity.jsonl"
limit="${limit:-50}"
entityType="${entity_type:-all}"

Step 2 — Execute Action

list (default)

echo "ACTIVITY — org: $org_name"
echo "  Filter: type=${entityType}  limit=${limit}${actor_id:+  actor=${actor_id}}${since:+  since=${since}}"
echo "────────────────────────────────────────────────────────"
printf "%-20s %-12s %-14s %-24s %s\n" "TIMESTAMP" "ENTITY TYPE" "ACTOR" "ENTITY" "EVENT"
echo "────────────────────────────────────────────────────────"

if [ ! -f "$activityFile" ]; then
  # Fall back to mastermind-events.jsonl
  eventSrc="data/mastermind-events.jsonl"
  if [ ! -f "$eventSrc" ]; then
    echo "  No activity log found. Activity is written when agents run."
    exit 0
  fi
  activityFile="$eventSrc"
fi

tail -${limit} "$activityFile" | while IFS= read -r line; do
  et=$(echo "$line" | jq -r '.entityType // .type // "unknown"')
  actor=$(echo "$line" | jq -r '.actorId // .actor // "-"' | cut -c1-12)
  entity=$(echo "$line" | jq -r '(.entityId // .entity // "-")' | cut -c1-22)
  event=$(echo "$line" | jq -r '.event // .action // .type // "-"')
  ts=$(echo "$line" | jq -r '.ts // .timestamp // .createdAt // "-"' | cut -c1-19)

  # Apply filters
  [ "$entityType" != "all" ] && [ "$et" != "$entityType" ] && continue
  [ -n "$actor_id" ] && [ "$actor" != "$actor_id" ] && continue
  [ -n "$since" ] && [ "$ts" \< "$since" ] && continue

  printf "%-20s %-12s %-14s %-24s %s\n" "$ts" "$et" "$actor" "$entity" "$event"
done

echo ""
echo "  Showing last $limit events. Use --limit N for more (max 200)."

filter

echo "ACTIVITY FILTER — org: $org_name  type=$entityType"
echo "────────────────────────────────────────────────────────"

if [ ! -f "$activityFile" ]; then
  echo "  No activity log found."
  exit 0
fi

# Show available entity types in the log
echo "AVAILABLE ENTITY TYPES IN LOG:"
tail -200 "$activityFile" | jq -r '.entityType // .type // "unknown"' 2>/dev/null | sort | uniq -c | sort -rn | while read -r cnt et; do
  printf "  %-20s %d events\n" "$et" "$cnt"
done

echo ""
echo "  Filter: /mastermind-activity --org $org_name --action list --entity-type <type>"

stats

echo "ACTIVITY STATS — org: $org_name"
echo "────────────────────────────────────────────────────────"

if [ ! -f "$activityFile" ]; then
  echo "  No activity log found."
  exit 0
fi

total=$(wc -l < "$activityFile" | tr -d ' ')
echo "  Total events: $total"
echo ""

echo "BY ENTITY TYPE:"
tail -200 "$activityFile" | jq -r '.entityType // .type // "unknown"' 2>/dev/null | sort | uniq -c | sort -rn | \
  while read -r cnt et; do printf "  %-20s %d\n" "$et" "$cnt"; done

echo ""
echo "BY ACTOR (top 5):"
tail -200 "$activityFile" | jq -r '.actorId // .actor // "-"' 2>/dev/null | sort | uniq -c | sort -rn | head -5 | \
  while read -r cnt actor; do printf "  %-28s %d\n" "$actor" "$cnt"; done

# Last 24h
cutoff=$(date -u -v-24H +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u --date="24 hours ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null)
last24=$(tail -200 "$activityFile" | jq -r --arg c "$cutoff" 'select((.ts // .timestamp // .createdAt // "") >= $c) | .entityType' 2>/dev/null | wc -l | tr -d ' ')
echo ""
echo "  Events in last 24h: $last24"

export

outFile="${output_file:-.monomind/exports/${org_name}-activity-$(date +%Y%m%d%H%M%S).jsonl}"
mkdir -p "$(dirname "$outFile")"

if [ ! -f "$activityFile" ]; then
  echo "  No activity log to export."
  exit 0
fi

if [ "$entityType" != "all" ]; then
  jq -r --arg et "$entityType" 'select(.entityType == $et or .type == $et)' "$activityFile" > "$outFile"
else
  cp "$activityFile" "$outFile"
fi

lines=$(wc -l < "$outFile" | tr -d ' ')
echo "Activity exported: $outFile  ($lines events)"

Step 3 — Return Output

domain: ops
status: complete
action: <action>
org: <org_name>
entity_type: <entity_type>
events_shown: <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

monoes
monoes/monomind

zk-steward

Org role guidance for a ZK steward: engineer zero-knowledge proof systems with circuit design, SNARK vs STARK choice and security review. This is zero-knowledge cryptography, not Zettelkasten note-taking.

★ 23
monoes
monoes/monomind

writing-plans

Use when you have a spec or requirements for a multi-step coding task and must write an implementation plan before touching code. Produces bite-sized TDD tasks with exact file paths, code and commands for an engineer with zero context.

内容创作者写作与文案
★ 23
monoes
monoes/monomind

write-spec

Write a feature spec or PRD from a problem statement or feature idea. Use when turning a vague idea or user request into a structured document, scoping a feature with goals and non-goals, defining success metrics and acceptance criteria, or breaking a big ask into a phased spec.

产品经理
★ 23
monoes
monoes/monomind

write-query

Write optimized SQL for your dialect with best practices. Use when translating a natural-language data need into SQL, building a multi-CTE query with joins and aggregations, optimizing a query against a large partitioned table, or getting dialect-specific syntax for Snowflake, BigQuery, Postgres, etc.

数据分析师
★ 23
monoes
monoes/monomind

workflow-automation

Org role guidance for workflow automation: build and maintain CI/CD definitions in GitHub Actions or equivalent: triggers, jobs, matrices, caching. Covers path filters, dependency caching, parallel jobs, timeouts and fail-fast ordering.

运维与部署Skill与智能体开发
★ 23
monoes
monoes/monomind

workflow-architect

Org role guidance for a workflow architect: map full workflow trees for systems, user journeys and agents, covering every branch and failure. Covers discovering workflows from code, handoff contracts, timeouts, recovery paths and observable state.

Skill与智能体开发
★ 23