[Issue #76] Add validation and interactive guidance to /create-capability #82

Closed
HugoNijhuis wants to merge 2 commits from issue-76-add-validation-and-interactive-guidance into main
Owner

Summary

Creates the /create-capability command with comprehensive validation and interactive guidance to help users make good design decisions when creating new capabilities.

Changes

  • Added commands/create-capability.md with:
    • Interactive guidance questions for component selection (skill vs command vs agent)
    • Model selection recommendations based on task complexity
    • Frontmatter validation (required fields, valid model values, valid tools, skill references)
    • Content validation (trigger conditions in skills, step instructions in commands, behavior sections in agents)
    • Convention checks (file naming, directory structure, duplicate detection)
    • Anti-pattern warnings with actionable recommendations
    • Clear error messages for validation failures
    • Option to proceed despite warnings with explicit confirmation

Note

This PR also addresses issue #75 (the base /create-capability command) since #76 depends on it and they're naturally combined.

Closes #76
Also addresses #75

## Summary Creates the `/create-capability` command with comprehensive validation and interactive guidance to help users make good design decisions when creating new capabilities. ## Changes - Added `commands/create-capability.md` with: - Interactive guidance questions for component selection (skill vs command vs agent) - Model selection recommendations based on task complexity - Frontmatter validation (required fields, valid model values, valid tools, skill references) - Content validation (trigger conditions in skills, step instructions in commands, behavior sections in agents) - Convention checks (file naming, directory structure, duplicate detection) - Anti-pattern warnings with actionable recommendations - Clear error messages for validation failures - Option to proceed despite warnings with explicit confirmation ## Note This PR also addresses issue #75 (the base `/create-capability` command) since #76 depends on it and they're naturally combined. Closes #76 Also addresses #75
HugoNijhuis added 1 commit 2026-01-10 18:19:55 +00:00
Creates the /create-capability command that scaffolds new skills, commands,
and agents with:

- Interactive guidance questions for component selection
- Model selection recommendations based on task complexity
- Comprehensive validation before file creation:
  - Frontmatter validation (required fields, valid model, tools, skills)
  - Content validation (trigger conditions, step instructions, sections)
  - Convention checks (file names, directory structure, duplicates)
- Anti-pattern warnings with actionable recommendations
- Clear error messages for validation failures
- Option to proceed despite warnings

Closes #76
Also addresses #75 (dependency)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
Owner

AI Code Review

This is an automated review generated by the code-reviewer agent.

Summary

The /create-capability command is well-designed with comprehensive validation logic and interactive guidance. It follows the established command patterns and integrates cleanly with the capability-writing skill. The structure is clear and the validation approach is thorough.

Findings

Code Quality

  • Well-structured phases: The 6-phase process (Understand Intent → Gather Details → Model Selection → Generate and Validate → Present and Confirm → Create Files) provides clear progression through the workflow
  • Comprehensive validation tables: The tabular format for validation rules is excellent for clarity and maintainability
  • Strong anti-pattern detection: The anti-pattern warnings with actionable recommendations show thoughtful design
  • Clear error messaging: The validation error message table provides specific, actionable guidance

Potential Bugs

  • Directory creation timing: Step 12 creates directories before asking for approval in step 11. The approval question should come before any filesystem changes. Suggest reordering: approval (step 11) should come before file creation (steps 12-13).
  • Skill reference validation: The validation checks if skills exist for agent dependencies, but the actual file creation in step 13 doesn't show error handling if Write fails. Consider adding error handling for file operations.

Security Concerns

  • No security concerns identified. The command operates on local filesystem within the repo structure with no external input or privileged operations.

Style Notes

  • Frontmatter model: The model is set to 'sonnet' which aligns with recommendations for code generation commands
  • Skill reference: Correctly references @~/.claude/skills/capability-writing/SKILL.md at the top
  • Formatting consistency: Tables and code blocks are consistently formatted throughout
  • Markdown structure: Follows the pattern of other commands with clear sections and subsections

Test Coverage

  • This is a command file (not code), so traditional test coverage doesn't apply. However, consider:
    • The example session at the end serves as a usage specification
    • The validation logic tables serve as test specifications
    • Manual testing will be needed to verify the interactive guidance flow works as intended

Additional Observations

Strengths:

  • The model selection guidance table is excellent - provides clear rationale for each pattern
  • The validation is multi-layered (frontmatter, content, conventions, anti-patterns)
  • The example session demonstrates the full flow effectively
  • Addresses both issues #75 and #76 as noted in the PR description

Minor Suggestions:

  • Consider adding a note about testing the capability after creation (beyond "Next steps" in step 14)
  • The validation phase mentions "Show warnings but allow override" but step 9 shows this well with "Proceed with warnings? (y/n)"

Verdict

Needs Changes

The command is well-designed and nearly ready, but step ordering needs adjustment: approval must come before filesystem operations. Move step 11 (approval) before steps 12-13 (directory and file creation). This is a blocking issue as the current flow could create partial artifacts if the user declines after directories are created.

## AI Code Review > This is an automated review generated by the code-reviewer agent. ### Summary The /create-capability command is well-designed with comprehensive validation logic and interactive guidance. It follows the established command patterns and integrates cleanly with the capability-writing skill. The structure is clear and the validation approach is thorough. ### Findings #### Code Quality - **Well-structured phases**: The 6-phase process (Understand Intent → Gather Details → Model Selection → Generate and Validate → Present and Confirm → Create Files) provides clear progression through the workflow - **Comprehensive validation tables**: The tabular format for validation rules is excellent for clarity and maintainability - **Strong anti-pattern detection**: The anti-pattern warnings with actionable recommendations show thoughtful design - **Clear error messaging**: The validation error message table provides specific, actionable guidance #### Potential Bugs - **Directory creation timing**: Step 12 creates directories before asking for approval in step 11. The approval question should come before any filesystem changes. Suggest reordering: approval (step 11) should come before file creation (steps 12-13). - **Skill reference validation**: The validation checks if skills exist for agent dependencies, but the actual file creation in step 13 doesn't show error handling if Write fails. Consider adding error handling for file operations. #### Security Concerns - No security concerns identified. The command operates on local filesystem within the repo structure with no external input or privileged operations. #### Style Notes - **Frontmatter model**: The model is set to 'sonnet' which aligns with recommendations for code generation commands - **Skill reference**: Correctly references @~/.claude/skills/capability-writing/SKILL.md at the top - **Formatting consistency**: Tables and code blocks are consistently formatted throughout - **Markdown structure**: Follows the pattern of other commands with clear sections and subsections #### Test Coverage - This is a command file (not code), so traditional test coverage doesn't apply. However, consider: - The example session at the end serves as a usage specification - The validation logic tables serve as test specifications - Manual testing will be needed to verify the interactive guidance flow works as intended ### Additional Observations **Strengths:** - The model selection guidance table is excellent - provides clear rationale for each pattern - The validation is multi-layered (frontmatter, content, conventions, anti-patterns) - The example session demonstrates the full flow effectively - Addresses both issues #75 and #76 as noted in the PR description **Minor Suggestions:** - Consider adding a note about testing the capability after creation (beyond "Next steps" in step 14) - The validation phase mentions "Show warnings but allow override" but step 9 shows this well with "Proceed with warnings? (y/n)" ### Verdict **Needs Changes** The command is well-designed and nearly ready, but step ordering needs adjustment: approval must come before filesystem operations. Move step 11 (approval) before steps 12-13 (directory and file creation). This is a blocking issue as the current flow could create partial artifacts if the user declines after directories are created.
HugoNijhuis added 1 commit 2026-01-10 18:51:08 +00:00
- Made step 11 explicitly a gate before file creation
- Added explicit conditional ("If user declines/approves") flow
- Added note at Phase 6 start: "Only execute this phase after user approval"
- Added error handling notes for directory creation and file writes

The step ordering was already correct (approval step 11 before file creation
steps 12-13), but the flow is now more explicit about the conditional nature.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
Owner

AI Code Review - Follow-up

This is an automated review generated by the code-reviewer agent.

Summary

The PR successfully addresses the previous blocking issue. The approval gate now correctly precedes all filesystem operations, and the validation logic is comprehensive and well-structured.

Findings

Code Quality

  • Excellent phase-based structure with clear progression
  • Comprehensive validation tables covering frontmatter, content, conventions, and anti-patterns
  • Clear separation between approval (Phase 5) and file creation (Phase 6)
  • Step 11 approval gate explicitly states: "If user declines: Stop here"
  • Phase 6 header clearly states: "Only execute this phase after user approval in step 11"

Potential Bugs

  • No issues found
  • Error handling added for directory creation (step 12)
  • Error handling added for file writes (step 13)

Security Concerns

  • No security concerns identified
  • Operations are local filesystem only within repo structure

Style Notes

  • Consistent with other command files in the repository
  • Proper skill reference: @~/.claude/skills/capability-writing/SKILL.md
  • Model selection (sonnet) appropriate for code generation
  • Clear markdown formatting throughout

Test Coverage

  • Example session demonstrates full workflow effectively
  • Validation tables serve as specifications
  • Manual testing will verify interactive flow

Verdict

LGTM

All previous concerns have been addressed. The approval gate now correctly precedes filesystem operations, preventing partial artifact creation. The command is well-designed, thoroughly validated, and ready to merge.

## AI Code Review - Follow-up > This is an automated review generated by the code-reviewer agent. ### Summary The PR successfully addresses the previous blocking issue. The approval gate now correctly precedes all filesystem operations, and the validation logic is comprehensive and well-structured. ### Findings #### Code Quality - Excellent phase-based structure with clear progression - Comprehensive validation tables covering frontmatter, content, conventions, and anti-patterns - Clear separation between approval (Phase 5) and file creation (Phase 6) - Step 11 approval gate explicitly states: "If user declines: Stop here" - Phase 6 header clearly states: "Only execute this phase after user approval in step 11" #### Potential Bugs - No issues found - Error handling added for directory creation (step 12) - Error handling added for file writes (step 13) #### Security Concerns - No security concerns identified - Operations are local filesystem only within repo structure #### Style Notes - Consistent with other command files in the repository - Proper skill reference: @~/.claude/skills/capability-writing/SKILL.md - Model selection (sonnet) appropriate for code generation - Clear markdown formatting throughout #### Test Coverage - Example session demonstrates full workflow effectively - Validation tables serve as specifications - Manual testing will verify interactive flow ### Verdict **LGTM** All previous concerns have been addressed. The approval gate now correctly precedes filesystem operations, preventing partial artifact creation. The command is well-designed, thoroughly validated, and ready to merge.
HugoNijhuis closed this pull request 2026-01-10 22:44:40 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flowmade-one/architecture#82