You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Available plugins can be listed with: `ls packages/appkit/src/plugins/`
31
+
> Available plugins can be listed with: `npx @databricks/appkit plugin list --dir packages/appkit/src/plugins --json`
32
+
> (Falls back to `ls packages/appkit/src/plugins/` if the CLI is unavailable.)
32
33
33
34
If at least one path exists, proceed.
34
35
@@ -51,6 +52,37 @@ Read **all** files under:
51
52
52
53
Collect the full contents of every file. You need the complete source to evaluate all 9 categories.
53
54
55
+
## Step 3.5: CLI Cross-Checks
56
+
57
+
Before evaluating files by hand, run the AppKit CLI checks below and capture their output. Each result feeds into a specific category in Step 5; treat any non-zero exit as a finding under that category.
58
+
59
+
```bash
60
+
# Schema-validates manifest.json against the plugin-manifest schema.
If `plugin validate` exits non-zero, record a MUST finding under Category 1 with the validator's error output as the description, and continue to Step 4 — the rest of the audit still applies.
83
+
84
+
If `packages/appkit/src/plugins/{PLUGIN_NAME}/` does not exist (connector-only package), skip the three CLI checks and proceed.
85
+
54
86
## Step 4: Structural Completeness Check
55
87
56
88
If `packages/appkit/src/plugins/{PLUGIN_NAME}/` does not exist (connector-only package), mark Structural Completeness as **N/A** in the scorecard and proceed to Step 5.
@@ -76,6 +108,12 @@ Treat each missing `MUST` file as a **MUST**-severity finding under the "Structu
76
108
77
109
Before evaluating, read the shared review rules in `.claude/references/plugin-review-guidance.md` and apply them throughout this step (deduplication, cache-key tracing).
78
110
111
+
Fold the Step 3.5 CLI results into the matching categories:
-`plugin list --json` mismatches between manifest fields and synced output → Category 1 (Manifest Design), SHOULD unless the plugin is absent (MUST).
114
+
-`plugin sync --json` warnings about orphaned resources / removed plugins → Category 0 (Structural Completeness) or Category 1, severity per the warning text.
115
+
- If the manifest declares `"stability": "beta"`, also run `npx @databricks/appkit plugin promote {PLUGIN_NAME} --to ga --dry-run`. Any rewrites it would perform that conflict with the current `/beta` re-export wiring → Category 0 (Structural Completeness), SHOULD.
116
+
79
117
Evaluate the plugin code against **all 9 categories** from the Category Index in `plugin-review-guidance.md`. Check each category's NEVER/MUST/SHOULD rules from the best-practices reference.
80
118
81
119
For each guideline in each category, determine whether the plugin **passes**, **violates**, or is **not applicable** (e.g., SSE rules for a non-streaming plugin). Record findings with:
Copy file name to clipboardExpand all lines: .claude/commands/create-core-plugin.md
+98-4Lines changed: 98 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,47 @@ Use the answers to determine:
38
38
39
39
## 2. Scaffold with the CLI
40
40
41
-
Run the scaffolding command to generate boilerplate. Pipe answers non-interactively if possible, or run it interactively:
41
+
Run the scaffolding command to generate boilerplate. **Always prefer the non-interactive form** — the agent already gathered every required answer in Step 1, and the interactive prompts will hang in headless sessions.
42
+
43
+
### 2a. Non-interactive (default)
44
+
45
+
Required flags: `--placement`, `--path`, `--name`, `--description`. Optional but recommended: `--display-name`, plus one of `--resources` (CSV of types) or `--resources-json` (full specs).
46
+
47
+
Simple case (just resource types, defaults filled in):
48
+
49
+
```bash
50
+
npx @databricks/appkit plugin create \
51
+
--placement in-repo \
52
+
--path packages/appkit/src/plugins/{name} \
53
+
--name {name} \
54
+
--display-name "{Display Name}" \
55
+
--description "{description}" \
56
+
--resources sql_warehouse,volume
57
+
```
58
+
59
+
Full-spec case (custom `resourceKey`, `permission`, `fields.env`):
Add `--force` only when intentionally regenerating into a non-empty directory.
72
+
73
+
### 2b. Interactive fallback
74
+
75
+
Use this **only** when the user explicitly asks for non-GA stability — `--placement`/`--path`/`--name`/`--description` work non-interactively, but the `stability` prompt (`ga` vs `beta`) is interactive-only. Run:
42
76
43
77
```bash
44
78
npx @databricks/appkit plugin create
45
79
```
46
80
47
-
Select**In-repo** placement and target path `packages/appkit/src/plugins/{name}`. Fill in the name, display name, description, and resources based on the gathered requirements.
81
+
Pick**In-repo** placement and target path `packages/appkit/src/plugins/{name}`. If you need `beta` and cannot run interactively, scaffold with the non-interactive command above (which defaults to `ga`), then hand-edit `manifest.json` to add `"stability": "beta"` — promotion to GA later goes through `appkit plugin promote` (see section 8).
48
82
49
83
This generates `manifest.json`, the plugin class file, and `index.ts`. Then enhance the generated files following the patterns below.
50
84
@@ -274,6 +308,19 @@ Example resource entry:
274
308
}
275
309
```
276
310
311
+
> **Tip:** When the resource was already known at scaffold time, prefer wiring it through `--resources-json` in Step 2a instead of hand-editing `manifest.json`. When a resource is discovered *after* scaffolding, use `appkit plugin add-resource` instead of editing the JSON by hand:
> Use `--no-required`for optional resources, `--dry-run` to preview the updated manifest without writing.
323
+
277
324
### 4f. User API Scopes (OBO)
278
325
279
326
If the plugin performs operations on behalf of the logged-in user via `this.asUser(req)`, it requires one or more `user_api_scopes`in the Databricks Apps bundle config (`databricks.yml`). Without the correct scopes, OBO calls will fail at runtime.
@@ -348,11 +395,58 @@ Any plugin using `this.asUser(req)` must declare `user_api_scopes` in the bundle
348
395
349
396
## 7. After Scaffolding
350
397
351
-
Run these to verify:
398
+
Run these to verify, in order:
352
399
353
400
```bash
401
+
# 1. Schema-check the generated/edited manifest before anything else.
# rather than `node_modules/@databricks/appkit/dist/plugins/`, which may be
413
+
# missing or stale) and `--output template/appkit.plugins.json` (the file
414
+
# that ships to consumers, instead of the project-root default that a bare
415
+
# `appkit plugin sync` writes).
416
+
pnpm run sync:template
417
+
418
+
# Equivalent direct invocation — works both inside and outside the monorepo
419
+
# (use it when you want to bypass the wrapper or pass extra flags):
420
+
# npx @databricks/appkit plugin sync --write \
421
+
# --plugins-dir packages/appkit/src/plugins \
422
+
# --output template/appkit.plugins.json
423
+
```
424
+
425
+
If the plugin must always ship with the template (i.e. be marked mandatory) even when not auto-detected via the server file's `plugins: [...]` array, pass it explicitly:
426
+
427
+
```bash
428
+
pnpm run sync:template -- --require-plugins server,{name}
429
+
# or, equivalently, directly via the CLI:
430
+
# npx @databricks/appkit plugin sync --write \
431
+
# --plugins-dir packages/appkit/src/plugins \
432
+
# --output template/appkit.plugins.json \
433
+
# --require-plugins server,{name}
434
+
```
435
+
436
+
>**Note:**`--require-plugins` is **non-additive** — Commander treats it as a single string and the last value wins. The `sync:template` script already passes `--require-plugins server`, so when you override it from the CLI you **must repeat `server`**in the comma-separated list (e.g. `server,{name}`) or the `server` plugin will silently lose its `requiredByTemplate` flag. If you invoke the CLI directly via `npx` instead of going through `sync:template`, also pass `--plugins-dir packages/appkit/src/plugins` (so sync reads the source manifests rather than `node_modules/@databricks/appkit/dist/plugins/`, which may be missing or stale) and `--output template/appkit.plugins.json` (so the synced file lands where consumers expect it).
437
+
438
+
Use `npx @databricks/appkit plugin list --json` to confirm the plugin shows up in the synced manifest with the expected `displayName`, `package`, `stability`, and resource counts.
439
+
440
+
## 8. Stability and Promotion (only if the plugin is non-GA)
441
+
442
+
If the plugin was scaffolded as `beta` (see Section 2b), it must be re-exported from the `/beta` import path, not the GA root. When ready to graduate, **do not edit `manifest.json` and import barrels by hand** — use `promote`, which updates the manifest, rewrites `@databricks/appkit` ↔ `@databricks/appkit/beta` (and `appkit-ui/js` / `appkit-ui/react`) imports across the repo, and re-runs `sync:template`:
443
+
444
+
```bash
445
+
# Preview every change first.
446
+
npx @databricks/appkit plugin promote {name} --to ga --dry-run
447
+
448
+
# Apply (will run the generators + sync:template automatically).
449
+
npx @databricks/appkit plugin promote {name} --to ga
358
450
```
451
+
452
+
Promotion is one-way (`beta → ga` only). Use `--skip-imports` or `--skip-sync` only if you intend to run those steps separately.
For **each** plugin detected in Step 3, run the AppKit CLI checks below before doing the textual review. Treat each non-zero exit or warning as a finding under the indicated category in Step 6.
Capture the relevant output and reference it from the corresponding findings in Step 6.
120
+
77
121
## Step 6: Best-Practices Review
78
122
79
123
Before evaluating, read the shared review rules in `.claude/references/plugin-review-guidance.md` and apply them throughout this step (deduplication, cache-key tracing).
80
124
81
-
For each plugin detected in Step 3, review the changed code against the scoped guidelines from Step 5.
125
+
For each plugin detected in Step 3, review the changed code against the scoped guidelines from Step 5, and **fold in the CLI results from Step 5.5** under the categories noted there.
82
126
83
127
For each finding:
84
128
- Identify the **severity** (NEVER, MUST, or SHOULD)
0 commit comments