Skip to content

Add a schema subcommand that prints the --json output schema #43

Description

@willkg

Add a schema subcommand that prints the published JSON Schema for --json output (schema/json-output/v1.json) to stdout, so a consumer — a script, CI, or an agent in Claude Code — can fetch the contract at runtime instead of reading it out of the repo.

Why

--json (#12) is now a versioned, drift-guarded contract (schema_version: 1, validated in tests against schema/json-output/v1.json). Making the schema self-serve from the binary means an agent can validate markfluence's own output, or generate types, without knowing the repo layout.

Shape

  • markfluence schema — print the current (latest) schema.
  • Embed the file via go:embed so it ships in the binary and can't drift from the tested copy.
  • Consider --schema-version N later if/when a v2 exists; for now there is only v1.

Notes

  • Tiny command; the schema file and its conformance tests already exist.
  • Pairs well with the offline check command and the Claude skill (Write a Claude skill for driving markfluence #36): the skill can point Claude at markfluence schema to learn the output shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions