Communityコーディング&開発github.com

grahama1970/assistant-lab

Self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

assistant-lab とは?

assistant-lab is a Antigravity agent skill that self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

対応~Claude Code~Codex CLI~CursorAntigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/assistant-lab

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

assistant-lab は何をしますか?

Self-improvement workbench for /assistant. This is the lab where /assistant diagnoses problems, trains new models, evaluates them, and promotes passing models into the live registry.

Not to be confused with /monitor-skills which is the observability daemon that watches ALL skills for health, drift, and sync issues. /assistant-lab is specifically the self-improvement toolbox.

The Self-Improvement Loop

/monitor-skills detects problem    ← observability
    ↓
/assistant-lab diagnoses root cause ← this skill
    ↓
Shadow mode: teacher (scillm) labels flow into shadow.jsonl
    ↓
ModelFactory.auto_improve(task)
    ├─ reads shadow agreement rate
    ├─ >= 90%: promote → update model_registry.json
    ├─ 80-90%: plateau → /prompt-lab redesign
    ├─ 70-80%: retrain → /create-gpt or /create-classifier
    └─ < 70%: aggressive retrain + architecture change
    ↓
/gpt-lab benchmark or /classifier-lab evaluate
    ↓ passing? → promote to live registry
    ↓
/assistant uses the improved model at inference time

Tools Available

ToolPurposeWhen Used
/create-gptTrain QLoRA/SFT/GRPO GPT (Tier 1.5)Agreement < 80% or no model exists
/create-classifierTrain DistilBERT/sklearn classifier (Tier 0.5)Text classification tasks
/create-regressorTrain sklearn/XGB regressor (Tier 0.75)Continuous prediction tasks
RunPod FlashServerless GPU training via Python SDK (7B–70B)Model too large for local A5000 — replaces /ops-runpod for training
/gpt-labBenchmark GPT against teacher baselineAfter training, before promotion
/classifier-labEvaluate classifier accuracy/F1After classifier training
/prompt-labRedesign prompts when plateau detectedAgreement stuck at 80-90%
/scillmTier 2 teacher — creates labelsAlways (teacher is ground truth)

Usage

CLI

# Diagnose what a task needs
./run.sh diagnose --task stress-test-grader

# Full autonomous improvement loop
./run.sh auto-improve --task stress-test-grader

# Train specific model type
./run.sh train --task stress-test-grader --type gpt
./run.sh train --task sparta-ambiguity --type classifier

# Evaluate a model
./run.sh evaluate --task stress-test-grader --type gpt

# Promote a passing model (disables shadow mode)
./run.sh promote --task stress-test-grader --type gpt

# Harvest teacher labels from shadow.jsonl
./run.sh harvest --task stress-test-grader --since 24h

# Show shadow agreement stats for all tasks
./run.sh status

# Run full self-test (train → eval → promote cycle on test data)
./run.sh self-test

Python API

from assistant_lab import AssistantLab

lab = AssistantLab()

# Diagnose: what does this task need?
diagnosis = lab.diagnose("stress-test-grader")
# → {"has_gpt": False, "has_classifier": False, "shadow_agreement": 0.0, ...}

# Auto-improve: decide + train + eval + promote
result = lab.auto_improve("stress-test-grader")
# → {"actions": ["trained gpt", "evaluated (passing=True)", "promoted"]}

# Manual steps
lab.train("stress-test-grader", model_type="gpt")
lab.evaluate("stress-test-grader", model_type="gpt")
lab.promote("stress-test-grader", model_type="gpt")

Model Factory

The core engine is ModelFactory (from /common/model_factory.py). /assistant-lab wraps it with CLI + diagnostics + reporting.

Shadow Agreement Thresholds

Agreement RateActionRationale
>= 90%PromoteStudent reliably matches teacher
80-90%/prompt-lab redesignPlateau — prompts may be the ceiling
70-80%Retrain with more labelsMore data likely helps
< 70%Aggressive retrainChange architecture or base model
< 50 samplesWaitNot enough data to decide

Minimum Training Data (NON-NEGOTIABLE)

Do NOT call /create-gpt train or /create-classifier train with insufficient data.

Model TypeMinimum SamplesRule
GPT (QLoRA SFT)1,000+ total< 1,000 → stays at Tier 2 teacher
Classifier (sklearn/SetFit)200 per classn_samples / n_classes >= 200
Regressor100+ totalStandard sklearn guidance

Evidence: sparta_stress_grading was trained on 246 samples → 33.7% agreement. That's 4 months of wasted shadow labels because the model was trained too early. Collect first, train when ready.

Training Data Flow

Tier 2 teacher (scillm via persona)
    ↓ labels saved to shadow.jsonl
    ↓
/assistant-lab harvest --task X
    ↓ extracts input+output pairs
    ↓
