aql-authoring — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited aql-authoring (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
The inline syntax below is a quick crib. The aql/syntax guide loaded in Step 1 is authoritative — if they ever disagree, follow the guide.Before writing or reviewing any AQL query, load the authoritative guides:
guide_get("aql/principles")
guide_get("aql/syntax")
guide_get("aql/idioms-cheatsheet")When the user asks for a query to adapt, or when the clinical question matches a common pattern (cohort selection, pagination with total count, time-window filtering, cross-composition joins, terminology value-set matching, "latest per EHR", ISM-state filtering), try examples_search(kind="aql") before drafting. The curated AQL examples are under openehr://examples/aql/{name} and include pattern metadata and related-spec links — reuse and adapt rather than invent. Skip this step if the question is clearly novel or the user already provided the skeleton.
AQL queries operate on archetypes. Before writing a query:
ckm_archetype_get("<archetype-id>")type_specification_get if you need to understand RM type detailsSELECT <paths>
FROM EHR e
CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.<name>.v1]
CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.<name>.v1]
WHERE <conditions>
ORDER BY <paths>Define the archetype hierarchy using CONTAINS:
FROM EHR e
CONTAINS COMPOSITION c
CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.blood_pressure.v2]Navigate archetype structure using at-codes:
o/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitudeFilter by patient:
FROM EHR e[ehr_id/value = $ehr_id]Use $parameter syntax for reusable queries:
WHERE o/data[at0001]/events[at0006]/time/value > $start_dateSELECT c
FROM EHR e[ehr_id/value = $ehr_id]
CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1]
ORDER BY c/context/start_time/value DESC
LIMIT 1SELECT o/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude AS systolic
FROM EHR e[ehr_id/value = $ehr_id]
CONTAINS COMPOSITION c
CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.blood_pressure.v2]
WHERE c/context/start_time/value >= $start_date
AND c/context/start_time/value <= $end_dateSELECT
COUNT(o) AS count,
AVG(o/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude) AS avg_systolic
FROM EHR e
CONTAINS COMPOSITION c
CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.blood_pressure.v2]
GROUP BY e/ehr_id/valueCONTAINS OBSERVATION o)SELECT * — select only needed pathsRun through the AQL checklist:
guide_get("aql/checklist")Verify:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.