AGENT SKILL

TypeSafe类型安全AI开发

typesafe-ai

使用 TypeSafe 构建 AI 驱动的软件:可像编程原语一样使用的微型 AI 智能单元。其 System One 模型(包括 Jev)将自然语言和应用状态转化为代码可组合的类型化判断与概率。当某个功能需要可编程的常识、在头脑风暴 AI 能在应用中实现什么,或某个 LLM 提示-解析步骤可转化为结构化决策时使用。应用场景包括路由、排序、抽取、验证和交互体验;这些只是起点,并非上限。阅读实时文档和范例集以找到有用的模式并发现新的组合。

适用职业AI 工程师
使用场景智能体开发
License 许可
MIT
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
typesafe-ai
license
MIT
description
Build AI-powered software with TypeSafe: small units of AI intelligence you can use like programming primitives. Its System One models, including Jev, turn natural language and application state into typed judgments and probabilities that code can combine. Use when a feature needs programmable common sense, when brainstorming what AI could make possible in an app, or when an LLM prompt-and-parse step could become a structured decision. Applications include routing, ranking, extraction, verification, and interactive experiences; these are starting points, not the limits. Read live docs and cookbooks to find useful patterns and discover new combinations.

02 资源文件 1

03 SKILL.md 正文

Build with TypeSafe

TypeSafe makes units of AI intelligence usable like programming primitives: small judgments you can compose into larger capabilities. Its System One models return fast, focused judgments that software can consume directly. Jev is TypeSafe's flagship and first System One model. It understands natural language and returns typed answers and probabilities rather than generating text or reasoning explanations. Code owns the workflow; the model supplies programmable common sense where ordinary code needs semantic understanding.

Read the live docs

The live TypeSafe docs are the source of truth. Read them as part of the task. This skill gives direction; the docs carry current concepts, prompting guidance, API contracts, SDK usage, models, limits, and worked examples.

  • Start with the documentation index to discover relevant pages and cookbooks. Use targeted reads rather than loading the entire site.
  • Mintlify serves Markdown by appending .md to a page path, for example how to build with TypeSafe. Follow links from the index; convert extensionless documentation page links to .md when useful. Resolve relative links against https://docs.typesafe.ai.
  • Before writing an integration, read the current API or chosen SDK page and the question guidance relevant to the design. For a new workflow, also inspect the closest cookbook: it often shows a better decomposition than a generic classifier.
  • If the index is unavailable, use the direct links below or the site's navigation. If Markdown fetching fails, try the normal page. If live access is unavailable, use available local docs or installed SDK types, state that limitation, and avoid inventing version-dependent details.
Task Start here; follow the relevant details
Understand the programming model System One, building guide
Explore what to build Use-case map, then relevant cookbooks from the index
Prepare inputs and questions State, primitives, then the chosen primitive's page
Decide how to handle uncertainty Confidence
Write API code HTTP API, Python SDK, or JavaScript SDK
Update an older integration Migration guide and the installed SDK's current reference

Find the useful shape

Start from the behavior the user wants: what will the application show, select, change, or hand off? Work backward to the judgments it needs. Keep known rules, calculations, exact lookups, and execution in code. Preserve the user's chosen stack and scope; add TypeSafe where semantic understanding helps.

When brainstorming or choosing an architecture, consider more than classification. The patterns below are starting points: combine primitives around the user's goal, including ideas that do not fit an established recipe.

  • Route and fill known arguments. A request can select a handler and its typed parameters. Ask useful branch-specific questions up front and consume only the relevant answers. Explore function calling and speculative fan-out.
  • Select instead of generate. Find candidate values or source spans in code, use a judgment to select the intended one, then copy or normalize it. Code can also assemble source text into a formatted document or reading guide. Explore value extraction and structure recovery.
  • Find and judge evidence. Retrieve candidates, compare their relevance to a query, and select useful context. Explore reranking and hierarchical classification.
  • Turn judgments into reusable data. Score dimensions once, then let code or user controls change weights, thresholds, rankings, and views. With labeled outcomes, those signals can become classical ML features. Explore composite scoring and feature discovery.
  • Verify and escalate. Check specific claims or fields against their evidence; send uncertain or failing cases to a person or reasoning model. Explore citation checks and extraction cascades.
  • Respond to changing state. Code can retain goals and observations while fresh judgments guide the next bounded step. Keep inferred state distinct from observed facts, and check freshness before applying a result to a changed situation.

For open-ended requests, offer the few directions that best serve the user's goal and recommend a starting point. For a concrete request, choose the relevant pattern and build; a brainstorm is not a mandatory detour.

Design the judgments

Choose by what the answer means, then read the relevant primitive page:

Need Primitive Important distinction
One of a defined set Choice Picks one option; its distribution compares competing options
Whether a condition holds Noul Probability of yes; no separate confidence; use one per label when several may apply
Degree along a described dimension Score Probability-weighted position on ordered levels; use comparable per-item Scores for graded ranking

Give each question enough relevant state to answer: source text, identities, relationships, policies, and current facts. Prefer named JSON fields when context has several parts. Put the judgment in instructions and define its possible answers in criteria. Question IDs are for code and are not sent to the model; include complete meaning in the question. Reference nested state with backticked paths such as ticket.messages[0].text.

Ask one narrow, coherent judgment per question. Split independently useful dimensions, without destroying the relationship being judged. A bounded action selection or contextual interpretation is valid; atomic does not mean literal fact extraction or a one-sentence limit. Strings work for simple questions. Use structured objects or arrays when definitions, contrasts, exclusions, or examples clarify instructions or criteria. Score levels must describe concrete situations and stand on their own.

