@codyswann/lisa 2.19.1 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/.agents/plugins/marketplace.json +12 -0
  2. package/dist/codex/hooks-installer.js +23 -11
  3. package/dist/codex/hooks-installer.js.map +1 -1
  4. package/dist/codex/plugin-marketplace-installer.d.ts.map +1 -1
  5. package/dist/codex/plugin-marketplace-installer.js +2 -0
  6. package/dist/codex/plugin-marketplace-installer.js.map +1 -1
  7. package/dist/codex/scripts/block-migration-edits.sh +78 -0
  8. package/dist/codex/scripts/block-no-verify.sh +26 -0
  9. package/dist/codex/scripts/format-on-edit.sh +35 -0
  10. package/dist/codex/scripts/inject-rules.sh +31 -0
  11. package/dist/codex/scripts/install-pkgs.sh +26 -0
  12. package/dist/codex/scripts/lint-on-edit.sh +32 -0
  13. package/dist/codex/scripts/notify-ntfy.sh +18 -0
  14. package/dist/codex/scripts/rubocop-on-edit.sh +32 -0
  15. package/dist/codex/scripts/setup-jira-cli.sh +24 -0
  16. package/dist/codex/scripts/sg-scan-on-edit.sh +34 -0
  17. package/dist/configs/eslint/harper-fabric.d.ts +28 -0
  18. package/dist/configs/eslint/harper-fabric.d.ts.map +1 -0
  19. package/dist/configs/eslint/harper-fabric.js +59 -0
  20. package/dist/configs/eslint/harper-fabric.js.map +1 -0
  21. package/dist/configs/eslint/index.d.ts +2 -0
  22. package/dist/configs/eslint/index.d.ts.map +1 -1
  23. package/dist/configs/eslint/index.js +2 -0
  24. package/dist/configs/eslint/index.js.map +1 -1
  25. package/dist/configs/vitest/harper-fabric.d.ts +26 -0
  26. package/dist/configs/vitest/harper-fabric.d.ts.map +1 -0
  27. package/dist/configs/vitest/harper-fabric.js +30 -0
  28. package/dist/configs/vitest/harper-fabric.js.map +1 -0
  29. package/dist/configs/vitest/index.d.ts +2 -1
  30. package/dist/configs/vitest/index.d.ts.map +1 -1
  31. package/dist/configs/vitest/index.js +2 -1
  32. package/dist/configs/vitest/index.js.map +1 -1
  33. package/dist/core/config.d.ts +1 -1
  34. package/dist/core/config.d.ts.map +1 -1
  35. package/dist/core/config.js +2 -0
  36. package/dist/core/config.js.map +1 -1
  37. package/dist/core/lisa.d.ts.map +1 -1
  38. package/dist/core/lisa.js +10 -0
  39. package/dist/core/lisa.js.map +1 -1
  40. package/dist/detection/detectors/harper-fabric.d.ts +18 -0
  41. package/dist/detection/detectors/harper-fabric.d.ts.map +1 -0
  42. package/dist/detection/detectors/harper-fabric.js +56 -0
  43. package/dist/detection/detectors/harper-fabric.js.map +1 -0
  44. package/dist/detection/index.d.ts.map +1 -1
  45. package/dist/detection/index.js +2 -0
  46. package/dist/detection/index.js.map +1 -1
  47. package/dist/strategies/copy-contents.d.ts +12 -2
  48. package/dist/strategies/copy-contents.d.ts.map +1 -1
  49. package/dist/strategies/copy-contents.js +28 -7
  50. package/dist/strategies/copy-contents.js.map +1 -1
  51. package/dist/strategies/package-lisa.d.ts +11 -1
  52. package/dist/strategies/package-lisa.d.ts.map +1 -1
  53. package/dist/strategies/package-lisa.js +30 -1
  54. package/dist/strategies/package-lisa.js.map +1 -1
  55. package/harper-fabric/copy-overwrite/.github/workflows/ci.yml +23 -0
  56. package/harper-fabric/copy-overwrite/eslint.config.ts +41 -0
  57. package/harper-fabric/copy-overwrite/knip.json +24 -0
  58. package/harper-fabric/copy-overwrite/tsconfig.eslint.json +25 -0
  59. package/harper-fabric/copy-overwrite/tsconfig.json +7 -0
  60. package/harper-fabric/copy-overwrite/vitest.config.ts +30 -0
  61. package/harper-fabric/merge/.claude/settings.json +34 -0
  62. package/harper-fabric/merge/.oxlintrc.json +16 -0
  63. package/harper-fabric/package-lisa/package.lisa.json +94 -0
  64. package/oxlint/harper-fabric.json +11 -0
  65. package/package.json +8 -3
  66. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  72. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +35 -0
  73. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +33 -0
  74. package/plugins/lisa-harper-fabric/hooks/inject-rules.sh +16 -0
  75. package/plugins/lisa-harper-fabric/rules/harper-fabric.md +51 -0
  76. package/plugins/lisa-harper-fabric/skills/harper-build-and-deploy/SKILL.md +101 -0
  77. package/plugins/lisa-harper-fabric/skills/harper-component-model/SKILL.md +87 -0
  78. package/plugins/lisa-harper-fabric/skills/harper-config-yaml/SKILL.md +107 -0
  79. package/plugins/lisa-harper-fabric/skills/harper-resources/SKILL.md +106 -0
  80. package/plugins/lisa-harper-fabric/skills/harper-schema-graphql/SKILL.md +72 -0
  81. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  83. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  85. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  87. package/plugins/src/harper-fabric/.claude-plugin/plugin.json +15 -0
  88. package/plugins/src/harper-fabric/hooks/inject-rules.sh +16 -0
  89. package/plugins/src/harper-fabric/rules/harper-fabric.md +51 -0
  90. package/plugins/src/harper-fabric/skills/harper-build-and-deploy/SKILL.md +101 -0
  91. package/plugins/src/harper-fabric/skills/harper-component-model/SKILL.md +87 -0
  92. package/plugins/src/harper-fabric/skills/harper-config-yaml/SKILL.md +107 -0
  93. package/plugins/src/harper-fabric/skills/harper-resources/SKILL.md +106 -0
  94. package/plugins/src/harper-fabric/skills/harper-schema-graphql/SKILL.md +72 -0
  95. package/scripts/build-plugins.sh +1 -1
  96. package/scripts/copy-codex-scripts.mjs +28 -0
  97. package/scripts/generate-codex-plugin-artifacts.mjs +15 -0
  98. package/scripts/install-claude-plugins.sh +5 -5
  99. package/tsconfig/harper-fabric.json +20 -0
