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/flagship_authorgit clone --depth 1 https://github.com/knowledgestack/ks-cookbookWhat 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.01118 |
| Opus 5 | $0.00005 | $0.00559 |
| Sonnet 5 | $0.00002 | $0.00224 |
| Haiku 4.5 | $0.00001 | $0.00112 |
Grade A, and why
flagship_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 3d 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 — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Flagship author rule
Applies when you're adding or editing anything under flagships/<name>/.
File layout (enforced)
flagships/<name>/
├── pyproject.toml # [project.scripts] entrypoint ks-cookbook-<slug>
├── README.md # title, tags, seed-data block, walkthrough
├── src/<module>/
│ ├── __main__.py # argparse → agent.draft_*()
│ ├── agent.py # pydantic-ai Agent + system prompt + MCP wiring
│ └── schema.py # pydantic output model with Citation field(s)
└── sample_inputs/ # at least one concrete example input
Don't create additional top-level files inside the flagship unless there's a specific reason.
README template (required sections, in this order)
# <Vertical>: <Flagship Name>
**Tags:** `vertical` `subdomain` `framework`
<one-paragraph what-and-why>
## Seed data required
This demo reads from a folder in your Knowledge Stack tenant. You need to create
that folder and upload the expected documents **before** running.
**Expected corpus:** <one-line description>
Set-up steps:
1. Sign up at [app.knowledgestack.ai](https://app.knowledgestack.ai).
2. Create a folder in the dashboard and copy its folder ID.
3. Upload the documents described above.
4. Issue an API key from the dashboard and put it in `.env` as `KS_API_KEY`.
5. Run: `<CORPUS_FOLDER_ID=<id> make demo-<slug>>`
Full corpus matrix: [`https://github.com/knowledgestack/ks-cookbook/wiki/seed-data`](https://github.com/knowledgestack/ks-cookbook/wiki/seed-data).
## Run
<make command + override examples>
## Framework
<pydantic-ai | LangGraph | raw-OpenAI | raw-Anthropic | CrewAI | …>
## Bring your own data
<short note on pointing the demo at a different folder>
Agent wiring (copy this shape)
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStdio
from .schema import Memo
SYSTEM_TEMPLATE = """...""" # include the four prompt invariants
async def draft(*, corpus_folder_id: str, model: str, ...) -> Memo:
mcp = MCPServerStdio(
command=os.environ.get("KS_MCP_COMMAND", "uvx"),
args=(os.environ.get("KS_MCP_ARGS", "knowledgestack-mcp") or "").split(),
env={"KS_API_KEY": os.environ["KS_API_KEY"],
"KS_BASE_URL": os.environ.get("KS_BASE_URL", "")},
)
agent = Agent(
model=f"openai:{model}",
mcp_servers=[mcp],
system_prompt=SYSTEM_TEMPLATE.replace("__CORPUS_FOLDER_ID__", corpus_folder_id),
output_type=Memo,
)
async with agent.run_mcp_servers():
result = await agent.run(user_prompt)
return result.output
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.
- 3d ago First seen · 119 lines · 10 tokens per session scan A 1afcd6bb8be3
flagship_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 1,118 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
provider-adapter-canonical-openai
Canonical = OpenAI shape; each non-OpenAI adapter owns its bidirectional translation (8 binding rules from provider-adapter-architecture.md §3a).
code-doc-lockstep
Binding — code changes must update matching docs (architecture / feature / API / runbook / SDD) in the same diff.
completion-time-self-audit
Self-audit before claiming work is complete (no defer / follow-up / mock).
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.