Commit d8930c9
committed
feat: standards-shaper now updates existing standards based on project
**Major Enhancement**: /standards-shaper intelligently updates existing standards
## Problem
Standards-shaper created generic standards that didn't match the project:
- ❌ Generic examples (Express when project uses Fastify)
- ❌ Wrong framework versions (React 17 when using React 18)
- ❌ Generic patterns not specific to project's tech stack
- ❌ Had to manually update all examples
- ❌ Standards became stale as project evolved
## Solution
standards-shaper now has two intelligent modes:
### Create Mode (No existing standards)
- Detects tech stack
- Generates standards with project-specific examples
- All examples match detected frameworks
### Update Mode (Existing standards found) ⭐ NEW
- Reads existing standard files
- Detects current tech stack
- Updates examples to match current stack
- Preserves structure and user customizations
- Adds project-specific patterns from codebase
## How It Works
**Update Process**:
```
1. Check: if [ -d "droidz/standards" ]; UPDATE mode
2. Detect: Find package.json, analyze imports, check configs
3. Read: Load each existing standard file
4. Update: Replace examples with project-specific ones
5. Report: Show what changed
```
**Example Update Flow**:
```markdown
Project detected: Express + TypeScript + Prisma + PostgreSQL
backend/api.md:
Before: Generic REST examples
After: Express + TypeScript + Prisma patterns
backend/database.md:
Before: Generic SQL
After: Prisma Client + PostgreSQL specific queries
frontend/components.md:
Before: React class components
After: React 18 hooks + Server Components
frontend/styling.md:
Before: CSS Modules examples
After: Tailwind CSS v4 patterns
```
## What Gets Updated
**All standards updated with project-specific patterns**:
- `error-handling.md` - Try-catch patterns from codebase
- `testing.md` - Jest/Vitest/Playwright from package.json
- `components.md` - React/Vue/Angular version-specific
- `styling.md` - Tailwind/styled-components/CSS Modules
- `state-management.md` - Redux/Zustand/Jotai patterns
- `api-design.md` - Express/Fastify/Hono/etc
- `database.md` - Prisma/TypeORM/Sequelize/Drizzle
- `authentication.md` - NextAuth/Passport/Lucia
## Benefits
**For Users**:
- ✅ Standards match actual tech stack
- ✅ Examples use real frameworks from project
- ✅ Can re-run to update when upgrading frameworks
- ✅ Standards evolve with project
- ✅ No manual updates needed
**For Teams**:
- ✅ New members see project-specific examples
- ✅ Standards reflect current architecture
- ✅ Consistency across codebase
- ✅ Framework upgrades reflected in standards
## Usage
```bash
# First time - creates standards
> /standards-shaper
AI: No standards found, creating...
AI: Detected Next.js 15 + React 18 + Prisma
✅ Created standards with Next.js 15 examples
# Later - after upgrading to React 19
> /standards-shaper
AI: Found existing standards, updating...
AI: Detected React 19 (upgraded from 18)
AI: Updating components.md with React 19 patterns...
✅ Updated standards to React 19
```
## Implementation Details
**Detection Logic**:
- Check for package.json dependencies
- Analyze import statements with Grep
- Read framework config files
- Identify versions and variants
**Update Logic**:
- Read existing standard structure
- Keep headings and organization
- Replace code examples with project-specific ones
- Add patterns found in codebase analysis
- Preserve any user customizations
**Intelligent Updates**:
- Only updates examples and patterns
- Preserves structure and explanations
- Maintains DO/DON'T sections
- Keeps user-added content
## Files Modified
- droid_cli/default/commands/standards-shaper.md (major update)
- claude/default/commands/standards-shaper.md (synced)
## Breaking Changes
None - backward compatible. Command works as before for new projects.
---
Closes #standards-update
Closes #project-specific-standards1 parent 89f693f commit d8930c9
File tree
6 files changed
+967
-52
lines changed- droidz_installer/payloads
- claude/default/commands
- droid_cli/default/commands
6 files changed
+967
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
150 | 237 | | |
151 | 238 | | |
152 | 239 | | |
| |||
Lines changed: 128 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
150 | 173 | | |
151 | 174 | | |
152 | 175 | | |
153 | 176 | | |
154 | 177 | | |
155 | 178 | | |
156 | | - | |
157 | | - | |
| 179 | + | |
| 180 | + | |
158 | 181 | | |
159 | 182 | | |
160 | 183 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
164 | 187 | | |
165 | 188 | | |
166 | | - | |
167 | | - | |
168 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
169 | 192 | | |
170 | 193 | | |
171 | 194 | | |
| |||
284 | 307 | | |
285 | 308 | | |
286 | 309 | | |
287 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
288 | 313 | | |
289 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
290 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
291 | 345 | | |
292 | 346 | | |
293 | 347 | | |
294 | | - | |
295 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
296 | 357 | | |
297 | 358 | | |
298 | 359 | | |
| |||
378 | 439 | | |
379 | 440 | | |
380 | 441 | | |
381 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
382 | 493 | | |
| 494 | + | |
383 | 495 | | |
384 | 496 | | |
385 | 497 | | |
| |||
0 commit comments