Files
archie/internal/skill/frontmatter_test.go
T
sam f6d51416f0 chore: replace 607 em-dashes with double hyphens project-wide
Includes MCP crash-after-init test fix (crash moved from handle() to serve()
entry point so transport sees immediate subprocess death).
2026-07-26 09:53:33 +10:00

41 lines
1.1 KiB
Go

package skill
import "testing"
// ── regression: Gap 8 -- frontmatter missing plugins key ─────────────
func TestFrontmatterMetadataArchieHasPluginsField(t *testing.T) {
// Gap 8: Frontmatter.Metadata.Archie has Tools and Engine only.
// PRD section 5 shows a plugins array in metadata.archie:
// plugins: [plugins/custom-gate.go, plugins/gosec-check.go]
fm, _, err := Parse([]byte(`---
name: test-skill
description: desc
version: 1.0.0
metadata:
archie:
tools: [go]
engine: any
plugins:
- plugins/custom-gate.go
- plugins/gosec-check.go
---
Body.
`))
if err != nil {
t.Fatal(err)
}
if fm.Metadata.Archie == nil {
t.Fatal("Metadata.Archie is nil")
}
if len(fm.Metadata.Archie.Plugins) != 2 {
t.Error("Gap 8: Frontmatter.Metadata.Archie has no Plugins field, or " +
"it didn't parse the plugins list. Add a Plugins []string field to " +
"the Metadata.Archie struct per PRD section 5.")
}
if fm.Metadata.Archie.Plugins[0] != "plugins/custom-gate.go" {
t.Errorf("Plugins[0] = %q, want plugins/custom-gate.go", fm.Metadata.Archie.Plugins[0])
}
}