-
Notifications
You must be signed in to change notification settings - Fork 0
Audit Spec
Ali Sadeghi edited this page Jan 20, 2026
·
2 revisions
Audits, generates, or compares specifications for existing KMP features.
Usage:
# Generate spec from existing code
/audit-spec login
# Compare existing spec with implementation (drift detection)
/audit-spec login --compare| Scenario | Use This? | Instead Use |
|---|---|---|
| Legacy feature without spec | Yes | - |
| Check spec-code consistency | Yes (--compare) | - |
| New feature creation | No |
creating-kmp-feature skill |
| Modifying existing feature | No |
modifying-kmp-feature skill |
Note: For SDD best practices, specs should be written BEFORE implementation. This command is for auditing existing code or documenting legacy features.
- Analyzes feature implementation in
feature/{name}/ - Extracts models, API contracts, state management, navigation
- Checks for existing PRD to preserve rationale/WHY sections
- Generates comprehensive specification
- Saves to
.claude/docs/{name}/spec.md
- Metadata with version tracking
- Goals and Non-Goals (TODO if not from PRD)
- Background & Rationale (from PRD or TODO)
- Design Decisions (from PRD or TODO)
- Data models with field descriptions
- API endpoints and contracts
- State management patterns
- Navigation routes and callbacks
- Test scenarios
Compares existing spec with current implementation:
/audit-spec login --compare- Summary of sync status by category
- Detailed drift findings with file locations
- Proposed spec updates in diff format
- Action checklist
## Spec Drift Report: login
| Category | Status |
|----------|--------|
| Data Models | ⚠️ 1 drift |
| State Management | ✅ In sync |
### Data Models Drift
**File:** `LoginDto.kt:15`
| Aspect | Spec Says | Code Has |
|--------|-----------|----------|
| Fields | 3 fields | 4 fields |
**Missing from spec:**
```kotlin
val rememberMe: Boolean
## Example Generated Spec
```markdown
# Login Specification
## Metadata
| Field | Value |
|-------|-------|
| Version | 1.0.0 |
| Status | Active |
## Purpose
User authentication with email/password login.
## Goals
- Enable secure user authentication
- Support remember me functionality
## Non-Goals
- Social login (future)
- Biometric authentication (future)
## Data Models
- LoginRequest: email, password, rememberMe
- LoginResponse: token, user
## State Management
- LoginUiState: Uninitialized | Loading | Success | Failed
## Navigation
- LoginRoute → onLoginSuccess: () -> Unit
Back to Commands