aiseo-audit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aiseo-audit contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # aiseo-audit
2
+
3
+ [![npm version](https://img.shields.io/npm/v/aiseo-audit.svg)](https://www.npmjs.com/package/aiseo-audit)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
6
+
7
+ Deterministic CLI that audits web pages for **AI search readiness**. Think Lighthouse, but for how well AI engines can fetch, extract, understand, and cite your content.
8
+
9
+ **AI SEO measures how reusable your content is for generative engines, not traditional search rankings.**
10
+
11
+ ## What is AI SEO?
12
+
13
+ Traditional SEO optimizes for ranking in a list of links. **AI SEO** optimizes for being **cited** in generated answers. Different goal, different signals.
14
+
15
+ When someone asks ChatGPT, Claude, Perplexity, or Gemini a question, those engines fetch web content, extract the useful parts, and decide what to cite. AI SEO (also called Generative Engine Optimization or GEO) is the practice of structuring your content so that process works in your favor. The foundational research behind this field comes from [Princeton's GEO paper](https://arxiv.org/abs/2311.09735), which identified the specific content traits that increase generative engine citations.
16
+
17
+ aiseo-audit measures those signals: can the content be extracted? Is it structured for reuse? Does it contain the patterns AI engines actually quote? It runs entirely locally with no AI API calls and no external services.
18
+
19
+ ## How aiseo-audit Is Different
20
+
21
+ Most "AI readiness" audits check whether certain files and tags exist. Does the site have llms.txt? Is there a sitemap? Is JSON-LD present? Those are binary checks that tell you very little about whether AI engines will actually use your content.
22
+
23
+ aiseo-audit goes deeper:
24
+
25
+ - **Content analysis, not just tag detection.** NLP-based entity extraction, readability scoring, answer capsule detection, section length analysis, and boilerplate measurement. 30+ factors across 7 research-backed categories.
26
+ - **Research-grounded scoring.** Thresholds and weights are derived from published research on what generative engines actually cite. See [Audit Breakdown](docs/AUDIT_BREAKDOWN.md) for the full methodology and [Research](docs/RESEARCH.md) for where the data comes from.
27
+ - **Configurable weights.** Prioritize the categories that matter to your content via `aiseo.config.json`. Zero vendor lock-in.
28
+ - **Four output formats.** Pretty terminal, JSON, Markdown, and self-contained HTML reports.
29
+ - **Zero external dependencies at runtime.** No API keys, no network calls beyond fetching the target URL. Fully deterministic.
30
+
31
+ ## Quick Start
32
+
33
+ Run a one-off audit without installing:
34
+
35
+ ```bash
36
+ npx aiseo-audit https://example.com
37
+ ```
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ # As a project dependency
43
+ npm install aiseo-audit
44
+
45
+ # As a dev dependency
46
+ npm install --save-dev aiseo-audit
47
+
48
+ # Globally
49
+ npm install -g aiseo-audit
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ```bash
55
+ # Pretty terminal output (default)
56
+ aiseo-audit https://example.com
57
+
58
+ # JSON output
59
+ aiseo-audit https://example.com --json
60
+
61
+ # Markdown output
62
+ aiseo-audit https://example.com --md
63
+
64
+ # HTML report (Lighthouse-style)
65
+ aiseo-audit https://example.com --html
66
+
67
+ # Write output to a file (uses the selected format)
68
+ aiseo-audit https://example.com --html --out report.html
69
+ aiseo-audit https://example.com --md --out report.md
70
+ aiseo-audit https://example.com --json --out report.json
71
+
72
+ # CI/CD: fail if score below threshold
73
+ aiseo-audit https://example.com --fail-under 70
74
+
75
+ # Custom timeout
76
+ aiseo-audit https://example.com --timeout 30000
77
+
78
+ # Custom user agent
79
+ aiseo-audit https://example.com --user-agent "MyBot/1.0"
80
+
81
+ # Use config file
82
+ aiseo-audit https://example.com --config aiseo.config.json
83
+ ```
84
+
85
+ ## CLI Options
86
+
87
+ | Option | Description | Default |
88
+ | ------------------- | ------------------------------------- | ---------------------- |
89
+ | `<url>` | URL to audit (required) | - |
90
+ | `--json` | Output as JSON | - |
91
+ | `--md` | Output as Markdown | - |
92
+ | `--html` | Output as HTML | - |
93
+ | `--out <path>` | Write rendered output to a file | - |
94
+ | `--fail-under <n>` | Exit with code 1 if score < threshold | - |
95
+ | `--timeout <ms>` | Request timeout in ms | `45000` |
96
+ | `--user-agent <ua>` | Custom User-Agent string | `AISEOAudit/<version>` |
97
+ | `--config <path>` | Path to config file | - |
98
+
99
+ If no output flag is given, the default is `pretty` (color-coded terminal output). The default format can also be set in the config file.
100
+
101
+ ## CI/CD
102
+
103
+ ```yaml
104
+ # .github/workflows/aiseo-audit.yml
105
+ name: AI SEO Audit
106
+ on:
107
+ pull_request:
108
+ push:
109
+ branches: [main]
110
+
111
+ jobs:
112
+ audit:
113
+ runs-on: ubuntu-latest
114
+ steps:
115
+ - run: npx aiseo-audit https://yoursite.com --fail-under 70
116
+ ```
117
+
118
+ ## User Agent
119
+
120
+ By default, all HTTP requests (page fetch, `robots.txt`, `llms.txt`) are sent with the header `User-Agent: AISEOAudit/<version>`. This is intentional. If a site blocks unknown bots, that is a meaningful negative signal for AI search readiness, and the audit should surface it as a failing "Fetch Success" score.
121
+
122
+ The `--user-agent` flag exists as an escape hatch for cases where you want to bypass bot detection and test the content independently of access policy. It does not change the audit logic, only what the server sees in the request header.
123
+
124
+ ## Audit Categories
125
+
126
+ The audit evaluates 7 categories of AI search readiness (_[Detailed Breakdown here](docs/AUDIT_BREAKDOWN.md)_):
127
+
128
+ | Category | What It Measures |
129
+ | ------------------------------- | ---------------------------------------------------------------------------------------- |
130
+ | **Content Extractability** | Can AI engines successfully fetch and extract meaningful text from the page? |
131
+ | **Content Structure for Reuse** | Is the content organized with headings, lists, and tables that engines can segment? |
132
+ | **Answerability** | Does the content provide clear definitions, direct answers, and step-by-step patterns? |
133
+ | **Entity Clarity** | Are named entities (people, orgs, places) clearly present and consistent with the topic? |
134
+ | **Grounding Signals** | Does the content cite external sources, include statistics, and attribute claims? |
135
+ | **Authority Context** | Is there author attribution, organization identity, publish dates, and structured data? |
136
+ | **Readability for Compression** | Is the content written at a readability level that compresses well for AI summarization? |
137
+
138
+ ## Output Formats
139
+
140
+ ### Pretty (default)
141
+
142
+ Color-coded terminal output with scores, factor breakdowns, and top recommendations. Best for quick checks during development.
143
+
144
+ ### JSON
145
+
146
+ Full structured output with all scores, factor details, raw data, and recommendations. Best for integrations, CI/CD pipelines, and programmatic consumption.
147
+
148
+ ### Markdown
149
+
150
+ Structured report with category tables, factor details, and recommendations grouped by category. Best for documentation, PRs, and sharing.
151
+
152
+ ### HTML
153
+
154
+ Self-contained single-file report with SVG score gauges, color-coded sections, and recommendations grouped by category. Best for stakeholder reports and visual review.
155
+
156
+ ## Config File
157
+
158
+ Create a config file in your project root to customize behavior. The CLI automatically discovers your config by searching from the current directory up to the filesystem root, looking for (in order):
159
+
160
+ - `aiseo.config.json`
161
+ - `.aiseo.config.json`
162
+ - `aiseo-audit.config.json`
163
+
164
+ You can also pass an explicit path with `--config path/to/config.json`.
165
+
166
+ ```json
167
+ {
168
+ "timeout": 45000,
169
+ "format": "pretty",
170
+ "failUnder": 50,
171
+ "weights": {
172
+ "contentExtractability": 1,
173
+ "contentStructure": 1,
174
+ "answerability": 1,
175
+ "entityClarity": 1,
176
+ "groundingSignals": 1,
177
+ "authorityContext": 1,
178
+ "readabilityForCompression": 1
179
+ }
180
+ }
181
+ ```
182
+
183
+ Weights are relative. Set a category to `2` to double its importance, or `0` to exclude it.
184
+
185
+ ## Programmatic API
186
+
187
+ ```typescript
188
+ import { analyzeUrl, loadConfig, renderReport } from "aiseo-audit";
189
+
190
+ const config = await loadConfig();
191
+ const result = await analyzeUrl(
192
+ { url: "https://example.com", timeout: 45000, userAgent: "MyApp/1.0" },
193
+ config,
194
+ );
195
+
196
+ console.log(result.overallScore); // 72
197
+ console.log(result.grade); // "B-"
198
+
199
+ // Render in any format
200
+ const html = renderReport(result, { format: "html" });
201
+ const md = renderReport(result, { format: "md" });
202
+ const json = renderReport(result, { format: "json" });
203
+ ```
204
+
205
+ ### Exported Types
206
+
207
+ ```typescript
208
+ import type {
209
+ AnalyzerResultType,
210
+ AnalyzerOptionsType,
211
+ AuditResultType,
212
+ CategoryNameType,
213
+ CategoryResultType,
214
+ FactorResultType,
215
+ RecommendationType,
216
+ ReportFormatType,
217
+ AiseoConfigType,
218
+ } from "aiseo-audit";
219
+ ```
220
+
221
+ ## Philosophy
222
+
223
+ This tool measures **AI search reusability**: how well a page's content can be fetched, extracted, understood, and reused by AI engines like ChatGPT, Claude, Perplexity, and Gemini.
224
+
225
+ It is:
226
+
227
+ - **Deterministic**: No AI API calls. Same URL produces the same score.
228
+ - **Engine-agnostic**: Not optimized for any specific AI platform.
229
+ - **Content-focused**: Analyzes what's on the page, not external signals.
230
+ - **Lightweight**: Fast CLI with minimal dependencies.
231
+
232
+ ## Exit Codes
233
+
234
+ | Code | Meaning |
235
+ | ---- | ----------------------------------------------- |
236
+ | `0` | Success |
237
+ | `1` | Score below `--fail-under` threshold |
238
+ | `2` | Runtime error (fetch failed, invalid URL, etc.) |
239
+
240
+ ## Compatibility Notes
241
+
242
+ **Node.js** -- Requires Node 20 or later. The `engines` field in `package.json` enforces this. Earlier versions will produce runtime errors.
243
+
244
+ **Zod** -- Uses [Zod 4](https://zod.dev). If you consume the library API and also use Zod in your project, ensure you are on Zod 4+ to avoid type incompatibilities.
245
+
246
+ **CJS bin entry** -- The `bin/aiseo-audit.js` executable uses `require()` (CommonJS). This is compatible with all Node 20+ environments regardless of your project's module system. The library exports support both ESM (`import`) and CJS (`require`).
247
+
248
+ **Config discovery** -- When using the programmatic API, `loadConfig()` searches for config files starting from `process.cwd()`. If your application's working directory differs from where your config file lives, pass an explicit path:
249
+
250
+ ```typescript
251
+ const config = await loadConfig("/path/to/aiseo.config.json");
252
+ ```
253
+
254
+ ## Documentation
255
+
256
+ - [Audit Breakdown](docs/AUDIT_BREAKDOWN.md) - Full scoring methodology, every factor, every threshold, with research citations
257
+ - [Research](docs/RESEARCH.md) - Sources and gap analysis
258
+
259
+ ## Contributing
260
+
261
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, project structure, and pull request guidelines.
262
+
263
+ ## Releases
264
+
265
+ Release notes are published on the [GitHub Releases](https://github.com/agencyenterprise/aiseo-audit/releases) page. A separate `CHANGELOG.md` is not maintained.
266
+
267
+ ## License
268
+
269
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require("../dist/cli.js");
package/dist/cli.d.mts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }