Skip to content

docs(skill): ship SKILL.md and declare violation codes frozen#20

Merged
machado144 merged 1 commit into
mainfrom
feat/agent-skill
Jul 10, 2026
Merged

docs(skill): ship SKILL.md and declare violation codes frozen#20
machado144 merged 1 commit into
mainfrom
feat/agent-skill

Conversation

@machado144

Copy link
Copy Markdown
Contributor

Summary

  • Ships an agent skill in-repo at `skills/structlint/SKILL.md` so AI agents get a real machine surface: violation-code decision table (fix tree vs fix config), JSON contracts (`validate` shape + `suggest` v1), fix loop, setup recipes, and gotchas.
  • Declares the 13 violation codes frozen and append-only in `docs/user/violation-codes.md`. Codes are a public contract — agents and CI parsers key on them, so they never rename or disappear. Enforced by tests going both directions.
  • Eleventh (final) PR in the roadmap. Spec: `docs/specs/011-agent-skill.md`.

Layout decision

`skills/` at the repo root, not `.claude/`. The skill is a distributed artifact for consumers (they install it into their own agent setups, or read it from the release/repo). `.claude/` is local tooling config for structlint's own development.

Cross-links

  • `.structlint.yaml` — `allowedPaths` gains `skills/**` in the same PR (self-validation lockstep).
  • `README.md` — new "For AI agents" section + a "Violation Codes" row in the Documentation table.
  • `docs/AI/overview.md` — preamble routes agents to SKILL.md when they're running structlint (vs. modifying it).

Test plan

  • `go test -race ./...` — 158 pass (5 new binary/text-based cases in `test/skill_contract_test.go`):
    • every code in the CodeDescriptions registry has an entry in `docs/user/violation-codes.md`
    • every heading in the doc is a real code (catches typos / stale renames)
    • SKILL.md exists with a frontmatter block declaring `name: structlint` + a description
    • SKILL.md's decision table covers every registry code
    • self-validation passes with the new `skills/` directory (proves the `.structlint.yaml` update landed)
  • `make build && ./bin/structlint validate` — self-dogfood, exit 0.

Roadmap complete

This closes the 11-spec roadmap. Full arc: `--staged` mode → `hook install` → pre-commit packaging → summary-by-code → rule engine → config discovery → `extends` presets → JSON schema → `init --infer` → `suggest` → agent skill.

Wave 4 of the roadmap — closes the "AI tools placing files incorrectly"
use case with a real agent surface instead of a docs jungle.

Spec: docs/specs/011-agent-skill.md.

- skills/structlint/SKILL.md — agent-facing skill shipped in-repo at the
  root (not under .claude/, since it's a distributed artifact for
  consumers). Frontmatter with trigger phrases, when-to-run guidance,
  full decision table for the 13 violation codes (fix tree vs fix
  config), machine contracts (validate --format json shape, suggest
  JSON v1), the fix loop (suggest → patch/git mv → validate), setup
  recipes (hook install / pre-commit / GitHub Action / extends /
  schema modeline), and gotchas.
- docs/user/violation-codes.md — canonical reference declaring the 13
  codes frozen and append-only. Codes are a public contract; agents
  and CI parsers key on them, so they never rename or disappear.
- .structlint.yaml gains skills/** in allowedPaths (self-validation
  lockstep — roadmap risk 5).
- README.md gains a "Documentation" row for the codes doc and a
  dedicated "For AI agents" section pointing to SKILL.md.
- docs/AI/overview.md gains a preamble routing agents to SKILL.md.

Tests (test/skill_contract_test.go):
- Every code in the CodeDescriptions registry has an entry in the
  codes doc AND in the SKILL.md decision table (both directions
  enforced — new codes without docs and stale docs both break CI).
- SKILL.md starts with a frontmatter block declaring name + description.
- Self-validation passes with the new skills/ directory (proves the
  .structlint.yaml update landed alongside).
@github-actions

Copy link
Copy Markdown

StructLint — All checks passed

134 rules validated against .structlint.yaml. No violations found.

View full run · Powered by StructLint

@machado144 machado144 merged commit 04241c9 into main Jul 10, 2026
5 checks passed
@machado144 machado144 deleted the feat/agent-skill branch July 10, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant