From 7742cf482b95ef1738504b1b0996d55a35edb489 Mon Sep 17 00:00:00 2001 From: Yvonne Devlin Date: Tue, 30 Jun 2026 15:21:30 +0000 Subject: [PATCH] fix: add missing name field to 7 scaffolded skill templates The 7 skill templates embedded in internal/agentkit/content/skills/ were missing the required name field in their YAML frontmatter. OpenCode's skill discovery requires both name and description fields to register a skill. Without name, skills scaffolded by replicator init were invisible to the skill tool. Add name: as the first frontmatter field in each SKILL.md template. Add TestSkillTemplates_HaveNameField regression test that walks the embedded filesystem and asserts every SKILL.md has a name field matching its directory name. Closes #28 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin --- internal/agentkit/agentkit_test.go | 63 +++++++++++++++++++ .../skills/always-on-guidance/SKILL.md | 1 + .../skills/forge-coordination/SKILL.md | 1 + .../content/skills/forge-global/SKILL.md | 1 + .../content/skills/learning-systems/SKILL.md | 1 + .../content/skills/replicator-cli/SKILL.md | 1 + .../content/skills/system-design/SKILL.md | 1 + .../content/skills/testing-patterns/SKILL.md | 1 + 8 files changed, 70 insertions(+) diff --git a/internal/agentkit/agentkit_test.go b/internal/agentkit/agentkit_test.go index 281020e..f8d59b2 100644 --- a/internal/agentkit/agentkit_test.go +++ b/internal/agentkit/agentkit_test.go @@ -1,6 +1,7 @@ package agentkit import ( + "io/fs" "os" "path/filepath" "strings" @@ -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: " 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: " 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) + } +} diff --git a/internal/agentkit/content/skills/always-on-guidance/SKILL.md b/internal/agentkit/content/skills/always-on-guidance/SKILL.md index 92950bc..70ed48e 100644 --- a/internal/agentkit/content/skills/always-on-guidance/SKILL.md +++ b/internal/agentkit/content/skills/always-on-guidance/SKILL.md @@ -1,4 +1,5 @@ --- +name: always-on-guidance description: Global coding rules and tool usage discipline tags: [always-on, coding, quality] --- diff --git a/internal/agentkit/content/skills/forge-coordination/SKILL.md b/internal/agentkit/content/skills/forge-coordination/SKILL.md index 4aad0ce..a0dcdd3 100644 --- a/internal/agentkit/content/skills/forge-coordination/SKILL.md +++ b/internal/agentkit/content/skills/forge-coordination/SKILL.md @@ -1,4 +1,5 @@ --- +name: forge-coordination description: Multi-agent coordination patterns for forge sessions tags: [forge, coordination, multi-agent] --- diff --git a/internal/agentkit/content/skills/forge-global/SKILL.md b/internal/agentkit/content/skills/forge-global/SKILL.md index f4067e4..f6d0dbe 100644 --- a/internal/agentkit/content/skills/forge-global/SKILL.md +++ b/internal/agentkit/content/skills/forge-global/SKILL.md @@ -1,4 +1,5 @@ --- +name: forge-global description: Cross-project forge coordination patterns tags: [forge, global, coordination] --- diff --git a/internal/agentkit/content/skills/learning-systems/SKILL.md b/internal/agentkit/content/skills/learning-systems/SKILL.md index b459c44..5533eed 100644 --- a/internal/agentkit/content/skills/learning-systems/SKILL.md +++ b/internal/agentkit/content/skills/learning-systems/SKILL.md @@ -1,4 +1,5 @@ --- +name: learning-systems description: How the forge learns from outcomes tags: [learning, forge, insights] --- diff --git a/internal/agentkit/content/skills/replicator-cli/SKILL.md b/internal/agentkit/content/skills/replicator-cli/SKILL.md index 1b9c1a9..66d3d02 100644 --- a/internal/agentkit/content/skills/replicator-cli/SKILL.md +++ b/internal/agentkit/content/skills/replicator-cli/SKILL.md @@ -1,4 +1,5 @@ --- +name: replicator-cli description: Replicator CLI quick reference tags: [cli, reference, replicator] --- diff --git a/internal/agentkit/content/skills/system-design/SKILL.md b/internal/agentkit/content/skills/system-design/SKILL.md index 693b2f5..3ad5f2c 100644 --- a/internal/agentkit/content/skills/system-design/SKILL.md +++ b/internal/agentkit/content/skills/system-design/SKILL.md @@ -1,4 +1,5 @@ --- +name: system-design description: System design principles for clean architecture tags: [design, architecture, principles] --- diff --git a/internal/agentkit/content/skills/testing-patterns/SKILL.md b/internal/agentkit/content/skills/testing-patterns/SKILL.md index 809e192..d6106eb 100644 --- a/internal/agentkit/content/skills/testing-patterns/SKILL.md +++ b/internal/agentkit/content/skills/testing-patterns/SKILL.md @@ -1,4 +1,5 @@ --- +name: testing-patterns description: Go testing patterns for the replicator project tags: [testing, go, patterns] ---