Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions internal/agentkit/agentkit_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package agentkit

import (
"io/fs"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -150,3 +151,65 @@ func TestScaffold_FileCount(t *testing.T) {
t.Errorf("agents = %d, want 3", agents)
}
}

func TestSkillTemplates_HaveNameField(t *testing.T) {
// Walk the embedded content filesystem and verify every SKILL.md
// has a "name: <directory-name>" field in its YAML frontmatter.
var checked int

err := fs.WalkDir(content, "content/skills", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() || d.Name() != "SKILL.md" {
return nil
}

data, readErr := content.ReadFile(path)
if readErr != nil {
t.Errorf("read %s: %v", path, readErr)
return nil
}

text := string(data)

// Extract directory name (e.g., "always-on-guidance" from
// "content/skills/always-on-guidance/SKILL.md").
dir := filepath.Dir(path)
dirName := filepath.Base(dir)

// Verify frontmatter delimiters exist.
if !strings.HasPrefix(text, "---\n") {
t.Errorf("%s: missing opening frontmatter delimiter", path)
return nil
}
endIdx := strings.Index(text[4:], "\n---")
if endIdx < 0 {
t.Errorf("%s: missing closing frontmatter delimiter", path)
return nil
}
frontmatter := text[4 : 4+endIdx]

// Check for "name: <dirName>" line.
wantLine := "name: " + dirName
found := false
for _, line := range strings.Split(frontmatter, "\n") {
if strings.TrimSpace(line) == wantLine {
found = true
break
}
}
if !found {
t.Errorf("%s: frontmatter missing %q", path, wantLine)
}

checked++
return nil
})
if err != nil {
t.Fatalf("walk embedded skills: %v", err)
}
if checked != 7 {
t.Errorf("checked %d skill templates, want 7", checked)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: always-on-guidance
description: Global coding rules and tool usage discipline
tags: [always-on, coding, quality]
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: forge-coordination
description: Multi-agent coordination patterns for forge sessions
tags: [forge, coordination, multi-agent]
---
Expand Down
1 change: 1 addition & 0 deletions internal/agentkit/content/skills/forge-global/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: forge-global
description: Cross-project forge coordination patterns
tags: [forge, global, coordination]
---
Expand Down
1 change: 1 addition & 0 deletions internal/agentkit/content/skills/learning-systems/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: learning-systems
description: How the forge learns from outcomes
tags: [learning, forge, insights]
---
Expand Down
1 change: 1 addition & 0 deletions internal/agentkit/content/skills/replicator-cli/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: replicator-cli
description: Replicator CLI quick reference
tags: [cli, reference, replicator]
---
Expand Down
1 change: 1 addition & 0 deletions internal/agentkit/content/skills/system-design/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: system-design
description: System design principles for clean architecture
tags: [design, architecture, principles]
---
Expand Down
1 change: 1 addition & 0 deletions internal/agentkit/content/skills/testing-patterns/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
name: testing-patterns
description: Go testing patterns for the replicator project
tags: [testing, go, patterns]
---
Expand Down