rastrillo / abono Public

Clone
git clone https://amadan.net/rastrillo/abono

Plain git — no account needed to clone.

Download

Download this file

1package abono
2
3import (
4 "os"
5 "strings"
6 "testing"
7)
8
9// skillBudget is the byte ceiling for SKILL.md. It is what an agent
10// loads instead of reading the source, so it is reviewed like code and
11// kept short; raise it here, with a reason, rather than trimming a
12// load-bearing fact to fit.
13const skillBudget = 9000
14
15func TestSkillMDIsWithinBudgetAndNamesTheSurface(t *testing.T) {
16 b, err := os.ReadFile("SKILL.md")
17 if err != nil {
18 t.Fatal(err)
19 }
20 if len(b) > skillBudget {
21 t.Fatalf("SKILL.md is %d bytes, budget %d", len(b), skillBudget)
22 }
23 s := string(b)
24 for _, want := range []string{
25 "abono.New", "abono.Schema", "BootSchema", "csrf.Exempt",
26 "WebhookPath", "SyncPath", "carlos schedule",
27 "Holder", "Claim", "OnChange", "idempotent",
28 "HasPlan", "HasPlanIn", "HoldingsIn", "Holdings", "Describe", "Checkout", "Finish", "Portal",
29 "Adopt", "Comp", "SeedPlans", "Templates()", "Catalog()",
30 "abono pages", "abonotest", "Sandbox", "2025-03-31.basil",
31 "Checkout Sessions", "Customer portal", "Subscriptions", "Customers",
32 "Prices", "Promotion codes", "30 days",
33 // The final review's fixes that change the surface or behaviour.
34 "cards only", "UnpaidSince", "Processing", "Customers(ctx, subject)",
35 "Portal(ctx, subject, customerID, returnPath)", "interval_count", "pinned", "one process",
36 "reset the sandbox",
37 } {
38 if !strings.Contains(s, want) {
39 t.Errorf("SKILL.md does not mention %q", want)
40 }
41 }
42 if strings.Contains(s, "—") {
43 t.Error("SKILL.md contains an em dash")
44 }
45}
46