ml-spec

A workflow for turning reviewed wireframes into a written specification through planning, writing, and review. A wireframe is a rough drawing of an app screen or interface.

In plain words
What is it for?
Use it to plan and write specifications for SwiftUI screens, reusable components, and other documented view categories from one or more wireframes.
Why use it?
It organizes design decisions before implementation and checks the specification for correctness, using the wireframe and project conventions as context.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jpavley/meta-loop-ios/ml-spec
Clone the repo
git clone --depth 1 https://github.com/jpavley/meta-loop-ios
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,808 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.02808
Opus 5 $0.00013 $0.01404
Sonnet 5 $0.00005 $0.00562
Haiku 4.5 $0.00003 $0.00281

Measured 2d ago against content hash b6044660f3e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

ml-spec scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

> rm -rf specs/{category}/{name}/
commands/ml-spec.md · 380 lines

How it starts

The opening of the file, as written. The whole thing — 380 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Meta-Loop: Specification Loop

Complete the specification loop: plan the spec, write it, and review for correctness.

Modes: Plan Mode → Agent Mode → Ask Mode

Arguments

  • $ARGUMENTS: Path to wireframe(s) that will drive the specification
    • Examples: specs/views/my-feature/main-view-wireframe.png or specs/views/my-feature/

Prerequisites

This skill implements Steps 2.1-2.4 of the Meta-Loop process defined in skills/meta-loop-methodology/SKILL.md.

The wireframe should have already passed /ml-wireframe review before invoking this skill.


Phase 1: Plan (Plan Mode)

Enter plan mode and create a plan for writing the specification.

1.1 Load Context

  1. Load wireframe(s) from $ARGUMENTS
  2. Load notes.md from the same directory (if it exists)
    • This file contains decisions from the /ml-wireframe phase
    • Clarifying questions and answers
    • Understanding summary and key components
    • Technical notes and references
  3. Read CLAUDE.md for codebase patterns and conventions
  4. Check for existing specs in specs/ directory that might be referenced
  5. Identify spec category:
    • specs/views/ for SwiftUI views (screens and reusable components)
    • specs/services/ for backend services
    • specs/utilities/ for helper utilities

1.2 Create the Plan

The plan should outline:

Spec Location:

  • Target path: specs/{category}/{name}/spec.md
  • Wireframe copy location (wireframes live with spec)

Sections to Include:

  • Overview/Purpose
  • Layout/Structure
  • Components (with references to existing component specs)
  • Interactive Elements
  • States and Transitions
  • Data Requirements
  • Accessibility Considerations

Existing Patterns to Reference:

  • Which views from specs/views/ to reference
  • Which shared patterns apply
  • Architecture patterns from CLAUDE.md

Architectural Decisions:

  • Any decisions needed for this feature
  • Trade-offs to document

1.3 Present Plan to Developer

Read the full file on GitHub · 380 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 380 lines · 25 tokens per session scan C b6044660f3e0

Subscribe to this mod's changes

ml-spec is a command published in the GitHub repository jpavley/meta-loop-ios (3 stars, last pushed 6mo ago), licensed MIT. It adds 25 tokens to every session and 2,808 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.