← Back to list

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)
Workflow (recommended)
- Start from a runnable baseline
- Use
examples/05_backend_runtime.pyas the default backend-shaped reference.
- Use
- Design your state slices
- Keep
request,response,_internalas the core. - Add domain slices (e.g.,
ticket,orders,workflow) and register them viaNodeRegistry.add_valid_slice(...).
- Keep
- 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).
- Each node:
- Wire via registry + GraphBuilder
- Register nodes into a
NodeRegistry. - Build with
build_graph_from_registry(...), set entry point, compile.
- Register nodes into a
- Add runtime wrapper
- Use
AgentRuntime(orStreamingRuntimewhen you need SSE-style progress events).
- Use
- Make it safe to change
- Run
ContractValidator(strict=True)in tests/CI. - Use
agent-contracts diffto review breaking contract changes across versions. - Generate architecture docs with
agent-contracts visualize.
- Run
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+AgentRuntimefor API handlers. - Treat
response.response_typeas your API “type”, and keep payload inresponse.response_data.
Multi-step workflow
- Use a domain slice (e.g.,
workflow) +_internalflags to drive steps (seeexamples/04_multi_step_workflow.py).
Interactive (question/answer) flow
- Use
InteractiveNodefor ask/process/check loops (seedocs/core_concepts.md).
References (load only when needed)
docs/getting_started.mddocs/core_concepts.mddocs/best_practices.mddocs/cli.mdexamples/
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

