Skip to content

Commit 67944ba

Browse files
jrenaldi79claude
andauthored
Update eval README and add unit test README (#22)
Eval README: added Python fixture, updated setup config docs (claude_md_must_mention, auto_doc_pipeline, docs_index_generated, Husky hook support), added streaming guidance, fixed artifact list. Unit test README: new file documenting all 9 test files, conventions, and how to run. CLAUDE.md: added tests/scripts/README.md to Docs Map. https://claude.ai/code/session_01Hbxy31TkbujzukGFSxLcPw Co-authored-by: Claude <[email protected]>
1 parent aea7e74 commit 67944ba

3 files changed

Lines changed: 47 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ tests/
111111
├── init-project.test.js # Tests for skills/setup/scripts/init-project.js
112112
├── install-enforcement.test.js # Tests for skills/setup/scripts/install-enforcement.js
113113
├── marketplace-schema.test.js # Tests for .claude-plugin/marketplace.json schema validity.
114+
├── README.md
114115
├── release.test.js # Tests for scripts/release.sh — validates version bumping, changelog
115116
└── repo-generate-docs.test.js # Tests for scripts/repo-generate-docs.js — the repo-level CLAUDE.md
116117
<!-- /AUTO:tree -->
@@ -210,3 +211,4 @@ Before merging:
210211
| Enforcement script patterns | `skills/setup/references/enforcement-scripts.md` |
211212
| Node/TypeScript stack reference | `skills/setup/references/stack-node-typescript.md` |
212213
| Eval suite documentation | `tests/evals/README.md` |
214+
| Unit test documentation | `tests/scripts/README.md` |

tests/evals/README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ each skill against fixture repos and validates the output.
2727
./tests/evals/run-evals.sh --config setup-eval-config.json --dry-run
2828
```
2929

30+
**Run evals as Bash shell commands** so output streams live and you can monitor progress. Evals can take 5-15 minutes per fixture.
31+
3032
## How It Works
3133

3234
1. **Fixtures** (`fixtures/`) — Self-contained project directories representing test scenarios
@@ -46,10 +48,11 @@ The runner accepts `--config <file>` to select which eval suite to run. Each con
4648

4749
## Setup Fixtures
4850

49-
| Fixture | What It Tests |
50-
|---|---|
51-
| `setup-bare` | Empty directory — full greenfield Node/TS Express setup path (scaffolding, enforcement, hooks, docs). |
52-
| `setup-existing-node` | Existing Express project — enhancement path that adds enforcement without destroying existing files. |
51+
| Fixture | Stack | What It Tests |
52+
|---|---|---|
53+
| `setup-bare` | Node/TS Express (new) | Full greenfield setup via fast path (scripts). |
54+
| `setup-existing-node` | Node/TS Express (existing) | Enhancement without destroying existing files. |
55+
| `setup-python` | Python FastAPI (new) | Adaptive path (Claude creates files, not scripts). Checks for Node leakage. |
5356

5457
## Eval Configs
5558

@@ -65,12 +68,14 @@ The runner accepts `--config <file>` to select which eval suite to run. Each con
6568
- **files_must_exist** — Files the skill must create (hard fail if missing)
6669
- **files_should_exist** — Recommended files (soft check)
6770
- **json_valid** — Files that must parse as valid JSON
68-
- **hooks_executable** — Git hooks that must have execute permissions
71+
- **hooks_executable** — Git hooks (checks both `.git/hooks/` and `.husky/`)
6972
- **claude_md_sections** — Sections that must appear in generated CLAUDE.md
73+
- **claude_md_must_mention / claude_md_must_not_mention** — Content checks on generated CLAUDE.md
7074
- **settings_has_allow_deny** — Verify .claude/settings.json has allow/deny permission lists
7175
- **rules_have_globs_frontmatter** — Verify .claude/rules/*.md files have `globs:` in frontmatter
76+
- **auto_doc_pipeline** — Verify generate-docs scripts, pre-commit hook wiring, and AUTO markers
77+
- **docs_index_generated** — Verify docs/ directory and docs/index.md exist
7278
- **existing_files_preserved** — Files from the original fixture that must not be deleted
73-
- **conversation_must_mention** — Terms the skill output must include
7479

7580
## Adding a New Fixture
7681

@@ -83,11 +88,12 @@ The runner accepts `--config <file>` to select which eval suite to run. Each con
8388
Each run creates a timestamped directory under `results/` containing:
8489

8590
- `claude-output.json` — Raw Claude CLI JSON output
86-
- `conversation.txt` — Extracted conversation text
91+
- `conversation.txt` — Extracted conversation text (final message only)
8792
- `grade.json` — Grader output with pass/fail per check
8893
- `stderr.log` — Any stderr from the Claude run
8994
- `duration.txt` — How long the run took
9095
- `summary.json` — Aggregate pass/fail/error counts
9196

9297
For readiness evals: `readiness-report.md` (the generated report)
93-
For setup evals: `CLAUDE.md`, `package.json`, `.claude/settings.json`, `.claude/rules/` (captured artifacts)
98+
99+
For setup evals: Full project artifacts captured for debugging — `scripts/`, `docs/`, `src/`, `tests/`, `.claude/`, `.husky/`, `.git/hooks/`, `CLAUDE.md`, `package.json`, etc.

tests/scripts/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Unit Tests
2+
3+
Jest unit tests for the enforcement scripts, scaffolding tools, and documentation generators.
4+
5+
## Running
6+
7+
```bash
8+
npx jest --config '{}' tests/scripts/ # All tests
9+
npx jest --config '{}' tests/scripts/release.test.js # Single file
10+
```
11+
12+
## Test Files
13+
14+
| Test | What It Covers |
15+
|---|---|
16+
| `detect-source-dirs.test.js` | `detectSourceDirs` adaptive scanning and `buildModuleIndex` across multiple source dirs |
17+
| `generate-docs.test.js` | `replaceMarkers`, `validateCrossLinks`, `buildDocsIndex`, `checkMarkersAreCurrent` |
18+
| `generate-docs-helpers.test.js` | `buildDirectoryTree`, `extractJSDocDescription`, `extractExports` |
19+
| `generate-claude-md.test.js` | CLAUDE.md generation from templates with framework-specific commands |
20+
| `init-project.test.js` | Node/TS project scaffolding (directories, package.json, tsconfig) |
21+
| `install-enforcement.test.js` | Enforcement script copying, hook installation, config generation |
22+
| `marketplace-schema.test.js` | Plugin manifest validation (plugin.json, marketplace.json) |
23+
| `release.test.js` | Release script: version validation, changelog check, version bump, tagging |
24+
| `repo-generate-docs.test.js` | Repo-level CLAUDE.md auto-generation (tree + modules for this repo) |
25+
26+
## Conventions
27+
28+
- Each test gets a temp directory (`os.tmpdir`), cleaned up in `afterEach`
29+
- Scripts run as child processes via `execFileSync` to isolate side effects
30+
- Tests verify both file existence and file content
31+
- Git operations in tests disable GPG signing (`commit.gpgsign false`)

0 commit comments

Comments
 (0)