You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,10 @@ user to resolve it.
9
9
10
10
Rules:
11
11
12
-
- Ask all foreseeable clarifying questions upfront in a single batch before work begins.
12
+
- When there are multiple clarifying questions to ask, ask them **one at a time**, in order of
13
+
dependency (earlier answers may resolve later questions). Wait for the answer before asking the
14
+
next question. This allows the user to discuss each point in depth without being overwhelmed by
15
+
a wall of questions.
13
16
- If new ambiguities emerge during execution that were not foreseeable upfront, pause and ask
14
17
follow-up questions before proceeding past that decision point.
15
18
- For high-stakes decisions (architecture, scope, data model, API shape, behaviour changes) always
@@ -19,6 +22,9 @@ Rules:
19
22
visible so the user can correct it.
20
23
- There must be no silent interpretation or interpolation of under-specified tasks. If something is
21
24
unclear, ask. Do not guess and proceed.
25
+
- For multi-phase implementations, **never start the next phase without an explicit go-ahead from
26
+
the user**. After completing a phase, summarise what was done and wait for confirmation before
27
+
proceeding.
22
28
23
29
When generating a new CLAUDE.md for a repository, include this clarification policy verbatim as a
24
30
preamble before all other content.
@@ -48,6 +54,20 @@ composer update
48
54
49
55
Tests write generated PHP classes to `sys_get_temp_dir()/PHPModelGeneratorTest/Models/` and dump failed classes to `./failed-classes/` (auto-cleaned on bootstrap).
50
56
57
+
### Running the full test suite
58
+
59
+
When running the full test suite, always save output to a file so the complete
60
+
output is available for analysis without re-running. Use `--display-warnings` to capture warning
61
+
details and `--no-coverage` to skip slow coverage collection:
- Uses `PropertyProcessorFactory` to instantiate the correct processor by JSON type (String, Integer, Number, Boolean, Array, Object, Null, Const, Any, Reference)
76
-
-Convention: processor class name is `PHPModelGenerator\PropertyProcessor\Property\{Type}Processor`
95
+
- Uses `PropertyFactory` (`src/PropertyProcessor/PropertyFactory.php`) to create and configure each property
96
+
-`PropertyFactory` resolves `$ref` references, delegates `object` types to `processSchema`, and for all other types constructs a `Property` directly and applies Draft modifiers
-**`Model/Validator/Factory/`** — `AbstractValidatorFactory` subclasses keyed to schema keywords (e.g. `MinLengthPropertyValidatorFactory` for `minLength`); run as modifiers when a matching key exists in the schema
108
+
109
+
`PropertyFactory::applyDraftModifiers` resolves `getCoveredTypes($type)` (which always includes `'any'`) and runs every modifier for each covered type in order.
@@ -131,6 +161,10 @@ property, duplicate property names with unresolvable type conflicts, and any oth
131
161
that cannot produce a correct PHP model. Fail loudly at generation time so the developer sees the
132
162
problem immediately rather than receiving silently incorrect generated code.
133
163
164
+
### Reading files
165
+
166
+
Always use the dedicated `Read` tool to read file contents. Never use `sed`, `head`, `tail`, `cat`, or `awk` to read or extract portions of files. The `Read` tool supports `offset` and `limit` parameters for reading partial files when needed.
167
+
134
168
### PHP import style
135
169
136
170
Always add `use` imports for every class referenced in a file, including global PHP classes such as
0 commit comments