Merge and Replacement¶
Choose operation from intent, not convenience.
| Intent | Form | Guidance |
|---|---|---|
| Add or merge content | @extend path { ... } | Preferred additive operation |
| Replace one direct regular field in an extension | field!: value | Compatibility form from syntax 1.3 |
| Replace one complete existing block or nested value | @override path { ... } | Preferred explicit replacement in syntax 1.6 |
Add with @extend¶
@extend standards {
testing: ["Require integration tests"]
}
Arrays deduplicate and append according to block merge policy. Objects merge recursively.
Compatibility Replacement with field!¶
@extend standards {
testing!: ["Use Vitest"]
}
field! replaces one direct regular field. It can create a missing field and does not support every nested target or skill property.
Atomic Replacement with @override¶
@meta { id: "replacement" syntax: "1.5.0" }
@standards {
testing: ["Use Jest", "Use Mocha"]
coverage: { minimum: 80 report: "text" }
}
@override standards.testing {
["Use Vitest"]
}
@override standards.coverage.minimum {
95
}
@override requires the complete target path to exist when operation runs. It replaces that target as one atomic value.
Failure Cases¶
- Missing target: resolution error.
- Traversal through scalar value: resolution error.
- Attempt to change sealed skill property: resolution error.
- Replacement before target declaration: resolution error.
- Syntax below 1.6: PS018 upgrade warning.
Enterprise Guidance¶
- Prefer
@extendfor additive team customization. - Prefer
@overridefor auditable replacement intent. - Keep
field!only where compatibility or concise direct replacement matters. - Place replacement near rationale and after target declaration.
- Review generated output for every configured target.