mcpField
D
docs-to-types

docs-to-types

github.com/oscabrielDevelopment6247 installsUpdated 4w ago
Repository

About docs-to-types

docs-to-types is a development skill that turns approved documentation into typed architecture for teams clarifying domain models and module boundaries before implementation. It checks project context, resolves ambiguity, and plans types, interfaces, adapters, and dependencies without implementing business behavior.

Key features

  1. 01Extract architecture facts and link them to sources
  2. 02Pause for clarification when facts conflict
  3. 03Plan types, interfaces, and module structure
  4. 04Define production and test call stacks
  5. 05Run type and architecture checks

Use cases

  1. 01Translate approved design documents into typed structures
  2. 02Clarify module boundaries and dependency direction before implementation
  3. 03Define adapter interfaces for production and tests

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oscabriel/skills --skill docs-to-types

After installing, type/docs-to-typesin Claude Code to confirm it loaded.

Bundled filesREFERENCE.md

Details

From the project README

Docs to Types

Upfront architecture skill for converting clarified prose into typed architecture. If the team knows a durable domain or architecture fact, the type system and module graph should know it too.

Not for general grilling, refactoring review, or the first TDD slice. CONTEXT.md, ADRs, and grill notes are source material, not the final harness.

Prime directive

Do not implement business behavior. Compress approved context into the whole intended typed architecture:

  • canonical domain types, schemas, brands, and invariants
  • discriminated unions/state models that rule out invalid states
  • smart constructors/parsers for values entering from system edges
  • service/interface seams using project conventions
  • typed result/error families and error translation boundaries
  • production/test adapter slots
  • composition/layer/module topology using project conventions
  • production and test call stacks
  • dependency-direction checks where practical

Do not create business workflows, real persistence/network logic, product behavior, after-the-fact refactors, generic mutation/outcome frameworks, or fake production logic pretending to be complete.

Read first

  1. AGENTS.md and project coding rules
  2. CONTEXT-MAP.md, if present
  3. relevant CONTEXT.md files
  4. relevant docs/adr/*
  5. approved grill-with-docs notes/specs
  6. existing source near the target area

If there are no context docs/ADRs and no approved grill-with-docs output, stop and recommend grill-with-docs.

Workflow

1. Extract architecture facts

Before editing, produce a fact table:

| Fact                                        | Source     | Code artifact         | Confidence |
| ------------------------------------------- | ---------- | --------------------- | ---------- |
| Link Catalog is the application-facing seam | CONTEXT.md | `LinkCatalog` service | high       |

Include domain names, ownership boundaries, dependency direction, call stacks, adapter choices, runtime constraints, typed errors, and infrastructure that must stay behind adapters.

2. Ambiguity gate

If docs, code, or user plan conflict, ask one concrete question and wait.

If a prose fact cannot be represented cleanly as a type, seam, adapter, state, error, or dependency rule, treat the domain language as still ambiguous.

Example: CONTEXT.md says “Operator,” but code says “User” and “Actor.” Which is canonical?

3. Propose the typed structure

Before editing, unless the user requested direct implementation, list:

  • files to create/update
  • domain types/schemas/brands/invariants/smart constructors
  • state models/discriminated unions
  • service/interface seams
  • typed result/error families
  • production and test call stacks
  • adapter slots/stubs
  • architecture checks
  • business logic intentionally excluded

Ask for approval.

4. Codify only the typed structure

When approved, write compiling architecture code for the full intended typed structure.

Rules:

  • Use project domain names exactly.
  • Prefer deep modules: small interfaces, complexity behind the seam.
  • Follow project conventions for services, interfaces, DI, composition, layers, factories, providers, or registries.
  • Model absence, validation, variants, states, and expected failures with project-native typed patterns.
  • Keep HTTP/UI/CLI transport details at their boundaries.
  • Keep storage, SQL, queues, RPC clients, SDKs, and third-party APIs behind adapters.
  • Add architecture tests/lint/import rules when dependency direction can be checked mechanically.

See REFERENCE.md for allowed code depth and examples.

5. Validate and report

Run narrow checks: typecheck, lint/static checks, and architecture tests if added. Final response: facts codified, files changed, production/test call stacks, adapter slots, checks run, and business logic left unimplemented.

Comments

Markdown supported