@clipboard-health/ai-rules 1.6.8 → 1.6.10
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/backend/AGENTS.md +12 -6
- package/datamodeling/AGENTS.md +2 -2
- package/fullstack/AGENTS.md +12 -6
- package/package.json +1 -1
package/backend/AGENTS.md
CHANGED
|
@@ -23,7 +23,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
23
23
|
|
|
24
24
|
<embedex source="packages/notifications/examples/usage.md">
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
### `triggerChunked`
|
|
27
27
|
|
|
28
28
|
`triggerChunked` stores the full, immutable trigger request at job enqueue time, eliminating issues with stale data, chunking requests to stay under provider limits, and idempotency key conflicts that can occur if the request is updated at job execution time.
|
|
29
29
|
|
|
@@ -48,8 +48,8 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
48
48
|
import { TRIGGER_NOTIFICATION_JOB_NAME } from "./triggerNotification.constants";
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* For mongo-jobs, implement HandlerInterface<SerializableTriggerChunkedRequest
|
|
52
|
-
* For background-jobs-postgres, implement Handler<SerializableTriggerChunkedRequest
|
|
51
|
+
* For mongo-jobs, implement `HandlerInterface<SerializableTriggerChunkedRequest>`.
|
|
52
|
+
* For background-jobs-postgres, implement `Handler<SerializableTriggerChunkedRequest>`.
|
|
53
53
|
*/
|
|
54
54
|
export class TriggerNotificationJob implements BaseHandler<SerializableTriggerChunkedRequest> {
|
|
55
55
|
public name = TRIGGER_NOTIFICATION_JOB_NAME;
|
|
@@ -63,6 +63,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
63
63
|
|
|
64
64
|
public async perform(
|
|
65
65
|
data: SerializableTriggerChunkedRequest,
|
|
66
|
+
/**
|
|
67
|
+
* For mongo-jobs, implement `BackgroundJobType<SerializableTriggerChunkedRequest>`, which has _id, attemptsCount, and uniqueKey.
|
|
68
|
+
* For background-jobs-postgres, implement `Job<SerializableTriggerChunkedRequest>`, which has id, retryAttempts, and idempotencyKey.
|
|
69
|
+
*/
|
|
66
70
|
job: { _id: string; attemptsCount: number; uniqueKey?: string },
|
|
67
71
|
) {
|
|
68
72
|
const metadata = {
|
|
@@ -72,7 +76,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
72
76
|
recipientCount: data.body.recipients.length,
|
|
73
77
|
workflowKey: data.workflowKey,
|
|
74
78
|
};
|
|
75
|
-
this.logger.info("
|
|
79
|
+
this.logger.info("TriggerNotificationJob processing", metadata);
|
|
76
80
|
|
|
77
81
|
try {
|
|
78
82
|
const request = toTriggerChunkedRequest(data, {
|
|
@@ -85,9 +89,11 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
85
89
|
throw result.error;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
const success = "TriggerNotificationJob success";
|
|
93
|
+
this.logger.info(success, { ...metadata, response: result.value });
|
|
94
|
+
// For background-jobs-postgres, return the `success` string result.
|
|
89
95
|
} catch (error) {
|
|
90
|
-
this.logger.error("
|
|
96
|
+
this.logger.error("TriggerNotificationJob failure", { ...metadata, error });
|
|
91
97
|
throw error;
|
|
92
98
|
}
|
|
93
99
|
}
|
package/datamodeling/AGENTS.md
CHANGED
|
@@ -89,7 +89,7 @@ These define our modeling rules, patterns, and safety constraints.
|
|
|
89
89
|
- DEVIN ONLY: When running dbt commands in the data-modeling repository, always reuse the existing SNOWFLAKE_SCHEMA environment variable value that is already set. Do NOT replace it with a hardcoded value like "dbt_devin" - the SNOWFLAKE_SCHEMA is set to a unique per-session string and overwriting it will cause issues.
|
|
90
90
|
- Use `dbt build` to verify your changes.
|
|
91
91
|
- ALL dbt staging models must have strictly defined datatypes. Please Read the "Casting DBT Staging Model Datatype Heuristic" Knowledge we have. These datatypes need to defined in the yaml documentation too.
|
|
92
|
-
-
|
|
92
|
+
- Always use doc blocks for YAML column descriptions (reference `models/docs.md`). Reuse existing doc blocks instead of duplicating descriptions for the same column across multiple models.
|
|
93
93
|
- When adding new fields to tables keep the original source field name format, but remove any custom field prefix (**c). For example assignment_type**c should be renamed to assignment_type. Please do not hallucinate the column field names as this is misleading for users.
|
|
94
94
|
- If a source table doesn't exist. Please tell the user to ask the data-team to ingest it via the relevant ETL tool.
|
|
95
95
|
- A model must always have a primary/unique key. If there's no obvious one, please create a surrogate key using a combination of fields and by looking at the data. Use `dbt_utils.generate_surrogate_key` to do so.
|
|
@@ -110,7 +110,7 @@ These define our modeling rules, patterns, and safety constraints.
|
|
|
110
110
|
- At least one column must be the primary key. This column should have both the `not_null` and `unique` tests.
|
|
111
111
|
- Every column must include:
|
|
112
112
|
- A `name`
|
|
113
|
-
- A `description`.
|
|
113
|
+
- A `description`. Always use doc blocks for YAML column descriptions (reference `models/docs.md`). Reuse existing doc blocks instead of duplicating descriptions for the same column across multiple models. If they don't already exist, make them.
|
|
114
114
|
- A `data_type`.
|
|
115
115
|
- Include a newline between columns
|
|
116
116
|
- Ensure proper YAML formatting and indentation.
|
package/fullstack/AGENTS.md
CHANGED
|
@@ -23,7 +23,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
23
23
|
|
|
24
24
|
<embedex source="packages/notifications/examples/usage.md">
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
### `triggerChunked`
|
|
27
27
|
|
|
28
28
|
`triggerChunked` stores the full, immutable trigger request at job enqueue time, eliminating issues with stale data, chunking requests to stay under provider limits, and idempotency key conflicts that can occur if the request is updated at job execution time.
|
|
29
29
|
|
|
@@ -48,8 +48,8 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
48
48
|
import { TRIGGER_NOTIFICATION_JOB_NAME } from "./triggerNotification.constants";
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* For mongo-jobs, implement HandlerInterface<SerializableTriggerChunkedRequest
|
|
52
|
-
* For background-jobs-postgres, implement Handler<SerializableTriggerChunkedRequest
|
|
51
|
+
* For mongo-jobs, implement `HandlerInterface<SerializableTriggerChunkedRequest>`.
|
|
52
|
+
* For background-jobs-postgres, implement `Handler<SerializableTriggerChunkedRequest>`.
|
|
53
53
|
*/
|
|
54
54
|
export class TriggerNotificationJob implements BaseHandler<SerializableTriggerChunkedRequest> {
|
|
55
55
|
public name = TRIGGER_NOTIFICATION_JOB_NAME;
|
|
@@ -63,6 +63,10 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
63
63
|
|
|
64
64
|
public async perform(
|
|
65
65
|
data: SerializableTriggerChunkedRequest,
|
|
66
|
+
/**
|
|
67
|
+
* For mongo-jobs, implement `BackgroundJobType<SerializableTriggerChunkedRequest>`, which has _id, attemptsCount, and uniqueKey.
|
|
68
|
+
* For background-jobs-postgres, implement `Job<SerializableTriggerChunkedRequest>`, which has id, retryAttempts, and idempotencyKey.
|
|
69
|
+
*/
|
|
66
70
|
job: { _id: string; attemptsCount: number; uniqueKey?: string },
|
|
67
71
|
) {
|
|
68
72
|
const metadata = {
|
|
@@ -72,7 +76,7 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
72
76
|
recipientCount: data.body.recipients.length,
|
|
73
77
|
workflowKey: data.workflowKey,
|
|
74
78
|
};
|
|
75
|
-
this.logger.info("
|
|
79
|
+
this.logger.info("TriggerNotificationJob processing", metadata);
|
|
76
80
|
|
|
77
81
|
try {
|
|
78
82
|
const request = toTriggerChunkedRequest(data, {
|
|
@@ -85,9 +89,11 @@ Send notifications through [Knock](https://docs.knock.app) using the `@clipboard
|
|
|
85
89
|
throw result.error;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
const success = "TriggerNotificationJob success";
|
|
93
|
+
this.logger.info(success, { ...metadata, response: result.value });
|
|
94
|
+
// For background-jobs-postgres, return the `success` string result.
|
|
89
95
|
} catch (error) {
|
|
90
|
-
this.logger.error("
|
|
96
|
+
this.logger.error("TriggerNotificationJob failure", { ...metadata, error });
|
|
91
97
|
throw error;
|
|
92
98
|
}
|
|
93
99
|
}
|
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": "1.6.
|
|
4
|
+
"version": "1.6.10",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@intellectronica/ruler": "0.3.21"
|