@@ -0,0 +1,51 @@
1
+ # Harper/Fabric Project Rules
2
+
3
+ These rules apply to Harper/Fabric component apps managed by Lisa.
4
+
5
+ ## Build The Real Thing
6
+
7
+ - Do not ship client-side workarounds for missing backend behavior. If a change needs a Harper resource, schema update, seed path, or deploy script change, make that change.
8
+ - Do not silently downgrade a feature to a stub, mock, or partial path. Only use a stop-gap when the user explicitly asks for one.
9
+ - Treat deployed Fabric behavior as part of the product. A change is unfinished until the local build and the relevant deployed or smoke path agree.
10
+
11
+ ## TypeScript Is Source
12
+
13
+ - TypeScript under `src/` is the source of truth for Harper resources, browser modules, shared libraries, and operational scripts.
14
+ - `harper-app/config.yaml`, `harper-app/schema.graphql`, HTML, CSS, docs, and research fixtures are source assets.
15
+ - `harper-app/resources.js` and `harper-app/web/**/*.js` are generated deploy artifacts. Never edit them directly; change the matching TypeScript and run `bun run build`.
16
+ - Deployment, bootstrap, smoke, seed, verify, preview, token, crawl, ingest, and extraction commands must run from compiled JavaScript or generated Harper assets, not stale checked-in JavaScript.
17
+
18
+ ## Harper/Fabric Deploy Surface
19
+
20
+ - A deployable Harper app must keep `config.yaml`, `schema.graphql`, `resources.js`, and `web/**` at the component root that Fabric packages.
21
+ - Build before symlinking, packaging, or deploying `harper-app/`.
22
+ - Keep runtime secrets out of tracked files. Prefer environment variables or OS keychain helpers; document secret locations without recording secret values.
23
+ - When discovering a Harper/Fabric limitation or workaround, document the symptom, root cause, fix, and tempting broken alternatives in the project runbook.
24
+
25
+ ## Documentation Sync
26
+
27
+ - Project docs are operational contracts. When commands, schema, deploy shape, data model, seeded-data summary, crawler behavior, credential handling, or UI components change, update the matching project doc in the same change.
28
+ - Harper schema changes must update the conceptual schema docs and any verify paths that assert joins or row counts.
29
+ - Deploy topology, credential rotation, generated-artifact layout, and Fabric workarounds belong in the Fabric runbook.
30
+ - UI component, token, variant, or design-system changes must update the design-system catalog.
31
+
32
+ ## UI Work
33
+
34
+ - Browser UI must be composed from the project design system. Search the existing design-system catalog and components before adding markup.
35
+ - Add or extend the design-system component first, then consume it from pages.
36
+ - Pages should import UI components through the design-system barrel, not deep component paths.
37
+ - Do not introduce raw colors or ad hoc spacing in UI styles. Use design tokens and update the token docs when adding tokens.
38
+ - Every UI change needs Playwright verification that checks DOM behavior and captures screenshots. Type checks and unit tests are not enough for visual changes.
39
+
40
+ ## Immutable Code
41
+
42
+ - Prefer immutable data flow: `readonly` types, pure transformations, object/array copies, and explicit returned values.
43
+ - Do not mutate parameters, imported singletons, fixture objects, records, arrays, DOM-derived state, or config objects unless an API requires mutation and the exception is documented locally.
44
+ - Avoid `let`; use `const` and small pure helper functions instead.
45
+ - Avoid `any`, broad casts, and `ts-ignore`. If an external API forces an escape hatch, isolate it behind a typed adapter.
46
+
47
+ ## Verification
48
+
49
+ - Run `bun run build`, `bun run typecheck`, and the smallest relevant test command before reporting completion.
50
+ - For deploy-affecting changes, also run the project smoke command against the local or deployed Harper endpoint.
51
+ - If a verification command cannot run, report the exact command and blocker.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: harper-build-and-deploy
3
+ description: This skill should be used when building, running locally, or deploying a Harper (HarperDB/Fabric) component — running harper dev/run, producing the generated resources.js and web/** from TypeScript via the project build, packaging the harper-app component, deploying to Harper Fabric, or handling deploy-time secrets. Use it for any change that affects the deployable surface or the dev loop. Pairs with harper-component-model, harper-config-yaml, and harper-resources.
4
+ ---
5
+
6
+ # Harper Build and Deploy
7
+
8
+ ## Overview
9
+
10
+ The Harper lifecycle is: **develop locally → build TypeScript into the deployable
11
+ component → run/iterate → deploy to Fabric**. This skill covers the CLI, the
12
+ project's build step, and the deploy surface so a change is provably finished, not
13
+ just compiling.
14
+
15
+ ## Local dev and run (the CLI)
16
+
17
+ The CLI binary is `harper` (v5; older installs use `harperdb`). Key commands:
18
+
19
+ | Command | What it does |
20
+ | --- | --- |
21
+ | `harper dev <path/to/app>` | Dev mode: **watches files, single-threaded, auto-restarts worker threads** on change, with console logging. The fast iteration loop. Does **not** restart the main thread. |
22
+ | `harper run <path/to/app>` | Run an app from any directory. Use when you need the main thread to (re)start; manage start/stop yourself. |
23
+ | `harper start` / `stop` / `restart` | Background (daemon) lifecycle. |
24
+ | `harper status` | Harper and clustering status. |
25
+ | `harper get_components` | List installed components. |
26
+
27
+ In this project, dev typically runs against the component dir, e.g.
28
+ `harper dev harper-app` (use the project's documented run command if it wraps this).
29
+
30
+ ## The build step (TypeScript → generated artifacts)
31
+
32
+ Harper loads JavaScript (`resources.js`) and serves static files (`web/**`). In this
33
+ project those are **generated**, not authored:
34
+
35
+ - **TypeScript under `src/` is source.** `bun run build` compiles it into
36
+ `harper-app/resources.js` and `harper-app/web/**`.
37
+ - **Never edit `resources.js` or `web/**` directly** — change the TypeScript and
38
+ rebuild. See [[harper-resources]] and [[harper-component-model]].
39
+ - **Build before symlinking, packaging, or deploying `harper-app/`.** Deploying
40
+ stale artifacts ships code that does not match `src/`.
41
+
42
+ ## The deployable surface
43
+
44
+ A deployable Harper component must keep these at the component root Fabric packages:
45
+
46
+ - `config.yaml` — active extensions ([[harper-config-yaml]])
47
+ - `schema.graphql` — data model ([[harper-schema-graphql]])
48
+ - `resources.js` — generated custom logic
49
+ - `web/**` — generated static assets
50
+
51
+ If a change touches this surface, it is not done until the local build and the
52
+ relevant deployed or smoke path agree.
53
+
54
+ ## Deploying to Fabric
55
+
56
+ Fabric is Harper's distributed deploy network. Deploy packages the component and
57
+ sends it to a target instance:
58
+
59
+ ```bash
60
+ harper deploy_component \
61
+ project=<app-name> \
62
+ package=<path-or-git-url> \
63
+ target=https://<instance>:9925 \
64
+ username=<user> \
65
+ password=<pass> \
66
+ restart=true \
67
+ replicated=true
68
+ ```
69
+
70
+ - Omitting `package` deploys the current directory.
71
+ - `restart=true` restarts threads after deploy so new code loads.
72
+ - `replicated=true` replicates the deploy across all nodes in a cluster — include it
73
+ when targeting Fabric/a cluster.
74
+ - Credentials can come from `CLI_TARGET_USERNAME` / `CLI_TARGET_PASSWORD` instead of
75
+ inline flags — prefer that so secrets never land in shell history or tracked files.
76
+
77
+ ## Secrets
78
+
79
+ Keep runtime secrets out of tracked files. Use environment variables, the
80
+ `loadEnv` extension, or an OS keychain helper. Document *where* secrets live (which
81
+ env var, which store) without recording their values.
82
+
83
+ ## Verification (required before reporting done)
84
+
85
+ 1. `bun run build` — produces fresh `resources.js` / `web/**`.
86
+ 2. `bun run typecheck`.
87
+ 3. The smallest relevant test command.
88
+ 4. For deploy-affecting changes, the project **smoke command** against the local or
89
+ deployed Harper endpoint.
90
+
91
+ If a verification command cannot run, report the exact command and the blocker —
92
+ do not claim completion. When you hit a Harper/Fabric limitation or workaround,
93
+ record the symptom, root cause, fix, and the tempting-but-broken alternatives in
94
+ the project's Fabric runbook.
95
+
96
+ ## Sources
97
+
98
+ - [Harper CLI overview](https://docs.harperdb.io/reference/v4/cli/overview)
99
+ - [Harper CLI](https://docs.harperdb.io/docs/deployments/harper-cli)
100
+ - [Plugin API](https://docs.harperdb.io/reference/v5/components/plugin-api)
101
+ - [Harper Fabric](https://www.harper.fast/)
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: harper-component-model
3
+ description: This skill should be used when reasoning about how a Harper (formerly HarperDB) Fabric application is structured — what a component, application, extension, or plugin is, where code and assets belong, and how the pieces depend on each other. Use it before adding a new capability, wiring an extension, deciding where a file should live, or explaining the runtime to someone. Pairs with harper-config-yaml, harper-resources, harper-schema-graphql, and harper-build-and-deploy.
4
+ ---
5
+
6
+ # Harper Component Model
7
+
8
+ ## Overview
9
+
10
+ Harper (formerly HarperDB; the product and company now at harper.fast) is an
11
+ open-source Node.js platform that fuses **database, cache, application logic, and
12
+ messaging into a single in-memory process**. **Fabric** is Harper's distributed
13
+ deploy network: you develop locally, then deploy the same component to Fabric.
14
+
15
+ Everything you build is a **component**. Understanding the component hierarchy is
16
+ the prerequisite for every other Harper decision — config, resources, schema, and
17
+ deploy all hang off it.
18
+
19
+ ## The three tiers
20
+
21
+ Harper organizes functionality into three tiers, top to bottom:
22
+
23
+ 1. **Applications** — the user-facing product. An application *is* a type of
24
+ component. It implements business logic (REST/GraphQL endpoints, web UI,
25
+ real-time) by depending on extensions/plugins. This is what this project is.
26
+ 2. **Plugins** (v5) / **Extensions** (deprecated) — the building blocks an
27
+ application depends on. A plugin exports a single `handleApplication(scope)`
28
+ method and always runs on worker threads. The deprecated Extension API used
29
+ `start`, `handleFile`, `handleDirectory`, and `setupDirectory` instead.
30
+ `handleApplication()` cannot coexist with Extension API methods — defining
31
+ both throws. Prefer the Plugin API for any custom building block.
32
+ 3. **Core services** — the high-performance database, networking middleware, and
33
+ the component manager. You configure these; you don't reimplement them.
34
+
35
+ > An *application* is the component you ship. *Extensions/plugins* are the
36
+ > capabilities it consumes. Built-in extensions (`graphqlSchema`, `jsResource`,
37
+ > `rest`, `static`, …) are provided by core; you only *enable* them in
38
+ > `config.yaml`. See [[harper-config-yaml]].
39
+
40
+ ## Built-in extensions an application typically uses
41
+
42
+ These ship with Harper and are enabled (not installed) via `config.yaml`:
43
+
44
+ - `graphqlSchema` — define database tables/types from GraphQL schema files. See [[harper-schema-graphql]].
45
+ - `jsResource` — load custom JavaScript resources (`resources.js`). See [[harper-resources]].
46
+ - `rest` — auto-generate REST endpoints for exported resources/tables.
47
+ - `static` — serve static files (the `web/**` directory) over HTTP.
48
+ - `roles` — role-based access control from `roles.yaml`.
49
+ - `loadEnv` — load environment variables from `.env`.
50
+ - `dataLoader` — seed Harper tables from JSON/YAML.
51
+ - `fastifyRoutes` — custom Fastify route handlers.
52
+
53
+ ## Where things live in this project
54
+
55
+ This project wraps Harper's native model with a fixed layout under `harper-app/`:
56
+
57
+ | Path | Role | Source or generated |
58
+ | --- | --- | --- |
59
+ | `harper-app/config.yaml` | Component config — which extensions are active | **Source** |
60
+ | `harper-app/schema.graphql` | Table/type definitions | **Source** |
61
+ | `src/**` (TypeScript) | Resources, browser modules, shared libs, scripts | **Source** |
62
+ | `harper-app/resources.js` | Loaded by `jsResource` | **Generated** — never edit; build from TS |
63
+ | `harper-app/web/**` | Served by `static` | **Generated** — never edit; build from TS |
64
+
65
+ The TypeScript under `src/` is the source of truth. `resources.js` and `web/**`
66
+ are deploy artifacts produced by `bun run build`. Never hand-edit them — change
67
+ the matching TypeScript and rebuild. See [[harper-build-and-deploy]].
68
+
69
+ ## Decision guide
70
+
71
+ - **Adding a backend behavior?** It's almost always a *resource* (custom logic) or
72
+ a *schema* change (new table/field), enabled through `config.yaml`. Don't ship a
73
+ client-side workaround for missing backend behavior — make the Harper change.
74
+ - **Adding a reusable building block / npm-publishable capability?** That's a
75
+ *plugin* (`pluginModule`), not application code.
76
+ - **Adding static UI?** It belongs in `web/**` (generated from `src/` UI code), served
77
+ by the `static` extension.
78
+ - **Not sure if it deploys?** A deployable Harper app must keep `config.yaml`,
79
+ `schema.graphql`, `resources.js`, and `web/**` at the component root that Fabric
80
+ packages. If your change touches that surface, build before packaging.
81
+
82
+ ## Sources
83
+
84
+ - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
85
+ - [Plugin API](https://docs.harperdb.io/reference/v5/components/plugin-api)
86
+ - [Applications](https://docs.harperdb.io/docs/developers/applications)
87
+ - [Harper platform](https://www.harper.fast/)
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: harper-config-yaml
3
+ description: This skill should be used when creating or editing a Harper (HarperDB/Fabric) component's config.yaml — enabling a built-in extension (graphqlSchema, jsResource, rest, static, roles, loadEnv, dataLoader, fastifyRoutes), wiring an external component, or troubleshooting why an extension is not loading. Critical: it documents the no-merge footgun where a custom config.yaml replaces Harper's default config entirely. Pairs with harper-component-model, harper-resources, and harper-schema-graphql.
4
+ ---
5
+
6
+ # Harper config.yaml
7
+
8
+ ## Overview
9
+
10
+ A Harper component is configured by a single `config.yaml` at the component root
11
+ (`harper-app/config.yaml` in this project). It declares **which extensions are
12
+ active** and which files each extension reads. Extensions are *enabled* here, not
13
+ installed — the built-ins ship with Harper.
14
+
15
+ The structure is a map of extension name to its options:
16
+
17
+ ```yaml
18
+ extensionName:
19
+ option-1: value
20
+ option-2: value
21
+ ```
22
+
23
+ ## ⚠️ The no-merge footgun
24
+
25
+ If a component has **no** `config.yaml`, Harper applies this default automatically:
26
+
27
+ ```yaml
28
+ rest: true
29
+ graphqlSchema:
30
+ files: '*.graphql'
31
+ roles:
32
+ files: 'roles.yaml'
33
+ jsResource:
34
+ files: 'resources.js'
35
+ fastifyRoutes:
36
+ files: 'routes/*.js'
37
+ urlPath: '.'
38
+ static:
39
+ files: 'web/**'
40
+ ```
41
+
42
+ The moment you add a **custom `config.yaml`, it replaces this default entirely —
43
+ Harper does not merge your file with the defaults.** If you write a `config.yaml`
44
+ that only enables `static`, you have silently turned off `rest`, `graphqlSchema`,
45
+ `jsResource`, and `roles`. This is the most common Harper config mistake.
46
+
47
+ **Rule:** when you add or edit `config.yaml`, re-declare every extension the app
48
+ actually needs — start from the default block above and add to it. Do not assume
49
+ unmentioned extensions stay on.
50
+
51
+ ## Built-in extensions
52
+
53
+ | Key | Purpose | Common options |
54
+ | --- | --- | --- |
55
+ | `rest` | Auto REST endpoints for exported resources/tables | `true`, or an object with options |
56
+ | `graphqlSchema` | Define tables/types from GraphQL files | `files: '*.graphql'` — see [[harper-schema-graphql]] |
57
+ | `jsResource` | Load custom JS resources | `files: 'resources.js'` — see [[harper-resources]] |
58
+ | `static` | Serve static files over HTTP | `files: 'web/**'`, `urlPath` |
59
+ | `roles` | Role-based access control | `files: 'roles.yaml'` |
60
+ | `loadEnv` | Load env vars from `.env` | `files` |
61
+ | `dataLoader` | Seed tables from JSON/YAML | `files` |
62
+ | `fastifyRoutes` | Custom Fastify routes | `files: 'routes/*.js'`, `urlPath` |
63
+
64
+ ## External components and custom plugins
65
+
66
+ A component you depend on from npm needs a `package:` directive matching a
67
+ `package.json` dependency:
68
+
69
+ ```yaml
70
+ '@harperdb/nextjs':
71
+ package: '@harperdb/nextjs'
72
+ files: './'
73
+ ```
74
+
75
+ A custom plugin you author is wired with `pluginModule` (point at the built JS, not
76
+ TypeScript source):
77
+
78
+ ```yaml
79
+ pluginModule: ./dist/index.js
80
+ ```
81
+
82
+ The deprecated Extension API used `extensionModule` instead. Prefer `pluginModule`.
83
+ See [[harper-component-model]] for the plugin-vs-extension distinction.
84
+
85
+ ## Project conventions
86
+
87
+ - `config.yaml` is **source** and lives at `harper-app/config.yaml`. It is part of
88
+ the deployable surface Fabric packages — keep it at the component root.
89
+ - The files `config.yaml` points to (`resources.js`, `web/**`) are **generated** by
90
+ `bun run build` from TypeScript under `src/`. Editing `config.yaml` to point at a
91
+ new file means the build must produce that file. See [[harper-build-and-deploy]].
92
+ - A `config.yaml` change is a deploy-shape change: update the matching project doc
93
+ (the Fabric runbook) in the same change, and re-run the smoke command.
94
+ - Keep secrets out of `config.yaml`. Use `loadEnv` / environment variables and
95
+ document *where* secrets live without recording their values.
96
+
97
+ ## Verification
98
+
99
+ After editing `config.yaml`, confirm the app still boots and the expected surface
100
+ is live: run `harper dev harper-app` (or the project's run command) and check that
101
+ the REST/GraphQL/static endpoints you rely on respond. A config that silently
102
+ dropped an extension often fails only at runtime, not at build time.
103
+
104
+ ## Sources
105
+
106
+ - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
107
+ - [Built-in extensions](https://docs.harperdb.io/docs/reference/components/built-in-extensions)
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: harper-resources
3
+ description: 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.
4
+ ---
5
+
6
+ # Harper Resources
7
+
8
+ ## Overview
9
+
10
+ A **Resource** is a class that provides a unified interface for a set of records or
11
+ entities. Resources are how you add custom server-side behavior to a Harper app.
12
+ They are loaded by the `jsResource` extension (default file `resources.js`) and,
13
+ when **exported**, become live REST and GraphQL endpoints.
14
+
15
+ A resource either **extends a database table** (to customize an existing table's
16
+ behavior) or **extends the base `Resource` class** (to expose data from anywhere —
17
+ an external API, a computed view, an in-memory source).
18
+
19
+ ## Method → HTTP verb mapping
20
+
21
+ The Resource API mirrors REST. Override the method matching the operation you want
22
+ to customize:
23
+
24
+ | Method | HTTP | Use |
25
+ | --- | --- | --- |
26
+ | `get(target)` | GET | Retrieve a record/collection |
27
+ | `post(data)` | POST | Create |
28
+ | `put(target, data)` | PUT | Replace |
29
+ | `patch(target, data)` | PATCH | Partial update |
30
+ | `delete(target)` | DELETE | Remove |
31
+ | `search(query)` | GET (query) | Query with conditions |
32
+ | `subscribe` / `publish` | MQTT/WebSocket | Real-time |
33
+
34
+ ## Extending a table
35
+
36
+ Add computed fields or guard logic while keeping the table's built-in behavior via
37
+ `super`:
38
+
39
+ ```javascript
40
+ export class MyTable extends tables.MyTable {
41
+ static async get(target) {
42
+ const record = await super.get(target);
43
+ return { ...record, computedField: 'value' };
44
+ }
45
+ }
46
+ ```
47
+
48
+ ## Wrapping an external source
49
+
50
+ ```javascript
51
+ export class MyExternalData extends Resource {
52
+ static async get(target) {
53
+ const response = await fetch(`https://api.example.com/${target.id}`);
54
+ return response.json();
55
+ }
56
+ }
57
+ ```
58
+
59
+ ## Making a resource an endpoint
60
+
61
+ A resource becomes an endpoint when it is **exported** and `rest: true` (and/or
62
+ `graphqlSchema`) is enabled in `config.yaml`:
63
+
64
+ ```yaml
65
+ rest: true
66
+ graphqlSchema:
67
+ files: schema.graphql
68
+ jsResource:
69
+ files: resources.js
70
+ ```
71
+
72
+ Resources can also be registered programmatically with `server.resources.set()`.
73
+ See [[harper-config-yaml]] for the extension wiring and [[harper-schema-graphql]]
74
+ for how the schema defines the tables resources extend.
75
+
76
+ ## Project conventions (TS is source)
77
+
78
+ - **Write resources in TypeScript under `src/`. `harper-app/resources.js` is a
79
+ generated artifact** produced by `bun run build`. Never edit `resources.js` by
80
+ hand — change the TypeScript and rebuild. See [[harper-build-and-deploy]].
81
+ - Operational scripts that touch resources (seed, smoke, verify, ingest, crawl,
82
+ extraction) must run from compiled JavaScript or generated Harper assets, not
83
+ stale checked-in JS.
84
+ - Prefer immutable data flow: `readonly` types, pure transformations, copies, and
85
+ explicit returns. Do not mutate parameters, records, arrays, or config objects
86
+ unless an API forces it, and document the exception locally.
87
+ - Avoid `any`, broad casts, and `ts-ignore`. If an external API forces an escape
88
+ hatch, isolate it behind a typed adapter.
89
+
90
+ ## Build the real thing
91
+
92
+ If an endpoint needs a schema change, a seed path, or a deploy script change, make
93
+ that change — do not ship a client-side workaround or silently downgrade to a stub
94
+ or mock. A change is unfinished until the local build and the relevant deployed or
95
+ smoke path agree.
96
+
97
+ ## Verification
98
+
99
+ Run `bun run build`, `bun run typecheck`, and the smallest relevant test. For an
100
+ endpoint change, also hit the actual REST/GraphQL route against a local or deployed
101
+ Harper instance (the project smoke command) and confirm the response shape.
102
+
103
+ ## Sources
104
+
105
+ - [Resources overview](https://docs.harperdb.io/reference/v5/resources/overview)
106
+ - [Applications](https://docs.harperdb.io/docs/developers/applications)
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: harper-schema-graphql
3
+ description: This skill should be used when editing a Harper (HarperDB/Fabric) schema.graphql — defining or changing database tables, types, fields, relationships, or indexes that the graphqlSchema extension turns into Harper tables and API surface. Use it when adding a table, changing the data model, or when a resource/verify path depends on schema shape. Pairs with harper-resources, harper-config-yaml, and harper-component-model.
4
+ ---
5
+
6
+ # Harper schema.graphql
7
+
8
+ ## Overview
9
+
10
+ Harper defines its database tables and types from **GraphQL schema files**, loaded
11
+ by the `graphqlSchema` extension (default `*.graphql`; this project uses
12
+ `harper-app/schema.graphql`). The schema is the source of truth for the data model:
13
+ the tables it declares are what resources extend ([[harper-resources]]) and what
14
+ the REST/GraphQL surface exposes.
15
+
16
+ ## Defining tables
17
+
18
+ A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
+ table and control exposure, primary keys, and indexes. The exact directive set
20
+ depends on the Harper version in use — confirm against the live `schema.graphql`
21
+ in this project and the Harper schema docs before adding new syntax. Common shape:
22
+
23
+ ```graphql
24
+ type Dog @table {
25
+ id: ID @primaryKey
26
+ name: String @indexed
27
+ breed: String
28
+ owner: String
29
+ }
30
+ ```
31
+
32
+ - `@table` marks the type as a persisted Harper table.
33
+ - `@primaryKey` marks the primary key field.
34
+ - `@indexed` adds a secondary index for query/`search`.
35
+ - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
+ configuration — see [[harper-config-yaml]].
37
+
38
+ > Treat the directive names above as a starting point, not gospel — verify against
39
+ > the project's existing schema and current Harper docs, since directive syntax has
40
+ > evolved across versions.
41
+
42
+ ## How the schema drives the app
43
+
44
+ - The `graphqlSchema` extension creates/migrates tables from the schema on load.
45
+ - `rest: true` exposes exported tables/resources as REST endpoints; the GraphQL
46
+ surface is generated from the same schema.
47
+ - Resources that `extends tables.X` depend on `X` existing in the schema. A rename
48
+ or removal in the schema is a breaking change for every resource and verify path
49
+ that references it.
50
+
51
+ ## Project conventions
52
+
53
+ - `schema.graphql` is **source** and lives at the component root that Fabric
54
+ packages (`harper-app/schema.graphql`). Keep it there.
55
+ - A schema change is a data-model change. In the **same change**:
56
+ - Update the conceptual schema docs.
57
+ - Update any verify/smoke paths that assert joins, relationships, or row counts —
58
+ those assertions encode the data model and must track it.
59
+ - Update resources and seed/data-loader paths that reference changed tables.
60
+ - Document deploy-affecting consequences (new tables, migrations) in the Fabric
61
+ runbook. See [[harper-build-and-deploy]].
62
+
63
+ ## Verification
64
+
65
+ After a schema change, boot the app (`harper dev harper-app` or the project run
66
+ command) and confirm tables migrate cleanly and the dependent endpoints respond.
67
+ Run any verify path that asserts row counts or joins against the changed model.
68
+
69
+ ## Sources
70
+
71
+ - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
+ - [Applications](https://docs.harperdb.io/docs/developers/applications)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.19.1",
3
+ "version": "2.21.0",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "lisa-harper-fabric",
3
+ "version": "1.0.0",
4
+ "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
+ "author": { "name": "Cody Swann" },
6
+ "dependencies": ["lisa-typescript"],
7
+ "hooks": {
8
+ "SessionStart": [
9
+ { "matcher": "", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/inject-rules.sh" }] }
10
+ ],
11
+ "SubagentStart": [
12
+ { "matcher": "", "hooks": [{ "type": "command", "command": "${CLAUDE_PLUGIN_ROOT}/hooks/inject-rules.sh" }] }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+ # Reads all .md files from the plugin's rules/ directory and injects them
3
+ # into Claude context at session/subagent start.
4
+ set -euo pipefail
5
+
6
+ ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}}"
7
+ RULES_DIR="$ROOT/rules"
8
+
9
+ [ -d "$RULES_DIR" ] || exit 0
10
+
11
+ for rule in "$RULES_DIR"/*.md; do
12
+ [ -f "$rule" ] || continue
13
+ printf '\n<lisa-harper-fabric-rule path="%s">\n' "$rule"
14
+ cat "$rule"
15
+ printf '\n</lisa-harper-fabric-rule>\n'
16
+ done