Ask coding agents to build every implementation
Once the specification is complete, one command creates the shared tests and multiple independently structured implementations. Codex is the default agent.
polyform generate --count 5
What the command does
- Validates that every specified function has a purpose, interface, requirements, and behavioral examples.
- Starts a test-author agent to create shared conformance tests, a real application acceptance test, and the differential fuzz harness.
- Requests one implementation of every function before the first complete check, then continues round by round so the executable can become usable early.
- Requires the agents to connect the generated registry to the program users actually run; a tested library with an untouched starter executable is rejected.
- Prevents agents from silently changing the specification, runs formatting, linting, tests, and builds during admission, then runs differential fuzzing once at the end.
With three specified functions and --count 5, Polyform requests fifteen implementation candidates. Humans review the results; they do not hand-write fifteen functions.
How candidates are pushed apart
Every implementation request receives a different, deterministic diversity brief. Polyform mixes an algorithmic approach, control-flow shape, data representation, validation strategy, engineering priority, and dependency policy. For five candidates, the major five-way dimensions are balanced so every option is used once.
The agent is also told not to imitate existing variants. The exact brief is saved beside the result in .polyform/generation.jsonl, so reviewers can compare the requested design with the code that was produced. The behavioral specification and shared tests still take priority over every style direction.
Generate one function again
polyform generate --function decode_filename --count 2 --skip-test-generation
This asks for two additional decoder candidates and keeps the existing shared tests. It is useful after you improve one function’s specification or want more diversity.
Use another coding agent
polyform generate --count 5 --agent /path/to/agent
The default codex command runs non-interactively with permission to edit only the project workspace. Another agent program can be used if it reads the prompt from standard input, edits the current repository, and exits unsuccessfully when it cannot finish.
Review what the agents produced
Run the real program, read the code, confirm that the implementations use genuinely different approaches, and inspect .polyform/generation.jsonl. Polyform rejects failed checks, but passing tests are evidence—not a guarantee that the specification itself is complete.