Keep the needed answers available. Include a no-match outcome when nothing may fit; use a separate presence judgment when it is independently useful. For source-value selection, check candidate coverage: the model cannot choose an omitted value.

Compose and verify

Ask independent questions over the same state together, including useful speculative questions. They run in parallel and cannot see one another's answers. State each speculative premise explicitly; code consumes the applicable answers. A second request is warranted when an earlier answer is needed to fetch evidence, construct new state, or determine the next options. Extra questions still use tokens; measure actual request budgets, cost, and end-to-end latency.

Use probabilities and confidence to guide behavior, with thresholds evaluated on the user's data and consequences. Choice/Score confidence summarizes distribution concentration, not overall workflow correctness or permission to act. A Noul near 0.5 means similar probability for yes and no, not medium intensity. Several acceptable alternatives can also spread probability; low confidence need not invalidate a harmless preference choice. Ignore uncertainty on unused branches.

Keep policy explicit and raw judgments reusable. Weighted scores suit compensating preferences; an “any serious violation” rule needs separate conditions. Changing a weight or display filter need not rerun inference when evidence and question meanings are unchanged. Typed output guarantees the interface, not truth. System One models are trained for calibrated decisions; validate their performance in the target domain.

Test representative cases and the resulting application behavior. For failures, inspect the exact state, questions, candidates, answers, composition, and observed outcome. Separate missing evidence, model errors, code errors, and service failures. Treat cookbook thresholds and demo results as examples to evaluate, not universal rules or permanent model limitations. Keep API credentials server-side in web apps.

04 同仓库更多 Skills

WhiteChronos
WhiteChronos/ChatGPT

意识流倾诉整理与需求澄清

thinking-out-loud

一份关于智能体在收到冗长、混乱、意识流式倾诉(通常为语音口述)时该如何行动的契约:在回声简报(echo brief)获得批准前不采取任何行动。该回声会审计整段传递内容、任务、已锁定的决策与约束、未决问题、立场翻转与搁置的题外话,并将模型的推断和猜测与用户自己的措辞隔离存放,以便用户核实模型所相信的内容,而不仅仅是它所怀疑的内容。当用户说“让我理清思路”或想在动手构建前先倾诉一番、当消息以语音转文字的开场白开头(如“切换到语音,抱歉有错别字”)、当输入是标点薄弱且带有重启和中途反转的长篇内容(“其实不,等等,完全抛弃那个想法”)、或当用户要求就一个模糊的半成品想法接受访谈时使用。包含用于跨多条消息倾诉的可选捕获模式,以及可选的有针对性访谈。

普通用户需求澄清与上下文补全
★ 0
WhiteChronos
WhiteChronos/ChatGPT

代码变更范围蔓延检测

scope-creep-detector

根据声明的意图分析 git diff,以检测范围蔓延、无关文件、过大的拉取请求(PR)、超出修复范围的变更、依赖添加、公共 API 重命名、配置或 CI 修改、超大 hunk(代码差异块)以及仅格式化文件。当用户询问某项变更是否超出修复范围、PR 是否过大、或触及了哪些无关内容,并希望获得保留、拆分或说明理由的指导时使用。在本地离线运行。

软件开发工程师代码仓库协作管理
★ 0
WhiteChronos
WhiteChronos/ChatGPT

废弃项目挖掘与复活

project-graveyard

扫描开发者的机器以查找已废弃的副项目,从每个项目的 git 历史中对其进行“尸检”(死在支付墙前、被更新的项目取代、已完成但从未发布),揭示其个人的“死亡模式”,并挑选出最值得复活的“遗骸” —— 然后帮助将其发布。当用户提到被放弃、未完成或陈旧的副项目,询问“我该完成什么”,想要复活或重启某个项目,说“运行墓地”,疑惑为何自己总是有始无终,或正要开始一个听起来像是自己已经做过的新项目时使用。完全在本地运行。

软件开发工程师代码仓库协作管理
★ 0
WhiteChronos
WhiteChronos/ChatGPT

依赖清单问题诊断

dependency-doctor

检查 requirements.txt、pyproject.toml 和 package.json 依赖清单中的表层直接依赖隐患:标准库遮蔽(shadowing)式版本锁定、废弃的 backport、未固定的依赖,以及明显的清单内冲突,外加可选的 PyPI yanked(撤回)版本检查。当用户要求检查清单中的依赖问题、询问依赖为何无法安装或依赖是否有问题、想要进行依赖"尸检",或怀疑依赖清单腐化时使用。默认以本地工具形式离线运行,用于用户自己的项目,而非仓库 CI。

软件开发工程师依赖升级与管理
★ 0
WhiteChronos
WhiteChronos/ChatGPT

Git 提交历史溯源分析

commit-archaeologist

从本地 git 历史还原代码存在的原因,包括引入该代码的提交、后续更改、当前作者、反复出现的伴随文件以及可能的意图。当用户询问“这段代码为什么存在”、“谁写了这个函数以及为什么”,或在重写、重构或高风险编辑前要求“解释这个函数的历史”时使用。完全在本地运行。

软件开发工程师代码仓库协作管理
★ 0
WhiteChronos
WhiteChronos/ChatGPT

多模型编排与任务拆分

advisor-orchestrator-worker

当任务规模过大、单个模型一次处理无法完成,需要跨多个子任务并行研究或生成(例如同时研究十几个竞争对手),或用户要求编排多个模型、在模型团队间拆分工作、运行顾问-工作者循环、让更强的模型审查计划而由低成本工作模型执行,或用户说“对单个模型来说太大”或“把它分散开”时使用。不适用于单文件编辑或单个模型一次即可完成的任务。

AI 工程师编码任务委派
★ 0