Jump to content

Epic AI Pair Programming Adventure: Building a Module with the Most Confused “Dev” Ever


Recommended Posts


Hey ProcessWire Community,

We recently built a user data table module for a client. It was solid – tailored for specific fields, neatly formatted, and with just the right amount of complexity.

Then we thought, “Why not turn this into a fully configurable module for ProcessWire’s admin?”
And to make it even more interesting, we decided to pair up with AI to build it.

Spoiler: AI is not great at ProcessWire.

Why AI?

We figured AI could help with some of the more repetitive coding tasks – like parameter parsing, formatting logic, and output generation. But AI had its own plans. It decided to take every simple task and turn it into a five-step process involving nested arrays, regexes, and a lot of unnecessary conversions.

What We Learned:
    •    AI is good at suggesting solutions – even when they’re completely wrong.
    •    AI will confidently map dates to currency values and sum() text fields.
    •    AI thinks that everything is a map() – and if it’s not, it should be.
    •    ProcessWire is flexible, but it doesn’t bend to AI’s will – and that’s a good thing.

But have a look for your own: User Data Table 
or
https://processwire.com/modules/process-user-data-table/ 

It is more or less production ready and we test it in some client projects as it really comes handy when showing user related data as a table in the backend. We even forced AI to do the Change log and the Readme files, so it should be not too hard to test. 😁 

Example 1: (detailed example including configuration can be seen in the README file)
UserAdminTable with users that have the 'member' status (showing their created value on :hover), their visits of certain pages (with modal opening for details), their purchases (with modal opening for details) and the Total of their purchases. All column titles are clickable for sorting asc/desc, direction is indicated after sorting.

1_usertable.thumb.png.60594ab75b9d4b409a2dbb3014d3f721.png

 

Example 2: (detailed example including configuration can be seen in the README file)
UserAdminTable with standard user fields and one virtual field showing `created` value as column with minimal configuration.  

6_minimal_configuration.thumb.png.5ff05b12d8cea2fded0d9de4a31f76d1.png

  • Like 10
Link to comment
Share on other sites

AI, Cursor, Windsurf, Claude Code... you name it.

In terms of ProcessWire they all need a strong hand that guides them through different tasks, ways, and whatever its in the way.

You need to oultine your part in ProcessWire in great detail.
You need to define hooks, the solutions to use - from ZIP to TempDir.
You have to outline the forms it needs to render and the fields to use from start to finish.
You could give an existing module as baseline, but beware it knows what to do then.
But extending existing modules works pretty good - see my fork here of GUID/UUID Generator

Whatever tool you use, it knows the baseline I knew 2 weeks into ProcessWire back in 2014 after doing the tutorials and reading the forums.
Hint: Let Composer/Cascade finish the tutorials - it's wild! And let them create rules, workflows and memories from it.
You will reach a junior-junior grade PW-dev this way.

BUT (big time)... it's great and even superior in terms of PHP.
Do the outline, from start to finish, do what you know in terms of ProcessWire.
Let the AI/IDE/Agents do the PHP part, including docs, and you will be happy.

Sure... not that much fun as people have that use NextJS (13, and maybe 14, but not 15) or AstroJS (2,3, and parts of 4, but not 5)... but hey... that's still only JavaScript (maybe Typescript) those AI/IDE/Agents are good at - the concepts still need either docs or a solid foundation. In the JS-world everything is a pattern, everything is JS or TS, the concepts are the same. But framework-specific... is another story.

Laravel works great. Ok, maybe not the latest version, and maybe not all the extensions, like Forge and Filament.
But yeah, it works. Even migrations. Depending on the database. And don't try Supabase or Neon. That's super wild.
But... older versions with just *.blade.php - works!
Flux, InertiaJS, VUE, React? meh

I am still not a coder/developer/programmer BUT... I know how to write a technical concepts and know how to outline modules, hooks, whatever in ProcessWire.

The moment I realised that those tools are great at PHP, and s*ck at ProcessWire - I understood what to do.

A new project I work on, a NextJS/AstroJS/ProcessWire-combo, has already 50+ documents to outline which tool does what and how to do it.
And I didn't even really start to outline anything in terms of modules or hooks.

 

The ProcessWire part, or at least a big part, is already outlined here: https://github.com/webmanufaktur/pwai/tree/windsurf
Which is the latest commit with most of the stuff needed - for my projects.

 

But yes... those AI/IDE/Agents only see patterns and try to match up - in frameworks.

To give a bit more helpful details here: AutoTemplateStubs is a great addition to help your tools to understand what's happening.
In case you hate to do everything yourself: RockMigrations has some nice .vscode snippets that help and most AI/IDE/Agents understand it and can create templates and fields right from migrate.php.

Noice!

  • Like 3
Link to comment
Share on other sites

4 hours ago, Mikel said:

AI isn´t even capable of getting the basic things right...

Because "Artificial Intelligence" is a marketing word, and computers will never become intelligent as the definition of intelligence according to the Oxford Dictionary on may Mac is:

"the ability to acquire and apply knowledge and skills"

You see, LLMs cannot acquire knowledge (nor skills), they are "trained" (which is also a marketing phrase, BWT...), and a database full of data is not knowledge, the dictionary says that knowledge is:

"facts, information, and skills acquired through experience or education; the theoretical or practical understanding of a subject"

"Understanding" is the key word here. LLMs and fine-tuned models calculate probability which is very far from being a "fact". Another key word is "experience". A computer with experience?

BTW, Interesting article to read: https://www.nngroup.com/articles/ai-model-training/

Anyways, thank you for sharing you module! Could you please also add an image or two to the readme, so that people can have a visual view of what to expect in that regard?

  • Like 5
Link to comment
Share on other sites

18 hours ago, szabesz said:

Anyways, thank you for sharing you module! Could you please also add an image or two to the readme, so that people can have a visual view of what to expect in that regard?

Thanks for your comment @szabesz and the kick in the ass 😁 We updated the README with some Screenshots and explanations. Also inserted a Screenshot in the initial Post above.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

For anyone who saw the forum post about our ProcessDataTables module: you can absolutely reproduce the same output and functionality (even more complex one if you need to) using that module. UserDataTables, however, gives you everything entirely within the backend—no need to touch or customize any PHP templates. If you need DataTables in your backend beyond just user-related data, choose ProcessDataTables—it’s designed for exactly that. We’re aiming to release a stable version by next week.

  • Like 1
Link to comment
Share on other sites

Recently, we did a lot of testing, including installations on different systems, and in that context, a small import/export functionality proved very useful:
New in version 2.4.3:

  • Import/Export Configuration Functions:
    • Introduced logic for importing/exporting user data table configurations using JSON files.
    • Added code to automatically create an import directory (UserDataTableImport/) if it does not exist.
    • The module scans for the latest JSON file in the import directory and, if found, decodes the configuration and applies it to the module settings, removing the file after a successful import.
    • This allows easy migration or backup/restore of configuration settings between environments.

The process is very simple and self-explanatory: you’ll find the relevant fields at the bottom of the config page. A JSON file is exported or imported, containing all the settings of the page.
We hope all of you find it just as useful as we do!

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...