Inspiration

I've built a lot of workflow-heavy business software: grievance desks, approval chains, registers, inspection logs. Every new one starts the same way. New tables, new endpoints, new forms, new screens, new role checks. Yet underneath, they are all the same skeleton: a record moves through steps, people with roles act on it, and every move must be audited.

So for Skeleton Crew I asked: what if the skeleton was the product, and each app was just data?

Skeleton Key is that skeleton. An app is a single versioned JSON definition (entities, fields, forms, views, roles and a workflow graph), and one engine plus one renderer bring it to life. One skeleton, many apps.

What it does

  • Define an app in JSON. Entities with 15 field types, forms, table and Kanban views, roles, and a workflow of steps, actions and transitions, with conditions written in JSONLogic.
  • Publish it. The engine validates the definition against a JSON Schema plus a set of graph, field and expression rules, then stores it as an immutable version. Running records stay pinned to the version they started on.
  • Use it. The Angular + NG-ZORRO frontend renders forms, tables, Kanban boards, a "My Tasks" inbox, record detail with action buttons, and a readable history timeline. All of it is driven by the definition, with no app-specific UI code.
  • Change it in the browser. Admins edit an app in a JSON editor with a form builder beside it. Every version is validated before publishing.
  • Trust it. History is append-only, enforced by a database trigger. Every step records from-status, to-status and time-in-step. Users are role-based, can be deactivated instantly, and citizens track requests by reference number and email without an account.

Two very different apps run on the same bones, each in its own folder under apps/:

  1. Grievance tracker: a public submission form, triage by the least-loaded clerk, department review, a site inspection only for road and water issues, resolution, and public status tracking.
  2. Asset register: staff request equipment, requests over 1,000 need a second approval (skipped below that), then procurement, setup, and a loop between use and maintenance until the asset is retired. Different roles, a different theme, its own host name, and no engine or frontend code changes: only the definition differs.

How I built it

The whole project was built with Kiro, using spec-driven development.

Steering first. Before writing code I wrote steering docs: product, tech stack, structure, and an app-definition guide that pulls in the JSON Schema with #[[file:]] instead of copying it. Every Kiro session started from the same ground truth.

Five specs. | Spec | What it covers | |---|---| | skeleton-backend | Spring Boot 3.5 engine: loader, validator, router, expression engine, records, history, auth | | frontend-backend-support | API additions the UI needed (current user, batched workflow summaries, version lists, validate-only publish) | | skeleton-frontend | Angular 22 + NG-ZORRO renderer, theming, dynamic forms, views, admin area | | user-admin-and-tracking | User administration, instant deactivation, case-insensitive logins, public request tracking with rate limiting | | ux-polish | Readable history and dates, inbox redirect after an action, a safer form-builder Save, plus the agent hooks |

Each spec went from requirements to design to tasks. I reviewed each stage before letting Kiro implement anything. For example, I made sure statuses are labels in the definition, never enums. The status precedence rule became:

$$ \text{status}{\text{new}} = \text{transition.status} \;\vee\; \text{action.status} \;\vee\; \text{step.status} \;\vee\; \text{status}{\text{current}} $$

Here $\vee$ means the first one that is defined wins.

Kiro IDE and Kiro Crew in parallel. While the IDE worked through the frontend spec, Kiro Crew implemented the entire frontend-backend-support spec (20 tasks) in its own folders at the same time. Its real-PostgreSQL test caught an ORDER BY bug that the in-memory tests had missed.

Agent hooks. Two hooks run on save: one validates any apps/**/*.app.json against the JSON Schema and reports each error with its path, and the other runs the spec file that matches a saved frontend .ts file. The surprise: Kiro's validation hook fired on its own edit of an app definition while it was building the ux-polish spec, so the agent got checked by the guardrail it had just written.

A second pair of eyes. I used Claude Code as a reviewer: it independently re-ran the test suites, checked Kiro's diffs against the specs, smoke-tested the full Docker stack, and scripted the demo video recording. The design, the specs and the implementation came from Kiro.

Stack: Java 21, Spring Boot 3.5, Spring JDBC (no JPA), Flyway, PostgreSQL 16 with JSONB, a sandboxed JSONLogic evaluator (operator allow-list, depth cap of 64), Angular 22, NG-ZORRO, Vitest, Docker Compose, nginx.

Property-based testing caught real bugs

The specs define correctness properties, which Kiro implemented with jqwik (backend) and fast-check (frontend). They paid off:

  • History continuity (for any path through any workflow, each history row starts where the previous one ended) found two router bugs that 20 example-based tests had missed. An action row ended at the wrong step after skipped steps, and automatic steps wrote no history at all. The fix added a new AUTO history kind.
  • A property test over all field types found that DATE and DATETIME fields would have crashed the running app, because a date adapter was never registered.

Today the project has 331 backend tests, including tests on real PostgreSQL through Testcontainers, and 384 frontend tests: over 700 in total.

Challenges

  • Keeping the AI honest about versions. The first scaffold pinned year-old library versions. Every dependency was checked against Maven Central and npm and pinned exactly.
  • Invisible bytes. Files written by a Windows shell got a UTF-8 BOM that broke the Java compiler. The fix became a steering rule, so it never happened again.
  • Bundle bloat. Adding the views pulled everything into the startup bundle (1.07 MB). Instead of raising the budget, the routes became lazy-loaded:

$$ 1.07\ \text{MB} \;\rightarrow\; 389\ \text{kB} \quad (\approx 108\ \text{kB over the wire}) $$

  • Limited hardware. Unbounded test workers ran the machine out of memory, so the test runner was capped at two workers. A filtered network blocked Docker from reaching Maven Central, so container builds had to happen elsewhere.
  • Long agent runs. One Kiro task timed out after an hour and left a file that wouldn't compile. Re-running it with explicit command timeouts fixed it. I learned to review every task's output, not just its "done" message.
  • Deploying next to another app. The demo runs on a VPS that already hosts another application. Behind the host's reverse proxy, every visitor looked like the same IP address, which would have put all users into one shared rate limit. The fix was to trust X-Forwarded-For only from private addresses, and to bind the containers to localhost only.

What I learned

  • Specs are the real skeleton. Requirements → design → tasks made Kiro's output reviewable. When something was wrong, I fixed the spec, not just the code.
  • Steering docs compound. Every rule I added once (no BOMs, the error format, the schema reference) was followed in every later session.
  • Hooks turn rules into habits. A check that runs on every save beats a rule in a document.
  • Property tests find the bugs you didn't think to write examples for.
  • Data-driven doesn't have to mean unsafe. Expressions are sandboxed, definitions are validated before publish, history is append-only, and 5xx errors never leak internal details.

What's next

  • SLA timers with automatic escalation
  • File attachments on actions and forms
  • A visual workflow designer next to the form builder

Try it: https://grievance.187-53-134-109.sslip.io (grievance tracker) · https://asset.187-53-134-109.sslip.io (asset register) · code: https://github.com/AmitPokhrel05082002/skeleton-key

Built With

Share this project:

Updates

Submission history