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 commands/zenobia0000/cursor-agentic-coding-template/api-designgit clone --depth 1 https://github.com/Zenobia0000/cursor-agentic-coding-templateWhat 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.00020 | $0.01100 |
| Opus 5 | $0.00010 | $0.00550 |
| Sonnet 5 | $0.00004 | $0.00220 |
| Haiku 4.5 | $0.00002 | $0.00110 |
Grade A, and why
api-design 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 2d 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.
This is a copy
100% identical to api-design — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🌐 API DESIGN GUIDE (v3)
像娜美畫航海圖一樣,遵循此指南,精確地設計出世界級的 API。
1. PLAN 🎯 (規劃)
Objective
作為一個 AI Agent,遵循本指南中定義的最佳實踐,為給定的需求設計出一個符合 RESTful 原則、穩健、可擴展且易於使用的 API 規範。
Guiding Rules
在執行 API 設計時,AI Agent 必須遵循以下規則:
- 主要規則:
.cursor/rules/principles/global.mdc - 架構原則:
.cursor/rules/backend/overview.mdc - 設計模式: (可選)
.cursor/rules/patterns/
Prerequisites Check
在開始設計之前,請確保:
- ✅ 需求已定義: 一個清晰的需求文檔、使用者故事或
memory-bank/current/projectbrief.md已經存在。 - ✅ 資源已識別: 核心的業務資源、屬性和它們之間的關係已經被初步識別。
- ❌ Failure Action: 如果需求不清晰,AI 必須先提出問題以澄清需求,而不是猜測。
2. DO 実行 (執行)
Core Process
遵循一個系統化的 API 設計流程:
Step 0: 健康檢查 (Health Check)
- 檢查輸入: 驗證需求文檔是否清晰、無歧義。
- 批判性思考: API 設計的目標是解決實際問題。如果需求本身似乎會導致一個複雜或不合理的 API,AI 應提出質疑。
Step 1: 記憶體互動 - 讀取 (Memory Interaction - Read)
- 讀取需求: 從
memory-bank/current/projectbrief.md,memory-bank/current/tasks.md, 或其他需求來源文件中,完全理解業務目標和功能需求。
Step 2: 設計核心元素 (Design Core Elements)
- 端點設計 (Endpoint Design): 根據資源和 CRUD 操作定義直觀的 URL 結構。
- 數據格式 (Data Formatting): 設計一致的 JSON 請求/回應格式。
- 認證授權 (Auth & Authz): 選擇合適的認證機制和權限控制策略。
Step 3: 設計進階特性 (Design Advanced Features)
- 資料驗證 (Data Validation): 建立嚴格的輸入驗證 schema。
- 版本管理 (Versioning): 制定清晰的 API 版本策略。
- 速率限制 (Rate Limiting): 設計速率限制策略以防止濫用。
Step 4: 記憶體互動 - 寫入 (Memory Interaction - Write)
- 產出設計文檔: 將最終的 API 設計規範,以 OpenAPI (Swagger) 格式,輸出到一個新的
memory-bank/current/creative-api-design-[feature].md文件中。 - 更新上下文: 在
memory-bank/current/activeContext.md中註明 API 設計已完成。
3. CHECK ✓ (檢查)
Verification Checklist
在產出設計文檔後,AI 應自我檢查:
- 一致性: 所有端點的命名、數據格式和錯誤處理是否一致?
- 記憶體同步:
memory-bank/current/creative-api-design-[feature].md是否已成功創建?
4. ACT 改善 (行動)
Finalization
- 向用戶確認: 報告 API 設計已完成並已存檔。例如:「API 設計已完成,詳細的 OpenAPI 規範已儲存至
memory-bank/current/creative-api-design-[feature].md。請您審閱。」
Next Steps
API 設計是實施的藍圖。
- 👉 Primary Next Step: 執行
/implement指令,根據此 API 設計規範開始編寫後端程式碼。 - 💡 Alternative: 執行
/review-code指令,邀請另一位 AI Agent 或人類專家對此 API 設計文檔進行審查。
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.
- 2d ago First seen · 70 lines · 20 tokens per session scan A 3daaa9293c0d
api-design is a command published in the GitHub repository Zenobia0000/cursor-agentic-coding-template (5 stars, last pushed 4mo ago), licensed MIT. It adds 20 tokens to every session and 1,100 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to api-design, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.