원클릭으로
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.