## Inspiration

A data-analysis prompt is usually put together by hand: a role, rows pasted from a CSV, and a list of rules that grows with every attempt. The pasted rows cost tokens, and rules written at different times start to repeat or contradict each other ("Detect outliers first", later "Do not detect outliers"). Each model also wants its own layout, and nothing checks whether the reply kept the format you asked for.

We wanted to treat a prompt the way a compiler treats source code: parse it into an AST, lint it, and generate output for a target.

## What it does

Candy-Corn takes a role, a list of constraints and a profile of a CSV or JSON file, lints them, and writes a short structured prompt for the target model: XML for Claude, Markdown for GPT, delimited sections for Gemini.

  • Lints the prompt: filler words are compressed, duplicates are removed, and contradicting rules are resolved (the later one wins). Every removal names the removed text. Uncertain pairs are kept with a warning.
  • Sends a profile, not raw rows: column types, null ratios, statistics, z-score outliers and a few sample rows. It reads messy exports too (CP949, UTF-16, BOM, tab, semicolon or pipe delimiters, NDJSON). A token report shows the saving.
  • Runs the prompt on Anthropic, OpenAI or Gemini and checks that the reply kept the output format and the required fields.
  • Helps you read the reply: sortable and filterable tables, charts, column statistics, and a check of which columns and outliers of your data the reply actually mentions. A saved reply can be opened without any API key.
  • One executable: a desktop GUI (egui), a terminal linter, a stdio MCP server that Kiro can call (compress_prompt), and a graph tool for chaining prompts, LLMs and MCP tools. English and Korean UI.
  • Samples: ten ready blueprints with synthetic data that has planted problems, so everything can be tried in a minute.

## How we built it

Rust (2024 edition) with egui for the GUI and clap for the command line. The GUI, the CLI and the MCP server share one compile pipeline: profiler, AST, lint passes, code generation, token report. Profiling, compiling and LLM calls run on worker threads and report back with generation numbers, so a stale result is dropped. Korean text lives in locale files, and a missing translation is a compile error.

Tests: 345 unit tests, 13,000 seeded random QC cases, 33 scenarios, 16 graph end-to-end tests, sample-data tests, and a QA suite that runs the real binary 1,000 times.

## How we used Kiro

  • Steering (.kiro/steering): product, tech and structure docs give every agent the same context. compiler-rules.md is also read by the product itself: its bullets become constraints.
  • Specs: the first design brief became EARS requirements, a design and a task list, and later rounds were added to them.
  • Agent hooks: cargo fmt and clippy -D warnings run after every Rust save. At the end of each agent turn a Stop hook runs clippy and the full cargo test, and a failure goes back to the agent, which keeps fixing until both pass.
  • MCP: Candy-Corn is an MCP server, so a Kiro agent can compile a data-analysis prompt from the chat.
  • Parallel agents: reviewer and worker agents, each worker in its own git worktree with a list of files it owned and one written brief. At the end, three independent reviewers read the whole codebase for bugs.

## Challenges we ran into

  • Removing the right rule. The first contradiction rule removed compatible pairs such as "Use the median instead of the mean" and "Do not use the mean": 7 of 60 realistic pairs lost a rule. Now a pair is removed only when the contradiction is certain; otherwise both stay with a warning.
  • Data that reads like instructions. A CSV header or cell can close an XML tag or open a fake prompt section. All text from the data is sanitized, and the guards look past invisible characters.
  • Messy files. Korean Excel exports in CP949, files that are plain ASCII for the first 64 KiB, UTF-16, odd delimiters.
  • Stale results in an immediate-mode GUI. Profiling, compiling and LLM runs race with the user's edits, so every result carries a generation number.
  • Cut-off replies were first reported as format violations. The client now reads each vendor's stop reason.

## Accomplishments that we're proud of

  • One executable covers the GUI, the CLI, an MCP server and a graph tool.
  • Every removed rule is named, and the contradiction rule is conservative on purpose.
  • The final review round found 30 problems. We fixed 29, most with regression tests, including network paths that a graph or blueprint file could use to make Windows connect to another host.

## What we learned

  • A linter that deletes instructions must be conservative: a warning costs a second look, a silently dropped rule costs a wrong analysis. rule costs a wrong analysis.
  • Text from a data file is untrusted input to the model, like user input in a SQL query.
  • Agents finish reliably when "done" is a command that can fail.
  • Rules that matter belong in the build, not in an agent's memory.

## What's next

Streaming replies with a real cancel, tool discovery and process cleanup for the MCP client, allowed folders for the MCP data path, and a command palette.

## Try it

Download the installer from the Releases page (Windows 10/11, 64-bit). It is not code-signed, so SmartScreen may ask: choose More info, then Run anyway. In the app, open the Samples menu and pick a blueprint.

Built With

  • anthropic-api
  • clap
  • csv
  • eframe
  • egui
  • encoding-rs
  • gemini-api
  • inno-setup
  • kiro
  • model-context-protocol
  • openai-api
  • powershell
  • rfd
  • rust
  • serde
  • serde-json
  • tiktoken
  • ureq
  • windows
  • windows-credential-manager
Share this project:

Updates

Submission history