本文へ移動
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).

インストール方法を見る

含まれるファイル(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(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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年9月28日 更新

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年9月28日 更新

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年9月28日 更新

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年9月28日 更新

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年9月28日 更新

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年9月28日 更新

tdimino のスキルをすべて見る

このスキルの問題を報告する