plugins/lisa-harper-fabric-cursor/skills/harper-resources/SKILL.md
This skill should be used when writing or editing Harper (HarperDB/Fabric) resources — the classes in resources.js (built from TypeScript under src/) that expose custom data logic over REST and GraphQL. Use it when adding an endpoint, overriding table behavior, wrapping an external API, or wiring real-time subscriptions. Covers the Resource method-to-HTTP mapping and the TS-is-source build convention. Pairs with harper-schema-graphql, harper-config-yaml, and harper-build-and-deploy.
npx skillsauth add codyswanngt/lisa harper-resourcesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 and [[harper-schema-graphql]]
for how the schema defines the tables resources extend.
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.
documentation
Onboard a user to the project via its LLM Wiki. Interviews the user about themselves in relation to the project, captures that to project-scoped memory only, then gives a guided tour of what the project is and sample questions they can ask. Use when someone is new to the project or asks to be onboarded. Read-mostly — it does not open PRs or write PII into the wiki.
documentation
Migrate an existing, hand-rolled wiki implementation onto the lisa-wiki kernel — phased and compatibility-first, with a strict no-loss guarantee. Use when adopting lisa-wiki in a repo that already has its own wiki/, ingest skills, docs, or roles. Renaming things into the canonical shape is fine; losing functionality or data is not. Ends by running /doctor.
development
Health-check the LLM Wiki. Reports orphan pages, contradictions, stale claims, broken internal links, missing index/log coverage, structure-manifest violations, and secret/tenant leaks. Use periodically or before hardening a wiki. Read-only — it reports findings, it does not fix them.
testing
Ingest source material into the LLM Wiki. With an argument (URL, file path, or prompt) it ingests that one source; with no argument it runs a full ingest across every enabled non-external-write source. Routes to the right connector, then runs the ordered pipeline (source note → synthesis → index → log → verify → state → commit/PR). Use whenever new knowledge should enter the wiki.