/create-gpt train --task X --data labels.jsonl
    ↓ QLoRA on Qwen2.5-1.5B (default)
    ↓
/gpt-lab benchmark --task X
    ↓ compare student vs teacher
    ↓
/assistant-lab promote --task X --type gpt
    ↓ updates model_registry.json, shadow_mode=false

Remote Training (RunPod Flash)

For models too large for the local RTX A5000 (24GB VRAM, max ~1.7B with LoRA), assistant-lab uses RunPod Flash — the serverless Python SDK with no Docker, no SSH, and no rsync overhead. Flash replaces /ops-runpod for all training paths. /ops-runpod is retained for persistent inference servers only.

When to Use Flash

Model SizeLocal A5000Flash NeededGPU
0.5–1.7BLoRA fitsNo./run.sh train (local)
3–7BCan't fitYesB200 (preferred) or H200
8–13BImpossibleYesB200 (preferred) or H200

Flash GPU Types

GPUVRAMNotes
B200192 GB HBM3eFastest; 3–5× H200 on MoE / long-context
H200192 GB HBM3Good availability; solid baseline

Billing: pay-per-second, 7-day execution maximum per job.

Flash cost estimates (approximate)

Model SizeGPUEst. Training TimeEst. Cost
7B QLoRA SFTB200~1–2 hrs~$5–15
7B QLoRA SFTH200~2–3 hrs~$8–20
13B QLoRA SFTB200~2–4 hrs~$10–25
13B QLoRA SFTH200~3–5 hrs~$12–30

Commands

# Step 1: Always estimate cost first
./run.sh estimate --task taxonomy-assessor --target flash --gpu B200 --size 7B

# Step 2: Train on Flash B200 (requires --confirm for safety)
./run.sh train --task taxonomy-assessor --target flash --gpu B200 --size 7B --confirm

# Train on Flash H200
./run.sh train --task taxonomy-assessor --target flash --gpu H200 --size 13B --confirm

# With custom base model
./run.sh train --task taxonomy-assessor --target flash --gpu B200 --size 8B \
  --base-model meta-llama/Llama-3.1-8B-Instruct --confirm

# With different quantization
./run.sh train --task qra-validator --target flash --gpu B200 --size 7B \
  --quantize Q5_K_M --confirm

Flash Training Pipeline

estimate --target flash --gpu B200 --size 7B
    ↓
train --target flash --gpu B200 --confirm
    ├─ 1. Cost estimate + budget gate
    ├─ 2. Flash serverless job submitted (Python SDK — no Docker/SSH)
    ├─ 3. Dataset streamed to Flash worker
    ├─ 4. QLoRA / SFT training runs on B200/H200 (192GB VRAM)
    ├─ 5. Pull model weights to /mnt/storage12tb/models/
    ├─ 6. create-gpt export --quantize Q4_K_M (GGUF)
    └─ 7. Evaluate + auto-promote if passing

Safety Gates

  • Budget cap: --max-cost (default $15.00) blocks training if estimate exceeds limit
  • Confirmation: Must pass --confirm — without it, shows cost and exits
  • Auto-teardown: Flash job is cancelled on exit (even on error, via trap)
  • Metrics logging: Every Flash training run logged to lab_metrics.jsonl

Integration with Self-Improvement Loop

Remote-trained models integrate with the same cascade as local models:

Tier 0:   Heuristic (free, instant)
Tier 0.5: Classifier (local, free)
Tier 1.5: Local GPT ≤1.7B (create-gpt, free after training)
Tier 1.5: Remote GPT 3-13B (train-remote, free after training)  ← NEW
Tier 2:   scillm/DeepSeek V3 (Chutes, $0.12/1K calls)

A 7-13B model at Tier 1.5 can significantly reduce Tier 2 (Chutes) escalations, potentially paying for its training cost in reduced overages.

Relationship to Other Skills

/monitor-skills ──→ "skill X is unhealthy"
                         ↓
/assistant-lab ──→ diagnose → train → eval → promote
                         ↓
/assistant ──────→ uses promoted model at inference time
  • /monitor-skills: Observes ALL skills. Detects problems. Reports health.
  • /assistant-lab: Fixes /assistant's models. Trains, evaluates, promotes.
  • /assistant: Runs inference. Uses whatever models the lab has produced.

Contract

  • Input: Task name + optional model type
  • Output: Diagnosis, training results, evaluation results, promotion status
  • Dependencies: model_factory.py (from /common), create-* and *-lab skills
  • Metrics: Appends to ~/.pi/assistant/lab_metrics.jsonl

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

grahama1970/acceptance-contract

