# Mini-App Spec

> Generate executable HTML5 specifications that reconcile PRDs, Figma designs, and code into a single source of truth.

Mini-App Spec is a free AI agent skill on Agensi by 阿丁的梦呓, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [阿丁的梦呓](https://www.agensi.io/creators/creator-628)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-16
- Security: scan passed (2026-10-16); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mini-app-spec
- Tags: ai-agents, bdd, requirements-engineering, html5, software-architecture

## About this skill

Software requirements often drift from implementation, leading to broken acceptance criteria and "stale" documentation. This skill enforces a Single Source of Truth (SSOT) by generating a self-contained, executable HTML5 specification that acts as a machine contract, operable prototype, and BDD test suite. It bridges the gap between Figma designs and code, ensuring every feature is verified against a frozen behavioral fingerprint before acceptance.

### What it does
- **Executable Contract Generation** produces a `mini-app-spec.html` containing state machines, BDD scenarios, and embedded prototypes.
- **Automated Verification Gate** freezes commands and collects evidence per scenario to prevent hand-waived passing status.
- **Multi-Source Reconciliation** maps requirements from PRDs, Figma (via MCP), and code into unified vertical user flows.
- **Interactive Review Sessions** launches a local browser session where users annotate the UI directly to generate structured change tickets.
- **Mechanical Rule Enforcement** blocks acceptance unless specific preconditions, like zero proposed annotations and valid source batches, are met.

### How it works
1. **Resume or Initialize**: Use `status` to recover context or `new` to create a fresh artifact from the stateless engine template.
2. **Decompose and Map**: Register sources and decompose requirements into tiered flows, followed by a mandatory confirmation gate.
3. **Align and Prototype**: Fill in states and transitions, then `open` the artifact for visual alignment and fingerprint freezing.
4. **Reconcile and Accept**: Run `record-run` to collect evidence, then `accept` with verbatim user confirmation to stamp the final gate.

### Frameworks & tools
The system uses a Node.js CLI `spec.mjs` for all contract writes and a stateless HTML5/CSS/JS engine. It integrates with Git for replay anchors and recovery, supports Figma via MCP, and enforces CSP-compliant, zero-dependency templates.

### Why this beats prompting it yourself
Generic prompts fail to maintain state across long implementation cycles and allow "status cheating" where AI claims success without evidence. This skill uses a mechanically enforced validator and git-anchored replay anchors to ensure the spec and implementation never diverge.

### Use cases
- Documenting complex multi-state UI components that require high-fidelity prototyping.
- Auditing legacy codebases by reconciling existing behavior against new BDD requirements.
- Managing stakeholder sign-off with an operable, annotated "live" specification.
- Generating verifiable evidence for compliance-heavy features where manual testing is insufficient.

### Known limitations
Requires a Git repository environment to function. The engine forbids external CDNs or heavyweight frameworks; all visual interactions must be self-contained within the HTML artifact.

## Requires

- Node.js
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Mini-App Spec skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent documentation from becoming outdated during development?

This skill generates a self-contained HTML5 file that functions as a live prototype, a BDD test suite, and a machine-readable contract, ensuring your code always matches your design and requirements.

### What are the technical requirements to run the mini app spec skill?

The skill requires a Git repository environment and a Node.js runtime to execute the `spec.mjs` CLI, which manages the contract writes and state transitions.

### How does this compare to simply asking an AI to write a PRD or test cases?

Unlike standard prompting, this skill uses a 'Mechanical Rule Enforcement' system that blocks feature acceptance until specific preconditions and behavioral fingerprints are verified with evidence.

### Can I sync my Figma designs directly with the generated specification?

Yes, it integrates with Figma via MCP (Model Context Protocol) to map design elements directly into unified user flows within the executable specification.

### What is included in the purchase of this skill?

You receive the core `spec.mjs` CLI tool, the stateless HTML5 engine template, and the full workflow logic for initializing, mapping, and accepting specifications.

### Can the skill handle long-term projects with multiple development cycles?

Yes, the skill includes a 'resume' function that uses Git-anchored replay anchors to recover context and continue building even after long breaks or context window resets.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
