Add create-skill command with validation and documentation#94
Add create-skill command with validation and documentation#94ericelliott wants to merge 48 commits intomainfrom
Conversation
Add a new /create-skill command that guides AI agents through creating skills following the AgentSkills.io specification and SudoLang syntax. Includes size validation, verb-form naming conventions, and a skill template structure. - ai/skills/create-skill.mdc: main skill guide with process, size constraints, authoring guidelines, and example structure - ai/commands/create-skill.md: command entry point - Register command in please.mdc and agent-orchestrator.mdc https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
…plan review - Scan ai/ and aidd-custom/ for related skills to avoid overlap - Web search for best practices on the skill topic - Present plan to user for approval before drafting - Run skills-ref validate with symbolic JS size checker - Report warnings when frontmatter > 100 tokens or body > 160 LoC https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
Rewrite create-skill.mdc to comply with the official AgentSkills.io spec:
- Skills are directories with SKILL.md (not standalone .mdc files)
- Frontmatter uses name + description (required), plus optional license,
compatibility, metadata, and allowed-tools fields
- Name validation: lowercase alphanumeric + hyphens, 1-64 chars, no
consecutive hyphens, must match parent directory name
- Progressive disclosure: ~100 token metadata, <5000 token instructions
- Output to $projectRoot/aidd-custom/${skillName}/SKILL.md
- Symbolic JS validator includes name validation and tiered size warnings
(160 line guideline, 500 line spec limit, 5000 token guideline)
- Support for optional scripts/, references/, assets/ directories
https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
…g mistakes Add explicit constraints section documenting mistakes to avoid when generating new skills: - Must create directory/SKILL.md structure, not standalone files - Must use AgentSkills.io frontmatter fields (name+description), not aidd .mdc fields (alwaysApply, globs) - Must validate name field (lowercase, no consecutive hyphens, match dir) - Must use plain Markdown in SKILL.md body, not SudoLang - Must always run validator and report metrics before success https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
Move from flat ai/skills/create-skill.mdc to proper spec-compliant ai/skills/create-skill/SKILL.md directory structure. The skill now eats its own dog food. - AgentSkills.io frontmatter: name + description + metadata - Proper SudoLang usage: type definitions (SkillName, SkillDescription, TokenCount), typed interfaces (Frontmatter, Skill, SizeMetrics, SkillPlan), pipe composition in createSkill process - Reference productmanager.mdc as SudoLang exemplar (not as a skill) - Update command to reference new path https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
The AgentSkills.io spec has no alwaysApply equivalent. Document the design decision to use the spec's metadata extension point (metadata.alwaysApply: "true") for AIDD-specific context preloading on project init. - Document AIDD Extensions via metadata section with rationale - Add SkillPlan.alwaysApply field to plan interface - Add RequiredSections interface enforcing documentation quality: When to use, Steps/Process, Examples, Edge cases - Add documentation constraints to spec compliance checks - Update example SKILL.md to show all required sections and metadata.alwaysApply usage https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
Add alwaysApply question to gatherRequirements with guidance hints: recommend "yes" only for universally-applicable skills (coding standards, security checks), "no" for task-specific skills that activate on demand. https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
…lication Review findings addressed: - Extract inline JS validator to scripts/validate-skill.js as a proper testable module with 4 exports: parseSkillMd, validateName, calculateMetrics, checkThresholds - 16 unit tests written TDD-first with riteway assertions covering all functional requirements (name validation, metrics, thresholds) - Remove duplication: SudoLang Reference section (meta-guidance), TokenCount type (just number), Skill interface (duplicated tree diagram), Progressive Disclosure section (already in AIDD Extensions) - SKILL.md reduced from 279 to 237 lines while adding clarity - Inline 40-line JS blob replaced with reference to tested script https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
|
@cursoragent please /review |
There was a problem hiding this comment.
Pull request overview
This PR adds a new create-skill capability to the ai/ knowledge/automation layer, including a full skill specification (SKILL.md), a validator module with unit tests, and updates to command/rule indexes so the new skill/command is discoverable.
Changes:
- Added
ai/skills/create-skill/SKILL.mddefining the “create skill” process, constraints, and documentation requirements. - Added a JavaScript validator module (
validate-skill.js) plus Vitest unit tests (validate-skill.test.js) for parsing/name/size checks. - Updated
ai/indexes and rules to reference the new skills directory and/create-skillcommand.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ai/index.md | Links the new skills/ section from the top-level AI index. |
| ai/commands/index.md | Adds create-skill to the commands index. |
| ai/commands/create-skill.md | Defines the /create-skill command and points to the skill guide. |
| ai/rules/please.mdc | Adds /create-skill to the global command list. |
| ai/rules/agent-orchestrator.mdc | Adds a create-skill reference to the orchestrator’s guide list. |
| ai/skills/index.md | Introduces a new skills directory index and links to create-skill/. |
| ai/skills/create-skill/index.md | Adds an index page describing the create-skill skill and subdirs. |
| ai/skills/create-skill/SKILL.md | Adds the full skill specification, workflow, constraints, and example template. |
| ai/skills/create-skill/scripts/index.md | Adds an index for scripts (currently inaccurate per PR contents). |
| ai/skills/create-skill/scripts/validate-skill.js | Adds validator utilities (currently documented as a CLI but not implemented as one). |
| ai/skills/create-skill/scripts/validate-skill.test.js | Adds unit tests for the validator utilities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Eric Elliott <support@paralleldrive.com>
Co-authored-by: Eric Elliott <support@paralleldrive.com>
…gn and review pipelines Co-authored-by: Eric Elliott <support@paralleldrive.com>
…review pipeline Co-authored-by: Eric Elliott <support@paralleldrive.com>
Remove '## When to use', '## Examples', and '## Edge cases' from RequiredSections in types.md. Only '# Title' and '## Steps | ## Process' are truly required for every generated SKILL.md.
ianwhitedeveloper
left a comment
There was a problem hiding this comment.
🔬 Code Review — Final Pass ✅ Approving
All blockers from the initial review have been addressed across the subsequent commits. The 04626e6 YAML refactor was particularly clean — switching from regex + quote-stripping to reading directly from the parsed YAML object resolved BUG-3 more robustly than the targeted fix alone, while also handling inline YAML comments and degenerate (non-mapping) frontmatter in the same pass.
✅ All Previously Flagged Issues — Resolved
| Issue | Fix commit |
|---|---|
BUG-1: resolveIsMainEntry exported but never called |
04626e6 |
| BUG-2: malformed YAML crashed validator instead of returning error | 195aca0 |
BUG-3: name field not quote-stripped (false validation errors) |
04626e6 (supersedes 195aca0) |
BUG-4: description max 1024-char limit not enforced (spec gap) |
cbb3db0 |
Stale please.mdc reference in command file |
bfc2612 |
README path mismatch (aidd-custom/aidd-[name] vs aidd-custom/skills/aidd-[name]) |
bfc2612 |
reportFindings lacked structure |
bfc2612 |
Boundary tests missing for all four checkThresholds thresholds |
416ef64 |
validateName + calculateMetrics tests were boolean checks, not concrete values |
b6aef22 |
⚪ Follow-up Recommendations (non-blocking)
These are too small to block merge but worth a follow-up ticket or next-pass cleanup:
1 — validateFrontmatterKeys: replace imperative loop with functional pipeline
Per the project's /aidd-javascript style guide ("favour map, filter, reduce over manual loops"):
// Current:
const errors = [];
for (const key of Object.keys(frontmatterObj)) {
if (!ALLOWED_FRONTMATTER_KEYS.has(key)) errors.push(…);
}
return errors;
// Recommended:
export const validateFrontmatterKeys = (frontmatterObj) =>
Object.keys(frontmatterObj)
.filter((key) => !ALLOWED_FRONTMATTER_KEYS.has(key))
.map((key) => `Unknown frontmatter key: ${key}`);2 — Boundary messages: "exceeds" → "reaches or exceeds" at 160 and 500 lines
The frontmatter warning already uses the correct phrasing ("reaches or exceeds 100 token guideline"). The body messages should match for consistency:
// At exactly 160 or 500 lines, these messages are technically inaccurate:
"Body exceeds 500 line spec limit …" // should be "reaches or exceeds"
"Body exceeds 160 line guideline" // should be "reaches or exceeds"3 — process.md validate step: add dev fallback
The validate step calls the compiled binary directly. Agents running this before building will hit a missing-file error. One line resolves it:
# Development (no compiled binary needed):
node ai/skills/aidd-upskill/scripts/validate-skill.js ./path-to-skill-directory…inline RTC with /aidd-rtc --caveman
…finition from eval winner
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e4109b. Configure here.
| body: content.slice(match[0].length).trim(), | ||
| frontmatter: match[1], | ||
| }; | ||
| }; |
There was a problem hiding this comment.
Reimplements frontmatter parsing despite existing gray-matter dependency
Low Severity
The parseSkillMd function hand-rolls YAML frontmatter extraction with a regex, but gray-matter (already a project dependency in package.json) does exactly this. gray-matter returns both the parsed data and the raw matter string, so it could replace this custom parser while also providing the raw frontmatter string needed by calculateMetrics.
Reviewed by Cursor Bugbot for commit 9e4109b. Configure here.
…fault, refine description
…endencies epic - Add PR #94 split plan: /aidd-rtc (3 files, zero deps), /aidd-upskill (11 files) - Add triage tasks for modified existing skills and infrastructure files - Update merge order: rtc → pipeline → parallel → pr → evals → upskill → genesplice - Document design decisions: parallel delegate is canonical, /aidd-delegate superseded - Split PR #168 into parallel, pr, and eval infrastructure tasks - Split PR #179: only /aidd-pipeline needed, /aidd-delegate excluded Co-authored-by: Eric Elliott <support@paralleldrive.com>
Split from PR #94. One skill per PR per project standards. Adds the /aidd-upskill skill for creating and reviewing AIDD agent skills, including: - Skill creation and review pipelines (SKILL.md, references, scripts) - Command definition (ai/commands/aidd-upskill.md) - AI eval tests (caveman, dedup, function tests) - validate-skill CLI and its unit tests - Epic documentation (tasks/aidd-upskill-epic.md) - Upskill entries in aidd-agent-orchestrator, aidd-please, index files - .gitignore and package.json entries for the validator binary and eval script


