feat: Add automated constitution compliance enforcement - #627
Conversation
- Add Article XIV: UI Kit Library Principle with mandatory UI component usage rules - Translate all remaining Chinese content in constitution.md to English - Update "Last Amended" date to 2026-02-11 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ion compliance Create new Claude Code skill that automatically enforces project constitution principles during feature implementation. Key features: - Requirements clarity check before implementation starts - Integrates with brainstorming skill for unclear requirements - Enforces UI Kit Library usage with component verification - Mandates test coverage (Service ≥90%, Provider ≥85%, Overall ≥80%) - Automates testing execution (unit tests + screenshot tests) - Runs code formatting (dart format) and analysis (flutter analyze) - Validates architecture compliance (layer separation, error handling) - Provides decision trees and examples for common scenarios The skill automatically triggers on keywords like 實作, 創建, 新增, 開發, 修改, 重構, 修正, etc., ensuring consistent adherence to constitution without manual reminders. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Review Summary by QodoAdd implement-feature-with-checks skill and UI Kit Library principle to constitution
WalkthroughsDescription• Add new implement-feature-with-checks skill for automated constitution compliance enforcement • Implement comprehensive workflow with 6 phases: planning, UI verification, implementation, testing, code quality, and verification • Add Article XIV defining mandatory UI Kit Library usage rules with component verification process • Translate constitution.md to English for broader team accessibility Diagramflowchart LR
A["User Request<br/>with Keywords"] -->|Triggers| B["implement-feature-with-checks<br/>Skill"]
B -->|Phase 1| C["Constitution Review<br/>& Planning"]
C -->|Requirements Clear?| D{Decision}
D -->|No| E["Stop & Suggest<br/>Brainstorming"]
D -->|Yes| F["Phase 2: UI Kit<br/>Verification"]
F -->|Component Missing?| G{Decision}
G -->|Yes| H["Stop & Ask User"]
G -->|No| I["Phase 3-6:<br/>Implementation,<br/>Testing, Quality"]
I -->|All Pass| J["✅ Compliance<br/>Verified"]
E -.->|After Clarification| B
H -.->|User Decision| I
File Changes1. .claude/skills/implement-feature-with-checks/SKILL.md
|
Code Review by Qodo
1. UI kit rule violates repo
|
| **Section 14.2: Import Specification** | ||
|
|
||
| Use the unified import approach: | ||
|
|
||
| ```dart | ||
| // ✅ Correct | ||
| import 'package:ui_kit_library/ui_kit.dart'; | ||
|
|
||
| // ❌ Wrong: Don't use subpath imports | ||
| import 'package:ui_kit_library/src/components/button.dart'; | ||
| ``` |
There was a problem hiding this comment.
1. Ui kit rule violates repo 🐞 Bug ⛯ Reliability
New Article XIV forbids ui_kit_library subpath imports, but the repository currently contains multiple such imports. Merging this change makes the repo instantly non-compliant with the constitution’s new rule.
Agent Prompt
### Issue description
Article XIV bans `package:ui_kit_library/src/...` imports, but the codebase already uses them (e.g., accessibility utilities). This makes the repo non-compliant immediately after merging the constitution update.
### Issue Context
Some `ui_kit_library` APIs may not be exported from `ui_kit.dart`, forcing subpath imports. If so, the constitution needs an explicit exception/scope clarification.
### Fix Focus Areas
- constitution.md[1139-1149]
- lib/demo/wcag_analysis_demo.dart[16-19]
- test/accessibility/widget_accessibility_test.dart[14-19]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
- Update Last Amended date to 2026-02-11 in constitution header for consistency - Allow ui_kit_library subpath imports when APIs are not exported from ui_kit.dart (e.g., accessibility utilities, foundation modules) - Change dart format rule from "only on modified files" to "dart format ." for consistent formatting across project - Update implement-feature-with-checks skill to use "dart format ." instead of specific feature directories These changes address three issues raised in PR #627 code review: 1. Resolved subpath import restriction conflict with existing accessibility code 2. Fixed Last Amended date mismatch between header and footer 3. Unified dart format command to format entire project Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update constitution and implement-feature-with-checks skill to include AppSurface in the common UI Kit components list. Changes: - Add AppSurface as the recommended container component - Note: Use AppSurface instead of Container for consistent styling - Update both constitution.md Article XIV and skill documentation This ensures developers and AI agents prioritize AppSurface over standard Container widgets for UI consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
AustinChangLinksys
left a comment
There was a problem hiding this comment.
looks good to me
Summary
implement-feature-with-checksskill that automatically enforces project constitution principles during feature implementationKey Features
The new skill provides automated enforcement of:
Behavior
Test Plan
🤖 Generated with Claude Code