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

grahama1970/assistant

パーソナ監視タスク向けの共有GPT + 分類器推論ゲートウェイです。ヒューリスティック→分類器→ローカルGPT→scillm の4段階カスケードで検証と分類をルーティングします。

assistant とは?

このスキルは、パーソナ監視タスクのための共有推論ゲートウェイ「/assistant」を提供します。Tier 0(ヒューリスティック、無料・マイクロ秒)からTier 2(scillm/DeepSeek V3.2、有料)までの4段階カスケードを実装し、低コストで高速なルールベース処理から高精度なLLM推論まで段階的に処理を委譲します。主な機能として、タスクに応じた検証・分類API、プロンプトの反復最適化ルール、シャドウモードによる安全なモデル育成、モデルファクトリーによる自律改善ループ(auto-improve)、教師ラベルの収穫(harvest)などを備えています。対応プラットフォームはClaude Code(./run.sh 経由)およびPython API(assistant.validate, assistant.classify)です。スキルは「温かい池」と呼ばれる自己改善エコシステムの一部で、/assistant-labによるモデル作成・評価・昇格と、/monitor-skillsによる可観測性が連携して動作します。

対応✓Claude Code~Codex CLI~Cursor✓Antigravity
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に質問する

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

ドキュメント

停止。エンドポイントを呼び出す前に、このSKILL.MD全体を読んでください。

assistant は何をしますか?

パーソナ監視タスク向けの共有GPT + 分類器 + 回帰器推論ゲートウェイ。

「温かい池」— /assistant は /assistant-lab(自己改善ワークベンチ: create-、-lab、モデルファクトリー)を介して推論スタックを自律的に進化させることができ、/monitor-skills はスキルエコシステム全体の可観測性を提供します。

プロンプト反復ルール(譲れません)

/assistant モデルのすべてのシステムプロンプトは、/prompt-lab を通じて反復された後、/create-gpt を介してトレーニングデータに焼き付けなければなりません。システムプロンプトをPython文字列で手作りしてはいけません。

  • 新しいモデルのプロンプト → まず /prompt-lab eval でグラウンドトゥルースに対して評価
  • プロンプトがプラトーに達した場合(シャドウ一致率80-90%) → /prompt-lab compare でバリアント間を比較
  • モデルの再トレーニング → /create-gpt の前に /prompt-lab find-minimum でプロンプトを検証

階層カスケード

階層方法コストレイテンシ作成者
0ヒューリスティック(正規表現/キーワード/スキーマ)無料マイクロ秒手書き
0.5分類器(DistilBERT/sklearn)無料5-25ms/create-classifier
0.75回帰器(sklearn/XGB)無料5-10ms/create-regressor
1.5共有GPT(Qwen3-0.6B GGUF)無料~200ms/create-gpt
2scillm(Chutes上のDeepSeek V3.2)$0.12/1K2-5秒パーソナ教師

モデルライフサイクル(温かい池)

Tier 2 パーソナ教師がラベルを作成
    ↓ harvest.py が shadow.jsonl を抽出
    ↓
ModelFactory.auto_improve(task)
    ↓ シャドウ一致率を読み取り
    ├─ >= 90%: 昇格(shadow_mode → false)
    ├─ 80-90%: プラトー → /prompt-lab で再設計
    ├─ 70-80%: /create-gpt または /create-classifier で再トレーニング
    └─ < 70%: 積極的再トレーニング + アーキテクチャ変更
    ↓
/gpt-lab ベンチマーク または /classifier-lab 評価
    ↓ 合格? → レジストリに昇格
    ↓
/monitor-skills がドリフトや健全性の問題を検出
    ↓
/assistant-lab auto-improve(診断 → トレーニング → 評価 → 昇格)

使用方法

# 階層カスケードを通じてデータを検証
./run.sh validate --task qra-assessor --scope brandon_bailey --input '{"question":"...", "answer":"..."}'

# テキストを分類
./run.sh classify --task bridge-tagger --text "satellite vulnerability assessment"

