fix(skills): align description cap with the 1024-char Agent Skills spec - #1119
Merged
Merged
Conversation
The admin skill form capped `description` at 500 characters, rejecting valid Anthropic-authored skills on import. The Agent Skills spec allows 1,024 — so the cap was roughly half the spec and blocked real skills (`math-olympiad` at 704, `hook-development` at 525), including two of this repo's own `.claude/skills/`. The field was also enforced at three different numbers for one column: 500 on the admin path, 2,000 on the user-authored path, and no cap at all on the `Skill` record itself. Replace all of them with a single spec-derived constant. A bound is still warranted — `description` is the Level-1 catalog line injected into the cacheable system prompt for every enabled skill, on every turn — so this sets the right number rather than removing the cap. - Add `SKILL_DESCRIPTION_MAX_LENGTH = 1024` to `apis/shared/skills/models` - Apply it to SkillCreate/Update (was 500) and CreateMy/UpdateMySkill (was 2,000) - Mirror it client-side in `shared/skills/skill-field-limits.ts`, following the `skill-resource-types.ts` precedent, and use it in both skill forms - Interpolate the constant into the admin form's error text so the message cannot drift from the validator again Note: lowering the user-authored cap from 2,000 to 1,024 affects only writes. The `Skill` model has no read-side cap, so an existing longer record still loads; it would fail only on a PUT that resends the description. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Creating a skill in the admin view rejects valid Anthropic-authored skills: the
descriptionfield caps at 500 characters, but the Agent Skills spec allows 1,024:Our cap was roughly half the spec, so a skill that uses the upper half of its budget can't be imported. This isn't hypothetical — scanning the SKILL.md files available locally, these were blocked:
math-olympiad(Anthropic official plugin)cutting-a-release(this repo)hook-development(Anthropic official plugin)dotenvkaizen-review-prep(this repo)Two of our own
.claude/skills/couldn't be re-created through our own admin UI.The field was also enforced at three different numbers for one column: 500 on the admin path, 2,000 on the user-authored path (
CreateMySkillRequest), and no cap at all on theSkillrecord itself — so nothing about storage required 500. It was purely form validation, and the strictest of three.Change
A single spec-derived constant, now the source for all four enforcement points.
Backend —
SKILL_DESCRIPTION_MAX_LENGTH = 1024inapis/shared/skills/models.py, applied to:SkillCreateRequest/SkillUpdateRequest(admin) — was 500CreateMySkillRequest/UpdateMySkillRequest(user-authored) — was 2,000Frontend — mirrored in
shared/skills/skill-field-limits.ts, following the existingskill-resource-types.tsprecedent of a documented client mirror naming the Python file as canonical. Used by both the admin and Customize skill forms. The admin form's error text now interpolates the constant instead of hardcoding "500", so the message can't drift from the validator again.Why keep a cap at all:
descriptionis the Level-1 catalog line injected into the cacheable system prompt for every enabled skill, on every turn — exactly the kind of thing CLAUDE.md's cost tenet says to bound. This sets the right number rather than removing the bound.Verification
tsc --noEmitclean; AOT build clean (strictTemplatescovers the new template binding).No browser check: port 4200 was held by another session's dev server from a different checkout, so it would have exercised the wrong code.
Reviewer notes
Lowering the user-authored cap from 2,000 → 1,024 affects writes only. The
Skillmodel has no read-side cap, so an existing longer record still loads and still works; it would fail only on aPUTthat resends the description. I could not check live data for such records from this environment — worth a scan of the skills table for user-owned rows wherelength(description) > 1024before this ships, if you want certainty.Out of scope, noticed in passing: this repo's
.claude/skills/kaizen-researchhas a 1,405-character description. That exceeds Anthropic's own 1,024 limit, so Claude Code's validation would reject it too — genuinely out of spec, not something our cap should accommodate.🤖 Generated with Claude Code