Community编程与开发github.com

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.

assistant 是什么?

assistant is a Claude Code agent skill that shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

兼容平台Claude Code~Codex CLI~CursorAntigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/assistant

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

STOP. READ THIS ENTIRE SKILL.MD BEFORE CALLING ANY ENDPOINT.

assistant 是做什么的?

Shared GPT + classifier + regressor inference gateway for persona monitor tasks.

The "warm pond" — /assistant can autonomously evolve its inference stack via /assistant-lab (self-improvement workbench: create-*, *-lab, model factory) while /monitor-skills provides observability across the skill ecosystem.

Prompt Iteration Rule (NON-NEGOTIABLE)

All system prompts for /assistant models MUST be iterated through /prompt-lab before being baked into training data via /create-gpt. NEVER hand-craft system prompts in Python strings.

  • New model prompt → /prompt-lab eval against ground truth first
  • Prompt plateau (80-90% shadow agreement) → /prompt-lab compare across variants
  • Model retraining → validate prompt with /prompt-lab find-minimum before /create-gpt

Tier Cascade

TierMethodCostLatencyCreated By
0Heuristic (regex/keyword/schema)freemicrosecondshand-coded
0.5Classifier (DistilBERT/sklearn)free5-25ms/create-classifier
0.75Regressor (sklearn/XGB)free5-10ms/create-regressor
1.5Shared GPT (Qwen3-0.6B GGUF)free~200ms/create-gpt
2scillm (DeepSeek V3.2 via Chutes)$0.12/1K2-5spersona teacher

Model Lifecycle (Warm Pond)

Tier 2 persona teacher creates labels
    ↓ harvest.py extracts shadow.jsonl
    ↓
ModelFactory.auto_improve(task)
    ↓ reads shadow agreement rate
    ├─ >= 90%: promote (shadow_mode → false)
    ├─ 80-90%: plateau → /prompt-lab redesign
    ├─ 70-80%: /create-gpt or /create-classifier retrain
    └─ < 70%: aggressive retrain + architecture change
    ↓
/gpt-lab benchmark or /classifier-lab evaluate
    ↓ passing? → promote to registry
    ↓
/monitor-skills detects drift or health issues
    ↓
/assistant-lab auto-improve (diagnose → train → eval → promote)

Usage

# Validate data through tier cascade
./run.sh validate --task qra-assessor --scope brandon_bailey --input '{"question":"...", "answer":"..."}'

# Classify text
./run.sh classify --task bridge-tagger --text "satellite vulnerability assessment"

# Register a new model
./run.sh register --task NAME --model-path PATH --type gpt|classifier --threshold 0.85

# Show registered models, hit rates, tier distribution
./run.sh status

# Run synthetic input through all tiers
./run.sh self-test

# Extract tier-2 escalations as training data
./run.sh harvest --since 24h

Python API

from assistant import validate, classify

# Validate with 4-tier cascade
result = validate(
    input_data={"question": "What is CWE-79?", "answer": "Cross-site scripting..."},
    task="qra-assessor",
    scope="brandon_bailey",
)
print(result.tier, result.confidence, result.result)

# Classify with 3-tier cascade
result = classify(
    text="satellite vulnerability assessment",
    task="bridge-tagger",
)
print(result.prediction, result.confidence, result.source)

Contract

  • Input: Task-specific dict (validators) or text string (classifiers)
  • Output: GatewayResult or ClassifyResult with tier, confidence, latency
  • Dependencies: loguru, typer; optional: llama-cpp-python, torch, joblib
  • Metrics: Appends JSONL to ~/.pi/assistant/metrics.jsonl

Model Factory

# Check what models a task needs
./run.sh factory needs --task stress-test-grader

# Train a GPT from harvested teacher labels
./run.sh factory train-gpt --task stress-test-grader

# Evaluate via /gpt-lab
./run.sh factory evaluate --task stress-test-grader --type gpt

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

# Autonomous improvement loop (decide + train + eval + promote)
./run.sh factory auto-improve --task stress-test-grader
from model_factory import ModelFactory

factory = ModelFactory()
result = factory.auto_improve("stress-test-grader")
# → reads shadow agreement, trains/evals/promotes as needed

Key Behaviors

  1. Lazy model loading: Weights loaded on first call, cached in-process
  2. Memory injection: Recalls from persona scope, prepends to GPT system prompt
  3. Passthrough mode: Falls directly to scillm if no local model exists
  4. Shadow mode: Tasks with "shadow_mode": true run local model AND scillm in parallel, log disagreements to shadow.jsonl, return the teacher (scillm) result. Enables safe ramp-up of new student models.
  5. Harvest: Nightly extraction of tier-2 escalations as teacher labels
  6. Model Factory: Via /assistant-lab, autonomously trains, evaluates, and promotes models when shadow mode shows a task needs improvement
  7. Warm Pond: /monitor-skills watches the ecosystem (observability), /assistant-lab fixes problems (self-improvement). Together they form the warm pond where /assistant evolves.

Common Mistakes

WRONG: Hand-crafting system prompts in Python strings

SYSTEM_PROMPT = "You are a QRA validator. Check if the answer is correct..."

RIGHT: Iterate prompts through /prompt-lab before baking into training data

.pi/skills/prompt-lab/run.sh eval --prompt qra_validator_v1 --model deepseek
# Only after prompt-lab validation → create training data

WRONG: Training with insufficient data (< 200 samples per class)

./run.sh factory train-gpt --task sparta-intent  # 50 samples, 12 classes = 4/class!

RIGHT: Stay at Tier 2 and harvest more teacher labels first

./run.sh harvest --since 7d  # accumulate shadow labels
./run.sh status              # check sample counts before training

WRONG: Skipping shadow mode and promoting untested models

./run.sh factory promote --task stress-test-grader  # no shadow comparison!

RIGHT: Run shadow mode, verify agreement rate, then promote

./run.sh factory auto-improve --task stress-test-grader
# auto-improve reads shadow agreement rate and decides

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-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.

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.

相关技能