diff --git a/.agents/skills/constructive-monorepo-setup/SKILL.md b/.agents/skills/constructive-monorepo-setup/SKILL.md new file mode 100644 index 000000000..164a50045 --- /dev/null +++ b/.agents/skills/constructive-monorepo-setup/SKILL.md @@ -0,0 +1,77 @@ +# Constructive Monorepo Setup + +Set up the Constructive monorepo for local development and testing. + +## Prerequisites + +- Node.js 20+ +- pnpm 9+ +- Docker (for PostgreSQL) +- pgpm CLI (`npm install -g pgpm`) + +## Quick Start + +```bash +# 1. Install dependencies +pnpm install + +# 2. Start PostgreSQL via pgpm Docker +pgpm docker start --image docker.io/constructiveio/postgres-plus:18 --recreate + +# 3. Load environment variables +eval "$(pgpm env)" + +# 4. Bootstrap admin users for testing +pgpm admin-users bootstrap --yes +pgpm admin-users add --test --yes + +# 5. Build the monorepo +pnpm build + +# 6. Run tests in a specific package +cd packages/ +pnpm test +``` + +## Docker Image + +Use `docker.io/constructiveio/postgres-plus:18` which includes PostgreSQL with PostGIS, pgvector, pg_textsearch, pg_trgm, btree_gin, and uuid-ossp extensions. + +For detailed Docker and pgpm usage, see the [pgpm skill](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/pgpm) in the public skills repo. + +## Monorepo Navigation + +See [AGENTS.md](../../AGENTS.md) at the repo root for the full navigation guide covering: +- Package layout (`packages/*`, `pgpm/*`, `graphql/*`, `postgres/*`, `graphile/*`) +- Entry points (PGPM CLI, Constructive CLI, GraphQL Server) +- Environment configuration patterns +- Testing framework selection guide + +## Code Generation (SDK) + +To regenerate the GraphQL SDK after schema changes: + +```bash +# Generate types, hooks, ORM, and CLI from a running GraphQL endpoint +cnc codegen +``` + +Skills are auto-generated to `.agents/skills/` when `docs.skills: true` is set in the codegen config. + +For detailed codegen configuration, see the [constructive-graphql skill](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-graphql) — specifically the [codegen.md reference](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-graphql/references/codegen.md). + +## Graphile Plugin Development + +Graphile plugins live under `graphile/*`. For PostGIS plugin development and testing, see the [constructive-graphql skill](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-graphql) — specifically the [search-postgis.md reference](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-graphql/references/search-postgis.md). + +## Testing + +See [AGENTS.md](../../AGENTS.md) for the testing framework selection guide. For comprehensive database testing patterns, see the [constructive-testing skill](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-testing). + +## Related Skills + +- [pgpm](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/pgpm) — Docker, migrations, deploy/verify/revert +- [constructive-graphql](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-graphql) — Codegen, search, PostGIS +- [constructive-testing](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-testing) — pgsql-test, drizzle-orm-test +- [constructive-tooling](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-tooling) — pnpm workspace, makage builds +- [constructive-setup](https://github.com/constructive-io/constructive-skills/tree/main/.agents/skills/constructive-setup) — Full setup guide (public skills repo) diff --git a/graphql/codegen/src/core/generate.ts b/graphql/codegen/src/core/generate.ts index cf4a9e97e..3b9459560 100644 --- a/graphql/codegen/src/core/generate.ts +++ b/graphql/codegen/src/core/generate.ts @@ -113,7 +113,7 @@ function resolveSkillsOutputDir( : path.resolve(workspaceRoot, config.skillsPath); } - return path.resolve(workspaceRoot, 'skills'); + return path.resolve(workspaceRoot, '.agents/skills'); } export async function generate( diff --git a/graphql/codegen/src/types/config.ts b/graphql/codegen/src/types/config.ts index 4d1bdf018..86dca75c4 100644 --- a/graphql/codegen/src/types/config.ts +++ b/graphql/codegen/src/types/config.ts @@ -426,7 +426,7 @@ export interface GraphQLSDKConfigTarget { /** * Custom path for generated skill files. * When set, skills are written to this directory. - * When undefined (default), skills are written to {workspaceRoot}/skills/ + * When undefined (default), skills are written to {workspaceRoot}/.agents/skills/ * where workspaceRoot is auto-detected by walking up from the output directory * looking for pnpm-workspace.yaml, lerna.json, or package.json with workspaces. */