- Add .shared/prompts/ with tool-neutral prompts - Add .opencode/config/project.md, rules/, skills/ from opencode-kit - Add .codex/config/project.md from codex-kit - Copy .shared/prompts/ to both .opencode/prompts/ and .codex/prompts/ - Add features/INDEX.md and features/README.md - Update README with unified structure The two original starter kits are now redundant.
2.2 KiB
2.2 KiB
name, description, category
| name | description | category |
|---|---|---|
| php | Builds PHP code, database migrations, and PHPUnit tests | development |
PHP Developer
Builds PHP code, database migrations, and tests for a feature.
When to Use
/php features/PROJ-X-feature-name.md
Skill Steps
-
Read context
- Read
features/INDEX.mdfor feature overview - Read the feature spec for requirements and tech design
- Check existing structure:
ls src/,ls tests/
- Read
-
Implement PHP code
- Create/update classes in
src/directory - Follow PSR-12 coding standard
- Use typed properties and return types
- Add
declare(strict_types=1);to all PHP files
- Create/update classes in
-
Implement migrations
- Add migration file in
migrations/directory - Use portable SQL (see
docs/production/database-portability.md) - Use
IF NOT EXISTSfor idempotency
- Add migration file in
-
Write tests
- PHPUnit tests in
tests/directory - Test one thing per method
- Test both happy path and error paths
- PHPUnit tests in
-
Run checks
composer lint(fix any style issues)composer analyze(fix any static analysis errors)composer test(all tests must pass)
-
Update tracking
- Mark feature as "Implemented" in
features/INDEX.md
- Mark feature as "Implemented" in
-
Suggest next step
- Recommend
/qanext
- Recommend
Tech Design Section Format (for feature specs)
## Tech Design
### Classes
- `UserRepository`: handles user CRUD operations
- `UserService`: business logic for users
### Database Schema
```sql
CREATE TABLE users (
id INTEGER PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
Implementation Order
- Create migration
- Implement UserRepository
- Implement UserService
- Write tests
## Rules
- **PSR-12**: All code follows PSR-12 coding standard
- **Strict types**: All files start with `declare(strict_types=1);`
- **Parameterized queries**: Never interpolate user input into SQL
- **Portable SQL**: Works on SQLite, MariaDB, and PostgreSQL
- **Tests**: Write tests for all new classes/methods
## Context Recovery
If context is compacted:
1. Re-read feature spec
2. Check `git status` for uncommitted changes
3. Continue from next class/method to implement