Teach any AI
to write Fieldbase surveys.
The Fieldbase AI SP Kit ships with ready-made
bundles for Claude, ChatGPT, and Gemini,
integration shims for Cursor, Copilot, Continue, and
Claude Code, a zero-dependency linter, and real
accuracy numbers on a 36-question tracker brief. Author
.yml, lint it, ship it.
Per-AI bundles
Each bundle is a self-contained folder with the reference, the examples, the linter, and a per-assistant HOW-TO. Grab the one folder you need, drop it in. The reference stays identical across bundles — only the install step changes.
bundles/claude/HOW-TO.md →
bundles/chatgpt/HOW-TO.md →
bundles/gemini/HOW-TO.md →
IDE / agent integrations
For an IDE or a coding agent, the shims in
integrations/ point the tool at the authoring
reference automatically:
- Cursor —
.cursorrulesfile; drop into project root. - Claude Code —
CLAUDE.mdin the repo; auto-loaded as project context. - Copilot / Continue / other code-agents —
AGENTS.md; recognised by any agent that reads an AGENTS convention file.
Tested accuracy
All three bundles tested on the same brief — a 36-question multi-market tracker — then imported to Fieldbase and checked against the platform's real validator. A clean validator result proves syntax, not logic — always import to a Fieldbase test project before fielding.
| Model & tier | Validator | Result | |
|---|---|---|---|
| Claude | Opus 5, high effort | 0 errors | Complete and thorough — cleanest output. |
| ChatGPT | GPT-5.6 Sol | 0 errors | Complete; a few cosmetic duplicate-helper warnings. |
| Gemini | 3.1 Pro | 0 errors | Complete, weakest of the three — left one empty quota - script: block, used a single generic error message instead of a pipeable error bank. Review those two spots. |
What's in the core kit
-
SURVEY-DSL-AUTHORING.md— the complete authoring reference. Every question type, every property, flow blocks, reusable lists, multilingual & multi-country patterns, the hard rules the DSL enforces. The same file every bundle uses. -
lint/survey-dsl-lint.js— a standalone, zero-dependency Node linter. Nonpm install, no engine, no network. A byte-identicalsurvey_dsl_lint.pyis bundled for Python workflows (ChatGPT Code Interpreter, Python CI). -
examples/— validator-clean sample surveys (synthetic) to show the shape and give the AI few-shot material. -
bundles/— the three per-AI bundles (chatgpt, claude, gemini) above. -
integrations/— the IDE / agent shims above.
How it works
- Clone the repo (
git clone https://github.com/inginit/fieldbase-ai-sp-kit) or download the ZIP. - Install the right bundle for your assistant, or point your IDE at the shim.
- Ask the AI to write a survey as
.yml. - Run the linter:
node lint/survey-dsl-lint.js my-survey.yml. Exit code 0 = no errors. - Fix what it flags, repeat until clean.
- Import the
.ymlinto Fieldbase (or hand it off to someone who will).
What the linter is — and isn't
It catches the frequent, mechanical mistakes
fast and offline: tabs / non-4-space indentation, non-numeric
or negative codes, true/false vs
True/False, inline {k: v}
options, underscored ids, Q.any( without
.selected, snake_case style:,
style: dropdown on gridSingle,
questions: on a - loop:, duplicate
qids / loop ids, multi-line options.from:,
continue/break in scripts, and more.
It is not a compiler. It does not resolve the grammar or a symbol table, so it does not catch deep semantic errors (an unknown qid referenced in a script, a required question with an empty option set, etc.). Those are caught by the platform's own validator when the survey is imported or published. Treat a clean lint as "no obvious violations," not "provably valid." The linter and the platform validator are complements.
Why we published it
We built this kit for ourselves — it's how our own AI-assisted
authoring works inside Fieldbase. Rather than gatekeep the DSL
knowledge behind the platform, we're publishing it under MIT
so anyone can author Fieldbase .yml with any tool
they prefer. The kit is the authoring front-end; the
Fieldbase platform is where surveys actually
run (publish, respondent runtime, quotas, translations, SPSS
exports — the parts you can't do with a Markdown file).
FAQ
Is it really free?
Really free. MIT license. You use whatever AI assistant you already pay for (or a local model). We don't bill, meter, or phone home.
Can I use the kit if I'm not on Fieldbase?
You can author DSL anywhere, but .yml files
aren't surveys on their own — they need a runtime. To actually
publish, collect responses, run quotas, translate, and export
data, you'll need the Fieldbase platform. We're in early
access — get in touch.
Does the kit stay in sync with the platform?
Yes — the reference tracks the current Fieldbase DSL contract
(engine v3.34.0 at the time of writing). The repo
CHANGELOG.md records updates. Watch the repo on
GitHub to get notified.
Found a bug in the DSL reference or the linter?
File an issue on GitHub or send a PR — we review them. MIT license, contributions welcome.