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 agentmods add rules/knowledgestack/ks-cookbook/recipe_authorgit clone --depth 1 https://github.com/knowledgestack/ks-cookbookWrote 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/rules/knowledgestack/ks-cookbook/recipe_author)<a href="https://agentmods.dev/rules/knowledgestack/ks-cookbook/recipe_author"><img src="https://agentmods.dev/badge/rules/knowledgestack/ks-cookbook/recipe_author.svg" alt="Measured on agentmods" 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 | $0.00010 | $0.00597 |
| Opus 5 | $0.00005 | $0.00298 |
| Sonnet 5 | $0.00002 | $0.00119 |
| Haiku 4.5 | $0.00001 | $0.00060 |
Grade A, and why
recipe_author 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 5d 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 — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Recipe author rule
Applies when you're adding or editing anything under recipes/<name>/.
Hard constraints (CI-enforced)
- ≤100 LOC in
recipe.py(docstrings + comments don't count). Bigger → flagship. - Mandatory grounding. Every recipe calls at least one MCP tool via
recipes/_shared/mcp_client.ks_mcp_session(). - KS-only MCP contract. Connect only to
knowledgestack-mcp. Don't add a second MCP server. - Visible citations. Inline
[chunk:<uuid>]tags fromreadoutput, or an explicitcitationsfield in structured output. - Defaults must just work.
uv run python recipes/<name>/recipe.py(no flags) runs against the seeded sample policies folder (ab926019-ac7a-579f-bfda-6c52a13c5f41) and completes. - No secrets in source. Keys come from
.envonly.
Frontmatter
First docstring of recipe.py:
"""<Title>.
Pain point: <who feels this and why in one sentence>
Framework: <pydantic-ai | LangGraph | raw-openai | raw-anthropic | mcp-only | LlamaIndex | CrewAI>
Tools used: list_contents, read, search_knowledge, ...
Output: <stdout | file | workbook>
"""
Connecting to MCP
Use the shared wrapper, not hand-rolled MCPServerStdio:
from recipes._shared.mcp_client import ks_mcp_session
async with ks_mcp_session() as session:
listing = await session.call_tool("list_contents", {"folder_id": folder_id})
passage = await session.call_tool("read", {"path_part_id": path_part_id})
Framework variety
Recipes ship across different frameworks on purpose. If we already have two pydantic-ai recipes, your next contribution should probably be in LangGraph, CrewAI, raw OpenAI function-calling, raw Anthropic tool-use, or MCP-only — whichever reduces duplication.
Smoke test
No unit tests required. The bar is:
uv run python recipes/<name>/recipe.py --help # must exit 0
If the recipe is complex enough to warrant more, add recipes/<name>/test_smoke.py that mocks ks_mcp_session with canned responses and asserts the output shape. See flagships/compliance_questionnaire/ for the pattern.
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.
- 5d ago First seen · 62 lines · 10 tokens per session scan A 6238aa198ad9
recipe_author is a cursor rule published in the GitHub repository knowledgestack/ks-cookbook (9 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 597 once invoked, about $0.0001 per session on Opus 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 cursor rules, from other repositories
vk-org-resolution
VirtualKey org resolution has TWO join chains (Project for application VKs, Owner for personal VKs); vkSelectSQL must COALESCE both or personal VKs silently return NULL org.
design-tokens
Visual values via CSS variables; no hex / rgb literals in style.
i18n-mandatory
All user-visible UI text uses t('namespace:section.key') from react-i18next.
useapi-querykey
Every useApi(fetcher, queryKey) call must start queryKey with at least two string literals that uniquely identify the endpoint, followed by any state variables that affect the fetcher.
binding-rules-quick-reference
Quick index of project binding rules (canonical text in CLAUDE.md).
ai-gateway-smoke-mandatory
AI Gateway / trafficevent changes require an ai-gateway smoke run before "done".