Turn a client brief, zip bundle, directory, or single requirements file into a typed acceptance-contract bundle with extracted requirements, acceptance checks, open questions, an immutable-goal draft, and a create-report-backed decision report. Use when users say acceptance contract, brief to requirements, freeze the goal, create immutable goal, amend immutable goal, build a Battle requirements bundle, or extract requirements from this bundle.

grahama1970/agent-ecosystem

Canonical map and shared contracts for the agent-governance ecosystem: the pi.receipt_envelope.v1 boundary envelope, the component graph, and the rules for which component owns which schema. Use when wiring a skill or extension into the shared receipt world, when asking how shame, triage-error, tau, ask, project-watchdog, ops-herdr, ponytail, and Memory fit together, or when validating an envelope.

grahama1970/agentic-evals

Agentic evaluation of skills using multi-trial fixtures, deterministic command assertions, trajectory checks, safety constraints, and evidence-backed readiness scoring. Use when users ask for agentic evals, multi-trial skill evaluation, skill trajectory validation, or readiness scoring for a skill workflow.

grahama1970/agent-inbox

File-based inter-agent messaging with headless dispatch. Check inbox, send bugs/requests to other projects, automatically spawn headless agents to fix bugs, and track progress via task-monitor.

grahama1970/agents-registry

Generate and query the centralized agent identity registry. Scans .pi/agents/*/AGENTS.md, parses frontmatter, outputs agents-registry.json and optionally syncs to /memory for semantic search.

grahama1970/agent-status

Artifact-driven status surfaces for long-running project-agent work. Maintains status.json, events.jsonl, proof manifests, and a stale-aware STATUS.html so humans can tell where the agent is, what passed, what is still unproven, and what decision or action is next — without dashboard theater.

grahama1970/align

Round-based context alignment before execution. Use when the human, project agent, WebGPT, scillm, ask, dogpile, memory, or project-knowledge may each hold different facts about a task; especially before ambiguous design, infographic, product workflow, high-stakes implementation, plan-iterate, project-infographic, or multi-review work.

grahama1970/analytics

Flexible data science analytics for any dataset. Auto-discovers schema, recommends charts, exports to create-figure. Works with JSONL, JSON, CSV from any source.

grahama1970/analyze-chatterbox-emotions

Evaluate generated Chatterbox voice files as voice-quality artifacts: affect match, arousal/valence proxies, pause placement, intelligibility inputs, clipping, loudness, and discontinuity flags. Use when reviewing Chatterbox emotional tags, pauses, Turbo/base affect delivery, Persona Dream utterance renders, or whether generated speech matches an intended product-facing affect.

grahama1970/analyze-elf

Reverse-engineer features from ELF binaries. Extracts CLI commands, state machines, protocols, Zod schemas, and data models. Automatically generates a /create-walkthrough prosecution brief with Mermaid diagrams. Uses /treesitter for AST analysis of bundled JS/TS source.

grahama1970/animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

grahama1970/anonymize-data

Anonymize supported CSV, JSON, UTF-8 text, and SQLite files using an explicit policy through the oai-trial project. Use for anonymize data, pseudonymize exports, redact policy literals, or discover and explicitly approve fuzzy name aliases. The skill is a thin CLI/Docker interface, not another engine.

grahama1970/anvil

Heavy-duty "No-Vibes" debugging and hardening orchestrator. Use this for complex, stubborn bugs where `review-code` has failed, or for "Red Teaming" (hardening) a codebase. Runs multiple agents in parallel (Thunderdome) using git worktree isolation.

grahama1970/apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

grahama1970/argue

Multi-persona structured debate orchestrator. Personas research via /dogpile, consult colleagues via /ask, and argue toward nuanced synthesis on complex questions.

grahama1970/arxiv

Search arXiv for papers and extract knowledge into memory. Use `search` to find papers, `learn` to extract knowledge.

grahama1970/ask

Use when the user asks to query project memory, ask an oracle, use supported browser-backed reviewers, run Tau roundtable/single-handler workflows, ask Pi-native subagents from within Pi, run persona/deep-review workflows, generate image prompts, check OS/project health through composed skills, or run an ask DAG. This skill is the executable /ask runtime; do not replace it with an informal subagent, plain web search, or hand-written review; inside Pi, explicit Pi-native subagent targets are routed through the pi-subagents tool as an Ask target type.

grahama1970/assess

Step back and critically reassess project state. Use when asked to "assess", "step back", "fresh eyes", "check alignment", "sanity check", "health check", "prune documentation", or "evaluate what's working". Offers documentation pruning and doc-code alignment analysis. Offer to run after major changes (don't auto-run).

grahama1970/assistant

Shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

grahama1970/batch-quality

Pre-flight validation and quality gates for batch LLM operations. ACTUALLY tests samples through LLM before burning tokens. Uses SPARTA contracts for DuckDB validation queries. Integrates with task-monitor for enforced quality gates.

関連スキル