diff --git a/OKF/blueprints/017-add-a-line-cap-lint-over-skills.md b/OKF/blueprints/017-add-a-line-cap-lint-over-skills.md index 2ffb848..dbe72bc 100644 --- a/OKF/blueprints/017-add-a-line-cap-lint-over-skills.md +++ b/OKF/blueprints/017-add-a-line-cap-lint-over-skills.md @@ -1,6 +1,6 @@ --- type: Blueprint -status: locked +status: implemented traces-to: user request 2026-07-30 sounded: 2026-07-30 cites: diff --git a/OKF/index.md b/OKF/index.md index d670469..d27f8a5 100644 --- a/OKF/index.md +++ b/OKF/index.md @@ -38,7 +38,7 @@ your task needs. Humans welcome too. - [014](blueprints/014-unify-skill-sibling-file-naming.md) — unify skill sibling-file naming on lowercase-kebab topic names — implemented - [015](blueprints/015-record-session-check-discharges-on-the-blueprint.md) — record session-check discharges on the blueprint — implemented - [016](blueprints/016-pull-two-skills-under-cap-and-level-commit-twins.md) — pull two skills under the line cap and level the commit twins — implemented -- [017](blueprints/017-add-a-line-cap-lint-over-skills.md) — add a line-cap lint over skills/ — locked +- [017](blueprints/017-add-a-line-cap-lint-over-skills.md) — add a line-cap lint over skills/ — implemented ## Ferries diff --git a/skills/productivity/conjure-a-skill/SKILL.md b/skills/productivity/conjure-a-skill/SKILL.md index af54b0f..aefc496 100644 --- a/skills/productivity/conjure-a-skill/SKILL.md +++ b/skills/productivity/conjure-a-skill/SKILL.md @@ -85,7 +85,7 @@ description: . Use when . ## Output / done criteria - New `SKILL.md` exists at the right path, passes the checks in step 4. -- `SKILL.md` is ≤ 110 lines. +- **`scripts/skill-check skills/` run and its output pasted**, exiting 0. - User has been told the exact `jj describe` command to run. - Skill appears in the skill list on next Claude Code session start. diff --git a/skills/productivity/conjure-a-skill/scripts/skill-check b/skills/productivity/conjure-a-skill/scripts/skill-check new file mode 100755 index 0000000..d41a6bb --- /dev/null +++ b/skills/productivity/conjure-a-skill/scripts/skill-check @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +"""Validate skill line counts. Usage: skill-check + +Errors (exit 1): a SKILL.md over the 110-line house cap. Warnings +(exit 0): a SKILL.md in the 101-110 headroom band — legal, but with +nowhere left to grow, so the next edit needs a topic-named sibling +rather than more lines. + +The cap errors rather than warns because a legal move always exists: +push reference into a sibling. Only `//SKILL.md` is +read — siblings load on demand and carry no cap. +""" +import sys +from pathlib import Path + +CAP = 110 +WARN_AT = 100 + + +def main(argv): + if len(argv) != 2: + print("usage: skill-check ", file=sys.stderr) + return 2 + root = Path(argv[1]).resolve() + if not root.is_dir(): + print(f"not a directory: {root}", file=sys.stderr) + return 2 + + errors, warnings = [], [] + for page in sorted(root.glob("*/*/SKILL.md")): + rel = page.relative_to(root.parent) + lines = page.read_text().count("\n") # `wc -l`, the count the cap is stated in + if lines > CAP: + errors.append(f"{rel}: {lines} lines, over the {CAP}-line cap") + elif lines > WARN_AT: + warnings.append(f"{rel}: {lines} lines, {CAP - lines} under the cap") + + for line in warnings: + print(f"WARN {line}") + for line in errors: + print(f"ERROR {line}") + print(f"{len(errors)} error(s), {len(warnings)} warning(s)") + return 1 if errors else 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv))