Skip to content

Add create-skill command with validation and documentation#94

Open
ericelliott wants to merge 48 commits intomainfrom
claude/fix-issue-93-6x2Oq
Open

Add create-skill command with validation and documentation#94
ericelliott wants to merge 48 commits intomainfrom
claude/fix-issue-93-6x2Oq

Conversation

@ericelliott
Copy link
Copy Markdown
Collaborator

@ericelliott ericelliott commented Feb 13, 2026

Overview

This PR introduces the create-skill command 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:

    • Full specification for creating agent skills
    • Type definitions and interfaces (SkillName, SkillDescription, SizeMetrics, SkillPlan)
    • Step-by-step process for skill creation
    • Validation requirements and constraints
    • Documentation requirements (required sections, size limits)
    • Example SKILL.md template
  • ai/skills/create-skill/scripts/validate-skill.js - Validator module exporting:

    • parseSkillMd() - Parses YAML frontmatter and body from SKILL.md content
    • validateName() - 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:

    • Frontmatter parsing (valid and missing)
    • Name validation (valid names, uppercase, leading/trailing/consecutive hyphens, length, empty, directory mismatch)
    • Metric calculation
    • Threshold checking (all within limits, frontmatter, 160-line, 500-line, 5000-token warnings)
  • ai/commands/create-skill.md - Command definition referencing the create-skill skill

  • Index files - Navigation and documentation:

    • ai/skills/index.md
    • ai/skills/create-skill/index.md
    • ai/skills/create-skill/scripts/index.md

Modified Files

  • ai/commands/index.md - Added create-skill command entry
  • ai/index.md - Added skills directory reference
  • ai/rules/please.mdc - Added /create-skill command reference
  • ai/rules/agent-orchestrator.mdc - Added create-skill reference

Key Features

  • Specification-compliant: Implements AgentSkills.io specification with AIDD extensions (e.g., metadata.alwaysApply)
  • Comprehensive validation: Name format, size metrics, and threshold warnings
  • Well-documented: Includes type definitions, interfaces, process flow, and constraints
  • Tested: Full unit test coverage for all validator functions
  • Extensible: Supports optional directories (scripts/, references/, assets/) and metadata

Test Plan

Added comprehensive unit tests in validate-skill.test.js covering all validator functions:

  • 2 tests for parseSkillMd (valid frontmatter, no frontmatter)
  • 8 tests for validateName (valid names, uppercase, hyphens, length, empty, directory mismatch)
  • 1 test for calculateMetrics
  • 5 tests for checkThresholds (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-skill CLI and tests; limited blast radius outside the ai/ tooling/docs surface area.

Overview
Introduces two new agent skills: aidd-rtc (a structured “show your work” reasoning pipeline) and aidd-upskill (a guide and workflows to create/review skills, including deduplication and function-test criteria).

Adds a Bun/Node-compatible validate-skill CLI (with extensive unit tests) to validate SKILL.md frontmatter/name rules and size thresholds, plus npm scripts to build the compiled binary and run new aidd-upskill eval 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 .gitignore coverage 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.

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
Copilot AI review requested due to automatic review settings February 13, 2026 20:46
@ericelliott
Copy link
Copy Markdown
Collaborator Author

@cursoragent please /review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md defining 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-skill command.

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.

@ericelliott ericelliott mentioned this pull request Feb 13, 2026
cursoragent and others added 2 commits March 5, 2026 01:46
Co-authored-by: Eric Elliott <support@paralleldrive.com>
Co-authored-by: Eric Elliott <support@paralleldrive.com>
Copilot AI review requested due to automatic review settings April 5, 2026 22:20
@ericelliott ericelliott review requested due to automatic review settings April 5, 2026 22:20
…gn and review pipelines

Co-authored-by: Eric Elliott <support@paralleldrive.com>
Copilot AI review requested due to automatic review settings April 5, 2026 22:23
@ericelliott ericelliott review requested due to automatic review settings April 5, 2026 22:23
…review pipeline

Co-authored-by: Eric Elliott <support@paralleldrive.com>
Copilot AI review requested due to automatic review settings April 5, 2026 22:29
@ericelliott ericelliott review requested due to automatic review settings April 5, 2026 22:29
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.
Copilot AI review requested due to automatic review settings April 7, 2026 23:27
@ericelliott ericelliott review requested due to automatic review settings April 7, 2026 23:27
Copilot AI review requested due to automatic review settings April 7, 2026 23:29
@ericelliott ericelliott review requested due to automatic review settings April 7, 2026 23:29
Copy link
Copy Markdown

@ianwhitedeveloper ianwhitedeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔬 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

Copilot AI review requested due to automatic review settings April 8, 2026 20:54
@ericelliott ericelliott review requested due to automatic review settings April 8, 2026 20:54
Copilot AI review requested due to automatic review settings April 8, 2026 21:52
@ericelliott ericelliott review requested due to automatic review settings April 8, 2026 21:52
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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],
};
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9e4109b. Configure here.

Copilot AI review requested due to automatic review settings April 8, 2026 22:25
@ericelliott ericelliott review requested due to automatic review settings April 8, 2026 22:25
Copilot AI review requested due to automatic review settings April 8, 2026 22:29
@ericelliott ericelliott review requested due to automatic review settings April 8, 2026 22:29
Copilot AI review requested due to automatic review settings April 8, 2026 22:32
@ericelliott ericelliott review requested due to automatic review settings April 8, 2026 22:32
cursor bot pushed a commit that referenced this pull request Apr 10, 2026
…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>
cursor bot pushed a commit that referenced this pull request Apr 10, 2026
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
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.

6 participants