Skip to content

Commit 9dba609

Browse files
synthableclaude
andcommitted
feat: update shape contracts to UMS v1.0 specification
- Update STANDARD_SHAPE_SPECS to match UMS v1.0 specification exactly - Add new standard shapes: procedural-specification, pattern-specification, playbook - Ensure shape contract validation follows the official specification - Part of CLI v2.0 implementation for UMS v1.0 compliance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 63563a8 commit 9dba609

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

packages/ums-lib/src/constants.ts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
export const MODULES_ROOT = 'instructions-modules';
6-
export const MODULE_FILE_EXTENSION = '.md';
6+
export const MODULE_FILE_EXTENSION = '.module.yml';
77

88
// Default render order for directives
99
export const RENDER_ORDER = [
@@ -37,37 +37,48 @@ export const STANDARD_SHAPES = [
3737
'pattern',
3838
'checklist',
3939
'data',
40-
'rule',
40+
'procedural-specification',
41+
'pattern-specification',
42+
'playbook',
4143
] as const;
4244
export type StandardShape = (typeof STANDARD_SHAPES)[number];
4345

44-
// Module ID validation regex
45-
export const ID_REGEX = /^[a-z0-9]+(?:\/[a-z0-9-]+)*$/;
46+
// Module ID validation regex (UMS v1.0 compliant)
47+
export const MODULE_ID_REGEX =
48+
/^(foundation|principle|technology|execution)\/(?:[a-z0-9-]+(?:\/[a-z0-9-]+)*\/[a-z0-9][a-z0-9-]*|[a-z0-9][a-z0-9-]*)$/;
4649

47-
// Standard shape directive specifications
50+
// Standard shape directive specifications (UMS v1.0 compliant)
4851
export const STANDARD_SHAPE_SPECS = {
4952
procedure: {
50-
required: ['goal', 'process', 'constraints'] as string[],
51-
optional: ['principles', 'criteria'] as string[],
53+
required: ['goal', 'process'] as string[],
54+
optional: ['examples', 'data'] as string[],
5255
},
5356
specification: {
54-
required: ['goal', 'principles'] as string[],
55-
optional: ['constraints', 'criteria'] as string[],
57+
required: ['goal', 'constraints'] as string[],
58+
optional: ['examples', 'data'] as string[],
5659
},
5760
pattern: {
5861
required: ['goal', 'principles'] as string[],
59-
optional: ['constraints', 'criteria'] as string[],
62+
optional: ['constraints', 'examples', 'data'] as string[],
6063
},
6164
checklist: {
6265
required: ['goal', 'criteria'] as string[],
63-
optional: ['principles', 'constraints'] as string[],
66+
optional: ['examples', 'data'] as string[],
6467
},
6568
data: {
6669
required: ['goal', 'data'] as string[],
67-
optional: ['principles'] as string[],
70+
optional: ['examples'] as string[],
6871
},
69-
rule: {
70-
required: ['goal', 'constraints'] as string[],
71-
optional: ['principles'] as string[],
72+
'procedural-specification': {
73+
required: ['goal', 'process', 'constraints'] as string[],
74+
optional: ['examples', 'data'] as string[],
75+
},
76+
'pattern-specification': {
77+
required: ['goal', 'principles', 'constraints'] as string[],
78+
optional: ['examples', 'data'] as string[],
79+
},
80+
playbook: {
81+
required: ['goal', 'process', 'constraints', 'criteria'] as string[],
82+
optional: ['principles', 'examples', 'data'] as string[],
7283
},
7384
};

0 commit comments

Comments
 (0)