Skip to content

Commit 528b919

Browse files
authored
SP-45: Add asset-registry schema, examples, methodology commands (#341)
1 parent a5fdf17 commit 528b919

13 files changed

Lines changed: 412 additions & 277 deletions

File tree

.cursor/skills/asset-registry-endpoints/SKILL.md

Lines changed: 80 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
name: asset-registry-endpoints
33
description: >-
4-
Call asset service endpoints (schema, validate, methodology, examples) for any
5-
registered asset type using the asset registry descriptor and the content-cli
6-
api command. Also covers exporting/importing/creating packages via config
7-
commands. Use when the user asks for a schema, wants to validate an asset,
8-
needs methodology/best-practices, wants example configurations for an asset
9-
type, or needs to export/import/list/create packages.
4+
Discover asset types, fetch schemas, examples, and methodology via
5+
content-cli asset-registry commands. Also covers exporting/importing/creating
6+
packages via config commands. Use when the user asks for a schema, wants to
7+
validate an asset, needs methodology/best-practices, wants example
8+
configurations for an asset type, or needs to export/import/list/create
9+
packages.
1010
---
1111

1212
# Asset Registry Endpoint Caller
1313

14-
Call any endpoint defined in an asset registry descriptor by combining the
15-
service `basePath` with the endpoint path, then hitting it via `content-cli api request`.
14+
Use `content-cli asset-registry` commands to discover asset types and fetch
15+
schemas, examples, and methodology for any registered asset type.
1616

1717
## Prerequisites
1818

@@ -122,7 +122,7 @@ nothing above or around it. If the schema defines a `metadata` field inside
122122
`configuration`, that is the asset's own metadata, not a platform concept.
123123

124124
Everything outside `configuration` is configuration-management metadata managed
125-
by Pacman.
125+
by the platform.
126126

127127
```json
128128
{
@@ -170,127 +170,122 @@ Field reference:
170170
| `variables` | Package variables (e.g. DATA_MODEL bindings) |
171171
| `dependencies` | Package-level dependencies |
172172

173-
## Step 1 — Get the asset descriptor
173+
## Step 1 — Discover asset types
174174

175-
```bash
176-
$CLI asset-registry get --assetType <ASSET_TYPE> -p <profile>
177-
```
178-
179-
This returns a descriptor like:
180-
181-
```json
182-
{
183-
"assetType": "BOARD_V2",
184-
"displayName": "View",
185-
"service": { "basePath": "/blueprint/api" },
186-
"endpoints": {
187-
"schema": "/validation/schema/BOARD_V2",
188-
"validate": "/validate/BOARD_V2",
189-
"methodology": "/methodology/BOARD_V2",
190-
"examples": "/examples/BOARD_V2"
191-
}
192-
}
193-
```
194-
195-
If you don't know which asset types exist, list them first:
175+
List all registered asset types:
196176

197177
```bash
198178
$CLI asset-registry list -p <profile>
199179
```
200180

201-
## Step 2 — Build the full path
202-
203-
Concatenate `service.basePath` + `endpoints.<endpoint>`:
181+
Get the full descriptor for a specific type (includes schema version, service
182+
info, and endpoint availability):
204183

205-
| Want | Formula | Example |
206-
|------|---------|---------|
207-
| Schema | `basePath + endpoints.schema` | `/blueprint/api/validation/schema/BOARD_V2` |
208-
| Validate | `basePath + endpoints.validate` | `/blueprint/api/validate/BOARD_V2` |
209-
| Methodology | `basePath + endpoints.methodology` | `/blueprint/api/methodology/BOARD_V2` |
210-
| Examples | `basePath + endpoints.examples` | `/blueprint/api/examples/BOARD_V2` |
211-
212-
`methodology` and `examples` are optional — check if they exist in the
213-
descriptor before calling.
214-
215-
**Not all endpoints may be available** for every asset type. Some services may
216-
not have deployed validate, methodology, or examples endpoints yet. If you get
217-
a 404, the endpoint is not implemented for that asset type — do not retry.
184+
```bash
185+
$CLI asset-registry get --assetType <ASSET_TYPE> -p <profile>
186+
```
218187

219-
## Step 3Call the endpoint
188+
## Step 2Fetch schema, examples, or methodology
220189

221-
> **Note on `api request`**: This command is **beta** and exists as a testing
222-
> mechanism. It hits Celonis APIs using the configured profile's authit is
223-
> not a general-purpose HTTP client. Do not use outside of testing.
190+
Use these commands to get asset authoring resources directly. Each proxies
191+
through the platform to the owning asset serviceno manual path construction
192+
needed.
224193

225194
### Schema (GET)
226195

227196
Returns the full JSON Schema for the asset type's `configuration` object.
228197

229198
```bash
230-
$CLI api request --path "<basePath><endpoints.schema>" -p <profile>
199+
$CLI asset-registry schema --assetType <ASSET_TYPE> -p <profile>
231200
```
232201

233-
### Validate (POST)
202+
Save to file:
234203

235204
```bash
236-
$CLI api request --path "<basePath><endpoints.validate>" --method POST \
237-
--body '{"assetType":"<TYPE>","packageKey":"<PKG>","nodes":[{"key":"<KEY>","configuration":{...}}]}' \
238-
-p <profile>
205+
$CLI asset-registry schema --assetType <ASSET_TYPE> --json -p <profile>
239206
```
240207

241-
### Methodology (GET)
208+
### Examples (GET)
209+
210+
Returns example configurations for the asset type. Not all asset types provide
211+
examples — a 404 means the endpoint is not available.
242212

243213
```bash
244-
$CLI api request --path "<basePath><endpoints.methodology>" -p <profile>
214+
$CLI asset-registry examples --assetType <ASSET_TYPE> -p <profile>
245215
```
246216

247-
### Examples (GET)
217+
### Methodology (GET)
218+
219+
Returns best-practices and methodology guidance. Not all asset types provide
220+
methodology — a 404 means the endpoint is not available.
248221

249222
```bash
250-
$CLI api request --path "<basePath><endpoints.examples>" -p <profile>
223+
$CLI asset-registry methodology --assetType <ASSET_TYPE> -p <profile>
251224
```
252225

253-
### Save response to file
226+
### Validate (POST — via config import)
227+
228+
Use `config import --validate` to validate assets against their schema before
229+
importing:
254230

255231
```bash
256-
$CLI api request --path "<path>" --json -p <profile>
232+
$CLI config import -d <export_dir> --validate --overwrite -p <profile>
257233
```
258234

259-
## Troubleshooting: 403 on asset endpoints
235+
**Important**: If validation returns errors, do **not** proceed with the import.
236+
Instead, fix the schema violations in the node JSON and re-run the command. If
237+
you cannot resolve the errors automatically, present the validation results to
238+
the user and ask whether they want to continue importing with invalid
239+
configuration or stop to fix it manually.
240+
241+
## Troubleshooting
260242

261-
If an asset service endpoint returns **403**, the endpoint is likely **not on
262-
the OAuth scope allowlist** for the token. The asset registry (Pacman) APIs may
263-
work, but downstream asset service APIs (e.g. `/blueprint/api/...`,
264-
`/llm-agent/api/...`) need their own allowlisting.
243+
**404 on examples / methodology** — Not all asset services have deployed these
244+
endpoints. The schema endpoint is required for all registered types; the others
245+
are optional.
265246

266-
**Tip for asset teams**: if your endpoints return 403 via Content CLI or public
267-
APIs, request that they be added to the OAuth `studio` scope allowlist.
247+
**500 on proxy endpoints** — The platform proxies requests to the owning asset
248+
service. A 500 typically means the downstream service is unavailable or returned
249+
an unexpected response.
250+
251+
**Errors on import (400)** — Ensure `spaceId` is set on every node and
252+
`schemaVersion` matches the descriptor's `assetSchema.version`.
268253

269254
## Full worked example
270255

271256
```bash
272-
# 1. Get descriptor
273-
$CLI asset-registry get --assetType BOARD_V2 --json
257+
# 1. Discover available asset types
258+
$CLI asset-registry list -p <profile>
274259

275-
# 2. Fetch schema (beta command — testing only)
276-
$CLI api request --path "/blueprint/api/validation/schema/BOARD_V2" --json
260+
# 2. Get the descriptor (includes schema version)
261+
$CLI asset-registry get --assetType BOARD_V2 --json -p <profile>
277262

278-
# 3. Export the target package
279-
$CLI config export --packageKeys <package-key> --unzip
263+
# 3. Fetch the schema
264+
$CLI asset-registry schema --assetType BOARD_V2 --json -p <profile>
280265

281-
# 4. Create a new node JSON in the export's nodes/ directory
282-
# — configuration root must conform to the schema from step 2
266+
# 4. (Optional) Fetch examples for reference
267+
$CLI asset-registry examples --assetType BOARD_V2 --json -p <profile>
268+
269+
# 5. Export the target package
270+
$CLI config export --packageKeys <package-key> --unzip -p <profile>
271+
272+
# 6. Create a new node JSON in the export's nodes/ directory
273+
# — configuration root must conform to the schema from step 3
283274
# — set spaceId to the package's space (ask the user)
284275

285-
# 5. Validate and import (--overwrite for existing package, omit for new)
286-
$CLI config import -d <export_dir> --validate --overwrite
276+
# 7. Validate and import (--overwrite for existing package, omit for new)
277+
$CLI config import -d <export_dir> --validate --overwrite -p <profile>
287278
```
288279

289280
## Quick reference
290281

291-
| Endpoint | Method | Required | Notes |
292-
|----------|--------|----------|-------|
293-
| schema | GET | Yes | Returns full JSON Schema |
294-
| validate | POST | Yes | May not be deployed for all types yet |
295-
| methodology | GET | No | May not be deployed for all types yet |
296-
| examples | GET | No | May not be deployed for all types yet |
282+
| Command | Description |
283+
|---------|-------------|
284+
| `asset-registry list` | List all registered asset types |
285+
| `asset-registry get --assetType X` | Get the full descriptor for an asset type |
286+
| `asset-registry schema --assetType X` | Get the JSON Schema for the asset's configuration |
287+
| `asset-registry examples --assetType X` | Get example configurations (if available) |
288+
| `asset-registry methodology --assetType X` | Get methodology / best-practices (if available) |
289+
| `config list` | List packages |
290+
| `config export --packageKeys X --unzip` | Export packages |
291+
| `config import -d <dir> --validate --overwrite` | Validate and import packages |

docs/user-guide/agentic-development-guide.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@ content-cli asset-registry list
2626
content-cli asset-registry get --assetType BOARD_V2
2727
```
2828

29-
The descriptor returns the `basePath` and endpoint paths for schema, validate, methodology, and examples.
29+
The descriptor returns metadata including the schema version needed for asset creation.
3030

3131
### 2. Fetch the schema
3232

33-
Combine `basePath` + `endpoints.schema` and call it:
34-
3533
```bash
36-
content-cli api request --path "/blueprint/api/validation/schema/BOARD_V2" --json
34+
content-cli asset-registry schema --assetType BOARD_V2 --json
3735
```
3836

3937
The schema describes the valid structure of the asset's `configuration` field. This is the only part of the asset governed by the schema — everything else is platform metadata.
4038

39+
You can also fetch examples and methodology when available:
40+
41+
```bash
42+
content-cli asset-registry examples --assetType BOARD_V2 --json
43+
content-cli asset-registry methodology --assetType BOARD_V2 --json
44+
```
45+
4146
### 3. Export the target package
4247

4348
```bash
@@ -86,11 +91,11 @@ content-cli config export --keysByVersion <packageKey>_<version> --unzip
8691

8792
## Troubleshooting
8893

89-
**403 on asset service endpoints**The asset registry (Pacman) APIs and asset service endpoints use separate OAuth scopes. If schema/validate endpoints return 403, the service's endpoints may not be on the `studio` scope allowlist yet. Asset teams should request their endpoints be added to the allowlist.
94+
**404 on examples / methodology**Not all asset services have deployed these endpoints. The schema endpoint is required for all registered types; the others are optional.
9095

91-
**404 on validate / methodology / examples**Not all services have deployed all endpoints. The schema endpoint is required; the others may not be available yet.
96+
**500 on proxy endpoints**The platform proxies requests to the owning asset service. A 500 typically means the downstream service is unavailable or returned an unexpected response.
9297

93-
**500 on import** — Ensure `spaceId` is set on every node and `schemaVersion` matches the descriptor's `assetSchema.version`.
98+
**Errors on import (400 / 500)** — Ensure `spaceId` is set on every node and `schemaVersion` matches the descriptor's `assetSchema.version`.
9499

95100
## Further reading
96101

docs/user-guide/asset-registry-commands.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Asset Registry Commands
22

3-
The **asset-registry** command group allows you to discover registered asset types and their service descriptors from the Asset Registry.
4-
This is useful for understanding which asset types are available on the platform, their configuration schema versions, and how to reach their backing services.
3+
The **asset-registry** command group allows you to discover registered asset types, fetch their schemas, examples, and methodology from the Asset Registry.
4+
This is useful for understanding which asset types are available on the platform, their configuration structure, and best practices for authoring assets.
55

66
## List Asset Types
77

@@ -38,11 +38,11 @@ Example output:
3838
Asset Type: BOARD_V2
3939
Display Name: View
4040
Group: DASHBOARDS
41-
Schema: v2.1.0
41+
Schema: v2
4242
Base Path: /blueprint/api
4343
Endpoints:
44-
schema: /schema/board_v2
45-
validate: /validate/board_v2
44+
schema: /validation/schema/board_v2
45+
validate: /validate
4646
methodology: /methodology/board_v2
4747
examples: /examples/board_v2
4848
```
@@ -51,3 +51,48 @@ Options:
5151

5252
- `--assetType <assetType>` (required) – The asset type identifier (e.g., `BOARD_V2`, `SEMANTIC_MODEL`)
5353
- `--json` – Write the full response to a JSON file in the working directory
54+
55+
## Get Schema
56+
57+
Fetch the JSON Schema that defines the valid structure of an asset type's `configuration` object.
58+
59+
```
60+
content-cli asset-registry schema --assetType BOARD_V2
61+
```
62+
63+
The response is the full JSON Schema (draft-07) for the asset type. Use `--json` to save it to a file for reference during asset authoring.
64+
65+
```
66+
content-cli asset-registry schema --assetType BOARD_V2 --json
67+
```
68+
69+
Options:
70+
71+
- `--assetType <assetType>` (required) – The asset type identifier
72+
- `--json` – Write the schema to a JSON file in the working directory
73+
74+
## Get Examples
75+
76+
Fetch example configurations for an asset type. Not all asset types provide examples.
77+
78+
```
79+
content-cli asset-registry examples --assetType BOARD_V2
80+
```
81+
82+
Options:
83+
84+
- `--assetType <assetType>` (required) – The asset type identifier
85+
- `--json` – Write the examples to a JSON file in the working directory
86+
87+
## Get Methodology
88+
89+
Fetch methodology and best-practices guidance for an asset type. Not all asset types provide methodology.
90+
91+
```
92+
content-cli asset-registry methodology --assetType BOARD_V2
93+
```
94+
95+
Options:
96+
97+
- `--assetType <assetType>` (required) – The asset type identifier
98+
- `--json` – Write the methodology to a JSON file in the working directory

0 commit comments

Comments
 (0)