Skip to content

Build @scope42/lint CLI for frontmatter & relation validation #433

@erikhofer

Description

@erikhofer

Part of #430.

New standalone npm package providing a CLI to validate scope42 workspaces in CI or pre-commit hooks.

Tasks

  • Scaffold packages/scope42-lint, depending on @scope42/data
  • CLI entrypoint scope42-lint [path] that loads scope42.yaml and validates every item file's frontmatter against the Zod schemas
  • Validate relation IDs (causedBy, resolves, modifies, creates, supersededBy, assesses) resolve to existing items of the allowed type
  • Validate filename/ID matches the type's idPattern from the config
  • Validate required H1/title heading is present in the body (format-agnostic: first non-blank line of body matches a heading syntax)
  • Warn (not fail) on smells: empty body, modified < created, orphaned items with no relations, unknown frontmatter keys
  • Human-readable output (default) with file:line references; machine-readable --format=json
  • Exit codes: 0 clean, 1 warnings, 2 errors
  • Fixture-based unit tests under packages/scope42-lint/test/fixtures/ covering Markdown and AsciiDoc inputs
  • Publish as @scope42/lint with clear npx usage
  • Document a GitHub Actions snippet for CI integration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions