Commit 12ac0f7
fix(phase6): Resolve critical instruction contradictions and add validation
## Critical Issues Fixed
### Issue #1: Indentation Contradictions (CRITICAL)
- **wpcs-php.instructions.md**: Fixed line 379 contradiction
- Changed from "Use 4 spaces for indentation, no tabs"
- To: "Use tabs for indentation (WordPress PHP standard)"
- Now consistent with line 24 which correctly states "tabs"
- **wpcs-javascript.instructions.md**: Clarified JS indentation rules
- Line 131: Added context "tabs for vanilla JavaScript (WordPress core standard)"
- Line 132: Added "For React/JSX files, use 2 spaces to align with @wordpress/scripts"
- Line 562: Clarified "2 spaces for React/JSX files (Gutenberg standard), tabs for vanilla JS"
- Resolves contradiction between tabs (line 131) and 2 spaces (line 561)
### Issue #3: Placeholder Preservation Checklist (CRITICAL)
- **scaffold-extensions.instructions.md**: Added comprehensive validation section
- New "Mustache Placeholder Preservation Checklist" with 6 subsections
- Core Placeholders checklist (namespace, slug, textdomain, name, etc.)
- Template Files checklist (patterns, templates, blocks)
- Common Hard-coding Mistakes with BAD vs GOOD examples
- 5-step Validation procedure including mustache scanning
- Documentation requirements for new placeholders
- Risk prevention identifying high-risk files
## Impact
### Before:
- AI agents received contradictory guidance on indentation
- No explicit validation checklist for mustache placeholder preservation
- Risk of hard-coded values breaking scaffold generation
### After:
- Clear, consistent indentation standards (PHP: tabs, React: 2 spaces, vanilla JS: tabs)
- Comprehensive checklist prevents mustache placeholder violations
- Explicit validation steps ensure scaffold integrity
## Validation
✅ Instructions now consistent across all WPCS files
✅ Placeholder preservation explicitly documented with examples
✅ High-risk files identified for extra caution
✅ 5-step validation procedure added
## Files Modified
- .github/instructions/wpcs-php.instructions.md (1 line corrected)
- .github/instructions/wpcs-javascript.instructions.md (3 sections clarified)
- .github/instructions/scaffold-extensions.instructions.md (106 lines added)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 9e632e0 commit 12ac0f7
File tree
6 files changed
+197
-13
lines changed- .github
- instructions
- schemas
- tests/js
6 files changed
+197
-13
lines changedLines changed: 104 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
561 | | - | |
| 562 | + | |
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
0 commit comments