skills/business-compliance/SKILL.md
Audit automatique de conformité aux règles métier du domaine Hexagone (docs/domain/). Analyse le code d'un écran et les API appelées, matche contre les invariants, transitions et validations documentés, et produit un rapport structuré avec citations. Mode report-only — aucune modification automatique sur des règles métier en contexte santé.
npx skillsauth add dedalus-erp-pas/foundation-skills business-complianceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a fully autonomous domain compliance audit on a page or component of the Hexagone Web application. The skill discovers documented business rules in docs/domain/, extracts the entities and bounded context of the target screen, matches applicable rules, detects violations of domain invariants, and prints a structured report with mandatory citations — without modifying any files. This is a report-only skill. It never auto-fixes business rule violations because the semantic and patient-safety impact is too high for machine judgment.
Activate when the user:
docs/domain/design-compliancedesign-compliance and business-compliance are complementary but separate skills:
| | design-compliance | business-compliance |
|---|---|---|
| Audits | Visual / presentation layer | Domain / business logic layer |
| Source of truth | hexagone-preset.js, CLAUDE.md, design rules | docs/domain/ (DDD structured Markdown) |
| Mode | Auto-fix all violations | Report only, never fix |
| Risk profile | Low (cosmetic) | High (patient safety, regulatory) |
| Reviewer | Frontend devs | Domain experts, clinical PO, compliance |
Do not merge them. Run both separately when needed. A unified screen-compliance aggregator is out of scope for v1.
Auto-fixing a business rule violation is categorically unsafe in healthcare software. A machine "fix" could:
The skill surfaces, documents, and cites — a human (developer + domain expert) decides the fix.
The skill requires docs/domain/ to follow a structured rule schema (see reference/rule-schema.md). If the schema is not respected, the skill refuses to audit and emits a migration checklist. Garbage in → hallucinated findings out. This is non-negotiable.
Matching a rule to a screen is done in a deterministic pipeline before any LLM reasoning:
api_prefixes in rule frontmatterentities: listsLLM is used only in step 4. Steps 1-3 are mechanical.
In healthcare, false negatives are catastrophic, false positives are annoying. The skill tunes for sensitivity: when uncertain, it reports with status NEEDS_CLINICAL_REVIEW rather than dropping the rule silently.
Every finding MUST cite:
docs/domain/rule_id (e.g., ADM-001, PRESC-014)A finding without all three citations is rejected from the report. No citation = no finding.
docs/domain/ — the only source of authoritative business rulesreference/rule-schema.md (this skill's contract for rule structure)UBIQUITOUS_LANGUAGE.md if present, used to reconcile entity namingThe skill does NOT invent rules. If a rule is not documented in docs/domain/, it does not exist for this skill.
Same three input modes as design-compliance:
/business-compliance http://localhost:5173/hexagone-etab/vue/prescriptions/123
/business-compliance PrescriptionEditor
**/PrescriptionEditor.vue, **/prescription-editor.vue/business-compliance Prescriptions
/business-compliance
Ask the user what to audit. Do not assume.
Before doing anything else, validate that docs/domain/ follows the required schema:
Locate docs/domain/ in the project. If it does not exist, abort with:
"No
docs/domain/directory found.business-compliancerequires documented domain rules. Seereference/rule-schema.mdfor the required format."
Parse each .md file in docs/domain/ and verify the frontmatter:
bounded_context, entities, api_prefixes (can be empty list), rule_id OR a list of rules with rule_id each, severity, layerseverity: P1, P2, P3, P4layer: client, server, bothIf any file fails validation, abort the audit and emit a migration checklist:
docs/domain/ schema violations — audit aborted
| File | Missing fields | Action |
|------|----------------|--------|
| docs/domain/prescriptions.md | severity, layer | Add frontmatter fields |
| ... | ... | ... |
Fix the rule files before re-running. See skills/business-compliance/reference/rule-schema.md.
If all files validate, build the normalized in-memory rule index:
(bounded_context, entity, rule_id)Same resolution strategy as design-compliance:
**/router/**/*.{js,ts}, **/router.{js,ts}) for matching route, get component**/<name>.vue, **/<name-kebab>.vue, **/<Name>/**.vue fileprimevue/*, vue, vue-router, pinia, node_modules, @hexagone/shared)For each file in the component tree, extract the artifacts needed for rule matching:
Route information:
/prescriptions/:id)/api/prescriptions)Pinia stores:
import { usePrescriptionStore } from '...'API endpoints:
axios.*, fetch('...'), useFetch(...), $api.*catch (err) blocks, 4xx/5xx handlersTypeScript types:
@/types/, @hexagone/shared/types, or local types.tsPrescription, Admission, Patient, Order, etc.Form fields and bindings:
v-model bindingsrequired, rules, schema, Zod/Yup/Valibot schemas):disabled, v-if, v-show on action buttons (state machine signals)Action handlers:
save, validate, discharge, sign, cancel)Output a per-file extraction summary:
PrescriptionEditor.vue:
route: /prescriptions/:id
api_prefixes: [/api/prescriptions, /api/allergies]
stores: [usePrescriptionStore, usePatientStore]
types: [Prescription, AllergyCheck, Patient]
actions: [save, validate, sign]
For each file's extracted artifacts, match applicable rules:
api_prefix in the screen, collect rules whose api_prefixes frontmatter overlapsentities list contains any extracted TS type nameUBIQUITOUS_LANGUAGE.md exists, use it to map code-level names to domain-level names before matching (e.g., Rx → Prescription)Output the rule shortlist per file:
PrescriptionEditor.vue: 7 applicable rules
- PRESC-001 (P1) — Allergy check required before validation
- PRESC-002 (P1) — Electronic signature required on save
- PRESC-014 (P2) — Signature requires audit log entry
- ADM-008 (P3) — Patient must have active admission
- ...
For each (file, applicable rule) pair, check the 5 violation categories:
X requires Y verified):disabled, v-if, form validation, or API precondition)?Discharged cannot return to Active)When a rule has layer: server or layer: both:
When the skill cannot confidently determine if a rule applies or is violated:
NEEDS_CLINICAL_REVIEWNEEDS_CLINICAL_REVIEW — PRESC-007
Rule: Prescriptions require electronic signature.
Screen: PrescriptionEditor.vue uses usePrescriptionStore.save() but signature step not clearly detected.
Please confirm:
(a) Rule applies, step missing → fix required
(b) Rule applies, step present but undetected → add code annotation or test anchor
(c) Rule does not apply → document why in commit message or rule exclusion
After analysis, list any rule that was in the shortlist but could NOT be evaluated (e.g., code too complex, dynamic dispatch, external library call). This prevents "no violations found" from being confused with "not audited":
Non-evaluable rules (5):
- PRESC-022 — dynamic dispatch on action name, cannot trace
- ADM-014 — relies on backend orchestration not visible in screen code
- ...
Print a structured report to the terminal:
## Business Compliance Report
**Target:** [component/page name or URL]
**Files analyzed:** [count]
**Rules indexed:** [count from docs/domain/]
**Rules applicable to target:** [count]
**Violations detected:** [count]
**Uncertain findings (NEEDS_CLINICAL_REVIEW):** [count]
**Non-evaluable rules:** [count]
### Rule Index Summary
| Bounded Context | Rules | Files |
|-----------------|-------|-------|
| prescriptions | 14 | docs/domain/prescriptions.md |
| admissions | 8 | docs/domain/admissions.md |
| ... | ... | ... |
### Files in Component Tree
| # | File | Applicable Rules | Violations |
|---|------|------------------|------------|
| 1 | `frontend/gap-mf/src/views/PrescriptionEditor.vue` | 7 | 2 |
| 2 | `frontend/gap-mf/src/components/AllergyBanner.vue` | 2 | 0 |
| ... | ... | ... | ... |
### Violations by Severity
#### P1 — Patient Safety ([count])
- **PRESC-001** — Allergy check required before validation
- Rule source: `docs/domain/prescriptions.md:42`
- Code location: `frontend/gap-mf/src/views/PrescriptionEditor.vue:118`
- Category: Missing precondition check
- Evidence: `validate()` handler calls `prescriptionStore.validate()` without prior check on `allergyCheckStore.verified`.
- Suggested action (NOT applied): add `:disabled="!allergyChecked"` to the Validate button, or guard inside the handler.
#### P2 — Regulatory / Compliance ([count])
...
#### P3 — Clinical Workflow Integrity ([count])
...
#### P4 — Data Quality / Interoperability ([count])
...
### NEEDS_CLINICAL_REVIEW ([count])
- **PRESC-007** — [structured question as in Step 6]
### Non-Evaluable Rules ([count])
- **PRESC-022** — dynamic dispatch on action name, static trace impossible
### Drift Signals
- Rule files unchanged in > 6 months while referenced entities evolved: [list]
- Rules with no applicable screen in this audit: [list]
### Summary
- **Total violations:** [count] (P1: [n], P2: [n], P3: [n], P4: [n])
- **Waivable by developer alone:** [count] (P3 + P4)
- **Require clinical / compliance sign-off:** [count] (P1 + P2)
- **No files modified.** Review the report, discuss with domain experts, apply fixes manually.
| # | Category | Typical Rule Phrasing | Evidence Required | |---|----------|----------------------|-------------------| | 1 | Missing precondition check | "X requires Y verified" | Action handler + absence of guard | | 2 | Forbidden transition exposed | "Cannot transition from A to B" | Action handler + forbidden state change | | 3 | Required field absent | "Field F is mandatory" | Template + validation schema | | 4 | Cross-entity invariant unenforced | "X must reference Y" | Both entities present + conditional | | 5 | Workflow gap | "Step S must occur within T" | UI artifact for step S |
| Severity | Meaning | Escalation | |----------|---------|------------| | P1 | Patient safety — direct harm pathway (allergy, dose, wrong-patient, signature bypass) | Blocks merge. Clinical PO sign-off required. | | P2 | Regulatory / compliance — HDS, MDR, CNIL, audit log, traceability | Blocks merge. Compliance officer sign-off required. | | P3 | Clinical workflow integrity — state machine, orphan entities, workflow gaps | Blocks merge. Waivable by clinical PO with written justification. | | P4 | Data quality / interoperability — optional fields, code systems, labels | Warns. Does not block. Dev may waive. |
P1 and P2 cannot be waived by a developer alone. The skill must require a named clinical or compliance reviewer in the waiver metadata when such a waiver is requested.
See reference/rule-schema.md for concrete examples. Common rule categories in Hexagone:
docs/domain/ Does Not ExistAbort audit. Emit:
"No
docs/domain/directory found. This skill requires documented domain rules following the schema inreference/rule-schema.md. Create the directory and add rule files before running."
docs/domain/ Exists but Schema FailsAbort audit. Emit a migration checklist of schema violations per file (see Step 1.3). Do not attempt partial audit — partial data leads to false confidence.
If a rule's entities: list contains a name not found anywhere in the codebase:
Report "0 applicable rules" — explicitly state that this is not the same as "compliant". The screen may operate on an undocumented bounded context (which is itself a drift signal to report).
If two rules in the index share the same rule_id or make contradictory claims about the same entity:
This skill does NOT require a dev server. It is a static analysis + doc-parsing skill. Visual inspection is out of scope — business rules are about code behavior, not rendering.
Process all files. Organize report by file for readability. Use parallel sub-agents only if the tree exceeds 10 files AND the rule index exceeds 30 rules, to keep LLM reasoning context manageable.
Apply the same rule index to all files regardless of MF. Note MF membership per file in the report.
The skill does NOT manage waivers. If a finding must be waived, the developer does so in the PR description or a dedicated waiver log outside this skill's scope. The skill always re-reports the finding on next run — it's not the skill's job to remember waivers (memory of waivers is a human-process concern).
NEEDS_CLINICAL_REVIEW. Never silently drop a rule.databases
Exécute des requêtes SQL en lecture seule sur plusieurs bases de données PostgreSQL. À utiliser pour : (1) interroger des bases PostgreSQL, (2) explorer les schémas/tables, (3) exécuter des requêtes SELECT pour l'analyse de données, (4) vérifier le contenu des bases. Supporte plusieurs connexions avec descriptions pour une sélection automatique intelligente. Bloque toutes les opérations d'écriture (INSERT, UPDATE, DELETE, DROP, etc.) par sécurité.
development
Automatisation complète du navigateur et tests web avec Playwright. Détecte automatiquement les serveurs de développement, gère le cycle de vie des serveurs, écrit des scripts de test propres dans /tmp. Tester des pages, remplir des formulaires, capturer des screenshots, vérifier le responsive design, valider l'UX, tester les flux de connexion, vérifier les liens, déboguer des webapps dynamiques, automatiser toute tâche navigateur. À utiliser quand l'utilisateur veut tester des sites web, automatiser des interactions navigateur, valider des fonctionnalités web ou effectuer tout test basé sur le navigateur.
documentation
Boîte à outils complète pour la manipulation de PDF : extraction de texte et tableaux, création de nouveaux PDF, fusion/découpage de documents et gestion de formulaires. Quand Claude doit remplir un formulaire PDF ou traiter, générer ou analyser des documents PDF de manière programmatique et à grande échelle.
testing
Lance une réunion simulée avec plusieurs personas experts pour analyser un sujet sous des perspectives diverses, prendre une décision et proposer une solution avant implémentation. Peut optionnellement publier l'analyse de la réunion sur une issue GitLab ou GitHub liée.