Skip to content

Commit 48d8a78

Browse files
v1779: Align TypeScript and Vite Plus adoption contract (samebase/samebase#1317)
Samebase-Source-Repository: samebase/samebase Samebase-Source-Commit: 6ff6f9e9dcecb9fe2ffcb379fcf6946802e2daa3 Samebase-Source-Path: packages/agent-plugins
1 parent 69fe4f6 commit 48d8a78

5 files changed

Lines changed: 110 additions & 18 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "samebase-agent-plugins",
3-
"version": "0.2.5",
3+
"version": "0.2.11",
44
"private": true,
55
"license": "Apache-2.0",
66
"type": "module",

plugins/samebase/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "samebase",
33
"displayName": "Samebase",
44
"description": "Build and ship web apps with Samebase through a user-owned GitHub repository, Convex backend, and Cloudflare Workers delivery.",
5-
"version": "0.2.5",
5+
"version": "0.2.11",
66
"author": {
77
"name": "Samebase"
88
},

plugins/samebase/.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "samebase",
3-
"version": "0.2.5",
3+
"version": "0.2.11",
44
"description": "Build and ship web apps with Samebase through a user-owned GitHub repository, Convex backend, and Cloudflare Workers delivery.",
55
"author": {
66
"name": "Samebase",

plugins/samebase/skills/samebase/SKILL.md

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,43 @@ description:
88

99
# Samebase
1010

11-
Use Samebase for repository-backed apps and work that joins GitHub, Convex, and Cloudflare. Do not
12-
use Samebase for Git-only work or standalone provider resources.
11+
## Scope gate
12+
13+
- Samebase is only for repository-backed apps and explicit provider attachments.
14+
- Do not use Samebase for unrelated Git work or standalone provider resources. A standalone
15+
Cloudflare Worker means no Samebase.
16+
- For a deletion request, direct the user to the Samebase dashboard. Do not call any Samebase or
17+
provider tool, including app inventory and browser handoff, and do not delete attached resources.
18+
19+
Use Samebase for repository-backed apps and work that joins GitHub, Convex, and Cloudflare.
20+
21+
## Route the request
22+
23+
Choose the route from the user request before you read live tool descriptions. Do not add preflight
24+
actions. Each action reports missing authentication itself.
25+
26+
- For an app-inventory request, call only the Samebase app inventory. Do not call authentication
27+
status or browser handoff as a preflight.
28+
- For a Cloudflare account-list request, call only the Cloudflare account list. Do not call app
29+
inventory, authentication status, or browser handoff as a preflight.
30+
- For a dashboard request, call only browser handoff. Do not call app inventory or authentication
31+
status as a preflight.
32+
- Use authentication status only when the user asks about authentication or after an action reports
33+
missing authentication.
34+
- For a new app, use only this closed flow:
35+
1. Read the app inventory.
36+
2. Create the app.
37+
3. Read only the inventory until source setup is `ready` or `failed`.
38+
4. If source setup is ready, separately read only the inventory until provider setup is `ready` or
39+
`failed`. Authentication-status, browser-handoff, and provider-account reads are not part of
40+
this flow. The complete sequence contains only inventory, create, and inventory polls. Call
41+
create directly after inventory. Do not list Cloudflare accounts first. Create has no
42+
`accountId` and uses the connected Cloudflare provider.
43+
44+
After you select the route, use live tool descriptions only for the exact tool name and arguments.
45+
Match an inventory `nextAction` to its action contract at
46+
[samebase.com/llms.txt](https://samebase.com/llms.txt). Do not guess a tool name from the action ID
47+
or copy tool schemas into this skill.
1348

1449
## Select the app
1550

@@ -19,17 +54,9 @@ use Samebase for Git-only work or standalone provider resources.
1954
a public repository.
2055
4. Connect an existing GitHub repository when it is not in Samebase. A connection does not attach
2156
Convex or Cloudflare.
22-
5. Use browser handoff directly when the user asks to open Samebase. Use authentication status when
23-
the user asks about authentication or a tool reports missing authentication.
24-
25-
Use the live MCP tool descriptions for exact names and arguments. Match an inventory `nextAction` to
26-
its action contract at [samebase.com/llms.txt](https://samebase.com/llms.txt). Do not guess a tool
27-
name from the action ID.
2857

2958
## Verify state
3059

31-
- After app creation, read inventory until source setup is `ready` or `failed`.
32-
- If source setup is ready, read inventory until provider setup is `ready` or `failed`.
3360
- Treat source setup and provider setup as separate states. Source work can continue while provider
3461
setup is incomplete.
3562
- Reread inventory after each attachment, configuration, or repair action.
@@ -42,14 +69,26 @@ setup commands, lockfile, generated-file policy, and validation commands before
4269
setup and code generation steps. Validate the final source. Commit or push only when the user asks
4370
to publish.
4471

72+
For stack-alignment work, compare the target with the generated app and, when accessible, current
73+
Samebase package scripts, configuration, dependencies, lock file, CI, and provider commands before
74+
edits. If private Samebase source is unavailable, record that gap and use the portable baseline:
75+
Node 24, ESM, TypeScript automation, Vite+ dev, build, and tests, Oxlint and Oxfmt through Vite+,
76+
explicit type checks, and the real provider build path. Cover the runtime and package manager,
77+
command surface, lint and format rules, tests and type checks, framework and deploy adapters, and
78+
shared version pins. Classify every difference as alignment, a proven target constraint, an
79+
investigation, or one exact tested exception before implementation. Samebase is the first baseline,
80+
not an unquestioned authority. Carry target and generated-app findings back when they improve the
81+
shared contract.
82+
83+
Treat authored `.js`, `.mjs`, and `.cjs` files and direct ESLint, Prettier, Vitest, or Vite runners
84+
as review smells. Keep an exception only for one named tool or runtime boundary that cannot use the
85+
normal TypeScript and Vite+ path. Document the boundary. Do not add a repository scanner only to
86+
enforce a source extension or selected tool name.
87+
4588
## Use the correct control surface
4689

4790
Use Samebase for app inventory, provider joins, and explicit repair actions. Use provider-native
4891
tools for live provider state, logs, environment values, migrations, domains, and terminal build
4992
state when no Samebase tool exposes that read or action.
5093

51-
The plugin cannot delete a Samebase app or its attached provider resources. Direct the user to the
52-
Samebase dashboard. Do not call any MCP tool for the deletion request. Do not delete these resources
53-
with provider-native tools.
54-
5594
Keep credentials out of Git, logs, screenshots, and responses. Report only states that you verified.

scripts/check.ts

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { existsSync, readdirSync } from "node:fs";
1+
import { existsSync, readFileSync, readdirSync } from "node:fs";
22
import { dirname, resolve } from "node:path";
33
import { fileURLToPath } from "node:url";
44

@@ -72,4 +72,57 @@ check(
7272
);
7373
checkRelativePath(skillsRoot, "samebase/SKILL.md", "Samebase skill");
7474

75+
const samebaseSkill = readFileSync(resolve(skillsRoot, "samebase/SKILL.md"), "utf8").replace(
76+
/\s+/g,
77+
" ",
78+
);
79+
check(
80+
samebaseSkill.includes(
81+
"For stack-alignment work, compare the target with the generated app and, when accessible, current Samebase package scripts, configuration, dependencies, lock file, CI, and provider commands before edits.",
82+
),
83+
"The Samebase skill must compare the target, Samebase, and the generated app before edits.",
84+
);
85+
for (const requiredToolchainGroup of [
86+
"runtime and package manager",
87+
"command surface",
88+
"lint and format rules",
89+
"tests and type checks",
90+
"framework and deploy adapters",
91+
"shared version pins",
92+
]) {
93+
check(
94+
samebaseSkill.includes(requiredToolchainGroup),
95+
`The Samebase skill stack-alignment contract must include ${requiredToolchainGroup}.`,
96+
);
97+
}
98+
check(
99+
samebaseSkill.includes(
100+
"If private Samebase source is unavailable, record that gap and use the portable baseline: Node 24, ESM, TypeScript automation, Vite+ dev, build, and tests, Oxlint and Oxfmt through Vite+, explicit type checks, and the real provider build path.",
101+
),
102+
"The Samebase skill must provide the portable stack baseline when private source is unavailable.",
103+
);
104+
check(
105+
samebaseSkill.includes(
106+
"Classify every difference as alignment, a proven target constraint, an investigation, or one exact tested exception before implementation.",
107+
),
108+
"The Samebase skill must classify every toolchain difference before implementation.",
109+
);
110+
const scopeGateIndex = samebaseSkill.indexOf(
111+
"Do not use Samebase for unrelated Git work or standalone provider resources. A standalone Cloudflare Worker means no Samebase.",
112+
);
113+
const positiveRouteIndex = samebaseSkill.indexOf(
114+
"For an app-inventory request, call only the Samebase app inventory.",
115+
);
116+
check(scopeGateIndex >= 0, "The Samebase skill must exclude unrelated and standalone work.");
117+
check(
118+
positiveRouteIndex >= 0 && scopeGateIndex < positiveRouteIndex,
119+
"The Samebase skill exclusions must precede its positive action routes.",
120+
);
121+
check(
122+
samebaseSkill.includes(
123+
"The complete sequence contains only inventory, create, and inventory polls. Call create directly after inventory. Do not list Cloudflare accounts first. Create has no `accountId` and uses the connected Cloudflare provider.",
124+
),
125+
"The Samebase skill must keep managed app creation on its closed tool sequence.",
126+
);
127+
75128
console.log("Agent plugin checks passed.");

0 commit comments

Comments
 (0)