# 新しいモデルを登録
./run.sh register --task NAME --model-path PATH --type gpt|classifier --threshold 0.85

# 登録済みモデル、ヒット率、階層分布を表示
./run.sh status

# すべての階層に合成入力を実行
./run.sh self-test

# 階層2のエスカレーションをトレーニングデータとして抽出
./run.sh harvest --since 24h

Python API

from assistant import validate, classify

# 4段階カスケードで検証
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)

# 3段階カスケードで分類
result = classify(
    text="satellite vulnerability assessment",
    task="bridge-tagger",
)
print(result.prediction, result.confidence, result.source)

契約

  • 入力: タスク固有の辞書(バリデーター)またはテキスト文字列(分類器)
  • 出力: 階層、信頼度、レイテンシを含む GatewayResult または ClassifyResult
  • 依存関係: loguru、typer; オプション: llama-cpp-python、torch、joblib
  • メトリクス: ~/.pi/assistant/metrics.jsonl にJSONLを追記

モデルファクトリー

# タスクに必要なモデルを確認
./run.sh factory needs --task stress-test-grader

# 収穫された教師ラベルからGPTをトレーニング
./run.sh factory train-gpt --task stress-test-grader

# /gpt-lab 経由で評価
./run.sh factory evaluate --task stress-test-grader --type gpt

# 合格したモデルを昇格(シャドウモードを無効化)
./run.sh factory promote --task stress-test-grader --type gpt

# 自律改善ループ(判断 + トレーニング + 評価 + 昇格)
./run.sh factory auto-improve --task stress-test-grader
from model_factory import ModelFactory

factory = ModelFactory()
result = factory.auto_improve("stress-test-grader")
# → シャドウ一致率を読み取り、必要に応じてトレーニング/評価/昇格を実行

主要な動作

  1. 遅延モデル読み込み: 重みは最初の呼び出し時に読み込まれ、プロセス内でキャッシュされる
  2. メモリ注入: パーソナスコープから想起し、GPTシステムプロンプトの前に追加
  3. パススルーモード: ローカルモデルが存在しない場合は直接scillmにフォールバック
  4. シャドウモード: "shadow_mode": true のタスクではローカルモデルとscillmを並列実行し、不一致を shadow.jsonl に記録し、教師(scillm)の結果を返す。新しい生徒モデルの安全な段階的導入を可能にする。
  5. 収穫: 階層2のエスカレーションを教師ラベルとして夜間に抽出
  6. モデルファクトリー: /assistant-lab を介して、シャドウモードがタスクの改善必要性を示した場合に、自律的にモデルをトレーニング、評価、昇格させる
  7. 温かい池: /monitor-skills がエコシステムを監視し(可観測性)、/assistant-lab が問題を修正する(自己改善)。これらが連携して、/assistant が進化する温かい池を形成する

よくある間違い

間違い: Python文字列でシステムプロンプトを手作りする

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

正しい: トレーニングデータに焼き付ける前に /prompt-lab でプロンプトを反復する

.pi/skills/prompt-lab/run.sh eval --prompt qra_validator_v1 --model deepseek
# prompt-labの検証後にのみトレーニングデータを作成する

間違い: 不十分なデータでトレーニングする(クラスあたり200サンプル未満)

./run.sh factory train-gpt --task sparta-intent  # 50個のサンプル、12クラス = 1クラスあたり4つ!

正しい: Tier 2に留まり、まず教師ラベルをさらに収穫する

./run.sh harvest --since 7d  # シャドウラベルを蓄積
./run.sh status              # トレーニング前にサンプル数を確認

間違い: シャドウモードをスキップし、未テストのモデルを昇格させる

./run.sh factory promote --task stress-test-grader  # シャドウ比較なし!

正しい: シャドウモードを実行し、一致率を確認してから昇格させる

./run.sh factory auto-improve --task stress-test-grader
# auto-improve がシャドウ一致率を読み取り、判断する

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.

関連スキル