Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .agents/skills/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
"categories": [
{
"name": "Everyday",
"skills": ["skills", "plan", "run", "test", "fix", "review", "task", "handover", "health", "audit", "export", "prompt-perfector"]
"skills": [
"skills",
"plan",
"run",
"test",
"fix",
"review",
"task",
"handover",
"health",
"audit",
"export",
"prompt-perfector"
]
},
{
"name": "Clinical and app",
Expand Down
4 changes: 4 additions & 0 deletions .agents/skills/prompt-perfector/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Prompt Perfector"
short_description: "Refine, structure, and optimize user prompts safely"
default_prompt: "Use $prompt-perfector to polish and optimize prompts in an isolated environment."
50 changes: 50 additions & 0 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bundle Size Audit

on:
pull_request:
branches: [main, develop, "release/*"]
paths:
- "src/**"
- "public/**"
- "package.json"
- "package-lock.json"
- "next.config.ts"
- "bundle-budget.json"
Comment on lines +6 to +12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Trigger the audit when its own implementation changes.

Changes to the bundle-budget checker, local setup action, or this workflow do not match these paths, so the guard can be modified without running. Include the relevant scripts/**, .github/actions/setup-node-cached/**, and workflow path. As per coding guidelines, CI workflows must use documented project and provider safety boundaries.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/bundle-size.yml around lines 6 - 12, Update the path
filters in the bundle-size workflow to also trigger when the bundle-budget
checker under scripts, the local setup action under
.github/actions/setup-node-cached, or this workflow itself changes. Preserve the
existing source, public, package, Next.js, and budget configuration paths while
using the documented project and provider safety boundaries.

Source: Coding guidelines


concurrency:
group: bundle-size-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
bundle-size:
name: Guard Bundle Budget
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Node and dependencies
uses: ./.github/actions/setup-node-cached

- name: Restore Next.js build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: .next/cache
key: bundle-${{ runner.os }}-${{ hashFiles('.nvmrc', 'package-lock.json') }}-${{ hashFiles('src/**', 'data/**', 'public/**', 'next.config.ts', 'tsconfig.json', 'postcss.config.mjs') }}
restore-keys: |
bundle-${{ runner.os }}-${{ hashFiles('.nvmrc', 'package-lock.json') }}-

- name: Build production application
env:
NEXT_BUILD_CPUS: "4"
run: npm run build

- name: Check Client Bundle Budget
run: npm run check:bundle-budget
70 changes: 70 additions & 0 deletions .github/workflows/nightly-drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Nightly Drift & Regression Suite

on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:

concurrency:
group: nightly-drift-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: read

env:
NEXT_PUBLIC_SUPABASE_URL: https://sjrfecxgysukkwxsowpy.supabase.co
SUPABASE_PROJECT_REF: sjrfecxgysukkwxsowpy
SUPABASE_PROJECT_NAME: Clinical KB Database
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: placeholder-ci-anon-key
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}

jobs:
nightly-suite:
name: Nightly Regression & Drift Check
runs-on: ubuntu-24.04
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Run unit and integration regressions
run: npm run test

- name: Check architecture boundaries and env parity
run: npm run check:env-parity

- name: Preflight required secrets for drift check
id: secret-check
run: |
if [ -z "$SUPABASE_SERVICE_ROLE_KEY" ]; then
echo "missing_secrets=true" >> $GITHUB_OUTPUT
echo "::warning::Skipping live drift check due to missing secrets."
else
echo "missing_secrets=false" >> $GITHUB_OUTPUT
fi

- name: Guard Supabase project identity
if: steps.secret-check.outputs.missing_secrets != 'true'
run: npm run check:supabase-project

- name: Compare live schema drift
if: steps.secret-check.outputs.missing_secrets != 'true'
run: npm run check:drift

- name: Align migration history for Supabase Preview
if: steps.secret-check.outputs.missing_secrets != 'true'
run: npm run check:migration-history
49 changes: 49 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Cross-Browser Playwright Matrix

on:
schedule:
- cron: "0 5 * * 0" # Sunday at 5:00 UTC
workflow_dispatch:

concurrency:
group: playwright-matrix-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
browser-matrix:
name: Playwright Tests (${{ matrix.project }})
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
project: [chromium, firefox, webkit]

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup UI e2e environment
uses: ./.github/actions/setup-ui-e2e

- name: Run Playwright suite
run: node scripts/run-playwright.mjs --project=${{ matrix.project }}
Comment on lines +31 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install browsers before running cross-browser jobs

On a fresh runner or browser-cache miss, the Firefox and WebKit matrix entries fail before executing tests: the inspected .github/actions/setup-ui-e2e/action.yml:12-28 caches and installs only Chromium (playwright install ... chromium), while this workflow requests all three projects. Install the selected matrix browser—or use a setup action that installs the full set—before invoking run-playwright.mjs; an empty ~/.cache/ms-playwright run is the smallest proof.

Useful? React with 👍 / 👎.


- name: Classify exact failed test identities
if: failure()
run: node scripts/classify-playwright-failures.mjs

- name: Upload browser diagnostics
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: playwright-${{ matrix.project }}-diagnostics-${{ github.run_id }}
path: |
test-results/
playwright-report/
if-no-files-found: ignore
4 changes: 2 additions & 2 deletions bundle-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$comment": "Client JS bundle-size budget captured from a known-good production build. CI fails when total gzip size grows beyond tolerancePct; refresh intentionally with `npm run check:bundle-budget -- --update`.",
"enforce": true,
"tolerancePct": 10,
"totalGzipBytes": 1309274,
"updatedAt": "2026-07-18T15:49:00.100Z"
"totalGzipBytes": 1344716,
"updatedAt": "2026-07-24T12:00:00.000Z"
}
67 changes: 4 additions & 63 deletions docs/audit/repo-wide-review-remediation-plan-2026-07-23.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<<<<<<< ours
<<<<<<< ours
<<<<<<< ours
# Repository-wide review remediation plan — 2026-07-23

## Goal
Expand All @@ -25,11 +22,7 @@ Resolve the outstanding issues from the repository-wide review sweep with the sm
2. Run `node scripts/check-node-engine.cjs`.
3. Run `npm ci` only after Node 24 is active.
4. Confirm dependency/tool presence:
=======
=======
>>>>>>> theirs
=======
>>>>>>> theirs

# Repository-wide review remediation completion plan — 2026-07-24

## Objective
Expand Down Expand Up @@ -73,20 +66,10 @@ Complete every outstanding finding from the 2026-07-19 repository-wide review sw
2. Run `node scripts/check-node-engine.cjs`.
3. Run `npm ci` without changing package manager or lockfile.
4. Confirm:
<<<<<<< ours
<<<<<<< ours
>>>>>>> theirs
=======
>>>>>>> theirs
=======
>>>>>>> theirs
- `node -v && npm -v`
- `test -f node_modules/typescript/bin/tsc`
- `test -f node_modules/next/dist/bin/next`
- `test -d node_modules/next/dist/docs`
<<<<<<< ours
<<<<<<< ours
<<<<<<< ours
5. Read only the relevant installed Next docs before any Next/config code change.

**Verification**
Expand Down Expand Up @@ -134,12 +117,7 @@ Complete every outstanding finding from the 2026-07-19 repository-wide review sw

1. In `.github/workflows/pr-policy.yml`, add `"release/**"` to `pull_request_target.branches` so PR Policy mirrors CI PR branches.
2. In `scripts/check-github-action-pins.mjs`, extend discovery to include:
=======
=======
>>>>>>> theirs
=======
>>>>>>> theirs
5. Before any Next/framework code change, read the relevant installed guide in `node_modules/next/dist/docs/`.
3. Before any Next/framework code change, read the relevant installed guide in `node_modules/next/dist/docs/`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Restore the missing action-pin discovery details.

The preceding item ends with “extend discovery to include:” but item 3 starts immediately, so this checklist omits the required .yml/.yaml patterns. Add those bullets under item 2 or remove this incomplete duplicate block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/audit/repo-wide-review-remediation-plan-2026-07-23.md` at line 120,
Complete the action-pin discovery checklist in item 2 by adding the required
.yml and .yaml patterns after “extend discovery to include:”, or remove the
incomplete duplicate block if those details are already documented elsewhere.
Keep item 3 focused solely on reading the installed Next guide before framework
changes.


**Verification ladder**

Expand Down Expand Up @@ -194,20 +172,10 @@ Complete every outstanding finding from the 2026-07-19 repository-wide review sw

1. Add `"release/**"` to PR Policy `pull_request_target.branches`.
2. Extend checker discovery to include workflow YAML plus composite action definitions:
<<<<<<< ours
<<<<<<< ours
>>>>>>> theirs
=======
>>>>>>> theirs
=======
>>>>>>> theirs
- `.github/workflows/*.yml`
- `.github/workflows/*.yaml`
- `.github/actions/**/action.yml`
- `.github/actions/**/action.yaml`
<<<<<<< ours
<<<<<<< ours
<<<<<<< ours
3. Add a self-test or fixture to prove unpinned external `uses:` inside a composite action fails the checker.

**Verification**
Expand Down Expand Up @@ -293,13 +261,7 @@ Run only after Node 24, dependencies, and focused checks are clean:

## Approval-required follow-up gates

Ask before running any of these:
=======
=======
>>>>>>> theirs
=======
>>>>>>> theirs
3. Add a self-test that would fail if an unpinned external `uses:` in a composite action is ignored.
Ask before running any of these: 3. Add a self-test that would fail if an unpinned external `uses:` in a composite action is ignored.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move the composite-action self-test out of the approval-only section.

This line is malformed as Ask before running any of these: 3. and incorrectly makes adding the self-test approval-gated. Keep the self-test as an unconditional Batch 2 requirement, reserving this section for provider-backed commands.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/audit/repo-wide-review-remediation-plan-2026-07-23.md` at line 264,
Update the remediation plan so the composite-action self-test is listed as an
unconditional Batch 2 requirement rather than under the approval-only section.
Remove the malformed “Ask before running any of these: 3.” entry and keep the
approval-only section limited to provider-backed commands.


**Focused proof**

Expand Down Expand Up @@ -405,13 +367,6 @@ Run after all batches are complete under Node 24 with dependencies installed:
## Provider-backed approval gates

Do not run these without explicit confirmation:
<<<<<<< ours
<<<<<<< ours
>>>>>>> theirs
=======
>>>>>>> theirs
=======
>>>>>>> theirs

- `npm run check:supabase-project`
- `npm run check:production-readiness`
Expand All @@ -420,9 +375,6 @@ Do not run these without explicit confirmation:
- `npm run eval:quality -- --rag-only`
- `npm run verify:release`

<<<<<<< ours
<<<<<<< ours
<<<<<<< ours
## Recommended execution order

1. Batch 0 — prerequisites.
Expand All @@ -434,11 +386,7 @@ Do not run these without explicit confirmation:
7. Final handoff gate.

This order fixes the highest clinical/governance risk first, avoids formatting noise during logic review, and keeps provider-backed uncertainty outside local development until explicit approval is given.
=======
=======
>>>>>>> theirs
=======
>>>>>>> theirs

## Recommended PR split

1. PR A: Batch 0 docs/prerequisite proof only if environment setup requires repo documentation; otherwise no PR.
Expand All @@ -449,10 +397,3 @@ This order fixes the highest clinical/governance risk first, avoids formatting n
6. PR F: Batch 5 formatting-only cleanup.

This split keeps clinical behavior, CI governance, UI polish, npm config, and formatting isolated so regressions are easier to detect and revert.
<<<<<<< ours
<<<<<<< ours
>>>>>>> theirs
=======
>>>>>>> theirs
=======
>>>>>>> theirs
Loading
Loading