@@ -58,9 +58,8 @@ func New(opts ...Option) *Context {
5858 return c
5959}
6060
61- // generateIDFromPath generates an ID from a file path by extracting the filename without extension.
62- // Used to auto-set ID fields in frontmatter when not explicitly provided.
63- func generateIDFromPath (path string ) string {
61+ // nameFromPath returns the filename without extension. Used to default Name in frontmatter when omitted.
62+ func nameFromPath (path string ) string {
6463 baseName := filepath .Base (path )
6564 ext := filepath .Ext (baseName )
6665 return strings .TrimSuffix (baseName , ext )
@@ -138,10 +137,8 @@ func (cc *Context) findTask(taskName string) error {
138137 if err != nil {
139138 return fmt .Errorf ("failed to parse task file %s: %w" , path , err )
140139 }
141-
142- // Automatically set ID to filename (without extension) if not set in frontmatter
143- if frontMatter .ID == "" {
144- frontMatter .ID = generateIDFromPath (path )
140+ if frontMatter .Name == "" {
141+ frontMatter .Name = nameFromPath (path )
145142 }
146143
147144 // Extract selector labels from task frontmatter and add them to cc.includes.
@@ -243,10 +240,8 @@ func (cc *Context) findCommand(commandName string, params taskparser.Params) (st
243240 if err != nil {
244241 return fmt .Errorf ("failed to parse command file %s: %w" , path , err )
245242 }
246-
247- // Automatically set ID to filename (without extension) if not set in frontmatter
248- if frontMatter .ID == "" {
249- frontMatter .ID = generateIDFromPath (path )
243+ if frontMatter .Name == "" {
244+ frontMatter .Name = nameFromPath (path )
250245 }
251246
252247 // Extract selector labels from command frontmatter and add them to cc.includes.
@@ -535,10 +530,8 @@ func (cc *Context) findExecuteRuleFiles(ctx context.Context, homeDir string) err
535530 if err != nil {
536531 return fmt .Errorf ("failed to parse markdown file %s: %w" , path , err )
537532 }
538-
539- // Automatically set ID to filename (without extension) if not set in frontmatter
540- if frontmatter .ID == "" {
541- frontmatter .ID = generateIDFromPath (path )
533+ if frontmatter .Name == "" {
534+ frontmatter .Name = nameFromPath (path )
542535 }
543536
544537 // Expand parameters only if expand is not explicitly set to false
0 commit comments