Commit bae4088
skills(api): optimization flight — RestApiEndpointSchema example and other packages' anchors cut, the apiMethods rule stated once, http.server mount / error ledger / OCC taught (net −1,676 tokens) (#14448)
* skills(api): cut other packages' anchors and the dead RestApiEndpointSchema example; teach http.server mount, the ADR-0112 code ledger and OCC
Optimization flight over skills/objectstack-api/SKILL.md (audit record posted
on the card). Shrink-only, additions paid by deletions in the same file.
DELETE / MERGE / REWRITE
API-E-01 the leading os:check example taught RestApiEndpointSchema: 0
consumers repo-wide, no plugin-rest-api package, and
RestApiPluginConfig has no `endpoints` key. The one live fact
(auth is the flat public + permissions pair) folded into the
auth section.
API-C-01 datasources + driver table -> objectstack-data rules/datasources.md
and objectstack-platform "Driver Selection Guide" (both carry more
than this file did, including the Turso Cloud/EE caveat).
API-C-02 inter-service communication -> objectstack-platform
rules/service-registry.md. Removes the `declare const kernel`
block that type-checked against a fabricated host shape.
API-C-03 Security Layers table named no authorable key -> one boundary line.
API-D-01 health/readiness response bodies -> one line (F-05, A-03).
API-D-02 Handler Status table, neutralised by its own callout.
API-D-03 Best Practices 1 and 4 (duplicate / no key, no gate).
API-D-04 Pitfalls 1, 2, 4 (FLS has no authorable spelling; the page sizes
match no platform constant; rate limiting is stated at D6).
API-D-05 the carve-out why-prose; the rule stays.
API-B-01 third rendering of "no nested auth block".
API-B-02 second gate invocation (and the `objectstack validate` spelling,
API-G-01) -> Verify your work states it once.
API-B-03 the apiMethods primitives/derived rule, stated 3x -> once. The
`## API Methods (Operations)` heading and all six ApiMethod members
stay: it is a registered exhaustive section (binding `api-methods`
in scripts/check-skill-identifier-liveness.mjs).
API-B-05 preamble restating the frontmatter.
API-F-04 environment-scoped routes / projectResolution, 0 usages (G-03).
API-F-05 ServiceInfo, a response shape with 0 usages -> one line.
API-F-06 the two declared-but-unenforced realtime notes (filed separately).
API-A-01 "When to Use This Skill" -> Skill Boundaries table, matching the
objectstack-data / objectstack-query form.
API-A-02 frontmatter drops the "versioning" promise: versioning.zod.ts has
zero consumers outside a pin test.
API-A-03 the description forbids the client seat; the body taught it.
ADD (funded)
API-F-01 the http.server code-mount example, the only code-route pattern the
repo ships. Left UNMARKED: `ctx` is @objectstack/core's
PluginContext and the skills os:check surface resolves
@objectstack/spec only, so a marker would need a locally declared
stand-in -- the same thing API-C-02 was deleted for.
Measured correction to the audit: ctx.getService is SYNCHRONOUS and
throws (0 awaited call sites in packages/plugins, 112 sync).
API-F-02 the ADR-0112 two-tier error-code ledger and the downstream
envelopeViolations + makeApiErrorSchema composition.
API-F-03 OCC stated with its real spellings: If-Match header or
expectedVersion body field, body wins, 409 CONCURRENT_UPDATE.
6311 -> 4635 tokens (ceiling 6319, unchanged); 607 -> 429 lines.
Part of #14304
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
* docs(skills): regenerate skills index after the objectstack-api frontmatter edit
Generator output only: `pnpm --filter @objectstack/spec gen:skill-docs` writes
both files from the SKILL.md frontmatter, and `check:skill-docs` fails without
this. The only change is API-A-02 dropping "versioning" from the description.
Part of #14304
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
* chore(gates): ratchet the role-word baseline down after API-C-03
`check:role-word` red on this branch with the ratchet-DOWN remedy: the file's
one baselined occurrence of the reserved word was the Security Layers row
`| **RBAC** | Object | Role-based access control (profile -> permissions) |`,
deleted by API-C-03. The gate names `--update` as the author's own path when a
baselined file goes clean, so the entry is dropped rather than left as budget a
later edit could spend silently. Baseline 43 -> 42 files; the objectstack-api
row is gone, no other row moves.
Part of #14304
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a9b2be0 commit bae4088
4 files changed
Lines changed: 113 additions & 293 deletions
File tree
- content/docs/ai
- scripts
- skills
- objectstack-api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments