feat: generate brain tools skill from OpenAPI; rename db-yaml to postgres (#21)
Cursor skills stay in lockstep with serve handlers. CI checks every bin/ path named in SKILL.md exists.
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -76,6 +78,17 @@ func TestMCPToolsListAndCall(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSkillMarkdownMatchesCommittedFile(t *testing.T) {
|
||||
want, err := os.ReadFile(filepath.Join("..", "..", "skills", "brain", "tools.md"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got := SkillMarkdown()
|
||||
if got != string(want) {
|
||||
t.Fatalf("skills/brain/tools.md stale; regenerate from SkillMarkdown()\n--- got ---\n%s\n--- want ---\n%s", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func postJSON(t *testing.T, h http.Handler, path, raw string) (int, []byte) {
|
||||
t.Helper()
|
||||
req := httptest.NewRequest(http.MethodPost, path, strings.NewReader(raw))
|
||||
|
||||
Reference in New Issue
Block a user