Work with repository-local dataset packages and their configured generated data
locations.
Path Discovery
- Resolve the temporary workspace with
git config --get dataset.tmp.
- Treat logs as belonging under
<dataset.tmp>/logs/; create that directory
before writing generation or validation logs.
- If
dataset.tmp is unset or empty, ask the user for a path. After they
provide one, persist it with git config --local dataset.tmp <path>.
- List configured dataset paths with
git config --get-regexp dataset.
- Treat
dataset.tmp as shared temporary/log configuration, not as a named
dataset package.
- Resolve a named dataset data path with
git config --get dataset.<dataset-name>.
- If
dataset.<dataset-name> is unset, ask the user for the dataset data path.
After they provide one, persist it with
git config --local dataset.<dataset-name> <path>.
- Do not guess missing data paths. Prefer absolute paths, or repository-relative
paths only when the user explicitly provides them.
Dataset Package Layout
- Keep each dataset source package at
project/dataset/<dataset-name>/.
- Make the dataset package a pnpm-managed NPM package.
- Name the package
dataset-<dataset-name> in package.json.
- Store generated dataset files in the path from
git config --get dataset.<dataset-name>, not by hard-coding output paths.
- Put generation scripts in
src/gen/.
- Put validation scripts in
src/validate/.
- Put shared helpers in
src/.
- Prefer TypeScript for generation, validation, and shared scripts.
- Allow dataset packages to depend on other repository workspace packages with
pnpm workspace dependencies when needed.
- If a dataset package uses
workspace:* dependencies, ensure the repository
pnpm workspace includes project/dataset/* or another pattern that covers
the package.
- Keep
README.md in the dataset package and describe how to generate,
validate, inspect, and refresh the dataset.
- Keep
package.json scripts as the main maintenance entry points; use
pnpm --dir project/dataset/<dataset-name> <script> from the repo root.
Maintenance Workflow
- Resolve
dataset.tmp and the target dataset.<dataset-name> paths before
editing or running dataset scripts.
- Inspect
project/dataset/<dataset-name>/README.md for dataset-specific
generation instructions.
- Inspect
project/dataset/<dataset-name>/package.json for available
maintenance scripts.
- Generate or update scripts under
src/gen/ so they write to the configured
dataset path.
- Generate or update validators under
src/validate/ so they verify the
configured dataset path.
- Write run logs under
<dataset.tmp>/logs/ with clear names such as
<dataset-name>-gen-<timestamp>.log or
<dataset-name>-validate-<timestamp>.log.
- Run the smallest package script that proves the change, then broader
validation when data format or generation logic changes.
- Summarize output paths, scripts run, log paths, and validation results in the
handoff.
Script Expectations
- Read
dataset.<dataset-name> with git config --get at runtime or pass it
through a package script environment variable that is computed from git
config.
- Fail fast when required config is missing, and print the exact
git config --local ... command the user should run.
- Keep generation scripts deterministic when inputs are unchanged.
- Keep validation scripts side-effect free except for logs or temporary files
under
dataset.tmp.
- Prefer package scripts such as
gen, validate, clean, and summary.
- Do not commit generated data unless the dataset package README or user
request says it is tracked.
Example
For dataset name revival:
git config --get dataset.tmp
git config --local dataset.tmp /tmp/meow-datasets
git config --get dataset.revival
git config --local dataset.revival /tmp/meow-datasets/revival
git config --get-regexp dataset
Package source layout:
project/dataset/revival/
├── README.md
├── package.json
└── src/
├── config.ts
├── gen/
│ └── build.ts
└── validate/
└── check.ts
Example package.json:
{
"name": "dataset-revival",
"private": true,
"type": "module",
"scripts": {
"gen": "tsx src/gen/build.ts",
"validate": "tsx src/validate/check.ts",
"refresh": "pnpm run gen && pnpm run validate"
},
"dependencies": {
"@meow-team/cli": "workspace:*"
},
"devDependencies": {
"tsx": "^4.20.0",
"typescript": "^5.9.0"
}
}
Example shared config helper:
import { execFileSync } from "node:child_process";
import { mkdirSync } from "node:fs";
import { join } from "node:path";
function gitConfig(key: string): string {
return execFileSync("git", ["config", "--get", key], {
encoding: "utf8",
}).trim();
}
export function datasetPath(name: string): string {
return gitConfig(`dataset.${name}`);
}
export function logPath(name: string, phase: "gen" | "validate"): string {
const logsDir = join(gitConfig("dataset.tmp"), "logs");
mkdirSync(logsDir, { recursive: true });
return join(logsDir, `${name}-${phase}-${Date.now()}.log`);
}
Example package README content:
# Revival Dataset
Generated files are written to `git config --get dataset.revival`.
Logs are written to `$(git config --get dataset.tmp)/logs/`.
Run `pnpm --dir project/dataset/revival gen` to generate data.
Run `pnpm --dir project/dataset/revival validate` to validate data.
Run `pnpm --dir project/dataset/revival refresh` to regenerate and validate.
1---2name: meow-dataset3description: Use when creating, updating, generating, validating, or reviewing Meow dataset packages and dataset output paths. Covers git config dataset path discovery, tmp log locations, pnpm package layout under project/dataset by dataset name, TypeScript generation and validation scripts, and dataset maintenance commands.4---56Work with repository-local dataset packages and their configured generated data7locations.89## Path Discovery1011- Resolve the temporary workspace with `git config --get dataset.tmp`.12- Treat logs as belonging under `<dataset.tmp>/logs/`; create that directory13 before writing generation or validation logs.14- If `dataset.tmp` is unset or empty, ask the user for a path. After they15 provide one, persist it with `git config --local dataset.tmp <path>`.16- List configured dataset paths with `git config --get-regexp dataset`.17- Treat `dataset.tmp` as shared temporary/log configuration, not as a named18 dataset package.19- Resolve a named dataset data path with20 `git config --get dataset.<dataset-name>`.21- If `dataset.<dataset-name>` is unset, ask the user for the dataset data path.22 After they provide one, persist it with23 `git config --local dataset.<dataset-name> <path>`.24- Do not guess missing data paths. Prefer absolute paths, or repository-relative25 paths only when the user explicitly provides them.2627## Dataset Package Layout2829- Keep each dataset source package at `project/dataset/<dataset-name>/`.30- Make the dataset package a pnpm-managed NPM package.31- Name the package `dataset-<dataset-name>` in `package.json`.32- Store generated dataset files in the path from33 `git config --get dataset.<dataset-name>`, not by hard-coding output paths.34- Put generation scripts in `src/gen/`.35- Put validation scripts in `src/validate/`.36- Put shared helpers in `src/`.37- Prefer TypeScript for generation, validation, and shared scripts.38- Allow dataset packages to depend on other repository workspace packages with39 pnpm workspace dependencies when needed.40- If a dataset package uses `workspace:*` dependencies, ensure the repository41 pnpm workspace includes `project/dataset/*` or another pattern that covers42 the package.43- Keep `README.md` in the dataset package and describe how to generate,44 validate, inspect, and refresh the dataset.45- Keep `package.json` scripts as the main maintenance entry points; use46 `pnpm --dir project/dataset/<dataset-name> <script>` from the repo root.4748## Maintenance Workflow49501. Resolve `dataset.tmp` and the target `dataset.<dataset-name>` paths before51 editing or running dataset scripts.522. Inspect `project/dataset/<dataset-name>/README.md` for dataset-specific53 generation instructions.543. Inspect `project/dataset/<dataset-name>/package.json` for available55 maintenance scripts.564. Generate or update scripts under `src/gen/` so they write to the configured57 dataset path.585. Generate or update validators under `src/validate/` so they verify the59 configured dataset path.606. Write run logs under `<dataset.tmp>/logs/` with clear names such as61 `<dataset-name>-gen-<timestamp>.log` or62 `<dataset-name>-validate-<timestamp>.log`.637. Run the smallest package script that proves the change, then broader64 validation when data format or generation logic changes.658. Summarize output paths, scripts run, log paths, and validation results in the66 handoff.6768## Script Expectations6970- Read `dataset.<dataset-name>` with `git config --get` at runtime or pass it71 through a package script environment variable that is computed from git72 config.73- Fail fast when required config is missing, and print the exact74 `git config --local ...` command the user should run.75- Keep generation scripts deterministic when inputs are unchanged.76- Keep validation scripts side-effect free except for logs or temporary files77 under `dataset.tmp`.78- Prefer package scripts such as `gen`, `validate`, `clean`, and `summary`.79- Do not commit generated data unless the dataset package README or user80 request says it is tracked.8182## Example8384For dataset name `revival`:8586```bash87git config --get dataset.tmp88git config --local dataset.tmp /tmp/meow-datasets8990git config --get dataset.revival91git config --local dataset.revival /tmp/meow-datasets/revival9293git config --get-regexp dataset94```9596Package source layout:9798```text99project/dataset/revival/100├── README.md101├── package.json102└── src/103 ├── config.ts104 ├── gen/105 │ └── build.ts106 └── validate/107 └── check.ts108```109110Example `package.json`:111112```json113{114 "name": "dataset-revival",115 "private": true,116 "type": "module",117 "scripts": {118 "gen": "tsx src/gen/build.ts",119 "validate": "tsx src/validate/check.ts",120 "refresh": "pnpm run gen && pnpm run validate"121 },122 "dependencies": {123 "@meow-team/cli": "workspace:*"124 },125 "devDependencies": {126 "tsx": "^4.20.0",127 "typescript": "^5.9.0"128 }129}130```131132Example shared config helper:133134```ts135import { execFileSync } from "node:child_process";136import { mkdirSync } from "node:fs";137import { join } from "node:path";138139function gitConfig(key: string): string {140 return execFileSync("git", ["config", "--get", key], {141 encoding: "utf8",142 }).trim();143}144145export function datasetPath(name: string): string {146 return gitConfig(`dataset.${name}`);147}148149export function logPath(name: string, phase: "gen" | "validate"): string {150 const logsDir = join(gitConfig("dataset.tmp"), "logs");151 mkdirSync(logsDir, { recursive: true });152 return join(logsDir, `${name}-${phase}-${Date.now()}.log`);153}154```155156Example package README content:157158```markdown159# Revival Dataset160161Generated files are written to `git config --get dataset.revival`.162Logs are written to `$(git config --get dataset.tmp)/logs/`.163164Run `pnpm --dir project/dataset/revival gen` to generate data.165Run `pnpm --dir project/dataset/revival validate` to validate data.166Run `pnpm --dir project/dataset/revival refresh` to regenerate and validate.167```