env-secrets 0.5.2 → 0.5.4
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.
- package/.claude/rules/cicd.md +189 -0
- package/.claude/rules/docs.md +96 -0
- package/.claude/rules/git-hooks.md +43 -0
- package/.claude/rules/local-dev-badges.md +91 -0
- package/.claude/rules/local-dev-env.md +382 -0
- package/.claude/rules/local-dev-license.md +104 -0
- package/.claude/rules/local-dev-mcp.md +70 -0
- package/.claude/rules/observability.md +23 -0
- package/.claude/rules/publishing-api.md +158 -0
- package/.claude/rules/publishing-apps.md +204 -0
- package/.claude/rules/publishing-apt.md +146 -0
- package/.claude/rules/publishing-brew.md +110 -0
- package/.claude/rules/publishing-cli.md +238 -0
- package/.claude/rules/publishing-libraries.md +115 -0
- package/.claude/rules/publishing-sdks.md +109 -0
- package/.claude/rules/publishing-web.md +185 -0
- package/.claude/rules/typescript-linting.md +141 -0
- package/.claude/rules/typescript-logging.md +356 -0
- package/.claude/rules/typescript-testing.md +185 -0
- package/.claude/settings.json +18 -0
- package/.claude/skills/github-health-check.skill +0 -0
- package/.codex/rules/cicd.md +21 -0
- package/.codex/rules/docs.md +98 -0
- package/.codex/rules/git-hooks.md +43 -0
- package/.codex/rules/github-health-check.md +440 -0
- package/.codex/rules/local-dev-env.md +47 -0
- package/.codex/rules/local-dev-license.md +3 -1
- package/.codex/rules/publishing-api.md +160 -0
- package/.codex/rules/publishing-apps.md +206 -0
- package/.codex/rules/publishing-apt.md +148 -0
- package/.codex/rules/publishing-brew.md +112 -0
- package/.codex/rules/publishing-cli.md +240 -0
- package/.codex/rules/publishing-libraries.md +117 -0
- package/.codex/rules/publishing-sdks.md +111 -0
- package/.codex/rules/publishing-web.md +187 -0
- package/.codex/rules/typescript-linting.md +143 -0
- package/.codex/rules/typescript-logging.md +358 -0
- package/.codex/rules/typescript-testing.md +187 -0
- package/.github/workflows/deploy-docs.yml +2 -2
- package/.github/workflows/unittests.yaml +1 -1
- package/.rulesrc.json +20 -0
- package/AGENTS.md +34 -0
- package/CLAUDE.md +58 -0
- package/README.md +17 -3
- package/__e2e__/aws-exec-args.test.ts +97 -1
- package/__e2e__/aws-secret-value-args.test.ts +142 -0
- package/__e2e__/utils/test-utils.ts +78 -0
- package/__tests__/cli/helpers.test.ts +35 -0
- package/__tests__/index.test.ts +208 -58
- package/dist/cli/helpers.js +13 -1
- package/dist/index.js +94 -44
- package/docker-compose.yaml +1 -1
- package/docs/AWS.md +42 -13
- package/package.json +6 -6
- package/src/cli/helpers.ts +16 -0
- package/src/index.ts +117 -52
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# Local Development Environment Rules
|
|
2
|
+
|
|
3
|
+
These rules help set up and maintain a consistent local development environment for TypeScript/JavaScript projects, including Dockerfile and Docker Compose for local development following https://www.markcallen.com/dockerfile-for-typescript/
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Local Development Environment Agent
|
|
8
|
+
|
|
9
|
+
You are a local development environment specialist for TypeScript/JavaScript projects.
|
|
10
|
+
|
|
11
|
+
## Goals
|
|
12
|
+
|
|
13
|
+
- **Reproducible environments**: Help set up and document local dev setup (Node version, env vars, Docker Compose, dev scripts) so anyone can run the project with minimal friction.
|
|
14
|
+
- **Developer experience**: Recommend and configure tooling (debugging, hot reload, env validation) and conventions (branch naming, commit hooks) that keep local dev fast and consistent.
|
|
15
|
+
- **Documentation**: Keep README and runbooks (e.g. "Getting started", "Troubleshooting") in sync with the actual setup so new contributors can self-serve.
|
|
16
|
+
|
|
17
|
+
## Scope
|
|
18
|
+
|
|
19
|
+
- Local run scripts, env files (.env.example), and optional containerized dev (e.g. Docker Compose for services).
|
|
20
|
+
- Version managers (nvm, volta) and required Node/npm versions.
|
|
21
|
+
- Pre-commit or pre-push hooks that run tests/lint locally before pushing. For TypeScript projects, run `build` before `test` in these hooks (e.g. `pnpm run build && pnpm test`). Make it clear in hook scripts that if `build` or `test` fails (non-zero exit), the hook should abort and prevent the commit/push. To keep commits fast, prefer light checks (format, lint, basic typecheck) in `pre-commit` and heavier `build && test` flows in `pre-push` or in CI.
|
|
22
|
+
|
|
23
|
+
## Pull Request Workflow
|
|
24
|
+
|
|
25
|
+
When the user is creating or landing a pull request as part of local development workflow, treat PR hygiene as part of the job.
|
|
26
|
+
|
|
27
|
+
### Your Responsibilities
|
|
28
|
+
|
|
29
|
+
1. **Ensure Copilot is assigned to the PR**
|
|
30
|
+
|
|
31
|
+
- When a PR exists or is being created, check whether GitHub Copilot is assigned for code review/agent assistance when the repository workflow expects it.
|
|
32
|
+
- If Copilot is not assigned, assign it before considering the PR ready.
|
|
33
|
+
- Do not assume assignment happened automatically; verify it.
|
|
34
|
+
- For Copilot or any other reviewer, summarize the review comments and requested changes so the user can decide what should be fixed next.
|
|
35
|
+
|
|
36
|
+
2. **Use a sub-agent to monitor PR checks**
|
|
37
|
+
|
|
38
|
+
- After pushing commits or creating/updating a PR, use a sub-agent to watch the PR checks while the main agent continues with other work.
|
|
39
|
+
- Have the sub-agent report back when checks succeed or when a check fails.
|
|
40
|
+
- Treat pending or failing checks as part of the task, not as an afterthought.
|
|
41
|
+
- Do not tell the user the PR is ready until the sub-agent confirms the required checks are green.
|
|
42
|
+
|
|
43
|
+
3. **Use `gh` to inspect failures**
|
|
44
|
+
|
|
45
|
+
- If PR checks fail, use the GitHub CLI to inspect the failing runs, jobs, logs, and annotations.
|
|
46
|
+
- Prefer `gh pr checks`, `gh run view`, and related `gh` commands so the user gets concrete failure context tied to the PR.
|
|
47
|
+
- Pass the failing details from the sub-agent back to the main agent, then summarize the failing check, the relevant error, and what needs to be fixed next.
|
|
48
|
+
|
|
49
|
+
4. **Reply directly to GitHub review comments when fixing them**
|
|
50
|
+
|
|
51
|
+
- When a specific GitHub review comment is addressed, reply on that review comment thread directly instead of posting a general summary comment on the PR.
|
|
52
|
+
- The reply should say what was changed or why the requested change was not made.
|
|
53
|
+
- Use general PR comments only for overall status or cross-cutting updates, not for resolving line-specific review feedback.
|
|
54
|
+
- This applies to Copilot review comments and human review comments alike.
|
|
55
|
+
- Do not stop at making the code change locally; if the review comment was addressed, add the thread reply.
|
|
56
|
+
- If multiple review comments were addressed, reply on each relevant thread rather than collapsing them into one PR-level summary.
|
|
57
|
+
|
|
58
|
+
5. **Summarize review asks before changing code**
|
|
59
|
+
- For Copilot reviews and human reviews alike, summarize the concrete asks, group duplicates, and identify which comments actually require code changes.
|
|
60
|
+
- If a comment is informational or already satisfied, say that explicitly.
|
|
61
|
+
|
|
62
|
+
### When to Apply
|
|
63
|
+
|
|
64
|
+
- When the user asks to create, update, review, or land a PR.
|
|
65
|
+
- When the task includes “open a PR”, “get the PR ready”, “make sure CI passes”, or similar language.
|
|
66
|
+
- When local work is complete and the next step is validating PR readiness.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Node Version Management (nvm)
|
|
71
|
+
|
|
72
|
+
When setting up or working on Node.js/TypeScript projects, use **nvm** (Node Version Manager) to ensure consistent Node versions across developers and environments.
|
|
73
|
+
|
|
74
|
+
### Your Responsibilities
|
|
75
|
+
|
|
76
|
+
1. **Create or update `.nvmrc`**
|
|
77
|
+
|
|
78
|
+
- If the project has no `.nvmrc`, create one with the **current Node LTS** version (e.g. `24`). Check [Node.js Releases](https://nodejs.org/en/about/releases/) for the current Active LTS; as of this writing it is Node 24 (Krypton).
|
|
79
|
+
- If a specific version is already used elsewhere, match it (e.g. `22`, `20`, `lts/hydrogen`).
|
|
80
|
+
- For **package.json** `engines` and **README** prerequisites/support text, use the **previous LTS** (one LTS back) as the minimum supported version (e.g. `22`) so the project documents support for both current and previous LTS. Example `engines`: `"node": ">=22"`. In the README, state e.g. "Node.js 22 (LTS) or 24 (Active LTS)" or "Use the version in `.nvmrc` (Node 24). Supported: Node 22+."
|
|
81
|
+
|
|
82
|
+
2. **Use `.nvmrc` in the project**
|
|
83
|
+
|
|
84
|
+
- Instruct developers to run `nvm use` (or `nvm install` if the version is not yet installed) when entering the project directory.
|
|
85
|
+
- Consider adding shell integration (e.g. `direnv` with `use nvm`, or `.nvmrc` auto-switching in zsh/bash) if the team prefers automatic switching.
|
|
86
|
+
|
|
87
|
+
3. **Update the README**
|
|
88
|
+
- Add a "Prerequisites" or "Getting started" subsection that states supported Node version (previous LTS and current LTS, e.g. "Node.js 22 (LTS) or 24 (Active LTS)") and instructs new contributors to:
|
|
89
|
+
1. Install nvm (e.g. `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash` or the latest from https://github.com/nvm-sh/nvm).
|
|
90
|
+
2. Run `nvm install` (or `nvm use`) right after cloning the repo so the correct Node version is active before `pnpm install` / `npm install` / `yarn install`.
|
|
91
|
+
- In **package.json**, add or update `engines` with the previous LTS as minimum, e.g. `"engines": { "node": ">=22" }`.
|
|
92
|
+
|
|
93
|
+
### Example README Addition
|
|
94
|
+
|
|
95
|
+
````markdown
|
|
96
|
+
## Prerequisites
|
|
97
|
+
|
|
98
|
+
- **Node.js**: Use the version in `.nvmrc`. Supported: Node 22 (LTS) or 24 (Active LTS). Run `nvm install` (or `nvm use`) after cloning so the correct Node version is active before `pnpm install`.
|
|
99
|
+
- [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager)
|
|
100
|
+
|
|
101
|
+
After cloning the repo, install and use the project's Node version:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
nvm install # installs the version from .nvmrc
|
|
105
|
+
nvm use # switches to it (or run `nvm install` which does both)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then install dependencies: `pnpm install` (or `npm install` / `yarn`).
|
|
109
|
+
````
|
|
110
|
+
|
|
111
|
+
### Example package.json engines
|
|
112
|
+
|
|
113
|
+
Use the previous LTS as the minimum supported version (one LTS back from `.nvmrc`):
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
"engines": {
|
|
117
|
+
"node": ">=22"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Key Commands
|
|
122
|
+
|
|
123
|
+
- `nvm install` — installs the version from `.nvmrc` (or `lts/*` if `.nvmrc` is missing)
|
|
124
|
+
- `nvm use` — switches the current shell to the version in `.nvmrc`
|
|
125
|
+
- `nvm install lts/*` — installs the current LTS version
|
|
126
|
+
|
|
127
|
+
### When to Apply
|
|
128
|
+
|
|
129
|
+
- When creating a new Node/TypeScript project.
|
|
130
|
+
- When a project lacks `.nvmrc` or README setup instructions.
|
|
131
|
+
- When the README does not mention nvm or Node version setup after cloning.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Dockerfile for Local Development (Node.js / TypeScript)
|
|
136
|
+
|
|
137
|
+
When the user wants a Dockerfile and containerized local development for a Node.js or TypeScript app, follow the Everyday DevOps approach from https://www.markcallen.com/dockerfile-for-typescript/
|
|
138
|
+
|
|
139
|
+
### Your Responsibilities
|
|
140
|
+
|
|
141
|
+
1. **Create a production-style Dockerfile**
|
|
142
|
+
|
|
143
|
+
- Use a Node LTS image matching `.nvmrc` (e.g. `node:24-bookworm` for current Active LTS).
|
|
144
|
+
- Set `WORKDIR /app`.
|
|
145
|
+
- Copy only `package.json` and lockfile (`yarn.lock`, `pnpm-lock.yaml`, or `package-lock.json`) first.
|
|
146
|
+
- Install dependencies with frozen lockfile and `--ignore-scripts` (e.g. `yarn install --frozen-lockfile --ignore-scripts`, or `pnpm install --frozen-lockfile --ignore-scripts`, or `npm ci --ignore-scripts`).
|
|
147
|
+
- Copy the rest of the application.
|
|
148
|
+
- Run the build script (e.g. `yarn build` / `pnpm run build`).
|
|
149
|
+
- Set `CMD` to start the app (e.g. `node dist/index.js` or `npm start`).
|
|
150
|
+
|
|
151
|
+
2. **Add a .dockerignore**
|
|
152
|
+
|
|
153
|
+
- Exclude: `node_modules`, `dist`, `.env`, `.vscode`, `*.log`, `.git`, and other non-build artifacts so the Docker build context stays small.
|
|
154
|
+
|
|
155
|
+
3. **Create both `docker-compose.yaml` and `docker-compose.local.yaml`**
|
|
156
|
+
|
|
157
|
+
- `docker-compose.yaml` should be the default, production-style local stack:
|
|
158
|
+
- Use `build: .` for the app service so the image is built from the local Dockerfile.
|
|
159
|
+
- Run the built app with a production-style command such as `npm start`, `pnpm start`, or `node dist/index.js`.
|
|
160
|
+
- Include the other required services for the application (for example Postgres, Redis, or other local dependencies) with sensible ports, volumes, healthchecks, and `depends_on` wiring.
|
|
161
|
+
- For CLI apps, set `tty: true` so the app container stays attached when appropriate.
|
|
162
|
+
- `docker-compose.local.yaml` should be the developer override for fast iteration:
|
|
163
|
+
- Reuse the app service from `docker-compose.yaml`.
|
|
164
|
+
- Add Compose `develop.watch` so code changes are reflected without a full manual rebuild.
|
|
165
|
+
- Use `action: sync+restart` for source directories (for example `src/`) so edits sync into the container and the process restarts.
|
|
166
|
+
- Use `action: rebuild` for dependency manifests such as `package.json` and the lockfile so dependency changes rebuild the image.
|
|
167
|
+
- Set `command` to the dev script (for example `yarn dev`, `pnpm run dev`, or `tsx src/index.ts`) so the app runs with watch or hot reload inside the container.
|
|
168
|
+
- Keep shared services defined once where practical so `docker-compose.local.yaml` layers on top of the base stack instead of duplicating everything.
|
|
169
|
+
|
|
170
|
+
4. **Create a Makefile for Docker Compose workflows**
|
|
171
|
+
|
|
172
|
+
- Add targets for the base stack:
|
|
173
|
+
- `make up` runs `docker compose up --build`.
|
|
174
|
+
- `make down` runs `docker compose down`.
|
|
175
|
+
- `make logs` runs `docker compose logs -f`.
|
|
176
|
+
- Add targets for the local/watch stack using both compose files:
|
|
177
|
+
- `make up-local` runs `docker compose -f docker-compose.yaml -f docker-compose.local.yaml up --build --watch`.
|
|
178
|
+
- `make down-local` runs `docker compose -f docker-compose.yaml -f docker-compose.local.yaml down`.
|
|
179
|
+
- `make logs-local` runs `docker compose -f docker-compose.yaml -f docker-compose.local.yaml logs -f`.
|
|
180
|
+
- If the project already has a Makefile, extend it instead of replacing it.
|
|
181
|
+
- Keep target names simple and aligned with the documented developer workflow.
|
|
182
|
+
|
|
183
|
+
5. **Ensure package.json scripts**
|
|
184
|
+
- `build`: compile/bundle (e.g. `rimraf ./dist && tsc`, or project equivalent).
|
|
185
|
+
- `start`: run the built app (e.g. `node dist/index.js`).
|
|
186
|
+
- `dev`: run for local development with watch (e.g. `tsx src/index.ts` or `ts-node-dev`, etc.).
|
|
187
|
+
|
|
188
|
+
### Implementation Order
|
|
189
|
+
|
|
190
|
+
1. Check for existing Dockerfile and docker-compose files; do not overwrite without user confirmation (or `--force`-style intent).
|
|
191
|
+
2. Identify package manager (yarn, pnpm, npm) and lockfile name.
|
|
192
|
+
3. Create `.dockerignore` with appropriate exclusions.
|
|
193
|
+
4. Create `Dockerfile` with multi-stage or single-stage build as above.
|
|
194
|
+
5. Create or update `docker-compose.yaml` for the built app and required services.
|
|
195
|
+
6. Create or update `docker-compose.local.yaml` for `develop.watch` and the dev `command`.
|
|
196
|
+
7. Create or update the `Makefile` with `up`, `down`, and `logs` targets for both the base and local/watch stacks.
|
|
197
|
+
8. Verify `package.json` has `build`, `start`, and `dev` scripts; suggest additions if missing.
|
|
198
|
+
9. Document in README: how to use `make up`, `make down`, `make logs`, `make up-local`, `make down-local`, and `make logs-local`, plus optional `docker build` / `docker run`.
|
|
199
|
+
|
|
200
|
+
### Key Snippets
|
|
201
|
+
|
|
202
|
+
**Dockerfile (yarn example):**
|
|
203
|
+
|
|
204
|
+
```dockerfile
|
|
205
|
+
FROM node:24-bookworm
|
|
206
|
+
|
|
207
|
+
WORKDIR /app
|
|
208
|
+
|
|
209
|
+
COPY package.json yarn.lock ./
|
|
210
|
+
RUN yarn install --frozen-lockfile --ignore-scripts
|
|
211
|
+
|
|
212
|
+
COPY . .
|
|
213
|
+
RUN yarn build
|
|
214
|
+
|
|
215
|
+
CMD [ "yarn", "start" ]
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Dockerfile (pnpm example):**
|
|
219
|
+
|
|
220
|
+
```dockerfile
|
|
221
|
+
FROM node:24-bookworm
|
|
222
|
+
|
|
223
|
+
WORKDIR /app
|
|
224
|
+
|
|
225
|
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
226
|
+
COPY package.json pnpm-lock.yaml ./
|
|
227
|
+
RUN pnpm install --frozen-lockfile --ignore-scripts
|
|
228
|
+
|
|
229
|
+
COPY . .
|
|
230
|
+
RUN pnpm run build
|
|
231
|
+
|
|
232
|
+
CMD [ "pnpm", "start" ]
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**.dockerignore:**
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
node_modules
|
|
239
|
+
dist
|
|
240
|
+
.env
|
|
241
|
+
.vscode
|
|
242
|
+
*.log
|
|
243
|
+
.git
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**docker-compose.yaml (base stack):**
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
services:
|
|
250
|
+
app:
|
|
251
|
+
build: .
|
|
252
|
+
command: pnpm start
|
|
253
|
+
depends_on:
|
|
254
|
+
db:
|
|
255
|
+
condition: service_healthy
|
|
256
|
+
|
|
257
|
+
db:
|
|
258
|
+
image: postgres:17
|
|
259
|
+
environment:
|
|
260
|
+
POSTGRES_DB: app
|
|
261
|
+
POSTGRES_USER: app
|
|
262
|
+
POSTGRES_PASSWORD: app
|
|
263
|
+
healthcheck:
|
|
264
|
+
test: ['CMD-SHELL', 'pg_isready -U app']
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**docker-compose.local.yaml (watch override):**
|
|
268
|
+
|
|
269
|
+
```yaml
|
|
270
|
+
services:
|
|
271
|
+
app:
|
|
272
|
+
develop:
|
|
273
|
+
watch:
|
|
274
|
+
- action: sync+restart
|
|
275
|
+
path: src/
|
|
276
|
+
target: /app/src
|
|
277
|
+
- action: rebuild
|
|
278
|
+
path: package.json
|
|
279
|
+
command: pnpm run dev
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Makefile:**
|
|
283
|
+
|
|
284
|
+
```makefile
|
|
285
|
+
COMPOSE := docker compose
|
|
286
|
+
LOCAL_COMPOSE := $(COMPOSE) -f docker-compose.yaml -f docker-compose.local.yaml
|
|
287
|
+
|
|
288
|
+
up:
|
|
289
|
+
$(COMPOSE) up --build
|
|
290
|
+
|
|
291
|
+
down:
|
|
292
|
+
$(COMPOSE) down
|
|
293
|
+
|
|
294
|
+
logs:
|
|
295
|
+
$(COMPOSE) logs -f
|
|
296
|
+
|
|
297
|
+
up-local:
|
|
298
|
+
$(LOCAL_COMPOSE) up --build --watch
|
|
299
|
+
|
|
300
|
+
down-local:
|
|
301
|
+
$(LOCAL_COMPOSE) down
|
|
302
|
+
|
|
303
|
+
logs-local:
|
|
304
|
+
$(LOCAL_COMPOSE) logs -f
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Use `pnpm run dev` or `npm run dev` in `docker-compose.local.yaml` if the project uses that package manager. Adjust watched paths, targets, and service names if the app uses a different layout (for example `app/` instead of `src/`).
|
|
308
|
+
|
|
309
|
+
### Important Notes
|
|
310
|
+
|
|
311
|
+
- Keep the Docker build context small: always use a `.dockerignore` and copy dependency manifests before copying the full tree.
|
|
312
|
+
- Use `--frozen-lockfile` (yarn/pnpm) or `npm ci` so production and CI builds are reproducible.
|
|
313
|
+
- Prefer `docker-compose.yaml` as the stable base stack and `docker-compose.local.yaml` as the watch-mode overlay so developers can choose between built-app and hot-reload workflows without maintaining two unrelated stacks.
|
|
314
|
+
- For local dev, `develop.watch` with `sync+restart` on source dirs avoids full image rebuilds on every code change; reserve `rebuild` for dependency or manifest changes.
|
|
315
|
+
- For web apps (e.g. Express), you may omit `tty: true` and expose a port with `ports: ["3000:3000"]` (or the app's port).
|
|
316
|
+
- When the app depends on backing services, include them in the compose stack instead of documenting them separately so `make up` and `make up-local` start a complete working environment.
|
|
317
|
+
- If the project has no `dev` script, suggest adding one (e.g. using `tsx`, `ts-node-dev`, or `node --watch`) so `docker compose up --watch` is useful.
|
|
318
|
+
|
|
319
|
+
### When Completed
|
|
320
|
+
|
|
321
|
+
1. Summarize what was created or updated (`Dockerfile`, `.dockerignore`, `docker-compose.yaml`, `docker-compose.local.yaml`, `Makefile`, and any script changes).
|
|
322
|
+
2. Tell the user how to run the built stack with `make up`, inspect it with `make logs`, and stop it with `make down`.
|
|
323
|
+
3. Tell the user how to run the watch-mode stack with `make up-local`, inspect it with `make logs-local`, and stop it with `make down-local`.
|
|
324
|
+
4. Mention that editing files under the watched path will sync and restart the service, and changing `package.json` or the lockfile will trigger a rebuild.
|
|
325
|
+
5. Optionally suggest adding a short "Docker" or "Local development" section to the README with these commands.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## TypeScript Path Aliases (@/)
|
|
330
|
+
|
|
331
|
+
When working with TypeScript projects, use the `@/` path alias for imports so that paths stay clean and stable regardless of file depth.
|
|
332
|
+
|
|
333
|
+
### Your Responsibilities
|
|
334
|
+
|
|
335
|
+
1. **Use `@/` for TypeScript imports**
|
|
336
|
+
|
|
337
|
+
- Prefer `import { foo } from '@/components/foo'` over `import { foo } from '../../../components/foo'`.
|
|
338
|
+
- The `@/` alias should resolve to the project's source root (typically `src/`).
|
|
339
|
+
|
|
340
|
+
2. **Configure `tsconfig.json`**
|
|
341
|
+
|
|
342
|
+
- Add `baseUrl` and `paths` so TypeScript resolves `@/*` correctly.
|
|
343
|
+
- Ensure `baseUrl` points to the project root (or the directory containing `src/`).
|
|
344
|
+
- Map `@/*` to the source directory (e.g. `src/*`).
|
|
345
|
+
|
|
346
|
+
3. **Configure the bundler/runtime**
|
|
347
|
+
- If using `tsc` only: `paths` in `tsconfig.json` is sufficient for type-checking, but the build output may need a resolver (e.g. `tsconfig-paths`) unless the bundler handles it.
|
|
348
|
+
- If using Vite, Next.js, or similar: they read `tsconfig.json` paths automatically.
|
|
349
|
+
- If using plain `tsc`: consider `tsconfig-paths` at runtime, or a bundler that resolves paths.
|
|
350
|
+
|
|
351
|
+
### Example tsconfig.json
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"compilerOptions": {
|
|
356
|
+
"baseUrl": ".",
|
|
357
|
+
"paths": {
|
|
358
|
+
"@/*": ["src/*"]
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"include": ["src"]
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
If the project root is the repo root and source lives in `src/`, this maps `@/utils/foo` → `src/utils/foo`.
|
|
366
|
+
|
|
367
|
+
### Example Imports
|
|
368
|
+
|
|
369
|
+
```typescript
|
|
370
|
+
// Prefer
|
|
371
|
+
import { formatDate } from '@/utils/date';
|
|
372
|
+
import { Button } from '@/components/Button';
|
|
373
|
+
|
|
374
|
+
// Avoid deep relative paths
|
|
375
|
+
import { formatDate } from '../../../utils/date';
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### When to Apply
|
|
379
|
+
|
|
380
|
+
- When creating or configuring a new TypeScript project.
|
|
381
|
+
- When a project uses long relative import chains (`../../../`).
|
|
382
|
+
- When `tsconfig.json` exists but has no `paths` or `baseUrl` for `@/`.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Local Development: License Setup
|
|
2
|
+
|
|
3
|
+
Ensure proper license configuration (LICENSE file, package.json, README reference). Default: MIT. Overridable in AGENTS.md or CLAUDE.md.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# License Setup for Projects
|
|
8
|
+
|
|
9
|
+
When setting up or working on projects, ensure proper license configuration for legal clarity and reuse.
|
|
10
|
+
|
|
11
|
+
## Default Behavior
|
|
12
|
+
|
|
13
|
+
**If no license is specified**, use the **MIT License**. Projects can override this in `AGENTS.md` or `CLAUDE.md` (see Configuration below).
|
|
14
|
+
|
|
15
|
+
## Your Responsibilities
|
|
16
|
+
|
|
17
|
+
1. **Create or update `LICENSE`**
|
|
18
|
+
|
|
19
|
+
- If the project has no `LICENSE` file, create one.
|
|
20
|
+
- Use the license specified in project docs (`AGENTS.md`, `CLAUDE.md`) if present; otherwise use MIT.
|
|
21
|
+
- For MIT, include the standard MIT License text with the current year and copyright holder (e.g. from `package.json` author or a placeholder).
|
|
22
|
+
|
|
23
|
+
2. **Update `package.json`**
|
|
24
|
+
|
|
25
|
+
- Ensure the `license` field is set (e.g. `"license": "MIT"`).
|
|
26
|
+
- If `package.json` exists but has no `license` field, add it.
|
|
27
|
+
- Use [SPDX identifiers](https://spdx.org/licenses/) (e.g. `MIT`, `Apache-2.0`, `ISC`).
|
|
28
|
+
|
|
29
|
+
3. **Reference LICENSE in README**
|
|
30
|
+
- Add a "License" section at the end of `README.md` that references the `LICENSE` file.
|
|
31
|
+
- Example: `MIT License - see [LICENSE](LICENSE) file for details.`
|
|
32
|
+
|
|
33
|
+
## MIT License Template
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
MIT License
|
|
37
|
+
|
|
38
|
+
Copyright (c) <YEAR> <COPYRIGHT HOLDER>
|
|
39
|
+
|
|
40
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
41
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
42
|
+
in the Software without restriction, including without limitation the rights
|
|
43
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
44
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
45
|
+
furnished to do so, subject to the following conditions:
|
|
46
|
+
|
|
47
|
+
The above copyright notice and this permission notice shall be included in all
|
|
48
|
+
copies or substantial portions of the Software.
|
|
49
|
+
|
|
50
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
51
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
52
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
53
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
54
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
55
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
56
|
+
SOFTWARE.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Replace `<YEAR>` with the current year and `<COPYRIGHT HOLDER>` with the author/org (e.g. from `package.json` author).
|
|
60
|
+
|
|
61
|
+
## Example README Addition
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
Default license for this project: Apache-2.0 (or ISC, BSD-3-Clause, etc.)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
When such a section exists, use the specified license instead of MIT. If both files define a license, prefer `AGENTS.md` (it is agent-facing and typically more authoritative for automation).
|
|
70
|
+
|
|
71
|
+
## Example package.json Addition
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"license": "MIT"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Configuration: Override Default License
|
|
80
|
+
|
|
81
|
+
Projects may specify a non-MIT license in `AGENTS.md` or `CLAUDE.md`:
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
Default license for this project: Apache-2.0 (or ISC, BSD-3-Clause, etc.)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When such a section exists, use the specified license instead of MIT. If both files define a license, prefer `AGENTS.md` (it is agent-facing and typically more authoritative for automation).
|
|
90
|
+
|
|
91
|
+
## Implementation Order
|
|
92
|
+
|
|
93
|
+
1. Check `AGENTS.md` and `CLAUDE.md` for a license override.
|
|
94
|
+
2. If none, use MIT.
|
|
95
|
+
3. Check if `LICENSE` exists; if not, create it with the chosen license text.
|
|
96
|
+
4. Check `package.json` for the `license` field; add or update if missing.
|
|
97
|
+
5. Check `README.md` for a License section at the end; add one if missing, referencing `[LICENSE](LICENSE)`.
|
|
98
|
+
|
|
99
|
+
## When to Apply
|
|
100
|
+
|
|
101
|
+
- When creating a new project.
|
|
102
|
+
- When a project lacks a `LICENSE` file.
|
|
103
|
+
- When `package.json` has no `license` field.
|
|
104
|
+
- When `README.md` does not reference the LICENSE file at the end.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Local Development: GitHub and Issues MCP (Optional)
|
|
2
|
+
|
|
3
|
+
Use GitHub MCP and/or issues MCP (Jira, Linear, GitHub Issues) when available to support local development context. Only apply when these MCP servers are enabled.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Optional: GitHub and Issues MCP Servers
|
|
8
|
+
|
|
9
|
+
When the user has **GitHub MCP** and/or **issues MCP** (Jira, Linear, or GitHub Issues) servers enabled, use them to support local development workflow and context.
|
|
10
|
+
|
|
11
|
+
## When to Use This Rule
|
|
12
|
+
|
|
13
|
+
- The user asks for a summary of open work (PRs, issues, Jira/Linear items).
|
|
14
|
+
- The user wants to correlate code changes with tickets or PRs.
|
|
15
|
+
- The user is starting work and needs context from assigned or in-progress items.
|
|
16
|
+
|
|
17
|
+
## GitHub MCP
|
|
18
|
+
|
|
19
|
+
If the **GitHub MCP** server is available:
|
|
20
|
+
|
|
21
|
+
- **Pull requests**: List or summarize open PRs for the current repo (or org). Help the user triage, review, or land PRs.
|
|
22
|
+
- **Repos and orgs**: Use repo/org context when the user asks about “my PRs” or “our open PRs.”
|
|
23
|
+
- **Branches and commits**: When relevant to local dev, use GitHub MCP to check branch status, CI status, or linked issues.
|
|
24
|
+
|
|
25
|
+
Do not assume the server is present; only use it when it is configured and the user’s request fits (e.g. “summarize my PRs”, “what’s open in this repo?”).
|
|
26
|
+
|
|
27
|
+
## Issues MCP (Jira / Linear / GitHub Issues)
|
|
28
|
+
|
|
29
|
+
If an **issues MCP** server is available (Jira, Linear, or GitHub Issues):
|
|
30
|
+
|
|
31
|
+
- **Assigned work**: When the user asks “what am I working on?” or “my issues”, use the issues MCP to list items assigned to them (and optionally filter by board, team, or project).
|
|
32
|
+
- **Sprint / cycle / milestone**: For Jira (board/sprint) or Linear (team/cycle), summarize current sprint or cycle work when the user asks.
|
|
33
|
+
- **Correlation with code**: When the user mentions a ticket ID (e.g. `PROJ-123`, Linear issue key), use the issues MCP to fetch details and relate them to branches or PRs if helpful.
|
|
34
|
+
|
|
35
|
+
Configuration (e.g. which board, team, or filters) is typically stored in project docs (e.g. `CLAUDE.md`, `AGENTS.md`) or a config file (e.g. `work_summary` YAML). Prefer not to overwrite that config; use it to scope queries.
|
|
36
|
+
|
|
37
|
+
## Scope
|
|
38
|
+
|
|
39
|
+
- **Optional**: This rule applies only when the corresponding MCP servers are enabled. Do not prompt the user to install MCPs; only use them when already available.
|
|
40
|
+
- **Local-dev focus**: Use these MCPs to support _local development_ context (what to work on next, PR/issue context while coding), not as a general “work summary” agent. Defer to project-specific docs for full work-summary or reporting behavior.
|
|
41
|
+
- **Documentation**: If you add or change how MCPs are used, suggest updating README or runbooks (e.g. “Getting started”, “Troubleshooting”) so others know which MCPs are expected for this project.
|
|
42
|
+
|
|
43
|
+
## Configuration Reference
|
|
44
|
+
|
|
45
|
+
Projects may document MCP usage in a structure like:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
work_summary:
|
|
49
|
+
mcp_tools:
|
|
50
|
+
github: github
|
|
51
|
+
jira: jira # optional
|
|
52
|
+
linear: linear # optional
|
|
53
|
+
sources:
|
|
54
|
+
pull_requests: true
|
|
55
|
+
github_issues:
|
|
56
|
+
enabled: false
|
|
57
|
+
scope: { mode: repos, orgs: [], repos: [] }
|
|
58
|
+
filters: { assigned_to_me: true, labels: [] }
|
|
59
|
+
jira:
|
|
60
|
+
enabled: false
|
|
61
|
+
board: ''
|
|
62
|
+
only_assigned_to_me: true
|
|
63
|
+
linear:
|
|
64
|
+
enabled: false
|
|
65
|
+
team: ''
|
|
66
|
+
view: cycle
|
|
67
|
+
only_assigned_to_me: true
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Respect such configuration when querying; use it to scope lists (e.g. “assigned to me”, specific board/team) rather than inventing defaults.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Observability Rules
|
|
2
|
+
|
|
3
|
+
These rules help add logging, tracing, metrics, and SLOs to TypeScript/JavaScript applications.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Observability Agent
|
|
8
|
+
|
|
9
|
+
You are an observability specialist for TypeScript/JavaScript applications.
|
|
10
|
+
|
|
11
|
+
## Goals
|
|
12
|
+
|
|
13
|
+
- **Logging and tracing**: Help add structured logging and distributed tracing (e.g. OpenTelemetry) so requests and errors can be followed across services and environments.
|
|
14
|
+
- **Metrics and dashboards**: Recommend and wire up metrics (latency, errors, throughput) and basic dashboards/alerting so the team can detect regressions and incidents.
|
|
15
|
+
- **Error handling and SLOs**: Guide consistent error reporting, error budgets, and simple SLO definitions so reliability is measurable and actionable.
|
|
16
|
+
|
|
17
|
+
## Scope
|
|
18
|
+
|
|
19
|
+
- Instrumentation in app code and runtimes (Node, edge, serverless).
|
|
20
|
+
- Integration with common backends (e.g. Datadog, Grafana, CloudWatch) and open standards (OTel, Prometheus).
|
|
21
|
+
- Runbooks and alerting rules that match the team’s tooling.
|
|
22
|
+
|
|
23
|
+
_This agent is a placeholder; full instructions will be expanded in a future release._
|