Building Optimizely OCP Apps Faster with AI and Coding Assistants
Developing Optimizely Connect Platform (OCP) apps can be a rewarding but complex process—especially when integrating with external APIs. Over the past few months, the Optimizely team has been experimenting with AI-powered coding assistants to speed up our own OCP app development. The results? A noticeable drop in time-to-market, less boilerplate coding, and a smoother design-to-deployment process.
Why AI and Coding Assistants?
OCP apps often require a lot of initial setup: defining services, building jobs and functions, handling authentication, and mapping data between systems. Coding assistants like Claude Code and GitHub Copilot (especially in agent mode) can handle much of this repetitive work.
By offloading code scaffolding, syntax details, and even API interaction samples to an AI agent, developers can focus on architecture, business logic, and integration nuances.
In our experience, using AI tools has cut our time-to-market for new OCP apps significantly.
The Tools We Used
We’ve tried multiple large language models (LLMs) and coding assistants, but found that:
- GitHub Copilot (in agent mode) and Claude Code yield similar results, although Claude Code provided better results for some engineers. We think that the choice depends mostly on personal preferences and work style as Claude Code is a console tool, while GitHub Copilot integrates with your IDE (e.g. VS Code).
- Claude family of models (Claude Code 3.7 and Claude Code 4) currently gives the best results for our use cases.
It is important to note that the AI development landscape is evolving rapidly. The “best” tool and model can change quickly and may also vary depending on the complexity of the OCP app and the external APIs you’re integrating with. What works best for us today may not be the top choice tomorrow—or for your specific use case.
The Reality: LLMs Don’t Know OCP by Default
Even the best LLMs don’t inherently know how to build an OCP app. You have to teach them:
- Use the online Optimizely OCP documentation as the basis for building custom instructions. Each coding assistant tool has a way to provide custom instructions for your project. Instruct coding agent to draft custom instructions based on on-line documentation (see examples below).
- Keep refining instructions when the assistant makes assumptions or uses outdated syntax.
- Include into custom instructions any significant design choices you make – organization of code, responsibilities, boundaries, etc.
We’ve found that building a custom “how to build an OCP app” primer for the agent early in the project saves hours of course correction later. For example:
You are an OCP app developer. Analyse on-line documendation available here https://docs.developers.optimizely.com/optimizely-connect-platform/docs/developer-platform-overview-ocp2 to learn how to build an OCP app. Follow links in ‘Core Concepts’ section to learn key building blocks of an OCP app. Create custom instructions file to help coding agent perform well in further tasks.
API Integrations: The Moving Target Problem
If your OCP app integrates with an external API, the coding agent may:
- Have no prior knowledge of the API at all.
- Know only an outdated version of the API.
The solution: explicitly instruct the agent to use the official online documentation for that API. If the docs are well-structured, the assistant can quickly learn the correct endpoints, authentication flows, and data models.
Example prompt:
Register a webhook in Shopify after successfull authorization. The webhook should notify the app about all changes in product catalog.
No speculative API calls. Verify all calls to Shopify in API reference: https://shopify.dev/docs/api/admin-rest
Formatting and Coding Standards
One limitation of AI coding assistants is that they don’t always follow your coding standards—especially when it comes to formatting, linting, or naming conventions.
Two approaches work well:
- Loosen the rules in your linting/formatting config during AI-assisted prototyping, then tighten them later.
- Instruct the assistant to fix formatting by running automated tools after each code generation. For example: yarn lint --fix
We typically use approach #2 so we can maintain consistent style without spending time manually reformatting AI-generated code.
Key Learnings and Best Practices
After building multiple OCP apps with AI assistance, here’s what’s worked best:
1. Start from Design, Not Code
Before writing a single line of code, use your coding assistant to:
- Design interactions between the external service and Optimizely services.
- List OCP components you’ll need (jobs, functions, configs, etc.).
- Define responsibilities and data flows for each component.
This upfront investment helps the AI produce code that fits into your architecture instead of scattering unrelated snippets.
Example:
Suggest the design of an OCP app that imports Shopify product catalog to Optimizely.
Features:
- one-off full catalog import
- real-time updates
- OAuth authorization
List and describe key components and data flows. Document design choices and trade-offs.
2. Break the Work into Small Pieces
Large, vague requests lead to large, vague code.
Instead:
- Ask the coding agent to implement one feature at a time.
- Review and test each piece before moving on.
- Keep context updated in the agent so it understands the growing codebase.
Example:
Add a job that fetches all products from authenticated Shopify account. Schedule the job to run nightly at 1am.
And then:
Add a button to app settings form to execute nightly import job manually.
3. Keep Feedback Loops Short
When the AI gets something wrong—incorrect endpoint, missing error handling—correct it immediately. Small, quick feedback loops lead to much better outcomes.
Summary and next steps
In short, AI coding assistants can’t replace an OCP developer’s expertise, but they can supercharge the process. By pairing well-structured instructions with iterative development, you can go from idea to deployed app much faster—without sacrificing quality.
In near future, OCP team is planning to develop OCP development MCP server to further simplify the process of building OCP apps. Having enough context about building OCP apps, the MCP server will assist developers in configuring and building OCP code. Examples will include:
- Scaffolding functions and jobs
- Building app settings form
- Calling OCP CLI based on developer prompts, etc.
Comments