@@ -3,7 +3,7 @@ package markdown
33import (
44 "testing"
55
6- "github.com/goccy/go- yaml"
6+ "gopkg.in/ yaml.v3 "
77)
88
99func TestCommandFrontMatter_Marshal (t * testing.T ) {
@@ -20,27 +20,31 @@ func TestCommandFrontMatter_Marshal(t *testing.T) {
2020 {
2121 name : "command with standard id, name, description" ,
2222 command : CommandFrontMatter {
23- ID : "cmd-123" ,
24- Name : "Standard Command" ,
25- Description : "This is a standard command with metadata" ,
23+ BaseFrontMatter : BaseFrontMatter {
24+ URN : "urn:agents:command:standard" ,
25+ Name : "Standard Command" ,
26+ Description : "This is a standard command with metadata" ,
27+ },
2628 },
27- want : `id: cmd-123
29+ want : `id: urn:agents:command:standard
2830name: Standard Command
2931description: This is a standard command with metadata
3032` ,
3133 },
3234 {
3335 name : "command with expand false" ,
3436 command : CommandFrontMatter {
35- ID : "cmd-456" ,
36- Name : "No Expand Command" ,
37- Description : "Command with expansion disabled" ,
37+ BaseFrontMatter : BaseFrontMatter {
38+ URN : "urn:agents:command:no-expand" ,
39+ Name : "No Expand Command" ,
40+ Description : "Command with expansion disabled" ,
41+ },
3842 ExpandParams : func () * bool {
3943 b := false
4044 return & b
4145 }(),
4246 },
43- want : `id: cmd-456
47+ want : `id: urn:agents:command:no-expand
4448name: No Expand Command
4549description: Command with expansion disabled
4650expand: false
@@ -49,15 +53,17 @@ expand: false
4953 {
5054 name : "command with selectors" ,
5155 command : CommandFrontMatter {
52- ID : "cmd-789" ,
53- Name : "Selector Command" ,
54- Description : "Command with selectors" ,
56+ BaseFrontMatter : BaseFrontMatter {
57+ URN : "urn:agents:command:selector" ,
58+ Name : "Selector Command" ,
59+ Description : "Command with selectors" ,
60+ },
5561 Selectors : map [string ]any {
5662 "database" : "postgres" ,
5763 "feature" : "auth" ,
5864 },
5965 },
60- want : `id: cmd-789
66+ want : `id: urn:agents:command:selector
6167name: Selector Command
6268description: Command with selectors
6369selectors:
@@ -89,27 +95,31 @@ func TestCommandFrontMatter_Unmarshal(t *testing.T) {
8995 }{
9096 {
9197 name : "command with standard id, name, description" ,
92- yaml : `id: cmd-abc
98+ yaml : `id: urn:agents:command:named
9399name: Named Command
94100description: A command with standard fields
95101` ,
96102 want : CommandFrontMatter {
97- ID : "cmd-abc" ,
98- Name : "Named Command" ,
99- Description : "A command with standard fields" ,
103+ BaseFrontMatter : BaseFrontMatter {
104+ URN : "urn:agents:command:named" ,
105+ Name : "Named Command" ,
106+ Description : "A command with standard fields" ,
107+ },
100108 },
101109 },
102110 {
103111 name : "command with expand false" ,
104- yaml : `id: cmd-def
112+ yaml : `id: urn:agents:command:no-expand
105113name: No Expand
106114description: No expansion
107115expand: false
108116` ,
109117 want : CommandFrontMatter {
110- ID : "cmd-def" ,
111- Name : "No Expand" ,
112- Description : "No expansion" ,
118+ BaseFrontMatter : BaseFrontMatter {
119+ URN : "urn:agents:command:no-expand" ,
120+ Name : "No Expand" ,
121+ Description : "No expansion" ,
122+ },
113123 ExpandParams : func () * bool {
114124 b := false
115125 return & b
@@ -118,17 +128,19 @@ expand: false
118128 },
119129 {
120130 name : "command with selectors" ,
121- yaml : `id: cmd-ghi
131+ yaml : `id: urn:agents:command:selector
122132name: Selector Command
123133description: Has selectors
124134selectors:
125135 database: postgres
126136 feature: auth
127137` ,
128138 want : CommandFrontMatter {
129- ID : "cmd-ghi" ,
130- Name : "Selector Command" ,
131- Description : "Has selectors" ,
139+ BaseFrontMatter : BaseFrontMatter {
140+ URN : "urn:agents:command:selector" ,
141+ Name : "Selector Command" ,
142+ Description : "Has selectors" ,
143+ },
132144 Selectors : map [string ]any {
133145 "database" : "postgres" ,
134146 "feature" : "auth" ,
@@ -149,8 +161,8 @@ selectors:
149161 }
150162
151163 // Compare fields individually
152- if got .ID != tt .want .ID {
153- t .Errorf ("ID = %q, want %q" , got .ID , tt .want .ID )
164+ if got .URN != tt .want .URN {
165+ t .Errorf ("URN = %q, want %q" , got .URN , tt .want .URN )
154166 }
155167 if got .Name != tt .want .Name {
156168 t .Errorf ("Name = %q, want %q" , got .Name , tt .want .Name )
0 commit comments