diff --git a/template-early-hints/AGENTS.md b/template-early-hints/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-early-hints/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-early-hints/CLAUDE.md b/template-early-hints/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-early-hints/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-react-ssr/AGENTS.md b/template-react-ssr/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-react-ssr/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-react-ssr/CLAUDE.md b/template-react-ssr/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-react-ssr/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-react-ts-ssr/AGENTS.md b/template-react-ts-ssr/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-react-ts-ssr/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-react-ts-ssr/CLAUDE.md b/template-react-ts-ssr/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-react-ts-ssr/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-react-ts/AGENTS.md b/template-react-ts/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-react-ts/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-react-ts/CLAUDE.md b/template-react-ts/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-react-ts/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-react/AGENTS.md b/template-react/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-react/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-react/CLAUDE.md b/template-react/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-react/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vanilla-ts/AGENTS.md b/template-vanilla-ts/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vanilla-ts/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vanilla-ts/CLAUDE.md b/template-vanilla-ts/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vanilla-ts/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vanilla/AGENTS.md b/template-vanilla/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vanilla/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vanilla/CLAUDE.md b/template-vanilla/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vanilla/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vue-ssr/AGENTS.md b/template-vue-ssr/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vue-ssr/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vue-ssr/CLAUDE.md b/template-vue-ssr/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vue-ssr/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vue-ts-ssr/AGENTS.md b/template-vue-ts-ssr/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vue-ts-ssr/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vue-ts-ssr/CLAUDE.md b/template-vue-ts-ssr/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vue-ts-ssr/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vue-ts/AGENTS.md b/template-vue-ts/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vue-ts/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vue-ts/CLAUDE.md b/template-vue-ts/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vue-ts/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template-vue/AGENTS.md b/template-vue/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/template-vue/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/template-vue/CLAUDE.md b/template-vue/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/template-vue/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/template.tests/template.test.js b/template.tests/template.test.js index 2b844b6..1059927 100644 --- a/template.tests/template.test.js +++ b/template.tests/template.test.js @@ -12,6 +12,10 @@ const tempDir = path.resolve(root, '.temp-integration-tests'); // can't silently skip a build it needs: it fails the assertions below until it's added here. const BUILD_BEFORE_DEPLOY_TEMPLATES = new Set(['nextjs', 'nextjs-ts']); +// Templates that don't receive the shared AGENTS.md / CLAUDE.md yet: the Next.js templates are not in the +// `templates-shared` fan-out (see applySharedTemplates.js). Explicit so a new template can't skip them silently. +const WITHOUT_AGENT_INSTRUCTIONS_TEMPLATES = new Set(['nextjs', 'nextjs-ts']); + describe('Integration tests', () => { beforeAll(() => { if (fs.existsSync(tempDir)) { @@ -90,6 +94,13 @@ describe('Integration tests', () => { expect(fs.existsSync(path.join(targetDir, '.env.example'))).toBe(true); } + // Agent instructions ship at the project root, un-renamed. + if (!WITHOUT_AGENT_INSTRUCTIONS_TEMPLATES.has(template)) { + const agentsMd = fs.readFileSync(path.join(targetDir, 'AGENTS.md'), 'utf-8'); + expect(agentsMd).toContain('.agents/skills/harper-architecture/SKILL.md'); + expect(fs.readFileSync(path.join(targetDir, 'CLAUDE.md'), 'utf-8').trim()).toBe('@AGENTS.md'); + } + // The deploy workflow must live under `.github/workflows/` (plural — GitHub only runs // workflows there; the singular `workflow/` these templates used to ship never triggered). expect(fs.existsSync(path.join(targetDir, '.github', 'workflows', 'deploy.yaml'))).toBe(true); diff --git a/templates-shared/all/AGENTS.md b/templates-shared/all/AGENTS.md new file mode 100644 index 0000000..96c00ad --- /dev/null +++ b/templates-shared/all/AGENTS.md @@ -0,0 +1,42 @@ +# AGENTS.md + +This is a Harper application. Harper is the whole backend. The database, cache, API server, real-time messaging, file storage, vector search, and web server all run in this one process, configured by `config.yaml`. Build every feature inside this component. Do not add separate services for jobs Harper already does. + +## Before you plan or write code + +1. **Read `.agents/skills/harper-architecture/SKILL.md` first.** Read it before planning, before choosing libraries, and before adding any dependency. If the file is missing, run `npm run agent:skills:update`, then read it. +2. **Record a capability decision for each requirement.** For every requirement, name the Harper capability that covers it, using the mapping table in that skill. Add an outside service only when you can name what Harper lacks for that requirement and point to the doc or rule that shows it. Preference, unfamiliarity, and not finding the docs are not gaps. +3. **Read the matching rule before you implement a feature.** The rules live in `.agents/skills/harper-best-practices/rules/`. For example, read `caching.md` before building a cache and `real-time-apps.md` before building live updates. + +## Stop and re-check if you are about to + +- Install `redis`, `ioredis`, `pg`, `mysql2`, `mongodb`, `prisma`, `drizzle-orm`, `express`, `fastify`, `koa`, `socket.io`, `ws`, `kafkajs`, `@aws-sdk/client-s3`, `@pinecone-database/pinecone`, `passport`, `jsonwebtoken`, or `bcrypt`. +- Add a second service to a `docker-compose.yml`. +- Start another HTTP server or listen on another port. +- Keep sessions, users, or app state in a module-level `Map` or object. +- Hash or compare passwords yourself. + +Each of these usually means you are rebuilding something Harper already provides. Go back to the mapping table in `harper-architecture`. + +## Project layout + +| Path | What goes here | +| ------------------- | ----------------------------------------------------------------------------------------------------------- | +| `schemas/*.graphql` | Tables. An `@export`ed table gets REST and WebSocket endpoints automatically. | +| `resources/` | Custom logic in `.js` or `.ts` files: extend a generated table (`extends tables.X`) or define a `Resource`. | +| `config.yaml` | Which Harper plugins load which files (`rest`, `graphqlSchema`, `jsResource`, `static`). | +| `web/` or `src/` | Frontend, served by Harper's `static` plugin (and `@harperfast/vite` for Vite apps). | +| `test/` | Tests, run by the `test` script in `package.json`. | + +## Commands + +Shown with npm. Use the project's package manager if it's different. + +- `npm run dev`: run locally with `harper dev .` +- `npm test`: run the tests +- `npm run deploy`: deploy to Harper Fabric +- `npm run agent:skills:update`: install or refresh the Harper skills in `.agents/skills/` + +## Tests + +A test must exercise production code. Ask: if the production change were reverted and the test left as is, would the test fail? If not, the test proves nothing. Import and call the real module or hit the real endpoint. Do not copy the logic into the test file. diff --git a/templates-shared/all/CLAUDE.md b/templates-shared/all/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/templates-shared/all/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md