You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc5c52e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CLAUDE.md
+5-11Lines changed: 5 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,37 +27,33 @@ Render a report to self-contained HTML:
27
27
scripts/run-qa-report.sh reports/data/qa-report-functional.json # type from filename
28
28
scripts/run-qa-report.sh reports/data/qa-report-aeo.json --aeo # aeo comes from the flag or mode: "aeo"
29
29
node scripts/generate-report.js reports/data/qa-report-aeo.json # renderer only: validates, skips the stamp and the archive
30
-
scripts/merge-qa-reports.sh # or /kosh:merge
31
30
node --test "tests/*.test.js"# script, snippet, JSON-file, schema-drift and validation tests
32
31
```
33
32
34
33
`.github/workflows/ci.yml` runs `npm ci` and that same `node --test` line on every PR and on pushes to `trunk` — no API calls. The promptfoo evals stay manual because they cost money.
35
34
36
-
`generate-report.js` validates the report against its schema (`scripts/validate-report.js`, ajv) before rendering, so the check runs on every render path: `run-qa-report.sh`, the merge, and a direct call. A report that doesn't match is refused — nothing is rendered or archived, and ajv's errors name each field, so the skill that wrote the JSON can fix it and re-run. `run-qa-report.sh` stamps provenance first, so a refused report comes back stamped with its own fields untouched. The types checked are the flagged ones plus any the content shows — `mode: "aeo"` or a `shop` block — so leaving a flag out or passing the wrong one doesn't skip the check. Only a schema file that declares `$schema` is validated — shop and aeo today; functional, performance and accessibility, and so the merged report, are still example documents and pass through with a note. Schemas must compile in ajv strict mode. `node scripts/generate-report.js <json> --skip-validation` renders without the check, which is how to re-render an archived report in an older shape; it's a renderer flag, not a `run-qa-report.sh` one, since the wrapper would also re-stamp and re-archive.
35
+
`generate-report.js` validates the report against its schema (`scripts/validate-report.js`, ajv) before rendering, so the check runs on every render path: `run-qa-report.sh` and a direct call. A report that doesn't match is refused — nothing is rendered or archived, and ajv's errors name each field, so the skill that wrote the JSON can fix it and re-run. `run-qa-report.sh` stamps provenance first, so a refused report comes back stamped with its own fields untouched. The types checked are the flagged ones plus any the content shows — `mode: "aeo"` or a `shop` block — so leaving a flag out or passing the wrong one doesn't skip the check. Only a schema file that declares `$schema` is validated — shop and aeo today; functional, performance and accessibility are still example documents and pass through with a note. Schemas must compile in ajv strict mode. `node scripts/generate-report.js <json> --skip-validation` renders without the check, which is how to re-render an archived report in an older shape; it's a renderer flag, not a `run-qa-report.sh` one, since the wrapper would also re-stamp and re-archive.
37
36
38
-
`run-qa-report.sh` stamps a `provenance` block into the source JSON before rendering: the skill writes `provenance.model` (self-reported), and `scripts/stamp-provenance.js` adds `pluginVersion`, a SHA-256 of each skill directory (references included), and a `seal` over those plus the report's `timestamp`. A valid seal means the block is never restamped, so re-rendering an archived run keeps the provenance of the run that produced it; a model-invented or copied-forward block fails the seal and is restamped. The seal is an unkeyed hash, so it guards against accidents, not deliberate tampering — anything with a shell can recompute it. A report with no `provenance` block at all is left untouched with a warning — it predates the feature, or the skill skipped `provenance.model`. The renderer prints the block as one footer line, and nothing for reports that predate it. The merged report carries no provenance — its JSON is a temp file that is deleted after rendering.
37
+
`run-qa-report.sh` stamps a `provenance` block into the source JSON before rendering: the skill writes `provenance.model` (self-reported), and `scripts/stamp-provenance.js` adds `pluginVersion`, a SHA-256 of each skill directory (references included), and a `seal` over those plus the report's `timestamp`. A valid seal means the block is never restamped, so re-rendering an archived run keeps the provenance of the run that produced it; a model-invented or copied-forward block fails the seal and is restamped. The seal is an unkeyed hash, so it guards against accidents, not deliberate tampering — anything with a shell can recompute it. A report with no `provenance` block at all is left untouched with a warning — it predates the feature, or the skill skipped `provenance.model`. The renderer prints the block as one footer line, and nothing for reports that predate it.
39
38
40
39
`run-qa-report.sh` also copies the source JSON to `reports/data/archive/` under the same basename as the HTML it generated, since `reports/data/qa-report-<type>.json` is overwritten by every run. A same-day rerun with different content moves the previous run's copy aside with its timestamp appended, so the un-suffixed JSON is always the source of the current HTML.
41
40
42
41
The renderer inlines each finding's screenshots as base64, because every run shares `reports/screenshots/` and a later run can overwrite a file an older report points at. Only image files inside `reports/` are read, and an inlined image expands in place through a CSS-only `<details>` toggle because a `data:` URI can't be a link target. A missing file keeps its external `src` with a warning; a remote, absolute, scheme-carrying or `../` path is dropped with a warning, so only paths inside `reports/` ever reach the HTML. The generator prints the inlined count and the HTML's size. The archived JSON still holds the shared-folder paths, so re-rendering an old run embeds whatever is at those paths now.
43
42
44
-
`reports/` lives next to `scripts/`, and every script resolves it from its own location, never from the cwd; `tests/reports-dir.test.js` runs the shell scripts from a foreign cwd to keep it that way. Skills and `commands/merge.md` are the exception: they write `reports/…` and call `scripts/*.sh` cwd-relative, which is why the documented launch is `cd kosh && claude --plugin-dir .`. `KOSH_REPORTS_DIR` redirects the scripts only — the tests use it to stay out of the real directory — and does not move where the skills write, so setting it for a real run leaves the renderer looking for screenshots the skill saved somewhere else. The SessionStart hook pre-creates the folders as a nicety; nothing depends on it.
45
-
46
-
Merging requires all three of functional, performance, and accessibility; shop and AEO reports are standalone. Prefer `/kosh:merge` over calling the script — it reports which JSON files are missing up front, where the script exits on the first one it can't find.
43
+
`reports/` lives next to `scripts/`, and every script resolves it from its own location, never from the cwd; `tests/reports-dir.test.js` runs `run-qa-report.sh` from a foreign cwd to keep it that way. Skills are the exception: they write `reports/…` and call `scripts/*.sh` cwd-relative, which is why the documented launch is `cd kosh && claude --plugin-dir .`. `KOSH_REPORTS_DIR` redirects the scripts only — the tests use it to stay out of the real directory — and does not move where the skills write, so setting it for a real run leaves the renderer looking for screenshots the skill saved somewhere else. The SessionStart hook pre-creates the folders as a nicety; nothing depends on it.
47
44
48
45
With no flag, `run-qa-report.sh` takes the test type from the filename, and for AEO from `mode: "aeo"` in the JSON, so validation, the stamp and the renderer all get `--aeo` even when the skill forgets to pass it. A report with neither is rendered with a "not validated" note. An AEO-shaped report missing `mode` is a hard error in the renderer, not a fallback.
49
46
50
47
## How it works
51
48
52
49
Each test is a **skill** (`skills/`), invoked directly as `/kosh:<name>`. The skill parses the URL and environment type from user input, then carries the full testing procedure — what to check, how to check it, and how to report findings. Results follow the structure defined in a **schema** (`schemas/`) and are saved as JSON reports, which are then rendered to self-contained HTML reports via scripts in `scripts/`.
53
50
54
-
Skills and commands share one `/kosh:` namespace, so a command named after a skill makes that entry appear twice in the slash menu. Tests are skills only; `commands/` holds `merge.md` alone.
51
+
Skills and commands share one `/kosh:` namespace, so a command named after a skill makes that entry appear twice in the slash menu.
55
52
56
53
```
57
-
commands/ → merge only — a skill of the same name would double the menu entry
58
54
skills/ → detailed testing procedures (the actual prompts)
59
55
schemas/ → JSON schemas that define report structure
60
-
scripts/ → report generationand merge scripts
56
+
scripts/ → report generation, validation and provenance scripts
61
57
hooks/ → session hooks (e.g., create reports/data/ on startup)
62
58
evals/ → promptfoo regression checks for skill decision rules (evals/README.md)
63
59
tests/ → `node --test` checks for the scripts, skill-embedded snippets, tracked JSON files, skill ↔ schema drift and report validation
@@ -82,8 +78,6 @@ Each test type has a matching set of files:
82
78
83
79
If you add a new test type, you need both: a skill and a schema. Do not add a matching command — the name would collide.
84
80
85
-
`commands/merge.md` is the exception — it has no skill or schema, and runs `scripts/merge-qa-reports.sh` after a pre-flight check for the three input reports.
Copy file name to clipboardExpand all lines: README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Kosh tests a site across five dimensions:
14
14
-**Shop (WooCommerce):** The guest purchase path — catalog, product pages, add to cart, cart quantity and removal operations, cart math, and the checkout form. Stops at the payment step and never places an order.
15
15
-**AEO (Answer Engine Optimization):** How AI tools like ChatGPT, Perplexity, Claude, and Google AI Overviews discover, parse, understand, and cite the site. 49 signals across 8 criteria, status-based evaluation (pass / partial / fail / N/A), site-type-aware and content-driven.
16
16
17
-
Each test visits 4–6+ pages, simulates real user behavior, and outputs a structured JSON report. A render script converts the JSON into a self-contained HTML report with color-coded severity, collapsible sections, and inline screenshots. The functional, performance, and accessibility test types can also be merged into one comprehensive report; shop and AEO reports are standalone.
17
+
Each test visits 4–6+ pages, simulates real user behavior, and outputs a structured JSON report. A render script converts the JSON into a self-contained HTML report with color-coded severity, collapsible sections, and inline screenshots.
18
18
19
19
## Quick start
20
20
@@ -44,10 +44,9 @@ For detailed setup instructions (including troubleshooting), see the [Getting St
44
44
## Project structure
45
45
46
46
```text
47
-
commands/ Slash command for /kosh:merge
48
47
skills/ Full testing procedures, invoked as /kosh:a11y, /kosh:aeo, /kosh:functional-design, /kosh:performance, /kosh:shop
49
48
schemas/ JSON schemas for report validation
50
-
scripts/ Report generationand merge scripts
49
+
scripts/ Report generation, validation and provenance scripts
51
50
hooks/ Session hook that creates reports/data/ on startup
52
51
evals/ Promptfoo regression checks for skill decision rules
53
52
tests/ node --test checks for the scripts, skill snippets, JSON files and skill ↔ schema drift — run by .github/workflows/ci.yml on every PR
Copy file name to clipboardExpand all lines: docs/getting-started.md
-10Lines changed: 0 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,16 +140,6 @@ Can you visit https://example.com/blog and check whether the post images all hav
140
140
I want to know if the navigation is keyboard accessible on mobile — can you check that?
141
141
```
142
142
143
-
## Combining reports
144
-
145
-
After running the functional, performance, and accessibility tests against the same site, you can merge them into one comprehensive report:
146
-
147
-
```
148
-
/kosh:merge
149
-
```
150
-
151
-
This creates a single HTML document covering functional, performance, and accessibility findings. The shop and AEO tests aren't part of the merge — they render as standalone reports.
152
-
153
143
## Specifying the environment
154
144
155
145
If you're testing a local or development site (not the live production site), you can tell kosh so it doesn't flag expected dev-environment things as bugs:
0 commit comments