fix(contract): define one authoritative SKILL.md contract (#583)#626
fix(contract): define one authoritative SKILL.md contract (#583)#626AlvinStanescu wants to merge 2 commits intomainfrom
Conversation
Document how to develop long-running or experimental skills in this public repository: feature-branch flow off main, public-repo discipline (no secrets, customer-readable commits), experimental callout in SKILL.md body, and rules on when to merge to main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolve drift between root guidance, real skill structure, and validators. Establishes a single canonical SKILL.md contract that matches how skills are actually written today, and tightens the validator to enforce the required portion of that contract. Changes ------- - .claude/rules/skill-structure.md: rewrite the frontmatter section as the single source of truth. Document `when_to_use`, `allowed-tools`, and `user-invocable` as supported optional fields (all already used in real skills). Soften the "MUST start with brand identity" / "no [PREVIEW] prefix" rules to SHOULD-style guidance, since real skills diverge here (uipath-review uses [PREVIEW]; uipath-diagnostics, llm-config, feedback, maestro-flow, rpa-legacy lead with action verbs). Replace the misleading "no references to other skills" rule with explicit Cross-Skill Boundaries: runtime independence is required, but `→` redirects in description are required for sibling disambiguation, not violations. - CLAUDE.md: drop the contradictory "must include TRIGGER/DO NOT TRIGGER" requirement (0/20 skills use it; .claude/rules already forbids it). Point at .claude/rules/skill-structure.md and the new CONTRIBUTING.md section as the authoritative contract. Clarify cross-skill rule. - CONTRIBUTING.md: add a top-level "Canonical SKILL.md Contract" section (Required / Optional / Style guidance / Cross-skill boundaries / What the validator enforces). Add `when_to_use` to the optional fields table in "Adding a New Skill". Update Key Principles to reflect runtime independence vs `→` disambiguation. - hooks/validate-skill-descriptions.sh: extend beyond description-length checks. Now also enforces (errors): `name` present, `name` matches parent folder, `description` present. Adds a non-fatal warning when `description + when_to_use` exceeds 1,500 chars (Claude Code truncates at 1,536). All 20 existing skills pass; tested name-mismatch, missing-field, and oversized-description failure paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @AlvinStanescu's task in 3m 14s —— View job PR Review: fix(contract): define one authoritative SKILL.md contract (#583)
SummaryThis PR resolves contract drift between Change-by-Change Review1.
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | OK | Contract is well-defined with Required/Optional/Style tiers |
| E2E Tests | N/A | Documentation-only PR, no skill changes |
| Skill Body | OK | No skills were modified |
| References & Assets | OK | No reference files changed |
| Repo Hygiene | Issue | Source-of-truth contradiction between two files; adjacent rule files (skill-review.md, pr-review.md) not updated to match |
Issues for Manual Review
- Verify that CI (Validate Skills workflow) passes — I was unable to execute the validator script directly, but the logic appears correct based on code review.
- Confirm the
[source](https://code.claude.com/docs/en/skills.md)link inskill-structure.mdandCONTRIBUTING.mdstill resolves to the correct Claude Code docs page. - The "Developing Experimental Skills" section in
CONTRIBUTING.mdis new content unrelated to issue Define and enforce one authoritative SKILL contract #583 — confirm this was intentional scope.
Conclusion
The PR's core goal — aligning documentation with reality — is well-executed. The Required/Optional/Style tiering, the nuanced cross-skill boundaries model, and the expanded validator are all solid improvements. However, the contradictory source-of-truth claims between skill-structure.md and CONTRIBUTING.md reintroduce the exact kind of drift this PR aims to eliminate. That should be resolved before merge. The adjacent rule files (skill-review.md, pr-review.md) and the Quality Checklist in CONTRIBUTING.md also still carry old language that conflicts with the new contract.
Recommendation: Request changes — fix the source-of-truth contradiction and update the adjacent rule files to match the new contract.
Closes #583.
Problem
Issue #583 documented contract drift between root guidance, actual skills, and validators:
CLAUDE.mdrequireddescriptionto includeTRIGGER/DO NOT TRIGGERclauses, while.claude/rules/skill-structure.mdandCONTRIBUTING.mdexplicitly forbid them. Reality: 0 of 20 skills use that form.when_to_useis used in 5 real skills (uipath-rpa, uipath-interact, uipath-planner, uipath-feedback, uipath-tasks) but is undocumented inCONTRIBUTING.md.CLAUDE.mdand.claude/rules/skill-structure.mdboth said "no cross-skill references", yet every description contains→redirects to sibling skills (anduipath-plannerexists specifically to route between them).validate-skill-descriptions.shonly checked description length — noname-folder match, no required-field check.[PREVIEW]prefix" don't match reality (e.g.,uipath-reviewuses[PREVIEW]; 7 skills lead with action verbs instead of "UiPath…").Approach
Ground truth = current skill structure. No skills were modified. All four changed files now agree with what skills actually look like.
Audit (20 skills)
namedescriptionallowed-toolswhen_to_useuser-invocabletrue)metadata:TRIGGER:/DO NOT TRIGGER:clauses→redirects in descriptionChanges
.claude/rules/skill-structure.md— rewrite as the single source of truth. Required/Optional/Style tables. New## Cross-Skill Boundariessection: runtime independence required;→redirects are required, not violations.CLAUDE.md— drop theTRIGGER/DO NOT TRIGGERrequirement. Point at the canonical files. Restate the cross-skill rule correctly.CONTRIBUTING.md— new top-level Canonical SKILL.md Contract section enumerating Required, Optional, Style, Cross-skill boundaries, and What the validator enforces.when_to_useadded to the optional fields table.hooks/validate-skill-descriptions.sh— extend withnamepresent,namematches folder,descriptionpresent, plus a non-fatal warning when combineddescription + when_to_use> 1,500 chars (Claude Code truncates at 1,536). Filename kept for compatibility with the pre-commit hook and.github/workflows/validate-skills.yml.Validation
bash hooks/validate-skill-descriptions.sh skills/uipath-*/SKILL.md→ all 20 skills passdescription→ failsdescription→ fails (existing behavior preserved)Test plan
Validate Skillsworkflow passes against this branchscripts/setup-hooks.sh) passesCONTRIBUTING.mdon GitHub, verify the new Canonical SKILL.md Contract anchor and table-of-contents entryCLAUDE.mdlinks to.claude/rules/skill-structure.mdandCONTRIBUTING.md#canonical-skillmd-contractresolve🤖 Generated with Claude Code