@clipboard-health/ai-rules 0.3.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/backend/AGENTS.md +5 -11
- package/backend/CLAUDE.md +5 -11
- package/common/AGENTS.md +1 -9
- package/common/CLAUDE.md +1 -9
- package/frontend/AGENTS.md +1 -9
- package/frontend/CLAUDE.md +1 -9
- package/fullstack/AGENTS.md +5 -11
- package/fullstack/CLAUDE.md +5 -11
- package/package.json +1 -1
- package/scripts/constants.js +6 -3
- package/scripts/sync.js +10 -8
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ npm install --save-dev @clipboard-health/ai-rules
|
|
|
56
56
|
4. Commit the generated files:
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
git add
|
|
59
|
+
git add .
|
|
60
60
|
git commit -m "feat: add AI coding rules"
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -74,10 +74,10 @@ npm update @clipboard-health/ai-rules
|
|
|
74
74
|
npm install
|
|
75
75
|
|
|
76
76
|
# Review the changes
|
|
77
|
-
git diff
|
|
77
|
+
git diff .
|
|
78
78
|
|
|
79
79
|
# Commit the updates
|
|
80
|
-
git add
|
|
80
|
+
git add .
|
|
81
81
|
git commit -m "chore: update AI coding rules"
|
|
82
82
|
```
|
|
83
83
|
|
package/backend/AGENTS.md
CHANGED
|
@@ -96,8 +96,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
96
96
|
EXAMPLE_NOTIFICATION_JOB_NAME,
|
|
97
97
|
// Important: Read the TypeDoc documentation for additional context.
|
|
98
98
|
{
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Set expiresAt at enqueue-time so it remains stable across job retries. Use date-fns in your
|
|
101
|
+
* service instead of this manual calculation.
|
|
102
|
+
*/
|
|
101
103
|
expiresAt: new Date(Date.now() + 60 * 60_000).toISOString(),
|
|
102
104
|
// Set idempotencyKey at enqueue-time so it remains stable across job retries.
|
|
103
105
|
idempotencyKey: {
|
|
@@ -169,6 +171,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
169
171
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
170
172
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
171
173
|
- Prefer data immutability.
|
|
174
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
172
175
|
|
|
173
176
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
174
177
|
|
|
@@ -183,15 +186,6 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
183
186
|
- Implement proper error logging and user-friendly error messages.
|
|
184
187
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
185
188
|
|
|
186
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
187
|
-
|
|
188
|
-
# Key conventions
|
|
189
|
-
|
|
190
|
-
- You are familiar with the latest features and best practices.
|
|
191
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
192
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
193
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
194
|
-
|
|
195
189
|
<!-- Source: .ruler/common/testing.md -->
|
|
196
190
|
|
|
197
191
|
# Testing
|
package/backend/CLAUDE.md
CHANGED
|
@@ -94,8 +94,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
94
94
|
EXAMPLE_NOTIFICATION_JOB_NAME,
|
|
95
95
|
// Important: Read the TypeDoc documentation for additional context.
|
|
96
96
|
{
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Set expiresAt at enqueue-time so it remains stable across job retries. Use date-fns in your
|
|
99
|
+
* service instead of this manual calculation.
|
|
100
|
+
*/
|
|
99
101
|
expiresAt: new Date(Date.now() + 60 * 60_000).toISOString(),
|
|
100
102
|
// Set idempotencyKey at enqueue-time so it remains stable across job retries.
|
|
101
103
|
idempotencyKey: {
|
|
@@ -167,6 +169,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
167
169
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
168
170
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
169
171
|
- Prefer data immutability.
|
|
172
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
170
173
|
|
|
171
174
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
172
175
|
|
|
@@ -181,15 +184,6 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
181
184
|
- Implement proper error logging and user-friendly error messages.
|
|
182
185
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
183
186
|
|
|
184
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
185
|
-
|
|
186
|
-
# Key conventions
|
|
187
|
-
|
|
188
|
-
- You are familiar with the latest features and best practices.
|
|
189
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
190
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
191
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
192
|
-
|
|
193
187
|
<!-- Source: .ruler/common/testing.md -->
|
|
194
188
|
|
|
195
189
|
# Testing
|
package/common/AGENTS.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
14
14
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
15
15
|
- Prefer data immutability.
|
|
16
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
16
17
|
|
|
17
18
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
18
19
|
|
|
@@ -27,15 +28,6 @@
|
|
|
27
28
|
- Implement proper error logging and user-friendly error messages.
|
|
28
29
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
29
30
|
|
|
30
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
31
|
-
|
|
32
|
-
# Key conventions
|
|
33
|
-
|
|
34
|
-
- You are familiar with the latest features and best practices.
|
|
35
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
36
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
37
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
38
|
-
|
|
39
31
|
<!-- Source: .ruler/common/testing.md -->
|
|
40
32
|
|
|
41
33
|
# Testing
|
package/common/CLAUDE.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
12
12
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
13
13
|
- Prefer data immutability.
|
|
14
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
14
15
|
|
|
15
16
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
16
17
|
|
|
@@ -25,15 +26,6 @@
|
|
|
25
26
|
- Implement proper error logging and user-friendly error messages.
|
|
26
27
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
27
28
|
|
|
28
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
29
|
-
|
|
30
|
-
# Key conventions
|
|
31
|
-
|
|
32
|
-
- You are familiar with the latest features and best practices.
|
|
33
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
34
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
35
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
36
|
-
|
|
37
29
|
<!-- Source: .ruler/common/testing.md -->
|
|
38
30
|
|
|
39
31
|
# Testing
|
package/frontend/AGENTS.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
14
14
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
15
15
|
- Prefer data immutability.
|
|
16
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
16
17
|
|
|
17
18
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
18
19
|
|
|
@@ -27,15 +28,6 @@
|
|
|
27
28
|
- Implement proper error logging and user-friendly error messages.
|
|
28
29
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
29
30
|
|
|
30
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
31
|
-
|
|
32
|
-
# Key conventions
|
|
33
|
-
|
|
34
|
-
- You are familiar with the latest features and best practices.
|
|
35
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
36
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
37
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
38
|
-
|
|
39
31
|
<!-- Source: .ruler/common/testing.md -->
|
|
40
32
|
|
|
41
33
|
# Testing
|
package/frontend/CLAUDE.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
12
12
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
13
13
|
- Prefer data immutability.
|
|
14
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
14
15
|
|
|
15
16
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
16
17
|
|
|
@@ -25,15 +26,6 @@
|
|
|
25
26
|
- Implement proper error logging and user-friendly error messages.
|
|
26
27
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
27
28
|
|
|
28
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
29
|
-
|
|
30
|
-
# Key conventions
|
|
31
|
-
|
|
32
|
-
- You are familiar with the latest features and best practices.
|
|
33
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
34
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
35
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
36
|
-
|
|
37
29
|
<!-- Source: .ruler/common/testing.md -->
|
|
38
30
|
|
|
39
31
|
# Testing
|
package/fullstack/AGENTS.md
CHANGED
|
@@ -96,8 +96,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
96
96
|
EXAMPLE_NOTIFICATION_JOB_NAME,
|
|
97
97
|
// Important: Read the TypeDoc documentation for additional context.
|
|
98
98
|
{
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Set expiresAt at enqueue-time so it remains stable across job retries. Use date-fns in your
|
|
101
|
+
* service instead of this manual calculation.
|
|
102
|
+
*/
|
|
101
103
|
expiresAt: new Date(Date.now() + 60 * 60_000).toISOString(),
|
|
102
104
|
// Set idempotencyKey at enqueue-time so it remains stable across job retries.
|
|
103
105
|
idempotencyKey: {
|
|
@@ -169,6 +171,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
169
171
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
170
172
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
171
173
|
- Prefer data immutability.
|
|
174
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
172
175
|
|
|
173
176
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
174
177
|
|
|
@@ -183,15 +186,6 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
183
186
|
- Implement proper error logging and user-friendly error messages.
|
|
184
187
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
185
188
|
|
|
186
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
187
|
-
|
|
188
|
-
# Key conventions
|
|
189
|
-
|
|
190
|
-
- You are familiar with the latest features and best practices.
|
|
191
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
192
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
193
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
194
|
-
|
|
195
189
|
<!-- Source: .ruler/common/testing.md -->
|
|
196
190
|
|
|
197
191
|
# Testing
|
package/fullstack/CLAUDE.md
CHANGED
|
@@ -94,8 +94,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
94
94
|
EXAMPLE_NOTIFICATION_JOB_NAME,
|
|
95
95
|
// Important: Read the TypeDoc documentation for additional context.
|
|
96
96
|
{
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Set expiresAt at enqueue-time so it remains stable across job retries. Use date-fns in your
|
|
99
|
+
* service instead of this manual calculation.
|
|
100
|
+
*/
|
|
99
101
|
expiresAt: new Date(Date.now() + 60 * 60_000).toISOString(),
|
|
100
102
|
// Set idempotencyKey at enqueue-time so it remains stable across job retries.
|
|
101
103
|
idempotencyKey: {
|
|
@@ -167,6 +169,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
167
169
|
- Use camelCase for files and directories (e.g., modules/shiftOffers.ts).
|
|
168
170
|
- When declaring functions, use the `function` keyword, not `const`.
|
|
169
171
|
- Prefer data immutability.
|
|
172
|
+
- Use Conventional Commits 1.0 for commit messages.
|
|
170
173
|
|
|
171
174
|
<!-- Source: .ruler/common/errorHandlingAndValidation.md -->
|
|
172
175
|
|
|
@@ -181,15 +184,6 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
181
184
|
- Implement proper error logging and user-friendly error messages.
|
|
182
185
|
- Favor `@clipboard-health/util-ts`'s `Either` type for expected errors instead of `try`/`catch`.
|
|
183
186
|
|
|
184
|
-
<!-- Source: .ruler/common/keyConventions.md -->
|
|
185
|
-
|
|
186
|
-
# Key conventions
|
|
187
|
-
|
|
188
|
-
- You are familiar with the latest features and best practices.
|
|
189
|
-
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
|
|
190
|
-
- You always write correct, up-to-date, bug-free, fully functional, working, secure, easy-to-read, and efficient code.
|
|
191
|
-
- If there might not be a correct answer or do not know the answer, say so instead of guessing.
|
|
192
|
-
|
|
193
187
|
<!-- Source: .ruler/common/testing.md -->
|
|
194
188
|
|
|
195
189
|
# Testing
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/ai-rules",
|
|
3
3
|
"description": "Pre-built AI agent rules for consistent coding standards.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@intellectronica/ruler": "0.3.10"
|
package/scripts/constants.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.PROFILES = exports.PATHS = void 0;
|
|
4
|
-
const node_path_1 = require("node:path");
|
|
5
|
-
const packageRoot =
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const packageRoot = node_path_1.default.join(__dirname, "..");
|
|
6
9
|
exports.PATHS = {
|
|
7
10
|
packageRoot,
|
|
8
|
-
outputDirectory:
|
|
11
|
+
outputDirectory: node_path_1.default.join(packageRoot, "..", "..", "dist", "packages", "ai-rules"),
|
|
9
12
|
};
|
|
10
13
|
exports.PROFILES = {
|
|
11
14
|
frontend: ["common", "frontend"],
|
package/scripts/sync.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* eslint-disable unicorn/no-process-exit */
|
|
4
|
-
|
|
6
|
+
/* eslint-disable unicorn/no-process-exit, n/no-process-exit */
|
|
7
|
+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
|
5
8
|
const promises_1 = require("node:fs/promises");
|
|
6
|
-
const node_path_1 = require("node:path");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
7
10
|
const constants_1 = require("./constants");
|
|
8
11
|
const toErrorMessage_1 = require("./toErrorMessage");
|
|
9
12
|
const PATHS = {
|
|
10
|
-
projectRoot:
|
|
11
|
-
rules:
|
|
13
|
+
projectRoot: node_path_1.default.join(__dirname, "../../../.."),
|
|
14
|
+
rules: node_path_1.default.join(__dirname, ".."),
|
|
12
15
|
};
|
|
13
16
|
function getProfileFromArguments() {
|
|
14
17
|
const profile = process.argv[2];
|
|
@@ -24,7 +27,7 @@ async function sync() {
|
|
|
24
27
|
try {
|
|
25
28
|
const profile = getProfileFromArguments();
|
|
26
29
|
// Force copy files; rely on `git` if it overwrites files.
|
|
27
|
-
await (0, promises_1.cp)(
|
|
30
|
+
await (0, promises_1.cp)(node_path_1.default.join(PATHS.rules, profile), PATHS.projectRoot, { force: true, recursive: true });
|
|
28
31
|
console.log(`✅ @clipboard-health/ai-rules synced ${profile}`);
|
|
29
32
|
}
|
|
30
33
|
catch (error) {
|
|
@@ -35,5 +38,4 @@ async function sync() {
|
|
|
35
38
|
}
|
|
36
39
|
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
37
40
|
void sync();
|
|
38
|
-
/* eslint-enable n/no-process-exit */
|
|
39
|
-
/* eslint-enable unicorn/no-process-exit */
|
|
41
|
+
/* eslint-enable unicorn/no-process-exit, n/no-process-exit */
|