agentleFS
ci4meci4me/CQRSTemplate/.claude/skills/property-addition/SKILL.md

property-addition

Skill0 starsChanged 6 months agoMITView on GitHub

Adds a new property/field/column to an existing domain entity, updating all 20+ required files (value object, entity, commands, handlers, repository, migration, database, views, tests). Use when user requests to add field, new column, entity property, or update existing entity with new attribute.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default value (if any)

    line 20
  2. Distinctive:

    No validation beyond type

    line 33
  3. Very specific:

    Use ddd-specialist + php-specialist to create value object following Cookie value object patterns.

    line 43
  4. Distinctive:

    Add setter if mutable

    line 56
  5. Distinctive:

    Add column with proper type, constraints, defaults.

    line 97
  6. Distinctive:

    create.php (add form field)

    line 110
  7. Distinctive:

    Use Bootstrap 5 with validation feedback.

    line 115
  8. Distinctive:

    Test factory (add to defaults)

    line 129
  9. Very specific:

    Follow checklist in .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md

    line 153

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Property Addition Skill

Automates adding a property to an existing entity across all layers.


Step 1: Gather Information

Ask user:

  1. Domain name (e.g., Cookie)
  2. Property name (camelCase, e.g., flavor, isGlutenFree)
  3. Property type (string, int, bool, float)
  4. Validation rules (min/max, required, format)
  5. Default value (if any)

Step 2: Decide Value Object vs. Simple Property

Create Value Object if:

  • Has validation rules (min/max, format, regex)
  • Has business logic
  • Represents domain concept

Use Simple Property if:

  • Simple boolean flag
  • No validation beyond type

Invoke ddd-specialist for guidance if unsure.


Step 3: Create Value Object (If Needed)

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 1

Use ddd-specialist + php-specialist to create value object following Cookie value object patterns.


Step 4: Update Entity

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 2

Update:

  • Constructor
  • create() method
  • reconstitute() method
  • Add getter
  • Add setter if mutable

Invoke: ddd-specialist + clean-code-specialist


Step 5: Update Commands and Handlers

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 3

Update:

  • CreateCommand (add property)
  • CreateHandler (convert to value object, pass to entity)
  • UpdateCommand (add property)
  • UpdateHandler (convert to value object, pass to entity)

Invoke: cqrs-specialist + clean-code-specialist


Step 6: Update Repository

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 4

Update:

  • Model $allowedFields
  • Repository save() method
  • Repository toDomainEntity() method with proper array shape

Invoke: phpstan-specialist for array shape validation


Step 7: Create Migration

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 5

php spark make:migration Add{Property}To{Entities}Table

Add column with proper type, constraints, defaults.

Run: php spark migrate

Invoke: codeigniter4-specialist


Step 8: Update Views

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 6

Update:

  • create.php (add form field)
  • edit.php (add form field with old value)
  • show.php (display value)
  • index.php (if shown in list)

Use Bootstrap 5 with validation feedback.


Step 9: Create/Update Tests

Reference: .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md Step 7

Create/update:

  • Value object test (if created)
  • Entity test (test new property)
  • Handler tests (test with new property)
  • Repository test (test persistence)
  • Feature test (test form submission)
  • Test factory (add to defaults)

Invoke: test-specialist to ensure 90% coverage maintained


Step 10: Validate Quality

Run checks:

vendor/bin/phpstan analyse --level=8
vendor/bin/phpcs
vendor/bin/phpunit --coverage-text

Invoke in sequence:

  1. phpstan-specialist (0 errors required)
  2. slevomat-specialist (0 violations required)
  3. test-specialist (90%+ coverage required)

Completion Checklist

Follow checklist in .claude/documentation/PROPERTY_ADDITION_PROTOCOL.md

Minimum 20+ files modified:

  • Value object created (if needed)
  • Entity updated
  • Commands updated (2)
  • Handlers updated (2)
  • Repository updated
  • Model updated
  • Migration created and run
  • Views updated (3-4)
  • Tests updated (6-8)
  • Factory updated
  • All quality checks passing

Report completion with file count and quality metrics.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.