import test from 'node:test'; import assert from 'node:assert/strict'; import fs from 'node:fs'; const skillText = fs.readFileSync(new URL('./skills/page-data-collect/SKILL.md', import.meta.url), 'utf8'); test('page-data-collect skill uses PostgreSQL DDL and fails closed on private data errors', () => { assert.match(skillText, /GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY/); assert.match(skillText, /TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP/); assert.doesNotMatch(skillText, /INTEGER PRIMARY KEY AUTOINCREMENT/); assert.match(skillText, /数据层失败必须立即停止/); assert.match(skillText, /禁止继续写 HTML、bind 或发布/); assert.match(skillText, /平台没有延迟补执行队列/); }); test('page-data-collect skill pins deletion to the public client API', () => { assert.match(skillText, /client\.deleteRow\('dataset_name', rowId\)/); assert.match(skillText, /禁止发明 `softDeleteRows`/); assert.match(skillText, /表必须包含 `deleted_at TIMESTAMPTZ`/); });