Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add nonlinear-xyz/factory-kit --skill factory-llm-workflowsgit clone --depth 1 https://github.com/nonlinear-xyz/factory-kitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-llm-workflows)<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-llm-workflows"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-llm-workflows/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/nonlinear-xyz/factory-kit/factory-llm-workflows"><img src="https://agentmods.dev/badge/skills/nonlinear-xyz/factory-kit/factory-llm-workflows.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00093 | $0.02836 |
| Opus 5.5 | $0.00037 | $0.01134 |
| Sonnet 5.5 | $0.00019 | $0.00567 |
| Haiku 4.5 | $0.00009 | $0.00284 |
Grade A, and why
factory-llm-workflows scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Factory LLM workflows
Each section leads with Principle (one sentence, stack-agnostic), then Why (constraint → option → tradeoff), then Recipe (the LangGraph / FastAPI / SSE shape we use), and Failure mode when there's one to name. Sections that are pure style with no deeper truth are marked Recipe only.
State shape — TypedDict, not Pydantic
Principle. LangGraph state is a TypedDict, not Pydantic. The state library's merge semantics dictate the shape.
Why. LangGraph merges state between nodes by shallow dict update — the framework expects a dict-like object whose fields are independently updatable. Pydantic validates on construction; every partial update fails validation or requires .model_copy(update=...), which loses the simplicity. TypedDict matches the framework's semantics: it's a dict, fields are optional via total=False, the type annotations are documentation that the type checker enforces at call sites.
Recipe.
from typing import TypedDict
from typing_extensions import NotRequired
class ChatState(TypedDict, total=False):
"""Documented fields. total=False makes everything optional."""
user_query: str
intent: NotRequired[str]
rewritten_query: NotRequired[str]
retrieved_chunks: NotRequired[list[RetrievedChunk]]
response: NotRequired[str]
rag_fallback_attempted: NotRequired[bool] # one-attempt loop guards
Nested TypedDicts (RetrievedChunk, EvidenceChunk, ClaimVerdict) for complex types.
Failure mode. Reaching for Pydantic state because "Pydantic is more rigorous" — every node update became a .model_copy(update=...) dance, and the graph wiring drowned in validation noise.
Graph composition — node factory closures
Principle. Nodes are produced by factory functions that close over their dependencies; the graph wires the result.
Why. A node that imports its dependencies (LLM client, prompt template, retriever) at module scope is hard to test and impossible to swap. A factory function takes dependencies as parameters and returns a callable; the graph passes the factory the wired-up dependencies. Testing is "construct the node with mocks"; swapping is "construct the node with the alternative."
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 256 lines · 93 tokens per session scan A 5da9ae65489d
factory-llm-workflows is a skill published in the GitHub repository nonlinear-xyz/factory-kit (9 stars, last pushed 12d ago), licensed MIT. It adds 93 tokens to every session and 2,836 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
databases
Design schemas, tune queries, migrate, and administer PostgreSQL, MySQL/MariaDB, MongoDB, MSSQL, Redis, and Valkey.
social-login
An implementation guide for letting users sign in with accounts from Google, Apple, Kakao, or Naver. It explains the frontend and backend steps, including checking the sign-in token before creating a session for your app.
backend-api
Design and review REST/HTTP APIs, with bounded GraphQL and gRPC contract guidance: OpenAPI, auth, pagination, compatibility, and retries.
update-docs
Update README, changelogs, API docs, and runbooks after changes; find and fix documentation drift.
fullstack-coding-standards
A reference guide for full-stack development, covering frontend code, APIs, databases, and Java Spring Boot examples. It is intended for explicit use rather than automatic application to every implementation.
api-tester
A workflow for testing communication between a web frontend and backend service. It covers proxy settings, cross-origin access (CORS), login tokens, error responses, and file uploads.