跳到正文
cccskills
免费在 GitHub 公开

dag-typesafe

Analyze a repository's type system and generate type-safe DAG execution pipelines with GraphSentry-style certificate verification. This skill should be used when building LLM-driven workflows that need deterministic type safety, when composing typed operations into validated execution graphs, or when adding contract-checked pipeline orchestration to any codebase. Supports Python (Pydantic) and TypeScript (Zod).

中文简介正在准备中。当前显示原文说明。

集成工具OpenAI
查看安装方法

包含的文件(19)

  • SKILL.md6.5 KB
  • extractors/__init__.py0 B
  • extractors/base.py3.0 KB
  • extractors/python_extractor.py14.9 KB
  • extractors/typescript_extractor.py11.7 KB
  • README.md7.9 KB
  • references/research-sources.md2.8 KB
  • schemas/certificate.schema.json2.5 KB
  • schemas/dag-plan.schema.json5.8 KB
  • schemas/registry.schema.json5.0 KB
  • scripts/analyze.py3.2 KB
  • scripts/compile.py14.9 KB
  • scripts/compose.py6.6 KB
  • scripts/registry.py3.2 KB
  • scripts/validate.py6.7 KB
  • tests/fixtures/python_repo/dag-registry.json7.2 KB
  • tests/fixtures/python_repo/models.py1.5 KB
  • tests/fixtures/python_repo/test-dag-plan.json1.5 KB
  • tests/fixtures/typescript_repo/api.ts755 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

dag-typesafe

Deterministic type safety via directed acyclic graphs for reasoning language models.

Analyze any repo's public API surface, extract a typed node registry, compose validated execution DAGs from natural language, and compile them into native pipeline code with GraphSentry-style (artifact, certificate) verification at every node boundary.

Category

Code Scaffolding & Templates

Core Concepts

Three layers compose into a single architecture:

  1. Typed Node Registry — the repo's public functions/classes extracted as typed nodes with JSON Schema input/output contracts. The LLM selects from this registry; it never generates arbitrary code.

  2. DAG Plan — a language-neutral execution graph where nodes reference registry entries and edges are schema-validated. No cycles, all inputs satisfied, all types compatible.

  3. Certificates — each node emits an (artifact, certificate) pair. Certificates are deterministic predicates evaluated from logged evidence. Failed certificates halt the pipeline with diagnostic context. Based on GraphSentry (Li et al., 2026).

Commands

Parse $ARGUMENTS to determine which command to run:

analyze

Extract a typed node registry from the current repository.

python3 ~/.claude/skills/dag-typesafe/scripts/analyze.py [--language python|typescript|auto] [--output dag-registry.json]
  1. Detect repo language(s) from file extensions and config files
  2. Run the appropriate extractor(s) from extractors/
  3. Walk the AST for public API surface only (exported functions, public classes, API endpoints)
  4. Convert type annotations to JSON Schema
  5. Output dag-registry.json at repo root

compose

Generate a DAG plan from natural language using the typed registry.

The compose phase is endpoint-agnostic — it works with any OpenAI-compatible API (OpenRouter, Groq, Subq Code, local models) or in-session via Claude Code.

In-session mode (default): Build a structured prompt from the registry and task description, then use the current Claude Code session to generate the DAG plan.

Headless mode: Set DAG_LLM_BASE_URL and DAG_LLM_API_KEY environment variables to point at any OpenAI-compatible endpoint.

python3 ~/.claude/skills/dag-typesafe/scripts/compose.py "task description" --registry dag-registry.json [--output dag-plan.json] [--provider session|openai]
  1. Load registry from dag-registry.json
  2. Build structured prompt constraining LLM to node selection and parameterization
  3. Generate DAG plan conforming to schemas/dag-plan.schema.json
  4. Validate the plan (type compatibility, no cycles, all inputs satisfied)
  5. Generate certificate predicates for each node
  6. Output dag-plan.json

compile

Compile a validated DAG plan into native executable code.

python3 ~/.claude/skills/dag-typesafe/scripts/compile.py dag-plan.json [--target python|typescript] [--output pipeline.py]
  1. Read validated dag-plan.json and dag-registry.json
  2. Topologically sort nodes
  3. Generate native pipeline code via inline code generation
  4. Wrap each node call in schema validation (Pydantic .model_validate() / Zod .parse())
  5. Inject certificate predicate evaluation at every node boundary
  6. Output executable pipeline file with zero runtime dependencies beyond standard validation libs

validate

Type-check an existing DAG plan against a registry.

python3 ~/.claude/skills/dag-typesafe/scripts/validate.py dag-plan.json --registry dag-registry.json

