Skip to content
Agentic AI Builder's Guide

Search every lesson, prompt, glossary term and troubleshooting topic. Use ↑ ↓ to move and Enter to open.

Best Practices

Principles for safe, efficient and maintainable AI-assisted development that hold up in production.

Full printable guide

These principles summarize what consistently separates successful AI-assisted projects from frustrating ones. Use this page as a quick reference.

Planning

  • Plan before prompting. A clear plan with acceptance criteria is the single biggest factor in output quality.
  • Write down what is out of scope. It prevents feature creep from both you and the AI.
  • Choose boring technology. Mainstream, stable tools are where AI agents are most reliable.
  • Start without a database if the application does not need one.
  • Ask what can be removed. Simplicity is cheaper to build, test, host and maintain.

Prompting

  • Consolidate. A few well-scoped sprint prompts beat many small ones.
  • Include LOW GAS instructions in every Claude Code prompt, and remember they are guidance, not a technical limit.
  • Be specific. State files, behaviors, constraints and acceptance criteria.
  • Provide evidence. Exact errors, logs, steps to reproduce and screenshots lead to root-cause fixes.
  • Request a completion report at the end of every prompt.
  • Keep CLAUDE.md current so every session starts with correct context.

Validation

  • Test every sprint yourself before moving on.
  • Verify claims. "All tests pass" is a claim until you confirm it.
  • Test unhappy paths: invalid input, unauthorized access, empty states, slow networks.
  • Test on a real phone.
  • Run the production build locally before pushing changes that might break deployment.

Security

  • Never commit secrets. Use .env locally (git-ignored) and Railway variables in production.
  • Never paste secrets into AI tools. Redact before sharing logs.
  • Use maintained libraries for authentication, payments and cryptography.
  • Validate input on the server and enforce authorization on every request.
  • Keep agent permissions appropriate. Approve commands you understand; avoid blanket bypasses.
  • Update dependencies and enable Dependabot alerts.
  • Limit access to GitHub, Railway and DNS accounts; enable two-factor authentication everywhere.

Source control

  • Commit validated work frequently with descriptive messages.
  • Never force-push to main.
  • Use feature branches once real users depend on the application.
  • Tag releases and keep a changelog.

Deployment and operations

  • Listen on PORT and add a health check.
  • Keep migrations backward-compatible and back up before risky changes.
  • Read logs first. The first error in a build log is usually the real one.
  • Know your rollback plan before you need it.
  • Preserve unrelated DNS records.
  • Smoke test after every release.

Costs

  • Separate subscription costs from runtime API costs. They are billed differently and scale differently.
  • Set usage limits and alerts with every usage-based provider.
  • Use conventional code for deterministic tasks like calculations and validation.
  • Cache and deduplicate expensive API calls.
  • Use the smallest model that meets quality needs for runtime AI features.

Human accountability

AI agents are powerful assistants, not owners. The human product owner decides what to build, verifies that it works, protects users' data and approves every release. Keep that responsibility explicit and the method works.