recipe_author

recipe_author is a cursor rule for Cursor from knowledgestack/ks-cookbook. It costs 10 tokens per session (597 once invoked), scanned A, original, MIT.

A set of rules for creating recipes in ks-cookbook, a collection of small knowledge-work programs. It defines the required file size, tool connection, citations, defaults, and secret handling.

In plain words
What is it for?
Use it when adding or editing a recipe, especially to check its structure, required MCP connection, visible citations, default run, and environment-based secrets.
Why use it?
It prevents recipes from failing automated checks or producing unsupported answers. It also ensures each recipe uses the approved knowledge service and shows where its information came from.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/knowledgestack/ks-cookbook/recipe_author
Clone the repo
git clone --depth 1 https://github.com/knowledgestack/ks-cookbook

Made for: Cursor.

Wrote 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.

agentmods badge for recipe_author

README.md
[![agentmods](https://agentmods.dev/badge/rules/knowledgestack/ks-cookbook/recipe_author.svg)](https://agentmods.dev/rules/knowledgestack/ks-cookbook/recipe_author)
Your own site
<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>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 597 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash 6238aa198ad9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

.cursor/rules/recipe_author.mdc · 62 lines

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)

  1. ≤100 LOC in recipe.py (docstrings + comments don't count). Bigger → flagship.
  2. Mandatory grounding. Every recipe calls at least one MCP tool via recipes/_shared/mcp_client.ks_mcp_session().
  3. KS-only MCP contract. Connect only to knowledgestack-mcp. Don't add a second MCP server.
  4. Visible citations. Inline [chunk:<uuid>] tags from read output, or an explicit citations field in structured output.
  5. 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.
  6. No secrets in source. Keys come from .env only.

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.

Read the full file on GitHub · 62 lines

Changes

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.

  1. 5d ago First seen · 62 lines · 10 tokens per session scan A 6238aa198ad9

Subscribe to this mod's changes

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.