Checks: cycle detection, edge type compatibility, required input satisfaction, certificate predicate well-formedness, registry reference integrity.

registry

Inspect, filter, and query the typed node registry.

python3 ~/.claude/skills/dag-typesafe/scripts/registry.py [--filter "pattern"] [--show-schemas] [--stats]

Schemas

All schemas live in schemas/ as JSON Schema (draft 2020-12):

  • dag-plan.schema.json — DAG plan format (nodes, edges, metadata)
  • registry.schema.json — typed node registry format
  • certificate.schema.json — GraphSentry certificate format

Read these schemas before generating or validating any DAG artifacts.

Extractors

Language-specific type extractors in extractors/:

ExtractorSource TypesOutput
python_extractor.pyPydantic BaseModel, dataclass, TypedDict, function annotationsJSON Schema
typescript_extractor.pyZod schemas, interfaces, type aliases, function signaturesJSON Schema

Each extractor walks the AST, identifies public API surface, and converts type definitions to JSON Schema for the registry. Internal/private symbols are excluded.

Code Generation

The compiler generates pipeline code inline (no external templates). Both Python and TypeScript targets produce complete executable files with:

  • Certificate/CertificateError classes
  • Topologically sorted node execution
  • Per-node certificate emission and predicate evaluation
  • Predicate expression sandboxing (AST-validated safe subset only)

LLM Provider Configuration

For headless/CI use, configure via environment variables:

export DAG_LLM_BASE_URL="https://openrouter.ai/api/v1"  # or Groq, Subq, local
export DAG_LLM_API_KEY="your-key"
export DAG_LLM_MODEL="anthropic/claude-sonnet-4-20250514"  # model identifier

When these are unset, compose mode generates a structured prompt for in-session use.

Research Basis

This skill synthesizes patterns from:

  • GraphSentry (Li et al., 2026) — certificate-driven typed DAGs, contract-checked graph surgery
  • ChopChop (Nagy et al., POPL 2026) — semantic constrained decoding via coinductive realizability
  • PlanCompiler (prnvh, 2026) — LLM confined to typed node registry selection
  • PlanAI (Provos, 2026) — Pydantic-typed DAG orchestration with automatic routing
  • Agint (Chivukula et al., 2025) — type floors (text→data→spec→code) in agentic graph compilation

Full source list: references/research-sources.md

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Search academic papers, build literature reviews, and synthesize research findings — combines Exa MCP (research_paper category, arxiv filtering) with arxiv-mcp-server for paper discovery, download, and deep analysis. Triggers on academic paper, literature review, research synthesis, arxiv, find papers, scholarly search.

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

This skill should be used when creating, auditing, or maintaining AGENTS.md files and Codex CLI configuration for any project—including initializing AGENTS.md for cross-agent compatibility (Codex, Cursor, Copilot, Devin, Jules, Amp, Gemini CLI), generating config.toml or .rules files, scaffolding .agents/skills/, converting CLAUDE.md to AGENTS.md, or auditing existing agent configs for bloat and staleness. Complementary to codex-orchestrator (which executes subagents; this skill creates the config files they consume).

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

Academic research skill for Biblical Hebrew, Semitic linguistics, cuneiform studies, and comparative Ancient Near Eastern research. Provides Sefaria API for Hebrew Bible, CDLI/ORACC for cuneiform databases, and web discovery via Omnisearch, Exa, Firecrawl, and Obscura for finding scholarly sources across JSTOR, Perseus, Persée, Google Scholar, and academia.edu. Triggers on Hebrew quotes, cuneiform, Sefaria, ANE research, Minoan, search for scholarship, find papers, literature review, scholarly search, academic search, Genesis/Tehom, Ugaritic, Talmudic sources, extract from PDF, OCR academic.

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

Build comprehensive ARCHITECTURE.md files following matklad's canonical guidelines — bird's-eye views, ASCII/Mermaid diagrams, codemaps, invariants, and layer boundaries. Triggers on document the architecture, create ARCHITECTURE.md, map this codebase, architectural overview.

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

Generate physically-based atmospheric scattering shaders — sky domes, planetary atmospheres, LUT-optimized pipelines, depth-aware post-processing. Four modes — sky-dome, atmosphere-post, planet, lut. Triggers on atmospheric scattering, sky shader, sunset rendering, planet atmosphere, Rayleigh scattering, Mie scattering, volumetric sky, sky dome, atmosphere post-processing, aerial perspective, transmittance LUT, sky rendering, realistic sky, planetary rendering.

中文简介正在准备中。当前显示原文说明。

tdimino/claude-code-minoan412026年10月16日 更新

查看 tdimino 的全部技能

报告此技能的问题