Overview
This PR introduces the
create-skillcommand and supporting infrastructure for creating new agent skills following the AgentSkills.io specification.Changes
New Files
ai/skills/create-skill/SKILL.md- Comprehensive skill definition with:ai/skills/create-skill/scripts/validate-skill.js- Validator module exporting:parseSkillMd()- Parses YAML frontmatter and body from SKILL.md contentvalidateName()- Validates skill names (1-64 chars, lowercase alphanumeric + hyphens, no leading/trailing/consecutive hyphens, matches directory name)calculateMetrics()- Calculates size metrics (frontmatter tokens, body lines, body tokens)checkThresholds()- Checks against size guidelines (frontmatter < 100 tokens, body < 160 lines / < 500 lines hard limit, < 5000 tokens)ai/skills/create-skill/scripts/validate-skill.test.js- Comprehensive unit tests covering:ai/commands/create-skill.md- Command definition referencing the create-skill skillIndex files - Navigation and documentation:
ai/skills/index.mdai/skills/create-skill/index.mdai/skills/create-skill/scripts/index.mdModified Files
ai/commands/index.md- Added create-skill command entryai/index.md- Added skills directory referenceai/rules/please.mdc- Added /create-skill command referenceai/rules/agent-orchestrator.mdc- Added create-skill referenceKey Features
metadata.alwaysApply)Test Plan
Added comprehensive unit tests in
validate-skill.test.jscovering all validator functions:parseSkillMd(valid frontmatter, no frontmatter)validateName(valid names, uppercase, hyphens, length, empty, directory mismatch)calculateMetricscheckThresholds(within limits, frontmatter, 160-line, 500-line, 5000-token)All tests use the riteway/vitest assertion framework and follow project conventions.
https://claude.ai/code/session_012PBVMXigqq6Bd4WTUhi4b7
Note
Low Risk
Mostly additive documentation/skill content plus a new
validate-skillCLI and tests; limited blast radius outside theai/tooling/docs surface area.Overview
Introduces two new agent skills:
aidd-rtc(a structured “show your work” reasoning pipeline) andaidd-upskill(a guide and workflows to create/review skills, including deduplication and function-test criteria).Adds a Bun/Node-compatible
validate-skillCLI (with extensive unit tests) to validateSKILL.mdfrontmatter/name rules and size thresholds, plus npm scripts to build the compiled binary and run newaidd-upskilleval suites.Wires the new commands/skills into existing indexes and orchestration (
ai/commands/index.md,ai/skills/index.md,aidd-agent-orchestrator,aidd-please,aidd-review), and adds.gitignorecoverage for the compiled validator output.Reviewed by Cursor Bugbot for commit cc5ddaf. Bugbot is set up for automated code reviews on this repo. Configure here.