package aviso import ( "os" "strings" "testing" ) // skillBudget is the byte ceiling for SKILL.md. It is what an agent // loads instead of reading the source, so it is reviewed like code and // kept short; raise it here, with a reason, rather than trimming a // load-bearing fact to fit. const skillBudget = 9000 func TestSkillMDIsWithinBudgetAndNamesTheSurface(t *testing.T) { b, err := os.ReadFile("SKILL.md") if err != nil { t.Fatal(err) } if len(b) > skillBudget { t.Fatalf("SKILL.md is %d bytes, budget %d", len(b), skillBudget) } s := string(b) for _, want := range []string{ "aviso.New", "aviso.Schema", "BootSchema", "PrivateKey", "aviso-key", "SendTo", "Send(", "Sweep", "DeleteSubject", "PublicKey", "Subscribe", "Unsubscribe", "JS()", "WorkerJS()", "importScripts", "enable(", "reconcile(", "disable(", "handlePush", "handleClick", "handleSubscriptionChange", "fallback", "publicKey:", "docs/installable.md", "3993", "24 hours", } { if !strings.Contains(s, want) { t.Errorf("SKILL.md does not mention %q", want) } } }