一键导入
add-scan
Guide for implementing a new scan in the core-scanner library, including page evaluation, entity integration, and testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for implementing a new scan in the core-scanner library, including page evaluation, entity integration, and testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Runbook for diagnosing and resolving production issues with the Site Scanning Engine on Cloud.gov.
Guide for deploying the Site Scanning Engine to Cloud.gov via GitHub Actions, and using the Cloud Foundry CLI to monitor and troubleshoot deployed environments.
Guide for adding new fields/columns to scan results, including entity decorators, snapshot integration, and API exposure.
Common development commands and workflows — linting, testing, building, Docker management, and troubleshooting.
Commands for loading and managing scan data — ingesting federal domains, enqueueing scans, running single-site tests, and exporting snapshots.
Guide through initial development setup of the Site Scanning Engine (prerequisites, Docker, building, first data load).
| name | add-scan |
| description | Guide for implementing a new scan in the core-scanner library, including page evaluation, entity integration, and testing. |
Guide for implementing a new scan in the core-scanner library.
The core-scanner has two main concepts:
libs/core-scanner/src/pages/): Different page types to scan (primary, robots.txt, sitemap.xml, DNS, accessibility, performance, www, notFound, clientRedirect)libs/core-scanner/src/scans/): Specific analyses performed on pages (DAP, CMS, cookies, USWDS, SEO, login, search, third-party services, tooling, required-links, feedback-links, mobile, url-scan)The primary scanner acts as parent - specific scans are children (sitemaps, USWDS checks, etc.).
Create a new file in libs/core-scanner/src/scans/ with your scan logic:
export async function myScan(page: Page | Response): Promise<MyScanResult> {
// Your scan logic here
// Evaluate the DOM to extract desired data
return {
// scan results
};
}
Parameters:
page: Puppeteer Page object for interactive scanningresponse: HTTP Response object for analyzing response dataReturn: Object with scan results that will be merged into final result
Use Puppeteer's page evaluation to extract data. See uswds.ts as a good example:
const result = await page.evaluate(() => {
// This runs in browser context
const elements = document.querySelectorAll('.my-selector');
return Array.from(elements).map(el => el.textContent);
});
Edit the primary scanner to call your new scan function and merge results:
const myScanResults = await myScan(page);
Object.assign(finalResult, myScanResults);
Add corresponding properties to entities/core-result.entity.ts with TypeORM decorators:
@Column({ type: 'boolean', nullable: true })
myNewField: boolean;
Add unit tests in the scan library's spec file.
scan-site CLI command for quick iterationlibs/core-scanner/src/scans/uswds.ts - DOM evaluation examplelibs/core-scanner/src/scans/dap.ts - Script detectionlibs/core-scanner/src/scans/cookies.ts - Response header analysisTest locally with a single site:
npx nest start cli -- scan-site --url yourtestsite.gov
Results will print to console with your new fields included.