Get the FREE Ultimate OpenClaw Setup Guide →

team-shinchan:budget

npx machina-cli add skill seokan-jeong/team-shinchan/budget --openclaw
Files (1)
SKILL.md
3.6 KB

Budget Skill

View and manage turn budget for the active workflow.

Usage

/team-shinchan:budget                    # Show current budget status
/team-shinchan:budget --set total=200    # Set total turn budget
/team-shinchan:budget --set phase=50     # Set phase turn budget
/team-shinchan:budget --reset            # Reset used counters to 0
/team-shinchan:budget --reset phase      # Reset only phase counter

Arguments

ArgDefaultDescription
(none)Show current budget status table
--set total=NSet total turn budget to N
--set phase=NSet phase turn budget to N
--resetReset both used_total and used_phase to 0
--reset phaseReset only used_phase to 0

Process

Step 1: Find Active Workflow

Look for .shinchan-docs/*/WORKFLOW_STATE.yaml files. Use the most recently modified one.

If no workflow state found:

No active workflow found.
Start a workflow with /team-shinchan:start to enable budget tracking.

Step 2: Handle --set

If --set total=N or --set phase=N is provided:

  1. Read the WORKFLOW_STATE.yaml
  2. Ensure budget section exists; create if missing:
    budget:
      total: 200
      phase: 50
      used_total: 0
      used_phase: 0
    
  3. Update the specified field (total or phase) with the given value N
  4. Write back to WORKFLOW_STATE.yaml
  5. Display confirmation:
    Budget updated: {field} set to {N}
    

Step 3: Handle --reset

If --reset is provided:

  1. Read the WORKFLOW_STATE.yaml
  2. If --reset phase: set budget.used_phase to 0
  3. If --reset (no qualifier): set both budget.used_total and budget.used_phase to 0
  4. Write back to WORKFLOW_STATE.yaml
  5. Display confirmation:
    Budget counters reset.
    

Step 4: Display Status (default)

  1. Read the WORKFLOW_STATE.yaml
  2. If no budget section:
    No budget configured for this workflow.
    Use /team-shinchan:budget --set total=200 to configure.
    
  3. Read current session ID from .shinchan-docs/.session-id
  4. Count current session turns from .shinchan-docs/work-tracker.jsonl
    • Filter events by current session ID
    • Count events where type is: tool_use, file_change, delegation
  5. Calculate effective usage:
    effective_total = budget.used_total + session_turns
    effective_phase = budget.used_phase + session_turns
    
  6. Display:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Budget Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

| Metric       | Used | Max | Pct   | Status  |
|--------------|------|-----|-------|---------|
| Total turns  | {effective_total} | {total} | {pct}% | {status} |
| Phase turns  | {effective_phase} | {phase} | {pct}% | {status} |

Session turns (current): {session_turns}
Accumulated (previous):  total={used_total}, phase={used_phase}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Status values:

  • On Track — under 80%
  • WARNING — 80% to 99%
  • EXCEEDED — 100% or above

Important

  • Budget is per-workflow, stored in WORKFLOW_STATE.yaml
  • Turn counting uses work-tracker.jsonl events as proxy
  • The budget-guard hook enforces limits automatically during execution
  • Phase budget resets are manual (use --reset phase when advancing phases)

Source

git clone https://github.com/seokan-jeong/team-shinchan/blob/main/skills/budget/SKILL.mdView on GitHub

Overview

The Budget Skill lets you view and manage the turn budget for the active Shinchan workflow. You can show current budget status, set total or phase budgets, and reset counters when needed. Budget data is stored in WORKFLOW_STATE.yaml and usage is computed against real session turns.

How This Skill Works

The skill locates the latest active workflow by scanning .shinchan-docs/*/WORKFLOW_STATE.yaml. It reads budget details and session turn data, applies changes to the YAML file, and computes effective usage as budget.used_total plus session turns and budget.used_phase plus session turns. It then renders a status table and confirmations for updates or resets.

When to Use It

  • When starting a new active workflow to configure budgets.
  • Before a milestone to assess remaining turns against total and phase budgets.
  • When you need to adjust total or phase budgets on the fly with --set.
  • When approaching budget limits and you want to reset counters with --reset.
  • When validating current budget status after counting session turns.

Quick Start

  1. Step 1: Check current status with /team-shinchan:budget
  2. Step 2: Configure budgets with --set total=N or --set phase=N
  3. Step 3: Monitor the live budget status and adjust as needed

Best Practices

  • Ensure a budget section exists in WORKFLOW_STATE.yaml before usage.
  • Prefer --set over manual edits to avoid desyncs.
  • Regularly review the status table to stay within limits.
  • Reset counters per phase to reflect progress, not accumulate indefinitely.
  • Document budget changes for auditability and team transparency.

Example Use Cases

  • Set a total budget to 200 turns: /team-shinchan:budget --set total=200
  • Set a phase budget to 50 turns: /team-shinchan:budget --set phase=50
  • Reset all counters to zero: /team-shinchan:budget --reset
  • Reset only the phase counters: /team-shinchan:budget --reset phase
  • View current budget status to compare with live session turns.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers