Best practices for AI Commerce coding tools

Adobe recommends the following practices when using the AI coding tools for Commerce App Builder. For setup steps, see Coding tools setup. For skills and sample prompts, see Skills, prompts, and commands.

Checklist

Before starting a development session

During development

When starting a new chat

Workflow

When developing with the AI coding tools, start with sample code or scaffolded projects. This approach ensures you are building on a solid foundation rather than starting from nothing, while also optimizing your AI development workflow.

This also allows you to leverage Adobe's templates and build upon proven patterns and architectures, while keeping established directory structures and conventions.

Consult the following resources to get started:

Why you should use these resources

Protocol

The following four-phase protocol is automatically enforced by the installed skills. The tools should follow this protocol automatically when developing applications:

Request implementation plans for complex development

For complex development involving multiple runtime actions, touchpoints, or integrations, explicitly request that the AI tools create a detailed implementation plan. When you see a high-level plan in Phase 2 that involves multiple components, ask for a detailed implementation plan to break it down into manageable tasks:

Create a detailed implementation plan for this complex development.

Complex Adobe Commerce applications often involve:

Use MCP tools

data-variant=info
data-slots=text
Before relying on MCP tools, ensure you are logged in to the Adobe I/O CLI.

The tooling defaults to MCP tools, but in certain circumstances it can use CLI commands instead. To ensure MCP tool usage, explicitly request them in your prompt.

If you see CLI commands being used and want to use MCP tools instead, use the following prompt:

Use only MCP tools and not CLI commands

CLI commands can be used for the following scenarios:

Development

Question unnecessary complexity created by the AI tools.

When unnecessary files are added (validator.js, transformer.js, sender.js) for simple read-only endpoints, use the following prompts:

Why do we need these files for a simple read-only endpoint?
Perform a root cause analysis before adding complexity
Verify if simpler solutions exist

Testing

Use the following best practices when testing:

Test each feature after implementation

After completing development of a feature in your implementation plan, test it immediately. Early testing prevents compound issues and makes debugging easier.

Test locally first

Always test locally first using the aio-app-dev tool. This provides immediate feedback and allows for faster iteration cycles, easier debugging, and no deployment overhead.

  1. Start local development server:

    aio-app-dev
    
  2. Test actions locally:

    aio-dev-invoke action-name --parameters '{"test": "data"}'
    

Deploy and test again

Once local testing is successful, deploy and test in the runtime environment. Runtime environments can have different behavior than local development.

  1. Deploy to runtime:

    aio-app-deploy
    
  2. Test deployed actions

  3. Use web browser or direct HTTP requests

  4. Check activation logs for debugging

Leverage the coding tools for testing support

Ask for help with testing. The tools can help with debugging, log analysis, and creating appropriate test data for your specific runtime actions.

Test runtime actions:

Help me test the customer-created runtime action running locally

Debug failures:

Why did the subscription-updated runtime action activation fail?

Check logs:

Help me check the logs for the last stock-monitoring runtime action invocation

Create test payloads:

Generate test data for this Commerce event
Create a test payload for the customer_save_after event

Find runtime endpoints:

What's the URL for this deployed action?

Handle authentication:

How do I authenticate with this external API?

Troubleshoot:

Help me debug why this action is returning 500 errors

Debugging

Stop and assess when things go wrong. If you encounter issues:

Deployment

Use the following best practices when deploying:

Deploy incrementally

Deploy only modified actions to speed up development. This approach reduces the risk of breaking existing functionality and provides quicker feedback on changes.

Runtime cleanup

After major changes, leverage the tools to clean up orphaned actions. Let the AI tooling handle the cleanup process systematically. It can efficiently identify orphaned actions, verify their status, and safely remove them without manual intervention.

Help me identify and clean up orphaned runtime actions

Request the AI tooling to list deployed actions and identify unused ones:

List all deployed actions and identify which ones are no longer needed

Have the AI tools remove orphaned actions using appropriate commands:

Remove the orphaned actions that are no longer part of the current implementation

Monitoring

Use the following best practices when monitoring your application:

Watch for context quality indicators

Track development velocity

Monitor cost efficiency

Track token usage patterns:

What to avoid

Avoid the following anti-patterns when using the AI coding tools:

Providing feedback

Developers who are interested in providing feedback on the AI coding tools can use the /feedback command.

This command allows you to provide text feedback and send logs to Adobe. Any logs you send will be sanitized to remove any private or personal information.

data-variant=info
data-slots=text
The user experience will vary slightly depending on the IDE you are using. The following process describes the experience in Cursor.
  1. In your agent, type /feedback and select the commerce-extensibility/feedback command.

  2. Provide your feedback for the tooling in the Feedback field that appears at the top of the IDE and press the Enter key.

    Cursor feedback command input field

  3. In the Save Locally field, type either yes or no and press Enter to indicate if you want to save a local copy of your logs.

    Cursor feedback command save locally field

    If you selected Yes, you can review the logs in your chats folder after sending your feedback.

  4. The commerce-extensibility/feedback command appears in your agent's chat input field. Press Enter or click Send to send your feedback to Adobe.

data-variant=info
data-slots=text
If you do not see the /feedback command, you may need to update to the latest version.