一键导入
bazinga-db-agents
Agent logs, reasoning, and token tracking. Use when logging interactions, saving reasoning, tracking tokens, or managing events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Agent logs, reasoning, and token tracking. Use when logging interactions, saving reasoning, tracking tokens, or managing events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
DEPRECATED - Use domain-specific skills instead. Routes to bazinga-db-core, bazinga-db-workflow, bazinga-db-agents, or bazinga-db-context.
Task groups and development planning. Use when managing task groups, development plans, or success criteria.
Validates BAZINGA completion claims with independent verification. Spawned ONLY when PM sends BAZINGA. Acts as final quality gate - verifies test failures, coverage, evidence, and criteria independently. Returns ACCEPT or REJECT verdict.
Build complete agent prompts deterministically via Python script. Use BEFORE spawning any BAZINGA agent (Developer, QA, Tech Lead, PM, etc.).
Context packages and learning patterns. Use when managing context packages, error patterns, or strategies.
Session lifecycle and system operations. Use when creating sessions, saving state, getting dashboard data, or running system queries.
| name | bazinga-db-agents |
| description | Agent logs, reasoning, and token tracking. Use when logging interactions, saving reasoning, tracking tokens, or managing events. |
| version | 2.0.0 |
| allowed-tools | ["Bash","Read"] |
You are the bazinga-db-agents skill. You manage agent interaction logs, reasoning capture, token usage, skill outputs, and events.
Invoke when:
Do NOT invoke when:
bazinga-db-corebazinga-db-workflowbazinga-db-contextPath: .claude/skills/bazinga-db/scripts/bazinga_db.py
All commands use this script with --quiet flag:
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet <command> [args...]
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet log-interaction \
"<session_id>" "<agent_type>" "<message>" <sequence_num>
Logs an agent interaction in the orchestration flow.
Parameters:
agent_type: pm, developer, sse, qa_expert, tech_lead, investigator, requirements_engineersequence_num: Integer for orderingpython3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet stream-logs \
"<session_id>" [limit] [offset]
Stream orchestration logs in markdown format. Always returns markdown (no format option).
Parameters:
limit: Maximum number of logs to return (default: 50)offset: Number of logs to skip (default: 0)# Recommended: Use --content-file to avoid exposing content in process table
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-reasoning \
"<session_id>" "<group_id>" "<agent_type>" "<phase>" \
--content-file /tmp/reasoning.txt [--confidence N] [--tokens N]
# Alternative: Inline content (avoid for sensitive data)
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-reasoning \
"<session_id>" "<group_id>" "<agent_type>" "<phase>" "<content>" \
[--confidence N] [--tokens N]
Saves agent reasoning with automatic secret redaction.
⚠️ Security: Prefer --content-file over inline content to avoid exposing reasoning in process listings.
Phases: understanding, approach, decisions, risks, blockers, pivot, completion
Example (recommended):
# Write content to temp file first
cat > /tmp/reasoning.txt << 'EOF'
Analyzed requirements: need add/subtract/multiply/divide operations
EOF
python3 .../bazinga_db.py --quiet save-reasoning \
"bazinga_xxx" "CALC" "developer" "understanding" \
--content-file /tmp/reasoning.txt --confidence 85
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet get-reasoning \
"<session_id>" [group_id] [agent_type] [phase]
Retrieve reasoning entries with optional filters.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet reasoning-timeline \
"<session_id>" [--group_id "<group_id>"] [--format markdown|json]
Get chronological reasoning timeline across all agents, optionally filtered by group.
Parameters:
--group_id: Optional filter by task group (e.g., AUTH, CALC)--format: Output format (json default, or markdown for human-readable)python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet check-mandatory-phases \
"<session_id>" "<group_id>" "<agent_type>"
Check if agent documented mandatory phases (understanding, completion).
Returns: {"complete": true/false, "missing": [...]}
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet log-tokens \
"<session_id>" "<agent_type>" <token_count> [model]
Log token usage for an agent.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet token-summary "<session_id>"
Get token usage summary by agent and model.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-skill-output \
"<session_id>" "<group_id>" "<skill_name>" '<json_output>'
Save skill execution output for audit trail.
Example:
python3 .../bazinga_db.py --quiet save-skill-output \
"bazinga_xxx" "AUTH" "specialization-loader" \
'{"templates_used": ["python.md"], "token_count": 450}'
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet get-skill-output \
"<session_id>" "<skill_name>" [group_id]
Get latest skill output, optionally filtered by group.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet get-skill-output-all \
"<session_id>" [skill_name]
Get all skill outputs for a session.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet check-skill-evidence \
"<session_id>" "<skill_name>" [--within-minutes N]
Check for recent skill invocation evidence.
# Recommended: Use --payload-file and --group-id for full isolation
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-event \
"<session_id>" "<event_subtype>" \
--payload-file /tmp/event_payload.json \
--idempotency-key "{session}|{group}|{type}|{iter}" \
--group-id "<group_id>"
# Alternative: Inline JSON (avoid for sensitive or large payloads)
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-event \
"<session_id>" "<event_subtype>" '<json_payload>' \
[--idempotency-key "<key>"] [--group-id "<id>"]
Save a generic event with JSON payload.
Options:
--payload-file <path>: Read payload from file (recommended for security)--idempotency-key <key>: Prevent duplicate events with same key--group-id <id>: Group isolation key (default: global). Used in idempotency check.⚠️ Security Best Practices:
--payload-file instead of inline JSON to avoid exposing data in ps aux--idempotency-key for consistent deduplication--group-id for parallel mode to isolate events per task group--payload-file to avoid shell quoting issues and argv limitsIdempotency Key Format:
{session_id}|{group_id}|{event_type}|{iteration}
Example: bazinga_abc123|AUTH|tl_issues|2
Common event types:
scope_change - User approved scope reductionrole_violation - Detected role boundary violationtl_issues - Tech Lead issues after CHANGES_REQUESTEDtl_issue_responses - Developer responses to TL issuestl_verdicts - TL verdicts on Developer rejectionsinvestigation_iteration - Investigator agent iteration progresspm_bazinga - PM sends BAZINGA completion signalvalidator_verdict - Validator ACCEPT/REJECT decisionTech Lead Review Events (Recommended Pattern):
# Write payload to temp file (avoid inline JSON for security)
cat > /tmp/tl_issues.json << 'EOF'
{"group_id": "AUTH", "iteration": 1, "issues": [...], "blocking_count": 3}
EOF
# Save with idempotency and group isolation
python3 .../bazinga_db.py --quiet save-event \
"sess_123" "tl_issues" \
--payload-file /tmp/tl_issues.json \
--idempotency-key "sess_123|AUTH|tl_issues|1" \
--group-id "AUTH"
# Developer responses
cat > /tmp/dev_responses.json << 'EOF'
{"group_id": "AUTH", "iteration": 1, "issue_responses": [...]}
EOF
python3 .../bazinga_db.py --quiet save-event \
"sess_123" "tl_issue_responses" \
--payload-file /tmp/dev_responses.json \
--idempotency-key "sess_123|AUTH|tl_issue_responses|1" \
--group-id "AUTH"
Deduplication: Events are deduplicated by (session_id, event_subtype, group_id, idempotency_key). If the same idempotency key is used, the event is skipped and the existing event_id is returned.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet get-events \
"<session_id>" [event_subtype] [limit]
Query events by session and optionally by subtype.
python3 .claude/skills/bazinga-db/scripts/bazinga_db.py --quiet save-investigation-iteration \
"<session_id>" "<group_id>" <iteration> "<status>" \
--state-file /tmp/state.json --event-file /tmp/event.json
Atomically save investigation state AND event together. Ensures consistency between state (for resumption) and events (for audit trail). Uses single transaction.
Parameters:
iteration: Integer iteration number (1-10)status: under_investigation, root_cause_found, hypothesis_eliminated, etc.--state-file: Path to JSON file with investigation state data--event-file: Path to JSON file with event payloadReturns:
{
"success": true,
"atomic": true,
"state_saved": true,
"event_saved": true,
"event_id": 123,
"iteration": 1,
"idempotent": false
}
Default: Return raw JSON output. No formatting or commentary.
Exceptions:
reasoning-timeline with --format markdown - Returns formatted markdown timelinestream-logs - Always returns markdown (no JSON option)When a command returns markdown, output it directly without wrapping in JSON.
{"error": "Session not found: <id>"}{"error": "Invalid phase: <phase>"}{"error": "Invalid JSON: <details>"}.claude/skills/bazinga-db/references/schema.mdbazinga/schemas/event_*.schema.json.claude/skills/bazinga-db/references/command_examples.mdpython3 .../bazinga_db.py help