Add Rule
Implement the rule specified in $ARGUMENTS.
Steps
- •
Create a worktree for the rule:
bashgit worktree add .worktrees/sass-lint-N-<rule-name> \ -b feat/sass-lint-N-<rule-name> <parent> cd .worktrees/sass-lint-N-<rule-name> pnpm install gt track
Replace
Nwith the GitHub issue number,<rule-name>with the kebab-case rule name, and<parent>with the parent branch (mainfor the first rule in a phase, or the previous rule's branch when stacking). - •
Read the rule spec from
docs/plan/rules/design/sass-<rule-name>.md - •
Write the test file first at
src/rules/<rule-name>/index.test.tsusing the BAD/GOOD cases from the spec as acceptance criteria - •
Implement the rule at
src/rules/<rule-name>/index.tsfollowing the pattern indocs/plan/01-architecture.md - •
Add TSDoc comments to the rule's exported function,
ruleName,messages, andmetaobjects. Include@exampleshowing a BAD case that triggers the rule. - •
Register the rule in
src/index.ts - •
Add the rule to
src/recommended.tswith its default setting from the spec - •
Add a BAD example to
src/__tests__/fixtures/invalid.sasswith a// sass/<rule-name>comment above it - •
Write user-facing documentation at
docs/rules/<rule-name>.md— include description, default severity, options (if any), and BAD/GOOD examples from the spec. This ships with the rule, not as a separate task. - •
Run
pnpm check— all tests must pass - •
If any step fails due to an issue outside the rule's scope (infrastructure bug, tooling failure, dependency problem, etc.):
- •Stop immediately — do not attempt an inline workaround
- •Report back with: what failed, the error message, and a proposed GitHub issue describing the problem and fix actions
- •Wait for the issue to be resolved before continuing
- •This prevents scope creep and avoids duplicate work when multiple agents hit the same blocker
- •
Commit:
git add -A git commit -m "feat(#N): add sass/<rule> rule" -m "Closes #N"