Skip to content

Commit 9e61048

Browse files
authored
Add support for RO-crates (#168)
* Add support for RO-crates * Add Claude review skill
1 parent ebacbc2 commit 9e61048

File tree

84 files changed

+11489
-1969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+11489
-1969
lines changed

.claude/skills/review-api/SKILL.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: review-api
3+
description: Review new or modified API features for completeness and consistency
4+
user-invocable: true
5+
---
6+
7+
# API Feature Review
8+
9+
Review new or modified API features for completeness and consistency.
10+
11+
## Checklist
12+
13+
### Server-Side (src/server/)
14+
15+
1. **Authorization**: All API endpoints use `authorize_workflow!` or `authorize_resource!` macros
16+
- Check `src/server/http_server.rs` for the endpoint handler
17+
- Verify the macro is called before any business logic
18+
19+
2. **Error Responses**: Proper HTTP status codes are returned
20+
- 403 for unauthorized access
21+
- 404 for not found resources
22+
- 422 for validation errors
23+
- 500 for server errors
24+
25+
### OpenAPI Spec (api/openapi.yaml)
26+
27+
3. **Endpoint Documentation**: All new/modified endpoints are documented
28+
- Path, method, parameters, request body
29+
- Response schemas for 200, 403, 404, 422, 500
30+
- Validate with: `npx @redocly/cli lint api/openapi.yaml`
31+
32+
4. **Schema Syntax** (OpenAPI 3.1):
33+
- Use `type: [integer, "null"]` not `nullable: true`
34+
- Use direct `$ref:` without `schema:` wrapper
35+
- Examples use actual objects: `error: {}` not `error: "{}"`
36+
37+
### Client CLI (src/client/commands/)
38+
39+
5. **Workflow ID Prompting**: Commands use `Option<i64>` for workflow_id
40+
- Call `select_workflow_interactively()` when None
41+
- Follow pattern in `jobs.rs` or `ro_crate.rs`
42+
43+
6. **Pagination**: List commands that fetch from server use pagination
44+
- Check for `paginate_*` functions or pagination iterators
45+
- Single API calls with no limit will truncate at 10,000 items
46+
47+
7. **JSON Output**: Commands support `-f json` output format
48+
- Use `print_if_json()` or `print_wrapped_if_json()`
49+
- Ensure structured data is serializable
50+
51+
8. **Logging**: Check that log messages that include database record IDs use a format like
52+
`info!("Created workflow workflow_id={}", workflow_id);` so that parsing scripts pick them up.
53+
54+
## How to Review
55+
56+
1. Identify all files changed in the feature
57+
2. For each server endpoint: check authorization and error responses
58+
3. For each CLI command: check prompting, pagination, JSON support
59+
4. Verify OpenAPI spec matches implementation
60+
5. Run linters: `cargo clippy`, `npx @redocly/cli lint api/openapi.yaml`
61+
62+
## Example Usage
63+
64+
```
65+
/review-api
66+
67+
# Or with context:
68+
Review the RO-Crate feature for API completeness
69+
```

.sqlx/query-18fd26f42f6536c391d36a61c17f13d6ff08662e08fbcce217d14a172f0827fc.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-21f31ec5b433e24ef00c56eaa56c4ae7d88bb458cdd527bb3424fca109836864.json

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-2bbbf2dc70094584cea48e1ffa116cec7d26ace37e91da8fef81bf2126ecfd0b.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-1e01ff3eb282bf9d7999fa28697befefa4621901d45f5788afe65895b6141721.json renamed to .sqlx/query-3c188c9c82168c247b1dd5b0c8e05e6e6fddd296b362d338f983d1d9b37ce3c1.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-d5173896f18199c824fec71dc7c417212cfa70dc04efd0b674590d352fc2fff1.json renamed to .sqlx/query-4dade853026db9f0bf9647b95a8547d3ae06f367c33a89b767c07dff80414a0c.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-54b2e7632900ecd51f86271c2b0c08b35ce3037f13641699b51d787a562e2ea9.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-58fd6909c40a994b850141fa34b3b1c97a66608eec88460682f9b84fa5281105.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-67e128d9ce384ee620e239c70ef555a6b8d0ea2f39443f0bdf739778a1af49dd.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-7b49069d8427f900aafb0763090e57128479328cf7451e081a54fac4480b74d0.json

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)