@carecard/validate 3.28.0 → 3.30.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/.agents/skills/carecard-must-do/SKILL.md +117 -0
- package/.agents/skills/carecard-workspace-standards/SKILL.md +46 -33
- package/.agents/skills/github-pr-create-update/SKILL.md +140 -167
- package/.agents/skills/github-pr-create-update/agents/openai.yaml +4 -4
- package/.agents/skills/github-pr-merge-cleanup/SKILL.md +228 -219
- package/.agents/skills/github-pr-merge-cleanup/agents/openai.yaml +4 -4
- package/.agents/skills/pkg-publish/SKILL.md +66 -7
- package/.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md +39 -3
- package/.agents/skills/pkg-validate-validation-library/SKILL.md +42 -32
- package/.codex/AGENTS.md +16 -4
- package/AGENTS.md +13 -1
- package/CLAUDE.md +43 -0
- package/package.json +3 -3
- package/readme.md +14 -0
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pkg-validate-coding-standards-and-best-practices
|
|
3
|
-
description: 'Mandatory for every pkg-validate task, including analysis, clarification, planning, implementation, review, debugging, documentation, public API work, skill maintenance, and validation. Use before every narrower skill.'
|
|
3
|
+
description: 'Use after carecard-must-do. Mandatory for every pkg-validate task, including analysis, clarification, planning, implementation, review, debugging, documentation, public API work, skill maintenance, and validation. Use before every narrower skill.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Pkg Validate Coding Standards And Best Practices
|
|
7
7
|
|
|
8
|
+
## Release 1.1.1 and production data
|
|
9
|
+
|
|
10
|
+
CareCard Release 1.1.1 is the production baseline. Seeding with
|
|
11
|
+
`--seed-release-data` is complete. Production cluster data, database rows,
|
|
12
|
+
and stored user files will be preserved going forward. There will be no
|
|
13
|
+
complete user-data wipeout and re-creation.
|
|
14
|
+
|
|
15
|
+
Future production changes must use data-preserving migrations. Do not replay
|
|
16
|
+
the completed initialization or run reset, rollback, or seed workflows as part
|
|
17
|
+
of ordinary production deployment.
|
|
18
|
+
|
|
19
|
+
## Commit and merge documentation and skills with the task
|
|
20
|
+
|
|
21
|
+
In each owning repository, include all task-related documentation, plans, and
|
|
22
|
+
skill changes in the same commit as the related task changes. Merge them
|
|
23
|
+
together into remote `main`. Do not leave changed documentation or skills
|
|
24
|
+
uncommitted or unmerged, and do not declare the task complete until their
|
|
25
|
+
inclusion in the merged commit is verified. Preserve unrelated work.
|
|
26
|
+
|
|
27
|
+
First read [carecard-must-do](../carecard-must-do/SKILL.md); it is mandatory for every agent and task.
|
|
28
|
+
Then apply this engineering standard before selecting narrower skills.
|
|
29
|
+
|
|
8
30
|
## JavaScript And TypeScript Style Contract
|
|
9
31
|
|
|
10
32
|
- Require braces around every optional control-flow body through ESLint core
|
|
@@ -40,7 +62,7 @@ cross-repository end-to-end testing is its explicit responsibility.
|
|
|
40
62
|
|
|
41
63
|
## Mandatory Use And Authorities
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
After `carecard-must-do`, load this skill before doing any work in `pkg-validate`, including read-only
|
|
44
66
|
and documentation-only work. Then load every narrower skill that owns the
|
|
45
67
|
affected package contract.
|
|
46
68
|
|
|
@@ -172,6 +194,12 @@ them unused and replaced.
|
|
|
172
194
|
|
|
173
195
|
## Completion
|
|
174
196
|
|
|
197
|
+
Reuse the current working branch for every follow-up request, even when the
|
|
198
|
+
subject changes or the working tree is clean. Create a branch only when no
|
|
199
|
+
working branch exists or the checkout is on `main` or `development`. Otherwise,
|
|
200
|
+
fetch remote `main` HEAD and rebase the same working branch onto that fetched
|
|
201
|
+
commit, preserving its commits and uncommitted work.
|
|
202
|
+
|
|
175
203
|
1. Review each changed repository's diff and status independently.
|
|
176
204
|
2. Run focused runtime, type, and coverage tests, then all broader checks
|
|
177
205
|
required by local skills.
|
|
@@ -181,7 +209,15 @@ them unused and replaced.
|
|
|
181
209
|
none exists, run the strongest repository-native focused validation.
|
|
182
210
|
5. Fix every in-scope failure at its root cause and rerun the exact command.
|
|
183
211
|
6. Report exact commands, results, limitations, and remaining risk.
|
|
184
|
-
7.
|
|
212
|
+
7. Fetch the latest `origin/main` at task start and before every source-branch
|
|
213
|
+
push; these required fetches need no separate approval. Create
|
|
214
|
+
`<agent-name>/<branch-name>` from it only when no working branch exists or the
|
|
215
|
+
current branch is `main` or `development`. Otherwise rebase the current branch
|
|
216
|
+
onto it, preserving
|
|
217
|
+
existing commits and uncommitted changes, and build subsequent task commits
|
|
218
|
+
on that same branch. Commits, pushes, PR mutations, and branch cleanup still
|
|
219
|
+
require an authorized task. Never delete local or remote `main` or
|
|
220
|
+
force-push to remote `main`.
|
|
185
221
|
|
|
186
222
|
## TDD And Validation
|
|
187
223
|
|
|
@@ -200,41 +200,51 @@ and remaining risk.
|
|
|
200
200
|
|
|
201
201
|
## Remote Git Operations Guardrail
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
Fetches needed to establish a fresh `origin/main` at task start and before a
|
|
204
|
+
source-branch push are authorized without a separate approval question. Commits,
|
|
205
|
+
pushes, PR mutations, and branch cleanup require an authorized task; a request
|
|
206
|
+
for local work alone does not authorize publication. An authorized squash merge
|
|
207
|
+
into `main` includes the merged-source cleanup, local `main` update, and
|
|
208
|
+
`development` synchronization below unless the user explicitly says otherwise.
|
|
209
|
+
Never delete local or remote `main`, or force-push to remote `main`, including
|
|
210
|
+
with `--force-with-lease`.
|
|
204
211
|
|
|
205
212
|
## Agent Guidance Git Workflow
|
|
206
213
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
214
|
+
Reuse the current working branch for every follow-up request, even when the
|
|
215
|
+
subject changes or the working tree is clean. Create a branch only when no
|
|
216
|
+
working branch exists or the checkout is on `main` or `development`. Otherwise,
|
|
217
|
+
fetch remote `main` HEAD and rebase the same working branch onto that fetched
|
|
218
|
+
commit, preserving its commits and uncommitted work.
|
|
219
|
+
|
|
220
|
+
Work from the owning repository root and stage only intended guidance changes.
|
|
221
|
+
Fetch fresh `origin/main` at task start. Create `<agent-name>/<branch-name>`
|
|
222
|
+
from it only when no working branch exists or the current branch is `main` or
|
|
223
|
+
`development`. Otherwise keep
|
|
224
|
+
and rebase the current branch onto it, preserving existing commits and
|
|
225
|
+
uncommitted changes. Build subsequent task commits on that same branch, even
|
|
226
|
+
for a different task or a clean working tree. Honor explicit user
|
|
227
|
+
working-branch instructions.
|
|
228
|
+
|
|
229
|
+
Fetch again before every source-branch push and rebase only when the branch
|
|
230
|
+
does not already contain the latest `origin/main`. Required fetches need no
|
|
231
|
+
separate approval; commits, pushes, PR mutations, and cleanup require an
|
|
232
|
+
authorized task. A local guidance edit does not authorize publishing it.
|
|
233
|
+
|
|
234
|
+
For an authorized merge, create or reuse the PR into `main`, run applicable
|
|
235
|
+
validation, and squash-merge; administrator privileges may be used without
|
|
236
|
+
GitHub reviews. Verify the merge and delete its source branch remotely and
|
|
237
|
+
locally after checking for newer unmerged work. Then fast-forward local `main`
|
|
238
|
+
and replace local and remote branches named exactly `development` with the
|
|
239
|
+
latest remote `main` commit, using an explicit observed-commit
|
|
240
|
+
`--force-with-lease` remotely. Create a missing development counterpart when
|
|
241
|
+
either existed; leave repositories with neither unchanged. If development was
|
|
242
|
+
the merged source, recreate it from the new main. Verify commit parity and
|
|
243
|
+
cleanup; preserve dirty worktrees and report conflicts or rejected leases.
|
|
244
|
+
|
|
245
|
+
Never delete local or remote `main` or force-push to remote `main`, including
|
|
246
|
+
with `--force-with-lease`. Guard exact destination refs before deleting or
|
|
247
|
+
forcing any branch. Do not amend commits or stage unrelated files.
|
|
238
248
|
|
|
239
249
|
## Fail-Closed Test Lifecycle Audit
|
|
240
250
|
|
package/.codex/AGENTS.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Codex Instructions For pkg-validate
|
|
2
2
|
|
|
3
|
+
## Mandatory startup for every agent
|
|
4
|
+
|
|
5
|
+
Every agent, including Codex, Claude, other assistants, and delegated agents,
|
|
6
|
+
must read and follow [carecard-must-do](../.agents/skills/carecard-must-do/SKILL.md)
|
|
7
|
+
before beginning or resuming any task. This includes planning, questions,
|
|
8
|
+
read-only investigation, coding, review, documentation, and validation.
|
|
9
|
+
|
|
10
|
+
Then load the [repository engineering standards](../.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
|
|
11
|
+
and the specialist skills relevant to the task.
|
|
12
|
+
An agent without automatic skill discovery must open the skill explicitly;
|
|
13
|
+
the requirement applies regardless of the agent platform.
|
|
14
|
+
|
|
3
15
|
## Non-negotiable Codex banked-reset requirement
|
|
4
16
|
|
|
5
17
|
- Never use or consume a banked Codex rate-limit reset automatically.
|
|
@@ -133,10 +145,10 @@ The `pkg-*` directories are reusable CareCard packages. Shared API response, err
|
|
|
133
145
|
- Use coverage reports only as diagnostics for potentially untested observable behavior. Percentages for lines, branches, functions, and statements are not functional evidence and must not determine test assertions. Never add implementation-detail tests to preserve a metric or lower thresholds to hide a failing check; report any conflict with the behavior-only policy.
|
|
134
146
|
- Keep tests readable and domain-specific. Prefer explicit helper names over generic test utilities that hide important behavior.
|
|
135
147
|
- Use existing test frameworks and layouts:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
148
|
+
- JavaScript `api-*`: usually Mocha, Supertest, `test/index.test.js`, and Docker-backed Postgres scripts.
|
|
149
|
+
- TypeScript `api-*`: usually Jest and `tests/index.test.ts`.
|
|
150
|
+
- `pkg-*`: Mocha plus TypeScript type tests where present.
|
|
151
|
+
- `app-dashboard`: Vitest, React Testing Library, mock API tests, and Selenium for end-to-end flows.
|
|
140
152
|
- For database tests, use existing seed, migration, rollback, and cleanup patterns. Keep tests isolated and make cleanup reliable even after failures.
|
|
141
153
|
- Add tests for API success responses, validation errors, auth/authz errors, JWT errors, not-found/conflict cases, and unexpected error handling when those paths change.
|
|
142
154
|
- For frontend changes, test rendered UI, public HTTP or network outcomes, navigation, accessibility, and user-visible flows at the narrowest practical level first. Use focused non-test dependency checks for validation, transform, query, mutation, hook, and module organization.
|
package/AGENTS.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Mandatory startup for every agent
|
|
4
|
+
|
|
5
|
+
Every agent, including Codex, Claude, other assistants, and delegated agents,
|
|
6
|
+
must read and follow [carecard-must-do](.agents/skills/carecard-must-do/SKILL.md)
|
|
7
|
+
before beginning or resuming any task. This includes planning, questions,
|
|
8
|
+
read-only investigation, coding, review, documentation, and validation.
|
|
9
|
+
|
|
10
|
+
Then load the [repository engineering standards](.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
|
|
11
|
+
and the specialist skills relevant to the task.
|
|
12
|
+
An agent without automatic skill discovery must open the skill explicitly;
|
|
13
|
+
the requirement applies regardless of the agent platform.
|
|
2
14
|
|
|
3
15
|
## Non-negotiable Codex banked-reset requirement
|
|
4
16
|
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Repository Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Mandatory startup for every agent
|
|
4
|
+
|
|
5
|
+
Every agent, including Codex, Claude, other assistants, and delegated agents,
|
|
6
|
+
must read and follow [carecard-must-do](.agents/skills/carecard-must-do/SKILL.md)
|
|
7
|
+
before beginning or resuming any task. This includes planning, questions,
|
|
8
|
+
read-only investigation, coding, review, documentation, and validation.
|
|
9
|
+
|
|
10
|
+
Then load the [repository engineering standards](.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
|
|
11
|
+
and the specialist skills relevant to the task.
|
|
12
|
+
An agent without automatic skill discovery must open the skill explicitly;
|
|
13
|
+
the requirement applies regardless of the agent platform.
|
|
14
|
+
|
|
15
|
+
Also read [AGENTS.md](AGENTS.md) for the full repository instructions.
|
|
16
|
+
|
|
17
|
+
## Existing repository isolation contract
|
|
18
|
+
|
|
19
|
+
Non-negotiable repository isolation rule: Every repository must run its Husky
|
|
20
|
+
hooks and tests using only files, code, fixtures, dependencies, and services
|
|
21
|
+
contained within that repository. Tests and Husky scripts must not import,
|
|
22
|
+
require, read, execute, or otherwise depend on sibling repositories or paths
|
|
23
|
+
outside the repository root. app-e2e-tests is the only exception because
|
|
24
|
+
cross-repository end-to-end testing is its explicit responsibility.
|
|
25
|
+
|
|
26
|
+
Also apply [$carecard-workspace-standards](.agents/skills/carecard-workspace-standards/SKILL.md)
|
|
27
|
+
for the mandatory TDD and code organization rules.
|
|
28
|
+
|
|
29
|
+
## Existing test-preservation policy
|
|
30
|
+
|
|
31
|
+
The TDD and validation requirements are non-negotiable and cannot be
|
|
32
|
+
overridden. The separate pre-existing-test protection still requires the
|
|
33
|
+
user's fresh, explicit permission for each exact proposed test modification.
|
|
34
|
+
|
|
35
|
+
A pre-existing test—defined as any test present before work on the current task
|
|
36
|
+
begins—must not be deleted, disabled, skipped, weakened, excluded from execution,
|
|
37
|
+
or otherwise removed. A pre-existing test must not be modified without the
|
|
38
|
+
user's explicit approval for the exact proposed change. If changing a
|
|
39
|
+
pre-existing test is believed necessary, stop before making the change and
|
|
40
|
+
request approval. The request must identify every affected test, describe the
|
|
41
|
+
precise proposed modification, provide detailed technical justification, and
|
|
42
|
+
explain all known or reasonably foreseeable regression risks. Until approval is
|
|
43
|
+
granted, leave every pre-existing test unchanged.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carecard/validate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/CareCard-ca/pkg-validate.git"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "6.0.3"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@carecard/common-util": "3.
|
|
50
|
+
"@carecard/common-util": "3.30.0"
|
|
51
51
|
},
|
|
52
52
|
"nyc": {
|
|
53
53
|
"all": true,
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
"glob": "13.0.6",
|
|
68
68
|
"minimatch": "10.2.6",
|
|
69
69
|
"serialize-javascript": "7.0.5",
|
|
70
|
-
"js-yaml": "4.3.
|
|
70
|
+
"js-yaml": "4.3.2"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/readme.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @carecard/validate
|
|
2
2
|
|
|
3
|
+
## Release 1.1.1 and production data
|
|
4
|
+
|
|
5
|
+
CareCard Release 1.1.1 is the production baseline. Seeding with
|
|
6
|
+
`--seed-release-data` is complete. Production cluster data, database rows,
|
|
7
|
+
and stored user files will be preserved going forward. There will be no
|
|
8
|
+
complete user-data wipeout and re-creation.
|
|
9
|
+
|
|
10
|
+
Future production changes must use data-preserving migrations. Do not replay
|
|
11
|
+
the completed initialization or run reset, rollback, or seed workflows as part
|
|
12
|
+
of ordinary production deployment.
|
|
13
|
+
|
|
14
|
+
The [completed seed inventory and verification record](https://github.com/CareCard-ca/cc-seed-data/blob/main/plans/production-seed-result.md)
|
|
15
|
+
documents the accepted release baseline and verification limitations.
|
|
16
|
+
|
|
3
17
|
Non-negotiable test order invariance rule: Every test must pass independently of which tests run before or after it, and the suite must pass in every execution order. Each test must establish the state it needs, isolate mutable state, and clean up state it owns; it must never rely on another test's setup, mutations, or cleanup. Default test, CI, and Husky commands must use the test framework's ordinary ordering and must not force randomized ordering. Random-order execution is an explicit diagnostic only, and every failure it exposes must be fixed at the root cause.
|
|
4
18
|
|
|
5
19
|
Non-negotiable root-cause solution rule: Always identify and solve the verified root cause, use the stronger solution, and deliver a correct, durable, production-quality result. Never treat a temporary workaround, resource increase, retry, suppression, bypass, or symptom-only patch as completion. Validate the root-cause fix against the real failing workflow and prove the end state.
|