Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Development

format

Creates or modifies pure string-transform functions in domain/formats/. Use when adding a new format module (toml, markdown, json, placeholders, command), implementing a lossless round-trip transform and its inverse, or writing exhaustive unit tests for an existing pure function. Do NOT use for capability classes — use `capability` instead. Do NOT use for AI tool definitions — use `tool` instead. Do NOT use for I/O-bearing code — use `adapter` instead.

ai-driven-dev · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add ai-driven-dev/framework --skill format

About this skill


name: format description: > Creates or modifies pure string-transform functions in domain/formats/. Use when adding a new format module (toml, markdown, json, placeholders, command), implementing a lossless round-trip transform and its inverse, or writing exhaustive unit tests for an existing pure function. Do NOT use for capability classes — use capability instead. Do NOT use for AI tool definitions — use tool instead. Do NOT use for I/O-bearing code — use adapter instead.

Format

Builds pure string-transform functions that live in domain/formats/. Every function in this layer is stateless, has no I/O, is a named export, and uses .js ESM import paths. Where a forward transform exists, a lossless reverse transform must accompany it.

Available actions

#ActionRoleInput
01define-pure-functionWrite the named export with correct signaturefunction name + transform description
02round-tripImplement the inverse function, verify lossless identityforward function from 01
03testWrite exhaustive unit tests (all branches + edge cases)both functions from 01-02

Default flow

01 → 02 → 03

Skip 02 when the transform has no meaningful inverse (e.g. a lossy stringify with no parse counterpart) — document this explicitly with a comment in the source file.

Transversal rules

  • Pure functions only: no I/O, no network, no filesystem, no side effects.
  • Named exports only; no default exports.
  • No any types; use generics or explicit union types.
  • .js extensions on all relative imports.
  • Inverse function name follows the pattern reverse<ForwardName> or deserialize<Concept>.
  • A lossless round-trip means reverse(forward(x)) === x for all valid inputs.
  • Module-level const in CONSTANT_CASE for any literal used more than once.
  • File name is <concept>.ts (e.g. toml.ts, markdown.ts, command.ts).

References

  • references/format-conventions.md — naming, file placement, no-any rule, ESM imports
  • references/round-trip.md — lossless identity requirement, composition order, verification pattern

Invariant rules

  • references/format-conventions.md — authoritative format layer rules