Community编程与开发github.com

grahama1970/assistant

共享 GPT + 分类器推理网关,用于人格监控任务。通过四层级联(启发式→分类器→本地 GPT→scillm)进行验证和分类。

assistant 是什么?

grahama1970/assistant 是一个推理网关,它整合了共享 GPT、分类器和回归器,专为人格监控任务设计。该技能的核心是其四层推理级联架构:从零成本、微秒级的启发式规则(Tier 0)开始,到免费的 DistilBERT/sklearn 分类器(Tier 0.5)和 XGB 回归器(Tier 0.75),再到免费的本地 GGUF 模型(Tier 1.5),最后以付费的高精度 scillm(DeepSeek V3.2 via Chutes)作为教师模型(Tier 2)。其独特之处在于“温暖水池”(Warm Pond)理念——通过 `/assistant-lab`(自改进工作台)和 `/monitor-skills`(可观测性)实现自治进化。系统通过影子模式(shadow mode)并行运行学生模型和教师模型,记录分歧到 `shadow.jsonl`,并利用模型工厂自动决定何时训练、评估和推广新模型。这为开发者提供了一个即用型、自适应的推理栈,特别适合需要持续学习和低成本部署的人格监控应用。

兼容平台✓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 中提问

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

文档

停止。在调用任何端点之前,请完整阅读本 SKILL.MD。

assistant 是做什么的?

共享 GPT + 分类器 + 回归器推理网关,用于人格监控任务。

“温暖水池”——/assistant 可通过 /assistant-lab(自改进工作台:create-*, *-lab, 模型工厂)自主进化其推理栈,同时 /monitor-skills 提供整个技能生态的可观测性。

提示迭代规则(不可协商)

所有用于 /assistant 模型的系统提示,在通过 /create-gpt 固化到训练数据之前,必须通过 /prompt-lab 进行迭代。绝不要在 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(DeepSeek V3.2 via Chutes)$0.12/1K2-5s人格教师

模型生命周期(温暖水池)

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 自动改进(诊断 → 训练 → 评估 → 推广)

使用方式

# 通过层级级联验证数据
./run.sh validate --task qra-assessor --scope brandon_bailey --input '{"question":"...", "answer":"..."}'

# 分类文本
./run.sh classify --task bridge-tagger --text "卫星漏洞评估"

# 注册新模型
./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": "什么是 CWE-79?", "answer": "跨站脚本..."},
    task="qra-assessor",
    scope="brandon_bailey",
)
print(result.tier, result.confidence, result.result)

# 使用 3 层级联进行分类
result = classify(
    text="卫星漏洞评估",
    task="bridge-tagger",
)
print(result.prediction, result.confidence, result.source)

契约

  • 输入:任务特定字典(验证器)或文本字符串(分类器)
  • 输出:GatewayResult 或 ClassifyResult,包含层级、置信度、延迟
  • 依赖:loguru, typer;可选:llama-cpp-python, torch, joblib
  • 指标:以 JSONL 格式追加到 ~/.pi/assistant/metrics.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 = "你是一个 QRA 验证器。检查答案是否正确..."

正确:在固化到训练数据之前,通过 /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 个类 = 每类 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.

相关技能