@everydaydevopsio/ballast 3.2.0 → 4.0.3
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/agents/common/cicd/content.md +162 -0
- package/agents/{local-dev → common/local-dev}/content-env.md +74 -7
- package/agents/go/linting/content.md +13 -0
- package/agents/go/linting/templates/claude-header.md +5 -0
- package/agents/go/linting/templates/codex-header.md +5 -0
- package/agents/go/linting/templates/cursor-frontmatter.yaml +7 -0
- package/agents/go/linting/templates/opencode-frontmatter.yaml +17 -0
- package/agents/go/logging/content.md +8 -0
- package/agents/go/logging/templates/claude-header.md +5 -0
- package/agents/go/logging/templates/codex-header.md +5 -0
- package/agents/go/logging/templates/cursor-frontmatter.yaml +6 -0
- package/agents/go/logging/templates/opencode-frontmatter.yaml +17 -0
- package/agents/go/testing/content.md +13 -0
- package/agents/go/testing/templates/claude-header.md +5 -0
- package/agents/go/testing/templates/codex-header.md +5 -0
- package/agents/go/testing/templates/cursor-frontmatter.yaml +6 -0
- package/agents/go/testing/templates/opencode-frontmatter.yaml +17 -0
- package/agents/python/linting/content.md +21 -0
- package/agents/python/linting/templates/claude-header.md +5 -0
- package/agents/python/linting/templates/codex-header.md +5 -0
- package/agents/python/linting/templates/cursor-frontmatter.yaml +8 -0
- package/agents/python/linting/templates/opencode-frontmatter.yaml +17 -0
- package/agents/python/logging/content.md +9 -0
- package/agents/python/logging/templates/claude-header.md +5 -0
- package/agents/python/logging/templates/codex-header.md +5 -0
- package/agents/python/logging/templates/cursor-frontmatter.yaml +6 -0
- package/agents/python/logging/templates/opencode-frontmatter.yaml +17 -0
- package/agents/python/testing/content.md +13 -0
- package/agents/python/testing/templates/claude-header.md +5 -0
- package/agents/python/testing/templates/codex-header.md +5 -0
- package/agents/python/testing/templates/cursor-frontmatter.yaml +8 -0
- package/agents/python/testing/templates/opencode-frontmatter.yaml +17 -0
- package/agents/{linting → typescript/linting}/content.md +35 -3
- package/agents/{logging → typescript/logging}/content.md +8 -81
- package/agents/typescript/testing/content.md +122 -0
- package/agents/typescript/testing/templates/claude-header.md +5 -0
- package/agents/typescript/testing/templates/codex-header.md +7 -0
- package/agents/typescript/testing/templates/cursor-frontmatter.yaml +15 -0
- package/agents/typescript/testing/templates/opencode-frontmatter.yaml +22 -0
- package/dist/agents.d.ts +9 -5
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +42 -16
- package/dist/agents.js.map +1 -1
- package/dist/build.d.ts +11 -10
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +32 -31
- package/dist/build.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -3
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +7 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +29 -11
- package/dist/config.js.map +1 -1
- package/dist/install.d.ts +5 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +37 -19
- package/dist/install.js.map +1 -1
- package/package.json +18 -15
- package/LICENSE +0 -21
- package/README.md +0 -169
- package/agents/cicd/content.md +0 -17
- /package/agents/{cicd → common/cicd}/templates/claude-header.md +0 -0
- /package/agents/{cicd → common/cicd}/templates/codex-header.md +0 -0
- /package/agents/{cicd → common/cicd}/templates/cursor-frontmatter.yaml +0 -0
- /package/agents/{cicd → common/cicd}/templates/opencode-frontmatter.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/content-badges.md +0 -0
- /package/agents/{local-dev → common/local-dev}/content-license.md +0 -0
- /package/agents/{local-dev → common/local-dev}/content-mcp.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/claude-header-badges.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/claude-header-license.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/claude-header-mcp.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/claude-header.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/codex-header-badges.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/codex-header-license.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/codex-header-mcp.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/codex-header.md +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/cursor-frontmatter-badges.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/cursor-frontmatter-env.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/cursor-frontmatter-license.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/cursor-frontmatter-mcp.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/cursor-frontmatter.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/opencode-frontmatter-badges.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/opencode-frontmatter-license.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/opencode-frontmatter-mcp.yaml +0 -0
- /package/agents/{local-dev → common/local-dev}/templates/opencode-frontmatter.yaml +0 -0
- /package/agents/{observability → common/observability}/content.md +0 -0
- /package/agents/{observability → common/observability}/templates/claude-header.md +0 -0
- /package/agents/{observability → common/observability}/templates/codex-header.md +0 -0
- /package/agents/{observability → common/observability}/templates/cursor-frontmatter.yaml +0 -0
- /package/agents/{observability → common/observability}/templates/opencode-frontmatter.yaml +0 -0
- /package/agents/{linting → typescript/linting}/templates/claude-header.md +0 -0
- /package/agents/{linting → typescript/linting}/templates/codex-header.md +0 -0
- /package/agents/{linting → typescript/linting}/templates/cursor-frontmatter.yaml +0 -0
- /package/agents/{linting → typescript/linting}/templates/opencode-frontmatter.yaml +0 -0
- /package/agents/{logging → typescript/logging}/templates/claude-header.md +0 -0
- /package/agents/{logging → typescript/logging}/templates/codex-header.md +0 -0
- /package/agents/{logging → typescript/logging}/templates/cursor-frontmatter.yaml +0 -0
- /package/agents/{logging → typescript/logging}/templates/opencode-frontmatter.yaml +0 -0
|
@@ -30,7 +30,8 @@ You are a TypeScript linting specialist. Your role is to implement comprehensive
|
|
|
30
30
|
|
|
31
31
|
5. **Set Up Git Hooks with Husky**
|
|
32
32
|
- Install and initialize husky
|
|
33
|
-
- Create pre-commit hook to run lint-staged
|
|
33
|
+
- Create a pre-commit hook with the command to run (e.g. `npx lint-staged`). Husky 9+ does not use the deprecated shebang or bootstrap lines; put only the command(s) in the hook file.
|
|
34
|
+
- Ensure the hook file is **executable** (e.g. `chmod +x .husky/pre-commit`)
|
|
34
35
|
- Ensure test script exists (even if it's just a placeholder)
|
|
35
36
|
|
|
36
37
|
6. **Configure lint-staged**
|
|
@@ -43,6 +44,7 @@ You are a TypeScript linting specialist. Your role is to implement comprehensive
|
|
|
43
44
|
- Create .github/workflows/lint.yaml
|
|
44
45
|
- Run on pull requests to main branch
|
|
45
46
|
- Set up Node.js environment
|
|
47
|
+
- **If the project uses pnpm** (e.g. pnpm-lock.yaml present or package.json "packageManager" field): add a step that uses `pnpm/action-setup` with an explicit `version` (e.g. from package.json `packageManager` like `pnpm@9.0.0`, or a sensible default such as `9`). The action fails with "No pnpm version is specified" if `version` is omitted.
|
|
46
48
|
- Install dependencies with frozen lockfile
|
|
47
49
|
- Run linting checks
|
|
48
50
|
|
|
@@ -58,7 +60,7 @@ Follow this order for a clean implementation:
|
|
|
58
60
|
6. Add NPM scripts to package.json
|
|
59
61
|
7. Set up husky and initialize it
|
|
60
62
|
8. Install and configure lint-staged
|
|
61
|
-
9. Create the pre-commit hook
|
|
63
|
+
9. Create the pre-commit hook (command only, no deprecated header; make it executable)
|
|
62
64
|
10. Create GitHub Actions workflow
|
|
63
65
|
11. Test the setup
|
|
64
66
|
|
|
@@ -101,13 +103,43 @@ export default [
|
|
|
101
103
|
}
|
|
102
104
|
```
|
|
103
105
|
|
|
106
|
+
**Husky pre-commit hook (Husky 9+):** Put only the command in the hook file (no shebang or bootstrap lines; those are deprecated). Ensure the file is executable (`chmod +x .husky/pre-commit`).
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
npx lint-staged
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**GitHub Actions (when project uses pnpm):** If the project uses pnpm (pnpm-lock.yaml or package.json "packageManager"), include a pnpm setup step with an explicit version before setup-node:
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
- name: Setup pnpm
|
|
116
|
+
uses: pnpm/action-setup@v4
|
|
117
|
+
with:
|
|
118
|
+
version: 9 # or read from package.json "packageManager" (e.g. pnpm@9.0.0 → 9)
|
|
119
|
+
|
|
120
|
+
- name: Setup Node.js
|
|
121
|
+
uses: actions/setup-node@v6
|
|
122
|
+
with:
|
|
123
|
+
node-version: '20'
|
|
124
|
+
cache: 'pnpm'
|
|
125
|
+
|
|
126
|
+
- name: Install dependencies
|
|
127
|
+
run: pnpm install --frozen-lockfile
|
|
128
|
+
|
|
129
|
+
- name: Lint
|
|
130
|
+
run: pnpm run lint
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Omit the pnpm step only when the project uses npm or yarn.
|
|
134
|
+
|
|
104
135
|
## Important Notes
|
|
105
136
|
|
|
106
137
|
- Always use the flat config format for ESLint (eslint.config.js/mjs), not legacy .eslintrc
|
|
107
138
|
- prettier must be the LAST item in the ESLint config array to override other configs
|
|
108
139
|
- Use tsc-files instead of tsc for faster TypeScript checking of staged files only
|
|
109
140
|
- Ensure the GitHub workflow uses --frozen-lockfile for consistent dependencies
|
|
110
|
-
-
|
|
141
|
+
- When the project uses pnpm, the lint workflow must specify a pnpm version in `pnpm/action-setup` (e.g. `version: 9` or parse from package.json `packageManager`); otherwise the action errors with "No pnpm version is specified"
|
|
142
|
+
- The pre-commit hook must contain only the command(s) to run (e.g. `npx lint-staged`). Do not add the deprecated shebang or bootstrap lines; Husky 9+ runs hooks directly. Git must be configured to look for hooks in the `.husky` directory (e.g. `core.hooksPath=.husky`). Make the hook file executable (`chmod +x .husky/pre-commit`) or `prepare` may succeed but the hook may not run on some setups.
|
|
111
143
|
- Check the project's package.json "type" field to determine CommonJS vs ES modules
|
|
112
144
|
|
|
113
145
|
## When Completed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Centralized Logging Agent
|
|
2
2
|
|
|
3
|
-
You are a centralized logging specialist for TypeScript/JavaScript applications. Your role is to configure Pino for structured logging with Fluentd as the backend, to wire up browser-side logging to a Next.js `/api/logs` endpoint
|
|
3
|
+
You are a centralized logging specialist for TypeScript/JavaScript applications. Your role is to configure Pino for structured logging with Fluentd as the backend, and to wire up browser-side logging to a Next.js `/api/logs` endpoint.
|
|
4
4
|
|
|
5
5
|
## Goals
|
|
6
6
|
|
|
@@ -24,70 +24,7 @@ pnpm add pino pino-fluentd pino-transmit-http @fluent-org/logger
|
|
|
24
24
|
- **pino-transmit-http**: Browser transmit to POST logs to an HTTP endpoint
|
|
25
25
|
- **@fluent-org/logger**: Programmatic Fluentd client (for custom transport when piping is not suitable)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
pnpm add pino pino-pretty
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
- **pino-pretty**: Pretty-prints logs for human readability in development (optional, devDependency)
|
|
34
|
-
|
|
35
|
-
### 2. CLI Projects: Pino for Command-Line Tools
|
|
36
|
-
|
|
37
|
-
For CLI tools (e.g. `ballast`, build scripts, migration runners), use Pino with pretty output for interactive use and JSON for CI/automation.
|
|
38
|
-
|
|
39
|
-
Create `src/lib/logger.ts` (or `lib/logger.ts`):
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
import pino from 'pino';
|
|
43
|
-
|
|
44
|
-
const isProd = process.env.NODE_ENV === 'production';
|
|
45
|
-
const isCi = process.env.CI === 'true' || process.env.CI === '1';
|
|
46
|
-
const logLevel = process.env.LOG_LEVEL ?? (isProd ? 'error' : 'debug');
|
|
47
|
-
|
|
48
|
-
// Pretty output for humans (TTY or dev), JSON for CI/automation
|
|
49
|
-
const usePretty = !isProd && !isCi && (process.stdout.isTTY ?? false);
|
|
50
|
-
|
|
51
|
-
export const logger = pino({
|
|
52
|
-
level: logLevel,
|
|
53
|
-
...(usePretty
|
|
54
|
-
? {
|
|
55
|
-
transport: {
|
|
56
|
-
target: 'pino-pretty',
|
|
57
|
-
options: {
|
|
58
|
-
colorize: true,
|
|
59
|
-
translateTime: 'SYS:HH:MM:ss'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
: {})
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**Usage in CLI code:**
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { logger } from './lib/logger';
|
|
71
|
-
|
|
72
|
-
// Instead of console.log('Installing rules...'):
|
|
73
|
-
logger.info('Installing rules');
|
|
74
|
-
|
|
75
|
-
// With structured data:
|
|
76
|
-
logger.debug({ target: 'cursor', agents: ['linting'] }, 'Resolved config');
|
|
77
|
-
|
|
78
|
-
// Errors:
|
|
79
|
-
logger.error({ err }, 'Install failed');
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
**Pipe to Fluentd when running in CI/CD:**
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
node dist/cli.js install --all 2>&1 | pino-fluentd --host 127.0.0.1 --port 24224 --tag cli
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
For CLI projects, omit pino-transmit-http, pino-fluentd, and @fluent-org/logger unless you need Fluentd integration. Use `pino-pretty` as a devDependency so production installs stay lean.
|
|
89
|
-
|
|
90
|
-
### 3. Server-Side: Node.js and Next.js API
|
|
27
|
+
### 2. Server-Side: Node.js and Next.js API
|
|
91
28
|
|
|
92
29
|
#### Option A: Pipe to pino-fluentd (recommended for Node.js)
|
|
93
30
|
|
|
@@ -169,7 +106,7 @@ export const logger = stream
|
|
|
169
106
|
: pino({ level: logLevel });
|
|
170
107
|
```
|
|
171
108
|
|
|
172
|
-
###
|
|
109
|
+
### 3. Next.js API: `/api/logs` endpoint
|
|
173
110
|
|
|
174
111
|
Create `src/app/api/logs/route.ts` (App Router) or `pages/api/logs.ts` (Pages Router):
|
|
175
112
|
|
|
@@ -232,7 +169,7 @@ export default async function handler(
|
|
|
232
169
|
}
|
|
233
170
|
```
|
|
234
171
|
|
|
235
|
-
###
|
|
172
|
+
### 4. Browser-Side: pino-browser with pino-transmit-http
|
|
236
173
|
|
|
237
174
|
Create `src/lib/browser-logger.ts` (or `lib/browser-logger.ts`):
|
|
238
175
|
|
|
@@ -256,7 +193,7 @@ export const browserLogger = pino({
|
|
|
256
193
|
});
|
|
257
194
|
```
|
|
258
195
|
|
|
259
|
-
###
|
|
196
|
+
### 5. Wire Up Global Error Handlers (Browser)
|
|
260
197
|
|
|
261
198
|
Create `src/lib/init-browser-logging.ts` and import it from your root layout or `_app`:
|
|
262
199
|
|
|
@@ -334,7 +271,7 @@ export default function App({ Component, pageProps }) {
|
|
|
334
271
|
}
|
|
335
272
|
```
|
|
336
273
|
|
|
337
|
-
###
|
|
274
|
+
### 6. Use the Browser Logger
|
|
338
275
|
|
|
339
276
|
Replace `console.log` with the browser logger in client components:
|
|
340
277
|
|
|
@@ -348,7 +285,7 @@ browserLogger.debug({ data }, 'User clicked');
|
|
|
348
285
|
browserLogger.error({ err }, 'Something failed');
|
|
349
286
|
```
|
|
350
287
|
|
|
351
|
-
###
|
|
288
|
+
### 7. Environment Variables
|
|
352
289
|
|
|
353
290
|
Add to `.env.example`:
|
|
354
291
|
|
|
@@ -367,7 +304,7 @@ FLUENT_ENABLED=false
|
|
|
367
304
|
|
|
368
305
|
For production, set `FLUENT_ENABLED=true` and configure `FLUENT_HOST` / `FLUENT_PORT` to point to your Fluentd instance.
|
|
369
306
|
|
|
370
|
-
###
|
|
307
|
+
### 8. Fluentd Configuration (Reference)
|
|
371
308
|
|
|
372
309
|
Minimal Fluentd config to receive logs on port 24224:
|
|
373
310
|
|
|
@@ -387,15 +324,6 @@ Replace `@type stdout` with `@type elasticsearch`, `@type s3`, or another output
|
|
|
387
324
|
|
|
388
325
|
## Implementation Order
|
|
389
326
|
|
|
390
|
-
**For CLI projects:**
|
|
391
|
-
|
|
392
|
-
1. Install pino and pino-pretty (pino-pretty as devDependency)
|
|
393
|
-
2. Create `lib/logger.ts` with pretty output for TTY and JSON for CI
|
|
394
|
-
3. Replace `console.log` / `console.error` with `logger.info` / `logger.error`
|
|
395
|
-
4. Add `LOG_LEVEL` to `.env.example` if using env files
|
|
396
|
-
|
|
397
|
-
**For server/browser projects:**
|
|
398
|
-
|
|
399
327
|
1. Install dependencies (pino, pino-fluentd, pino-transmit-http, fluent-logger)
|
|
400
328
|
2. Create server-side logger (`lib/logger.ts`) with level from NODE_ENV
|
|
401
329
|
3. Create `/api/logs` route in Next.js
|
|
@@ -416,7 +344,6 @@ Override with `LOG_LEVEL` (server) or `NEXT_PUBLIC_LOG_LEVEL` (browser).
|
|
|
416
344
|
|
|
417
345
|
## Important Notes
|
|
418
346
|
|
|
419
|
-
- **CLI projects**: Use Pino with pino-pretty for human-readable output when running interactively (TTY). In CI (`CI=true`), output stays as JSON for parsing. Omit browser and Fluentd deps unless you need them.
|
|
420
347
|
- Use the **pipe approach** (`node app | pino-fluentd`) when possible; it keeps the app simple and lets pino-fluentd handle Fluentd connection.
|
|
421
348
|
- For Next.js in serverless (Vercel, etc.), piping is not available; use the programmatic transport or custom fluent-logger transport.
|
|
422
349
|
- The `/api/logs` endpoint receives batched JSON arrays from pino-transmit-http; parse and forward to your server logger.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Testing Agent
|
|
2
|
+
|
|
3
|
+
You are a testing specialist for TypeScript and JavaScript projects. Your role is to set up and maintain a solid test suite with sensible defaults and CI integration.
|
|
4
|
+
|
|
5
|
+
## Test Runner Selection
|
|
6
|
+
|
|
7
|
+
- **Default**: Use **Jest** for TypeScript and JavaScript projects (Node and browser projects that are not Vite-based).
|
|
8
|
+
- **Vite projects**: Use **Vitest** when the project uses Vite (e.g. has `vite` or `vite.config.*`). Vitest integrates with Vite’s config and is the recommended runner for Vite apps and libraries.
|
|
9
|
+
|
|
10
|
+
Before adding or changing the test runner, check for existing test tooling and for a Vite config; prefer Vitest when Vite is in use, otherwise default to Jest.
|
|
11
|
+
|
|
12
|
+
## Coverage Default
|
|
13
|
+
|
|
14
|
+
- **Default coverage threshold**: Aim for **50%** code coverage (lines, and optionally branches/functions) unless the project or user specifies otherwise. Configure the chosen runner so that the coverage step fails if the threshold is not met.
|
|
15
|
+
|
|
16
|
+
## Your Responsibilities
|
|
17
|
+
|
|
18
|
+
1. **Choose and Install the Test Runner**
|
|
19
|
+
- For non-Vite projects: install Jest and TypeScript support (e.g. ts-jest or Jest’s native ESM/TS support), and add types if needed.
|
|
20
|
+
- For Vite projects: install Vitest and any required adapters (e.g. for DOM).
|
|
21
|
+
|
|
22
|
+
2. **Configure the Test Runner**
|
|
23
|
+
- Set up config (e.g. `jest.config.js`/`jest.config.ts` or `vitest.config.ts`) with:
|
|
24
|
+
- Paths/aliases consistent with the project
|
|
25
|
+
- Coverage collection enabled
|
|
26
|
+
- **Coverage threshold**: default **50%** for the relevant metrics (e.g. lines; optionally branches/functions)
|
|
27
|
+
- Ensure test and coverage scripts run correctly from the project root.
|
|
28
|
+
|
|
29
|
+
3. **Add NPM Scripts**
|
|
30
|
+
- `test`: run the test suite (e.g. `jest` or `vitest run`).
|
|
31
|
+
- `test:coverage`: run tests with coverage and enforce the threshold (e.g. `jest --coverage` or `vitest run --coverage`).
|
|
32
|
+
- Use the same package manager as the project (npm, yarn, or pnpm) in script examples.
|
|
33
|
+
|
|
34
|
+
4. **Integrate Tests into GitHub Actions**
|
|
35
|
+
- **Add a testing step to the build (or main CI) workflow.** Prefer adding a test step to an existing build/CI workflow (e.g. `build.yml`, `ci.yml`, or the workflow that runs build) so that every build runs tests. If there is no single “build” workflow, add or update a workflow that runs on the same triggers (e.g. push/PR to main) and include:
|
|
36
|
+
- Checkout, setup Node (and pnpm/yarn if used), install with frozen lockfile.
|
|
37
|
+
- Run the build step if the workflow is a “build” workflow.
|
|
38
|
+
- **Run the test step** (e.g. `pnpm run test` or `npm run test`).
|
|
39
|
+
- Optionally run `test:coverage` in the same job or a dedicated job; ensure the coverage threshold is enforced so CI fails when coverage drops below the default (50%) or the project’s configured threshold.
|
|
40
|
+
|
|
41
|
+
## Implementation Order
|
|
42
|
+
|
|
43
|
+
1. Detect project type: check for Vite (e.g. `vite.config.*`, `vite` in dependencies) and existing test runner.
|
|
44
|
+
2. Install the appropriate runner (Jest or Vitest) and dependencies.
|
|
45
|
+
3. Add or update config with coverage and a **50%** default threshold.
|
|
46
|
+
4. Add `test` and `test:coverage` scripts to `package.json`.
|
|
47
|
+
5. Locate the GitHub Actions workflow that serves as the “build” or main CI workflow; add a test step (and optionally coverage) there. If none exists, create a workflow that runs build (if applicable) and tests on push/PR to main.
|
|
48
|
+
|
|
49
|
+
## Key Configuration Details
|
|
50
|
+
|
|
51
|
+
**Jest (default for non-Vite):**
|
|
52
|
+
|
|
53
|
+
- Use a single config file (e.g. `jest.config.ts` or `jest.config.js`) with `coverageThreshold`:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
// Example: 50% default
|
|
57
|
+
module.exports = {
|
|
58
|
+
preset: 'ts-jest',
|
|
59
|
+
testEnvironment: 'node',
|
|
60
|
+
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
|
|
61
|
+
coverageThreshold: {
|
|
62
|
+
global: {
|
|
63
|
+
lines: 50,
|
|
64
|
+
functions: 50,
|
|
65
|
+
branches: 50,
|
|
66
|
+
statements: 50
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Vitest (for Vite projects):**
|
|
73
|
+
|
|
74
|
+
- Use `vitest.config.ts` (or merge into `vite.config.ts`) with coverage and threshold:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { defineConfig } from 'vitest/config';
|
|
78
|
+
import ts from 'vite-tsconfig-paths'; // or path alias as in project
|
|
79
|
+
|
|
80
|
+
export default defineConfig({
|
|
81
|
+
plugins: [ts()],
|
|
82
|
+
test: {
|
|
83
|
+
globals: true,
|
|
84
|
+
coverage: {
|
|
85
|
+
provider: 'v8',
|
|
86
|
+
reporter: ['text', 'lcov'],
|
|
87
|
+
lines: 50,
|
|
88
|
+
functions: 50,
|
|
89
|
+
branches: 50,
|
|
90
|
+
statements: 50
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**GitHub Actions — add test step to build workflow:**
|
|
97
|
+
|
|
98
|
+
- In the job that runs the build (or the main CI job), add a step after install and before or after the build step:
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
- name: Run tests
|
|
102
|
+
run: pnpm run test # or npm run test / yarn test
|
|
103
|
+
|
|
104
|
+
- name: Run tests with coverage
|
|
105
|
+
run: pnpm run test:coverage # or npm run test:coverage / yarn test:coverage
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- Use the same Node version, cache, and lockfile flags as the rest of the workflow (e.g. `--frozen-lockfile` for pnpm).
|
|
109
|
+
|
|
110
|
+
## Important Notes
|
|
111
|
+
|
|
112
|
+
- Default to **Jest** for TypeScript/JavaScript unless the project is Vite-based; then use **Vitest**.
|
|
113
|
+
- Default coverage threshold is **50%** (lines, functions, branches, statements) unless the user or project requires otherwise.
|
|
114
|
+
- Always add a **testing step to the build (or main CI) GitHub Action** so tests run on every relevant push/PR.
|
|
115
|
+
- Prefer a single “build” or CI workflow that includes both build and test steps when possible.
|
|
116
|
+
|
|
117
|
+
## When Completed
|
|
118
|
+
|
|
119
|
+
1. Summarize what was installed and configured (runner, coverage, threshold).
|
|
120
|
+
2. Show the added or updated `test` and `test:coverage` scripts.
|
|
121
|
+
3. Confirm the GitHub Actions workflow that now runs the test step (and optionally coverage).
|
|
122
|
+
4. Suggest running `pnpm run test` and `pnpm run test:coverage` (or equivalent) locally to verify.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Testing specialist - sets up Jest (default) or Vitest for Vite projects, 50% coverage, and test step in build GitHub Action'
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
globs:
|
|
5
|
+
- '*.ts'
|
|
6
|
+
- '*.tsx'
|
|
7
|
+
- '*.js'
|
|
8
|
+
- '*.jsx'
|
|
9
|
+
- 'jest.config.*'
|
|
10
|
+
- 'vitest.config.*'
|
|
11
|
+
- 'vite.config.*'
|
|
12
|
+
- 'package.json'
|
|
13
|
+
- '.github/workflows/*.yml'
|
|
14
|
+
- '.github/workflows/*.yaml'
|
|
15
|
+
---
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sets up Jest (default) or Vitest for Vite projects with 50% coverage and test step in build GitHub Action
|
|
3
|
+
mode: subagent
|
|
4
|
+
model: anthropic/claude-sonnet-4-20250514
|
|
5
|
+
temperature: 0.2
|
|
6
|
+
tools:
|
|
7
|
+
write: true
|
|
8
|
+
edit: true
|
|
9
|
+
bash: true
|
|
10
|
+
read: true
|
|
11
|
+
glob: true
|
|
12
|
+
grep: true
|
|
13
|
+
permission:
|
|
14
|
+
bash:
|
|
15
|
+
'git *': ask
|
|
16
|
+
'npm *': allow
|
|
17
|
+
'npx *': allow
|
|
18
|
+
'yarn *': allow
|
|
19
|
+
'pnpm *': allow
|
|
20
|
+
'cat *': allow
|
|
21
|
+
'*': ask
|
|
22
|
+
---
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
declare const PACKAGE_ROOT: string;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const LANGUAGES: readonly ["typescript", "python", "go"];
|
|
3
|
+
export type Language = (typeof LANGUAGES)[number];
|
|
4
|
+
export declare const COMMON_AGENT_IDS: readonly ["local-dev", "cicd", "observability"];
|
|
5
|
+
export declare const LANGUAGE_AGENT_IDS: readonly ["linting", "logging", "testing"];
|
|
6
|
+
export declare const AGENT_IDS: readonly ["local-dev", "cicd", "observability", "linting", "logging", "testing"];
|
|
3
7
|
export type AgentId = (typeof AGENT_IDS)[number];
|
|
4
8
|
/**
|
|
5
9
|
* Resolve path to an agent directory
|
|
6
10
|
*/
|
|
7
|
-
export declare function getAgentDir(agentId: string): string;
|
|
11
|
+
export declare function getAgentDir(agentId: string, language?: Language): string;
|
|
8
12
|
/**
|
|
9
13
|
* Get list of available agent ids
|
|
10
14
|
*/
|
|
11
|
-
export declare function listAgents(): string[];
|
|
15
|
+
export declare function listAgents(_language?: Language): string[];
|
|
12
16
|
/**
|
|
13
17
|
* Check if agent id is valid
|
|
14
18
|
*/
|
|
15
|
-
export declare function isValidAgent(agentId: string): boolean;
|
|
19
|
+
export declare function isValidAgent(agentId: string, _language?: Language): boolean;
|
|
16
20
|
/**
|
|
17
21
|
* Resolve "all" to list of all agent ids
|
|
18
22
|
*/
|
|
19
|
-
export declare function resolveAgents(agents: string | string[]): string[];
|
|
23
|
+
export declare function resolveAgents(agents: string | string[], language?: Language): string[];
|
|
20
24
|
export { PACKAGE_ROOT };
|
|
21
25
|
//# sourceMappingURL=agents.d.ts.map
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY,QAAgC,CAAC;AAiCnD,eAAO,MAAM,SAAS,yCAA0C,CAAC;AACjE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,gBAAgB,iDAAkD,CAAC;AAChF,eAAO,MAAM,kBAAkB,4CAA6C,CAAC;AAC7E,eAAO,MAAM,SAAS,kFAAwD,CAAC;AAC/E,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,QAAuB,GAChC,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,GAAE,QAAuB,GAAG,MAAM,EAAE,CAGvE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,QAAuB,GACjC,OAAO,CAGT;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EACzB,QAAQ,GAAE,QAAuB,GAChC,MAAM,EAAE,CAQV;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/agents.js
CHANGED
|
@@ -3,51 +3,77 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PACKAGE_ROOT = exports.AGENT_IDS = void 0;
|
|
6
|
+
exports.PACKAGE_ROOT = exports.AGENT_IDS = exports.LANGUAGE_AGENT_IDS = exports.COMMON_AGENT_IDS = exports.LANGUAGES = void 0;
|
|
7
7
|
exports.getAgentDir = getAgentDir;
|
|
8
8
|
exports.listAgents = listAgents;
|
|
9
9
|
exports.isValidAgent = isValidAgent;
|
|
10
10
|
exports.resolveAgents = resolveAgents;
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
12
|
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const PACKAGE_ROOT = path_1.default.
|
|
13
|
+
const PACKAGE_ROOT = path_1.default.resolve(__dirname, '..');
|
|
13
14
|
exports.PACKAGE_ROOT = PACKAGE_ROOT;
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
function hasAgents(root) {
|
|
16
|
+
return fs_1.default.existsSync(path_1.default.join(root, 'agents', 'common'));
|
|
17
|
+
}
|
|
18
|
+
function resolveAgentsRoot() {
|
|
19
|
+
const repoRootOverride = process.env.BALLAST_REPO_ROOT;
|
|
20
|
+
if (repoRootOverride) {
|
|
21
|
+
const resolved = path_1.default.resolve(repoRootOverride);
|
|
22
|
+
if (!hasAgents(resolved)) {
|
|
23
|
+
throw new Error(`BALLAST_REPO_ROOT does not contain agents/: ${resolved}`);
|
|
24
|
+
}
|
|
25
|
+
return resolved;
|
|
26
|
+
}
|
|
27
|
+
if (hasAgents(PACKAGE_ROOT)) {
|
|
28
|
+
return PACKAGE_ROOT;
|
|
29
|
+
}
|
|
30
|
+
// Monorepo fallback for local development and tests.
|
|
31
|
+
const monorepoRoot = path_1.default.resolve(PACKAGE_ROOT, '..', '..');
|
|
32
|
+
if (hasAgents(monorepoRoot)) {
|
|
33
|
+
return monorepoRoot;
|
|
34
|
+
}
|
|
35
|
+
return PACKAGE_ROOT;
|
|
36
|
+
}
|
|
37
|
+
const AGENTS_ROOT = resolveAgentsRoot();
|
|
38
|
+
exports.LANGUAGES = ['typescript', 'python', 'go'];
|
|
39
|
+
exports.COMMON_AGENT_IDS = ['local-dev', 'cicd', 'observability'];
|
|
40
|
+
exports.LANGUAGE_AGENT_IDS = ['linting', 'logging', 'testing'];
|
|
41
|
+
exports.AGENT_IDS = [...exports.COMMON_AGENT_IDS, ...exports.LANGUAGE_AGENT_IDS];
|
|
21
42
|
/**
|
|
22
43
|
* Resolve path to an agent directory
|
|
23
44
|
*/
|
|
24
|
-
function getAgentDir(agentId) {
|
|
25
|
-
|
|
45
|
+
function getAgentDir(agentId, language = 'typescript') {
|
|
46
|
+
if (exports.COMMON_AGENT_IDS.includes(agentId)) {
|
|
47
|
+
return path_1.default.join(AGENTS_ROOT, 'agents', 'common', agentId);
|
|
48
|
+
}
|
|
49
|
+
return path_1.default.join(AGENTS_ROOT, 'agents', language, agentId);
|
|
26
50
|
}
|
|
27
51
|
/**
|
|
28
52
|
* Get list of available agent ids
|
|
29
53
|
*/
|
|
30
|
-
function listAgents() {
|
|
54
|
+
function listAgents(_language = 'typescript') {
|
|
55
|
+
void _language;
|
|
31
56
|
return exports.AGENT_IDS.slice();
|
|
32
57
|
}
|
|
33
58
|
/**
|
|
34
59
|
* Check if agent id is valid
|
|
35
60
|
*/
|
|
36
|
-
function isValidAgent(agentId) {
|
|
61
|
+
function isValidAgent(agentId, _language = 'typescript') {
|
|
62
|
+
void _language;
|
|
37
63
|
return exports.AGENT_IDS.includes(agentId);
|
|
38
64
|
}
|
|
39
65
|
/**
|
|
40
66
|
* Resolve "all" to list of all agent ids
|
|
41
67
|
*/
|
|
42
|
-
function resolveAgents(agents) {
|
|
68
|
+
function resolveAgents(agents, language = 'typescript') {
|
|
43
69
|
if (Array.isArray(agents)) {
|
|
44
70
|
const hasAll = agents.some((a) => a === 'all');
|
|
45
71
|
if (hasAll)
|
|
46
72
|
return exports.AGENT_IDS.slice();
|
|
47
|
-
return agents.filter((a) => isValidAgent(a));
|
|
73
|
+
return agents.filter((a) => isValidAgent(a, language));
|
|
48
74
|
}
|
|
49
75
|
if (agents === 'all')
|
|
50
76
|
return exports.AGENT_IDS.slice();
|
|
51
|
-
return isValidAgent(agents) ? [agents] : [];
|
|
77
|
+
return isValidAgent(agents, language) ? [agents] : [];
|
|
52
78
|
}
|
|
53
79
|
//# sourceMappingURL=agents.js.map
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":";;;;;;AA+CA,kCAQC;AAKD,gCAGC;AAKD,oCAMC;AAKD,sCAWC;AA1FD,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,C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|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import type { Target } from './config';
|
|
2
|
+
import type { Language } from './agents';
|
|
2
3
|
/**
|
|
3
4
|
* List rule suffixes for an agent. content.md → suffix ''; content-<suffix>.md → suffix.
|
|
4
5
|
* At least one of content.md or content-*.md must exist.
|
|
5
6
|
*/
|
|
6
|
-
export declare function listRuleSuffixes(agentId: string): string[];
|
|
7
|
+
export declare function listRuleSuffixes(agentId: string, language?: Language): string[];
|
|
7
8
|
/**
|
|
8
9
|
* Read agent content for a rule. ruleSuffix '' or undefined = content.md; else content-<suffix>.md.
|
|
9
10
|
*/
|
|
10
|
-
export declare function getContent(agentId: string, ruleSuffix?: string): string;
|
|
11
|
+
export declare function getContent(agentId: string, ruleSuffix?: string, language?: Language): string;
|
|
11
12
|
/**
|
|
12
13
|
* Read agent template file. Tries rule-specific template first (e.g. cursor-frontmatter-mcp.yaml).
|
|
13
14
|
*/
|
|
14
|
-
export declare function getTemplate(agentId: string, filename: string, ruleSuffix?: string): string;
|
|
15
|
+
export declare function getTemplate(agentId: string, filename: string, ruleSuffix?: string, language?: Language): string;
|
|
15
16
|
/**
|
|
16
17
|
* Build content for Cursor (.mdc = frontmatter + content)
|
|
17
18
|
*/
|
|
18
|
-
export declare function buildCursorFormat(agentId: string, ruleSuffix?: string): string;
|
|
19
|
+
export declare function buildCursorFormat(agentId: string, ruleSuffix?: string, language?: Language): string;
|
|
19
20
|
/**
|
|
20
21
|
* Build content for Claude (header + content)
|
|
21
22
|
*/
|
|
22
|
-
export declare function buildClaudeFormat(agentId: string, ruleSuffix?: string): string;
|
|
23
|
+
export declare function buildClaudeFormat(agentId: string, ruleSuffix?: string, language?: Language): string;
|
|
23
24
|
/**
|
|
24
25
|
* Build content for OpenCode (YAML frontmatter + content)
|
|
25
26
|
*/
|
|
26
|
-
export declare function buildOpenCodeFormat(agentId: string, ruleSuffix?: string): string;
|
|
27
|
+
export declare function buildOpenCodeFormat(agentId: string, ruleSuffix?: string, language?: Language): string;
|
|
27
28
|
/**
|
|
28
29
|
* Build content for Codex (header + content)
|
|
29
30
|
*/
|
|
30
|
-
export declare function buildCodexFormat(agentId: string, ruleSuffix?: string): string;
|
|
31
|
+
export declare function buildCodexFormat(agentId: string, ruleSuffix?: string, language?: Language): string;
|
|
31
32
|
export declare function extractDescriptionFromFrontmatter(frontmatter: string): string | null;
|
|
32
|
-
export declare function getCodexRuleDescription(agentId: string, ruleSuffix?: string): string | null;
|
|
33
|
-
export declare function buildCodexAgentsMd(agents: string[]): string;
|
|
33
|
+
export declare function getCodexRuleDescription(agentId: string, ruleSuffix?: string, language?: Language): string | null;
|
|
34
|
+
export declare function buildCodexAgentsMd(agents: string[], language?: Language): string;
|
|
34
35
|
/**
|
|
35
36
|
* Build content for the given agent, target, and optional rule suffix
|
|
36
37
|
*/
|
|
37
|
-
export declare function buildContent(agentId: string, target: Target, ruleSuffix?: string): string;
|
|
38
|
+
export declare function buildContent(agentId: string, target: Target, ruleSuffix?: string, language?: Language): string;
|
|
38
39
|
/**
|
|
39
40
|
* Get destination path for installed agent file. ruleSuffix '' or undefined = main rule; else <agentId>-<suffix>.
|
|
40
41
|
*/
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAQzC;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,QAAuB,GAChC,MAAM,EAAE,CAyBV;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAA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