mdpact

structure/too-short

severity: warningcategory: structurefixable: no

A spec is too short to meaningfully govern agent behavior — typical working specs are at least 50 tokens.

structure/too-short

Severity: warning Category: structure Fixable: no

What it catches

Specs that are below a minimum token threshold (default: 50 tokens, ~200 characters). At that size there isn't room for even a single well-scoped directive plus context.

Why it matters

A short spec either:

Large, well-structured specs are where mdpact's other rules do their job. This rule flags the case where there isn't enough surface area for the rest of the catalog to say anything meaningful.

Options

// mdpact.config.ts
export default {
  rules: {
    "structure/too-short": { minTokens: 50 },
  },
};

Example — bad

---
version: 1
---

# Spec

Be nice.

Example — good

---
version: 1
owner: platform-team
---

# Spec

This document governs agent behavior in the payments pipeline. Binding rules below apply to any agent touching `packages/payments`.

- Always run the integration tests before merging changes.
- Never introduce breaking schema changes without a migration in the same PR.
good.md
---
version: 1
owner: platform-team
---

# Spec

This document governs agent behavior across the repository. Binding rules apply to any agent or developer touching the codebase, regardless of which file they are editing.

## Binding rules

- Always run the integration tests before merging changes to `main`.
- Never commit secrets, API keys, or anything matched by the `compliance/secret-in-spec` rule.
- Always request review from the codeowner before merging to protected branches.
- Never introduce breaking schema changes without a migration in the same PR.

## Advisory rules

- Prefer the existing utility helpers over writing new ones.
- Keep commit messages focused on the "why" rather than the "what".
bad.md
---
version: 1
---

# Spec

Always run tests.