Build with Cursor
Cursor's inline Composer is well-suited to Konstera agent authoring: open the scaffold, give it the project context, describe what you want. Same preamble works for Claude Code / Windsurf / ChatGPT — this page is just the Cursor-specific setup and keybindings.
For the preamble content itself and the SDK's rules, see Build with Claude Code — that page is the single-source-of-truth for what the coding agent needs to know. This page is just about Cursor the editor.
One-time setup#
- Install Cursor
cursor.com/download. You'll pick a model on first launch — Claude Sonnet 4.6 or GPT-5 are both good choices for Konstera agent authoring.
- Clone the agents repo as your scaffold baseTerminal
git clone https://github.com/Konstera/agents cd agents/hello-world-python # or: cs agents/customer-service-agent (richer reference) cursor . - Add the Konstera preamble to the project
Cursor reads two files for project context:
.cursorrules— project-level system prompt (sent on every message).cursor/rules/*.md— reusable rule files you can toggle
Create
.cursorrulesat the agent repo root with the preamble content from Build with Claude Code § Preamble. Cursor picks it up automatically. - Load the docs as context (optional but helpful)
In Cursor:
Ctrl/Cmd + Shift + P→Add @docs source- URL:
https://konstera.ai/docs/llms-full.txt(compiled single-file reference)
Now you can
@docsin a prompt and Cursor retrieves relevant Konstera reference material inline.
Three workflows#
| Workflow | Cursor mode | What you get |
|---|---|---|
| Scaffold from a one-sentence requirement | Ctrl/Cmd + K or Ctrl/Cmd + L | main.py, manifest.json, Dockerfile edited in-place |
| Edit-test-fix loop | Agent mode, Ctrl/Cmd + I | Edits + test runs until green |
| Convert manifest from one connector to another | Chat | Confirmation that the manifest doesn't change |
Scaffold from a one-sentence requirement#
- Open the projectOpen the project with
.cursorrulesset. - Open a prompt
Ctrl/Cmd + K(inline edit) orCtrl/Cmd + L(chat panel). - Paste the requirement
Build a Konstera agent that polls a Zendesk inbox every hour, classifies new tickets by product area, and routes them to the right team's Slack channel.
- Review the diffCursor edits
main.py,manifest.json, andDockerfilein-place. Review the diff before accepting. - Local testTerminal
pip install -e . python -m main # In another shell: curl -X POST http://localhost:8080/invoke \ -H content-type:application/json \ -d '{"invocationId":"t1","input":"","config":{}}'
Edit-test-fix loop#
Cursor's agent mode (Ctrl/Cmd + I) handles multi-file edits + runs commands
in a sandboxed terminal. Pattern:
- Paste the failurePaste the failing invocation's exception + stack trace.
- Ask for a fixAsk: "Diagnose and fix. Run the tests after."
- Let Cursor iterateCursor edits, runs
python -m pytest, iterates until green.
Works well for:
- Missing
awaitin front ofctx.*calls - Forgotten
await ctx.capability.available(name)guards - Manifest
needs[]out of sync with code (CapabilityUnbound at runtime)
Convert manifest from one connector to another#
Fast refactor pattern — the capability-indirection layer makes this near-trivial:
Switch this agent from Shopify (orders.lookup_by_email) to BigCommerce (same capability name, different connector binding). What manifest changes are needed on the operator side?
Review before you accept a diff#
- Every
ctx.*call isawait-ed - Optional capabilities are guarded by
await ctx.capability.available(name) - The manifest's
needs[]matches what the code calls - No vendor SDK imports — vendor calls go through
ctx.capability.call(...)(catalogue; Pattern gotchas)
Keyboard shortcuts worth memorising#
| Shortcut | Action |
|---|---|
Ctrl/Cmd + K | Inline edit (replace/edit selected region) |
Ctrl/Cmd + L | Chat panel (open side-by-side chat) |
Ctrl/Cmd + I | Agent mode (multi-file + terminal) |
Ctrl/Cmd + Shift + L | Add selected code to chat context |
@file / @docs / @git | Add context sources inline |
Known Cursor quirks that bite coding-agent accuracy#
| Quirk | What happens | What to do |
|---|---|---|
| Agent mode tool loop | Cursor's agent-mode occasionally retries a failed shell command repeatedly. Watch for infinite pip install konstera-sdk loops when the dev machine has no network. | Stop with Esc and switch to the chat panel for the manual pattern. |
.cursorrules size limit | ~15k characters. | The Konstera preamble is ~5k; fits comfortably. |
| Model drift on long contexts | Cursor's context window handles refactors >1000 lines, but accuracy drops on the SDK's naming conventions (e.g. ctx.capability vs ctx.connector). | For refactors >1000 lines, break into smaller tasks. |