XLSForm REPL - vibing with Claude Code

Last night I played with Claude Code to design ODK XLSForm.

How it works?

  • Claude code makes changes to the xls file based on the prompt given on the terminal. It also refer to CLAUDE.md for the context and general instructions.
  • I have asked it use xlwings to edit excel file, which is capable of modifying opened files so that I could see what is being changed.
  • Nodemon is watching changes to excel file and onchange it uploads the file to the Central using its REST API and reloads the browser. Server details are configured in .pyodk_config.toml at the home directory, so that pyodk could be used as well if required.

How good is it?

It's good but not perfect. It was able to create conditional questions, populate select_one question with real data, add repeat groups, cascading dropdowns, etc.

Sometimes it makes silly mistakes, for example:

  • It wasn't able to use the list_name in the select_one question type in the first attempt.
  • At one point, it removed the format of the xlsform template
  • It added a duplicate column 'audio' in the template during the session
  • Added duplicate name for the questions
  • Lastly it doesn't understand sarcasm of frustrated user :stuck_out_tongue:

Maybe with better instructions and context in CLAUDE.md above problems can be fixed. Overall I find this setup quite beneficial.

Lessons learned

  • Make commit after every change so that history is preserved. Claude model is not capable of undoing its changes perfectly
  • Running '/clear' frequently can help with model performance
  • Provide explicit instructions, model often behaves like this

Future / wish-list

  • Integrate with android emulator or adb to see Form preview in Collect as well
  • An opensource and small LLM model that could be run on local machine
  • I think whatever is develop to replace ODK Build would have some LLM capabilities :crossed_fingers:

Repository: https://github.com/sadiqkhoja/xlsform-repl

8 Likes