AI-assisted development

Use AI as a coding partner, not as an excuse to skip specifications and tests.

The best AI results come from exact runtime requirements, schemas, failure rules and tests. Ask for a small verifiable component rather than “a profitable bot.”

Humorous illustration of a trading bot being debugged around code and API errors
Illustration: AI can help diagnose code, rate-limit and connection errors, but the system still needs tests and explicit rules.

A useful workflow

Write the specification → ask AI to list assumptions → generate the smallest version → compile/run it → test invalid cases → review secrets and failure behavior → deploy in demo/paper mode → monitor real behavior.

Practical example

A better debugging prompt

Instead of “fix my bot,” provide the exact runtime, full error message, the smallest relevant code block, what you expected, what actually happened and what must not be changed. That gives the model something testable.

Planning

Turn a vague idea into inputs, outputs, state, security and failure rules before code exists.

Code generation

Generate bounded components with exact language and platform versions.

Review

Ask a second pass to look for hard-coded secrets, duplicate actions, missing timeouts and undocumented APIs.

Debugging

Give exact errors, logs and expected behavior. Do not ask the model to guess what happened.

What AI should not decide by itself

Production credentials, live-mode enablement, financial risk limits, destructive actions and retry behavior after uncertain external requests should be explicit human-defined rules in the system. AI output can be wrong even when it sounds confident.

Credential rule: never paste live secrets into prompts when a sanitized example can reproduce the problem.

Prompt pattern

Runtime: Cloudflare Worker
Language: JavaScript module syntax
Endpoint: POST /api/webhook
Input: exact JSON schema
Authentication: shared secret stored as Worker Secret
State: D1 table processed_events
Duplicate rule: reject repeated event_id
Failure rule: fail closed; no blind retry
Logging: event_id + decision + status, no credentials
Tests: valid, malformed, duplicate, stale, unauthorized

Before coding, list assumptions. Do not invent APIs.

Useful guides

Common questions

Can AI build the entire bot automatically?

AI can produce substantial code, but someone still has to define requirements, verify platform APIs, test failure cases and decide production safety rules.

What makes a prompt better?

Exact runtime, language version, input schema, output behavior, state, secrets, failure behavior and tests. Asking the model to list assumptions before coding also helps.

Should I paste real API keys into a coding prompt?

No. Replace credentials with placeholders and reproduce the issue using sanitized data whenever possible.