agentleFS
oscabrieloscabriel/skills/docs-to-types/SKILL.md

docs-to-types

Skill63 starsChanged 58 days agoMITView on GitHub

Converts grill-with-docs output — CONTEXT.md glossaries, ADRs, and approved domain decisions — into typed architecture. Use after grill-with-docs when the user wants domain types, seams, adapters, errors, call stacks, and dependency rules expressed in code before business behavior.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not for general grilling, refactoring review, or the first TDD slice.

    line 11
  2. Distinctive:

    Do not implement business behavior.

    line 15
  3. Distinctive:

    Do not create business workflows, real persistence/network logic, product behavior, after-the-fact refactors, generic mutation/outcome …

    line 27
  4. Very specific:

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

    line 38
  5. Distinctive:

    Before editing, produce a fact table:

    line 44
  6. Distinctive:

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

    line 56
  7. Distinctive:

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

    line 58
  8. Distinctive:

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

    line 64
  9. Distinctive:

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

    line 80
  10. Distinctive:

    Use project domain names exactly.

    line 84
  11. Distinctive:

    Prefer deep modules: small interfaces, complexity behind the seam.

    line 85
  12. Distinctive:

    Follow project conventions for services, interfaces, DI, composition, layers, factories, providers, or registries.

    line 86
  13. Very specific:

    Keep HTTP/UI/CLI transport details at their boundaries.

    line 88
  14. Distinctive:

    Keep storage, SQL, queues, RPC clients, SDKs, and third-party APIs behind adapters.

    line 89
  15. Very specific:

    Add architecture tests/lint/import rules when dependency direction can be checked mechanically.

    line 90
  16. Distinctive:

    Run narrow checks: typecheck, lint/static checks, and architecture tests if added.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.