primitive-admin 1.1.0-alpha.50 → 1.1.0-alpha.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,9 @@ description: >
7
7
  users/groups). Also trigger whenever about to run any `primitive` CLI command (e.g., primitive sync, primitive integrations, primitive apps, primitive env) to ensure Step 0 CLI verification is performed first. After writing or modifying code that touches Primitive
8
8
  APIs, this skill cross-references the implementation against official guides and automatically
9
9
  corrects common mistakes. Use this skill even if the user doesn't explicitly ask for it —
10
- any Primitive-related code should be validated against current best practices.
10
+ any Primitive-related code should be validated against current best practices. Also use it
11
+ when something looks like a platform bug or missing platform capability, to decide whether
12
+ (and how) to file a platform issue.
11
13
  allowed-tools: Bash, Read, Edit, Write, Glob, Grep, Agent
12
14
  ---
13
15
 
@@ -279,3 +281,91 @@ For any question about Primitive platform capabilities:
279
281
  3. **Answer from the guide content** — don't guess or make up APIs
280
282
  4. **Include working code examples** from the guide
281
283
  5. **Point the user to the guide** for further reading: "You can see more examples by running `primitive guides get <topic>`"
284
+
285
+ ## Filing Platform Issues
286
+
287
+ Sometimes the problem is in the platform itself — a bug in js-bao, the client library,
288
+ the CLI, or a capability the platform doesn't have — rather than in the user's app.
289
+ Platform work is tracked as GitHub issues on `Primitive-Labs/js-bao-wss`.
290
+
291
+ **Gate: only suggest filing an issue if the signed-in GitHub user is a member of the
292
+ Primitive-Labs org.** Check silently before ever raising the option:
293
+
294
+ ```bash
295
+ gh api user/memberships/orgs/Primitive-Labs --jq .state 2>/dev/null
296
+ ```
297
+
298
+ If this doesn't print `active` (not a member, or `gh` is missing or unauthenticated),
299
+ don't mention filing an issue at all — help the user work around the problem instead.
300
+
301
+ ### Issue hygiene
302
+
303
+ Issues are read by an agent pipeline and by maintainers who have none of your session's
304
+ context. The description is all they get, and investigating is the assignee's job —
305
+ yours is to state the problem clearly.
306
+
307
+ - **Brevity and clarity win over verbosity.** Keep the prose to 1000 characters or
308
+ less. Fenced code blocks (repro commands, config, verbatim error output) don't count
309
+ toward the cap — precision there is what makes an issue reproducible. If the prose
310
+ doesn't fit, you're including solution detail or context the assignee can rediscover.
311
+ - **Self-contained.** Assume the reader knows nothing about the user's app and has no
312
+ internal knowledge of the platform. Reference related issues by number, but inline
313
+ whatever context is needed to read the issue standalone.
314
+ - **Describe the problem, not the solution.** Don't prescribe the fix or assume a
315
+ particular implementation.
316
+ - **Don't relitigate decisions rejected in earlier issues** — carry forward the
317
+ discovered tradeoffs, stated neutrally.
318
+
319
+ ### Bugs (an existing platform feature not working as designed)
320
+
321
+ Body template — fill each section with as much precision as possible, so the issue is
322
+ easy to reproduce on the first try:
323
+
324
+ ```
325
+ ## Repro steps
326
+ <numbered, precise steps: exact API calls, config, versions>
327
+
328
+ ## Observed behavior
329
+ <what actually happens, with verbatim error text>
330
+
331
+ ## Expected behavior
332
+ <what should happen instead>
333
+ ```
334
+
335
+ Labels: `type:bug` + `stage:ready-to-implement` when the repro is precise and clearly
336
+ reproducible; otherwise `type:bug` + `stage:design`.
337
+
338
+ ### Features / enhancements / platform extensions
339
+
340
+ ```
341
+ ## Problem
342
+ <the application-level problem being solved>
343
+
344
+ ## What I tried
345
+ <existing platform features attempted, and why each falls short — omit if none apply>
346
+
347
+ ## Ideas
348
+ <high-level directions as bullets, not specs>
349
+ ```
350
+
351
+ Labels: `type:feature` + `stage:design`.
352
+
353
+ ### Filing
354
+
355
+ Use only `type:bug` or `type:feature` (e.g. file performance problems as `type:bug`
356
+ with measurements in the repro steps). Search open issues for duplicates first:
357
+
358
+ ```bash
359
+ gh issue list --repo Primitive-Labs/js-bao-wss --search "<keywords>" --state open \
360
+ --json number,title
361
+ ```
362
+
363
+ Then create the issue with labels only — **no assignee** (triage assigns sponsors;
364
+ unassigned is the correct starting state) and no priority labels:
365
+
366
+ ```bash
367
+ gh issue create --repo Primitive-Labs/js-bao-wss \
368
+ --title "<one-line symptom or need>" \
369
+ --label "type:bug,stage:design" \
370
+ --body "<template body>"
371
+ ```
@@ -246,6 +246,7 @@ export declare function rewriteWorkflowSchemasToNative(rawToml: string, workflow
246
246
  changed: boolean;
247
247
  };
248
248
  export declare function serializeWorkflow(workflow: any, draft: any, configs: any[], logger?: (message: string) => void): string;
249
+ export declare function serializeRuleSet(ruleSet: any): string;
249
250
  export declare function serializeGroupTypeConfig(config: any, ruleSetIdToName: Map<string, string>): string;
250
251
  /**
251
252
  * Issue #1567 — the TOML-owned scalar fields of a database-type config.
@@ -291,6 +292,7 @@ export declare function parseDatabaseTypeToml(tomlData: any): {
291
292
  operations: any[];
292
293
  subscriptions: any[];
293
294
  };
295
+ export declare function parseRuleSetToml(tomlData: any): any;
294
296
  export declare function parseGroupTypeConfigToml(tomlData: any): any;
295
297
  export declare function parseCollectionTypeConfigToml(tomlData: any): any;
296
298
  export declare function hashLocalRuleSetForDiff(parsedToml: any): string;
@@ -972,7 +972,7 @@ function serializeEmailTemplate(template) {
972
972
  }
973
973
  return stringifyConfigToml(data);
974
974
  }
975
- function serializeRuleSet(ruleSet) {
975
+ export function serializeRuleSet(ruleSet) {
976
976
  const data = {
977
977
  ruleSet: {
978
978
  name: ruleSet.name,
@@ -1181,7 +1181,7 @@ export function parseDatabaseTypeToml(tomlData) {
1181
1181
  const subscriptions = (tomlData.subscriptions || []).map((sub) => normalizeSubscriptionFromToml(sub));
1182
1182
  return { typeConfig, operations, subscriptions };
1183
1183
  }
1184
- function parseRuleSetToml(tomlData) {
1184
+ export function parseRuleSetToml(tomlData) {
1185
1185
  const ruleSetSection = tomlData.ruleSet || {};
1186
1186
  return {
1187
1187
  name: ruleSetSection.name,