Starting Small: One Agent on a Power Pages Project
One coding agent, one instructions file, one downloaded portal, and the first month of finding out what it would do without being asked
Post 32 ended with a promise to write about how I use AI when I build Power Pages sites. It starts where I started: one agent, one instructions file and a portal I had just created.
The project throughout is my own: a casting portal for the Nordic film, theatre and advertising market, connecting casters with actors and models. The mistakes are real too, some made here and some repeated from earlier projects. The Power Pages version runs on ppai, a pro-code framework I wrote: generated JSON API templates, definition-driven tables and forms, server logic for the writes, Dataverse underneath, Power Automate for the slow bits, GitHub for everything else.
What I had on day one
A downloaded site from the Power Platform CLI with my ppai starter tree laid over it: the ppai web templates, a handful of generated API templates, a server-logic folder, a theme token file and a Playwright suite that passed because it tested almost nothing.
And an instructions file. I had written a document on how a portal built on ppai fits together: the API router and the global variables, how a generated JSON template and its definitions relate, where the snippets live, the naming conventions, which tables a web role may touch.
So I pointed a general-purpose coding agent at the repository and the instructions file. Claude Code in the terminal, one CLAUDE.md that pointed at the longer document, and a prompt that said roughly “read this, then tell me what the template called PPAI/API/JSON/Casting does”.
What it was good at immediately
Explaining Liquid. Give it a web template full of nested includes, ask what happens when a contact with both the Caster and the Talent role opens it, and you get a readable answer in under a minute. Occasionally wrong about runtime behaviour, never wrong about structure.
Drafting FetchXML. Writing the query is easy; remembering the link-entity syntax and the alias rules for the third time this week is not. It produced working queries from a sentence, provided the names were right.
Reading the instructions file so I did not have to. Ask “what’s the rule for naming API parameters” and it quotes the section back. That alone saved me hours a week.
What went wrong in the first weeks
It guessed table and column names. Confidently. A casting has a cast_deadline column, so obviously the application has cast_applicationdate. It has cast_submittedon. The query failed on the unknown attribute, and the agent still reported the step as done. Verify the schema before writing FetchXML is advice I had given people for years. The agent needed it in writing, every time.
It put HTML comments in web templates. Fine, until the template is one that renders JSON for the component layer and <!-- TODO --> ends up inside a payload. Nothing in a coding agent’s training says a Power Pages web template is not quite HTML.
It wrote Liquid inside comment blocks. This took down every API on the development site for an afternoon. The agent wrote something like {% comment %} use {% capture %} here later {% endcomment %}. On my site the runtime still parsed the tags inside the comment block, found an unclosed capture, and the shared include failed to render, along with every template that included it. The documentation does not say this; it only says the content is not rendered. I now say the rest in capital letters.
It fixed things nobody asked it to fix. Asked to add a column to a list, it also tidied the surrounding template, renamed two variables and removed a snippet reference it thought was unused. Another template used it. The review took longer than writing it by hand.
What I learned from the first month
Every one of those mistakes became a sentence in the instructions file. Not a paragraph, a sentence: never guess a schema name, verify it against the Dataverse metadata first. No HTML or JavaScript comments in web templates. No Liquid tags inside comment blocks. Change only what the task asks for and report anything else you notice.
That is the method, and it has not changed since. The agent is not learning from its mistakes. I am, and I write the lessons down where the next session will read them.
The other lesson: one agent in one context window works until the project is not small. Explaining a template is a small job. “Add an application form to the casting detail page, with a server-logic endpoint, a Dataverse table, a flow that notifies the caster and a test” is not. One agent did all of it in one go, with the same blind spots in every layer, and told me it was done.
It was not done. It had checked its own work, and it agreed with itself. That is the problem the next post is about.
Useful links
- Liquid overview for Power Pages
- Web templates
- FetchXML overview
- Power Platform CLI: pac pages
- Claude Code: managing memory and CLAUDE.md
Next: why one agent became a team, and how the roles were split.