add-feature
Original:🇺🇸 English
Translated
Add new features to Syncpack including commands and validation logic. Use when implementing new CLI commands, adding InstanceState variants, or extending version group behaviour.
1installs
Sourcejamiemason/syncpack
Added on
NPX Install
npx skill4agent add jamiemason/syncpack add-featureTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Add Feature
Guide for adding new functionality to Syncpack.
Quick Decision
What are you adding?
- New CLI command (lint, fix, format, etc.) → See adding-command.md
- New validation logic (InstanceState variant) → See adding-instance-state.md
- Both → Start with instance state, then add command
Prerequisites
Before adding any feature:
- Understand the 3-phase pattern: Create Context → Inspect Context → Run Command
- Know which phase your feature affects
- Check if similar code exists (use )
ast-grep -p 'PATTERN' src/
Feature Types
Commands
Commands are user-facing operations (, , etc.).
syncpack lintsyncpack fixWhen to create a new command:
- New user-facing operation that doesn't fit existing commands
- Different output format or behaviour needed
Registration points (all three required):
- - Add to
src/cli.rsenumSubcommand - - Add match arm for dispatch
src/main.rs - - Implement
src/commands/*.rspub fn run(ctx: Context) -> i32
→ Full guide: adding-command.md
Instance States
InstanceState variants describe validation results (valid, fixable, unfixable, suspect).
When to add a new state:
- New validation rule needed
- New type of error/warning to report
- New auto-fix capability
Location: +
src/instance_state.rssrc/visit_packages/*.rs→ Full guide: adding-instance-state.md
Common Workflow
- Write failing test using TestBuilder
- Implement minimal code to pass
- Run and fix warnings
cargo clippy - Refactor if needed
- Update documentation
Checklist
Before submitting:
- Tests pass ()
just test - Zero clippy warnings
- Follows existing patterns
- Registered in all required places (for commands)
- Uses TDD approach