Back to list
yatarousan0227

agent-contracts-app-builder

by yatarousan0227

Contract-driven architecture for building LangGraph agents with declarative node definitions, automatic graph construction, and hybrid rule/LLM-based routing.

6🍴 0📅 Jan 20, 2026

SKILL.md


name: agent-contracts-app-builder description: Build a production-minded AI agent using agent-contracts (contracts, slices, validation, graph, runtime, CLI tooling). metadata: short-description: Build agents with agent-contracts

agent-contracts App Builder

Use this skill when you are implementing an AI agent using agent-contracts (not modifying the library itself).

Outcomes

  • A working agent with well-defined state slices and node contracts
  • CI-friendly validation (ContractValidator(strict=True) + agent-contracts validate --strict)
  • Architecture docs (agent-contracts visualize) and contract change review (agent-contracts diff)
  1. Start from a runnable baseline
    • Use examples/05_backend_runtime.py as the default backend-shaped reference.
  2. Design your state slices
    • Keep request, response, _internal as the core.
    • Add domain slices (e.g., ticket, orders, workflow) and register them via NodeRegistry.add_valid_slice(...).
  3. Implement nodes contract-first
    • Each node: NodeContract(name, description, reads, writes, supervisor, trigger_conditions, requires_llm, services, is_terminal).
    • Keep writes=["request"] out of your design (discouraged).
  4. Wire via registry + GraphBuilder
    • Register nodes into a NodeRegistry.
    • Build with build_graph_from_registry(...), set entry point, compile.
  5. Add runtime wrapper
    • Use AgentRuntime (or StreamingRuntime when you need SSE-style progress events).
  6. Make it safe to change
    • Run ContractValidator(strict=True) in tests/CI.
    • Use agent-contracts diff to review breaking contract changes across versions.
    • Generate architecture docs with agent-contracts visualize.

Quick Checks

  • Tests: pytest
  • Coverage: pytest --cov=agent_contracts --cov-report=term-missing
  • Contracts: agent-contracts validate --strict --module <your.nodes.module>
  • Docs: agent-contracts visualize --module <your.nodes.module> --output ARCHITECTURE.md

Common Patterns

Backend request/response agent

  • Use RequestContext + AgentRuntime for API handlers.
  • Treat response.response_type as your API “type”, and keep payload in response.response_data.

Multi-step workflow

  • Use a domain slice (e.g., workflow) + _internal flags to drive steps (see examples/04_multi_step_workflow.py).

Interactive (question/answer) flow

  • Use InteractiveNode for ask/process/check loops (see docs/core_concepts.md).

References (load only when needed)

  • docs/getting_started.md
  • docs/core_concepts.md
  • docs/best_practices.md
  • docs/cli.md
  • examples/

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon