Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6e70106
Add notes on how to use cli testing
andrewmumblebee Jun 2, 2026
6c5e4d3
fix linegraph yAxisColum prop name
andrewmumblebee Jun 11, 2026
e0bdbde
update cli handling in skill
andrewmumblebee Jun 11, 2026
21dbb63
add post-request script handling of non-json data
andrewmumblebee Jun 11, 2026
529d8cb
Split testing into subagents
andrewmumblebee Jun 11, 2026
a29d814
Author import streams without the data-streams guide
andrewmumblebee Jun 11, 2026
8599331
Give the main agent its own checkpoint testing reference
andrewmumblebee Jun 11, 2026
14b337c
Author OOB default content in a sub-agent
andrewmumblebee Jun 11, 2026
993a55f
Ensure dev branch is resolved correctly in plugin link
andrewmumblebee Jun 11, 2026
cd7a56a
Document rawId, timeframe enum, and Lambda response cap
andrewmumblebee Jun 12, 2026
33ff8cd
Harden scoped-stream PASS criteria: verify against two objects
andrewmumblebee Jun 12, 2026
6b23d7a
@
andrewmumblebee Jun 12, 2026
206b107
build-plugin: re-run Checkpoint B cycle after post-import index changes
andrewmumblebee Jun 12, 2026
148951a
Remove repo reference in skill
andrewmumblebee Jun 12, 2026
622aff1
build-plugin: capture data granularity early, pass timeframe hints to…
andrewmumblebee Jun 12, 2026
114c99f
Add --silent to testing.md CLI examples so JSON capture is spinner-safe
andrewmumblebee Jun 12, 2026
7ea3402
Add --silent to checkpoints.md CLI examples for spinner-safe JSON cap…
andrewmumblebee Jun 12, 2026
2f8c4fc
Add --silent and platform shell guidance to test-agent.md
andrewmumblebee Jun 12, 2026
91ad41c
build-plugin: token-hygiene rules for browsing, icon, auth probe
andrewmumblebee Jun 12, 2026
6cf0e16
use schemaVersion 2.1 for metadata.json
andrewmumblebee Jun 15, 2026
ea15fbc
Add no-wait instructions to index command
andrewmumblebee Jun 15, 2026
39bdef4
build-plugin: add consolidate/split rule to Phase 2 planning
andrewmumblebee Jun 15, 2026
ddc505e
build-plugin: add "one stream per shape" section to data-streams.md
andrewmumblebee Jun 15, 2026
5e1527d
build-plugin: document objects-filter scope binding in oob-content.md
andrewmumblebee Jun 15, 2026
e52f660
build-plugin: document the objects data-stream parameter in ui.md
andrewmumblebee Jun 15, 2026
ce87a9e
build-plugin: scope ui.md overview line to ui.json explicitly
andrewmumblebee Jun 15, 2026
d1117ab
Update ui.md notes to include validation notes and further input notes
andrewmumblebee Jun 16, 2026
ee80e55
Add skill guidance on using monitors
andrewmumblebee Jun 16, 2026
61a3a00
Add consolidation testing notes
andrewmumblebee Jun 16, 2026
a301695
Remove monitors mention from Claude skill
andrewmumblebee Jun 17, 2026
7acf0df
Add model guidance for sub-agents
andrewmumblebee Jun 17, 2026
2264873
Add icon search guidance
andrewmumblebee Jun 17, 2026
0b5ea10
update approval gate
andrewmumblebee Jun 18, 2026
d93e804
Prune build-plugin skill: collapse reconciliation pass, single-source…
andrewmumblebee Jun 18, 2026
195c42c
Condense timeframe information in initial phase
andrewmumblebee Jun 18, 2026
41e9572
Move re-indexing knowledge into checkpoints
andrewmumblebee Jun 18, 2026
dd39c8e
Attempt to reduce duplication of indexing
andrewmumblebee Jun 18, 2026
94fc066
Add hint on using valueExpression to index-defs
andrewmumblebee Jun 22, 2026
e1d3c6f
Reduce duplication of stale import rule
andrewmumblebee Jun 22, 2026
54e9e86
Unify the two-object rule reference section
andrewmumblebee Jun 22, 2026
e911df5
Condense non-tty guidance and assume to always use --silent --json
andrewmumblebee Jun 22, 2026
80e4902
point to data stream consolidation notes
andrewmumblebee Jun 22, 2026
b646e32
condense some ui options
andrewmumblebee Jun 22, 2026
a0bbe60
use status --json and capture region as part of build-plugin skill
andrewmumblebee Jun 22, 2026
98828ca
add note on not adding import in description
andrewmumblebee Jun 22, 2026
74dee78
Remove blocking of reading oob-content
andrewmumblebee Jun 22, 2026
2f1f01c
Add guidance on using data stream tags, and also on how to install cli
andrewmumblebee Jun 25, 2026
3957b53
docs(checkpoints): clarify <validationStream> placeholder meaning
andrewmumblebee Jun 25, 2026
39c271d
docs(data-streams): remove redundant "exactly" from consolidate example
andrewmumblebee Jun 25, 2026
2a87bd1
docs(data-streams): add text language marker to timeframes enum block…
andrewmumblebee Jun 25, 2026
b43d16c
docs(data-streams): remove blank line between adjacent blockquotes (M…
andrewmumblebee Jun 25, 2026
8be2372
docs(index-defs): fix sentence fragments and heading level
andrewmumblebee Jun 25, 2026
884c814
docs(test-agent): make scoping β†’ baseDataSourceName mapping explicit
andrewmumblebee Jun 25, 2026
5131d5e
docs(testing): add JSON example for raw→value→formatted cell triple
andrewmumblebee Jun 25, 2026
6844131
docs(ui): add blank lines around code blocks in list items (MD031)
andrewmumblebee Jun 25, 2026
2481de2
docs(deploy-plugin): add ValidationResult JSON example for downstream…
andrewmumblebee Jun 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 154 additions & 43 deletions .claude/skills/build-plugin/SKILL.md

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions .claude/skills/build-plugin/references/checkpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Checkpoints A & B β€” deploy, authenticate, import

This is the **main agent's** testing reference. It covers the two sequential gates the main agent runs inline: the Checkpoint A auth probe and the Checkpoint B import trigger/poll. The per-stream test loop (reading `squaredup test` output, the fix cycle, flags) lives in [testing.md](testing.md) and is read by the **testing sub-agents only** β€” the main agent never needs it.

## Mental model

`squaredup test` sends a **local** data stream config to the test endpoint and runs it against a deployed plugin's **authenticated config**. Two consequences:

- No redeploy is needed to test a new or edited stream β€” only the deploy in Checkpoint A, the redeploy in Checkpoint B (to ship import steps), and the final deploy.
- Testing needs prerequisites in place: a deployed+authenticated config (Checkpoint A) for any stream, **and imported objects** (Checkpoint B) for *scoped* streams.

## Always run non-interactively

You are in a non-TTY shell, so the CLI's interactive pickers (object, config, data-stream selection) block. **Always pass `--json`** and supply ids explicitly via flags.

> ⚠️ **Pass `--silent` and don't merge stderr into stdout when parsing `--json`.** The JSON payload goes to **stdout**; the progress spinner goes to **stderr**. `--silent` suppresses the spinner entirely, so pair it with `--json` on every call to make output capture safe by construction. Even so, never merge stderr into stdout with `2>&1` β€” a real error line would still corrupt the JSON stream. Pipe stdout only. On Windows there is no `/tmp`; use `$env:TEMP` for scratch files.

## Checkpoint A: capture the ids once, then probe auth

Once the user has authenticated the config, grab **both** ids and hold onto them for the rest of the session:

```bash
squaredup datasources --json --silent # β†’ { "pluginId": "plugin-...", "datasources": [ { "id": "config-...", "displayName": "..." } ] }
```

Pass `--plugin-id <id> --datasource-id <id>` on **every** subsequent `test`/`objects` call and **into every sub-agent prompt** (Phases 5–6). If omitted, the CLI re-resolves both on each invocation β€” two round-trips per call that add up fast across the per-stream loops. (`--datasource-id` alone does **not** skip the plugin lookup β€” pass both.)

Then probe auth with the configValidation backing stream. Ask for **just the HTTP status**, not the full diagnostics β€” `--diagnostic Status` filters to the one diagnostic, and combined with `--json` it emits a compact one-line array instead of the multi-KB `currentUser` dump:

```bash
# <validationStream> is the configValidation backing stream name (e.g. 'currentUser' from Phase 4)
squaredup test <validationStream> --plugin-id <pluginId> --datasource-id <id> --diagnostic Status --json --silent
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# β†’ [ { "requestId": "...", "name": "Status", "controlType": "code", "value": "200" } ]
```

A 2xx `value` means auth is good. A non-2xx status β€” or a request error (surfaced on stderr with a non-zero exit) or a missing `Status` diagnostic (the CLI exits non-zero and lists the available diagnostics) β€” means the config isn't authenticated yet. **Only then** drop `--diagnostic Status` to inspect the full response. Repeat until the status is 2xx.

## Checkpoint B: trigger & poll the import

After redeploying the import steps, drive the import via the CLI yourself (no UI, no user pause):

```bash
# 1. Trigger a re-index; --no-wait returns the `since` poll anchor immediately instead of blocking until done
squaredup index --datasource-id <id> --no-wait --json --silent
# β†’ { "datasourceId": "config-...", "triggered": true, "alreadyRunning": false, "since": 1717000000000 }

# 2. Poll until done, passing that `since` so it pins to the run you just triggered
squaredup index-status --datasource-id <id> --since 1717000000000 --json --silent
# β†’ { ..., "done": false, "status": "inProgress", "succeeded": null } # keep polling
# β†’ { ..., "done": true, "status": "succeeded", "succeeded": true, "steps": [ ... ] } # objects indexed

# 3. Confirm objects now exist β€” pass an inline scope (no scoped stream exists yet; import streams have no `matches` to resolve)
squaredup objects --matches '{"sourceType":{"type":"equals","value":"<Object Type>"}}' --plugin-id <pluginId> --datasource-id <id> --json --silent # β†’ non-empty "objects"
```

Notes:

- `index` / `index-status` are **folder-independent** β€” they need only `--datasource-id <id>` (not `--plugin-id`), since the re-index endpoint is keyed purely on the datasource.
- **Branch on the JSON, not the exit code.** `index-status` exits `0` on every clean read regardless of import state. A failed import is `done: true, succeeded: false` β€” *not* a non-zero exit. Read the run-level `message` and the per-step `steps[]` (each step has `name`, `status`, `errorReason`, `totalObjectsReceived`, `totalObjectsWritten`) to see **which** step broke and why, fix that import stream, and re-trigger.
- **`status` is the run's lifecycle, not the outcome.** While running it's `ready`/`inProgress`; once `done` it's one of `succeeded`, `failed`, `warning`, or `cancelled`. `succeeded` and `warning` both report `succeeded: true` (a `warning` run finished but a step emitted warnings β€” check the `steps[]`); `failed` and `cancelled` report `succeeded: false`. A datasource that has never imported reports `status: "notRun"`, `done: false`.
- `--since` is **exclusive** (`scheduledStart > since`): always pass the `since` from `index` so `done` can't latch on a stale previous run.
- If `index` reports `alreadyRunning: true`, it adopted the in-flight run β€” poll with the `since` it returned. Imports can take several minutes (object import allows up to ~10 min); use a generous overall timeout.
- The `--matches` confirm in step 3 must be **inline JSON** β€” `--matches @<importStream>.json` only resolves a real scope, and an import stream's `matches` is `none`/absent. Likewise `objects <stream>` needs a scoped stream, which doesn't exist until Phase 6.

## Imported objects are frozen at import time β€” re-index to refresh them

The objects this import created carry the shape defined by the `indexDefinitions/*.json` and import streams **as they were when the import ran**. Editing either afterwards does **not** retroactively change the objects already in the graph β€” every existing object stays **stale**, and a newly mapped property is absent on it until the datasource is re-imported. This is the trap behind the shipped `undefined === undefined` scope bug: a property was added to `objectMapping.properties` *after* the import, sub-agents were told it existed, and they filtered on a field that was `undefined` on every object.

So **any** change to `indexDefinitions/*.json` or an import stream after this import has run means you must **repeat this whole Checkpoint B cycle before relying on the change** β€” before spawning sub-agents that reference a new property or building anything that scopes on it:

1. **First check the change is even needed.** A value already covered by `id`/`name`/`type` is on every object for free (`rawId` as a scalar, `name`, `type`) β€” don't add a duplicate `properties` mapping to reach it (see [index-defs.md](index-defs.md)). Only re-index for a property that genuinely isn't already available.
2. **Redeploy** the edited definition/stream (invoke `deploy-plugin`).
3. **Re-index** β€” `squaredup index --datasource-id <id> --no-wait --json --silent`, capture the new `since`.
4. **Poll** `index-status` until `done: true, succeeded: true`.
5. **Confirm the change itself landed, not just that the import succeeded.** A typo'd source column imports cleanly and silently drops the property, so import success proves nothing about the mapping. Re-run the step-3 `objects --matches` confirm and inspect a returned object for the new property (or test a scoped stream that reads `{{object.<newProp>}}` and see it resolve to a real value). Only then is it safe to tell a sub-agent the property exists.

The same staleness applies to the **deployed** tenant after the final deploy β€” see Phase 9's conditional final re-index in SKILL.md.
2 changes: 1 addition & 1 deletion .claude/skills/build-plugin/references/common-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SquaredUp includes a built-in `datastream-properties` stream that automatically

## Config validation steps

`configValidation.json` is optional but strongly preferred. Use a **lightweight endpoint** (e.g. `/me`, `/user`). No extra flag needed in `metadata.json` β€” the presence of the file is sufficient.
`configValidation.json` is **required for authenticated APIs** (any plugin whose config carries a credential) and recommended otherwise. Use a **lightweight endpoint** (e.g. `/me`, `/user`) as the `Authenticate` step's backing data stream β€” that same unscoped stream doubles as the auth probe during the build (`squaredup test <stream> --json` in Checkpoint A, see [checkpoints.md](checkpoints.md)). No extra flag needed in `metadata.json` β€” the presence of the file is sufficient.

```json
{
Expand Down
Loading
Loading