SOC 職業分類に基づく
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/CodySwannGT/lisa --skill harper-resourcesコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
This skill should be used for any non-trivial request — features, bugs, stories, epics, spikes, or multi-step tasks. It accepts a ticket URL (Jira, Linear, GitHub), a file path containing a spec, or a plain-text prompt. It assembles an agent team, breaks the work into structured tasks, and manages the full lifecycle from research through implementation, code review, deploy, and empirical verification.
any non-trivial request —…
This skill should be used for any non-trivial request — features, bugs, stories, epics, spikes, or multi-step tasks. It accepts a ticket URL (Jira, Linear, GitHub), a file path containing a spec, or a plain-text prompt. It assembles an agent team, breaks the work into structured tasks, and manages the full lifecycle from research through implementation, code review, deploy, and empirical verification.
| name | harper-resources |
| description | writing or editing Harper… |
A Resource is a class that provides a unified interface for a set of records or
entities. Resources are how you add custom server-side behavior to a Harper app.
They are loaded by the jsResource extension (default file resources.js) and,
when exported, become live REST and GraphQL endpoints.
A resource either extends a database table (to customize an existing table's
behavior) or extends the base Resource class (to expose data from anywhere —
an external API, a computed view, an in-memory source).
The Resource API mirrors REST. Override the method matching the operation you want to customize:
| Method | HTTP | Use |
|---|---|---|
get(target) | GET | Retrieve a record/collection |
post(data) | POST | Create |
put(target, data) | PUT | Replace |
patch(target, data) | PATCH | Partial update |
delete(target) | DELETE | Remove |
search(query) | GET (query) | Query with conditions |
subscribe / publish | MQTT/WebSocket | Real-time |
Add computed fields or guard logic while keeping the table's built-in behavior via
super:
export class MyTable extends tables.MyTable {
static async get(target) {
const record = await super.get(target);
return { ...record, computedField: 'value' };
}
}
export class MyExternalData extends Resource {
static async get(target) {
const response = await fetch(`https://api.example.com/${target.id}`);
return response.json();
}
}
A resource becomes an endpoint when it is exported and rest: true (and/or
graphqlSchema) is enabled in config.yaml:
rest: true
graphqlSchema:
files: schema.graphql
jsResource:
files: resources.js
Resources can also be registered programmatically with server.resources.set().
See [[harper-config-yaml]] for the extension wiring, [[harper-schema-graphql]] for
how the schema defines the tables resources extend, and [[harper-realtime]] when
subscribe, publish, or WebSocket behavior is part of the feature.
Harper's thrown-error response writer reads error.statusCode (falling back
to 500). A plain error.status is ignored — throw an error with only
status set and every intended 4xx is served as a 500. Verified on
harperdb 4.7.32.
Always set statusCode (keep status too only if callers or tests read it):
static async post(target, data, context) {
if (!context.user) {
const error = new Error('Authentication required');
error.statusCode = 401; // NOT `error.status` — Harper reads statusCode
throw error;
}
// ...
}
A shared helper keeps every throw site correct:
function throwStatus(message, status) {
// Set both: `statusCode` is what Harper serves; `status` is kept for
// returned-response symmetry and any caller/test that reads it.
throw Object.assign(new Error(message), { status, statusCode: status });
}
The harper-require-statuscode-on-thrown-error ast-grep rule flags errors that
carry status without statusCode. Pass context through to super and nested
table calls so authorization and the request transaction stay aligned — see
[[harper-rest-queries]] for context propagation and iterator draining.
src/. harper-app/resources.js is a
generated artifact produced by bun run build. Never edit resources.js by
hand — change the TypeScript and rebuild. See [[harper-build-and-deploy]].readonly types, pure transformations, copies, and
explicit returns. Do not mutate parameters, records, arrays, or config objects
unless an API forces it, and document the exception locally.any, broad casts, and ts-ignore. If an external API forces an escape
hatch, isolate it behind a typed adapter.If an endpoint needs a schema change, a seed path, or a deploy script change, make that change — do not ship a client-side workaround or silently downgrade to a stub or mock. A change is unfinished until the local build and the relevant deployed or smoke path agree.
Run bun run build, bun run typecheck, and the smallest relevant test. For an
endpoint change, also hit the actual REST/GraphQL route against a local or deployed
Harper instance (the project smoke command) and confirm the response shape.