.cursor/skills/add-static-dataset/SKILL.md
Add a new static dataset to app/scripts/StaticDatasets/geojson. Infers config from prompt, asks for missing data, uses types to guide required fields.
npx skillsauth add FixMyBerlin/tilda-geo add-static-datasetInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Adds a new static dataset folder to app/scripts/StaticDatasets/geojson. The /geojson folder is a symlink.
Extract from user prompt or ask if missing:
region-berlin, region-bb) - parent folder nameberlin-bezirke) - dataset folder name (must be valid slug). Must include region/group prefix: for region-berlin use berlin-<name>, not just <name>['infravelo'], ['berlin'])app/scripts/StaticDatasets/geojson/<GROUP_FOLDER>/<SUB_FOLDER>/
Important: /geojson is a symlink. Create folders in app/scripts/StaticDatasets/geojson/ path.
Create directory if group folder doesn't exist. Ensure sub-folder name follows naming convention (see Required Information above).
<SUB_FOLDER>/<FILENAME>.geojsonapp/ directory (prettier config is in app/): cd app && bunx prettier --write scripts/StaticDatasets/geojson/<GROUP_FOLDER>/<SUB_FOLDER>/<FILENAME>.geojsonOnly if transformation required. Use helpers from app/scripts/StaticDatasets/geojson/_utils:
transformUtils.ts - property transformationsdefaultLayerStyles.ts - default styling helperstranslateUtils.ts - translation helpersExample:
import { FeatureCollection } from "geojson";
export const transform = (data: FeatureCollection) => {
// Use helper functions from _utils when possible
return data;
};
Critical: Research similar datasets in same group folder first.
Before writing meta.ts:
<GROUP_FOLDER>/ directorymeta.ts files (similar geometry type, similar purpose)Required fields (from app/scripts/StaticDatasets/types.ts):
regions: RegionSlug[] (required)public: boolean (required)dataSourceType: 'local' (required)configs: Array with at least one config (required)Config required fields:
name: stringattributionHtml: stringinspector: { enabled: boolean, ... } or { enabled: false }layers: Layer[] (required)Config optional fields:
category: StaticDatasetCategoryKey | nullupdatedAt: stringdescription: stringdataSourceMarkdown: stringlicence: License type (see types.ts)licenceOsmCompatible: 'licence' | 'waiver' | 'no'legends: Legend[]Style/Legend: If not specified, make best guess:
defaultLayerStyles() from _utils/defaultLayerStyles.ts for simple casesExample structure:
import { MetaData } from "../../../types";
import { defaultLayerStyles } from "../../_utils/defaultLayerStyles";
export const data: MetaData = {
regions: ["infravelo"], // From user or infer from group folder
public: true,
dataSourceType: "local",
configs: [
{
name: "Dataset Name",
category: "berlin/misc", // Infer from similar datasets
attributionHtml: "Source Name", // Ask if unclear
licence: "DL-DE/ZERO-2.0", // Infer from similar datasets
inspector: { enabled: false }, // Default unless specified
layers: defaultLayerStyles(), // Or custom layers
},
],
};
Check app/scripts/StaticDatasets/updateStaticDatasets.ts for correct params:
--folder-filter=<SUB_FOLDER_NAME> (matches full path, so sub-folder name works)--env=dev (or staging/production; omit to be prompted)One-click command from app/ (replace <SUB_FOLDER_NAME> with actual folder name; static-datasets-update uses the repository root .env via bun --env-file=../.env, same as bun run dev):
bun run static-datasets-update -- --folder-filter=<SUB_FOLDER_NAME> --env=dev
Note: updateDownloadSources.ts is for WFS downloads (requires downloadConfig.ts). Use updateStaticDatasets.ts for local GeoJSON files.
Always run this after creating or modifying TypeScript files (meta.ts, transform.ts, or any imports):
bun run type-check-deploy
This temporarily removes the geojson symlink, runs TypeScript type-checking, and restores the symlink. It simulates the Docker build environment where symlinks aren't available, ensuring your code will compile correctly during builds.
Before completing:
bun run type-check-deploy run successfully (see Step 6)app/scripts/StaticDatasets/types.tsapp/scripts/StaticDatasets/geojson/region-berlin/*/meta.tsapp/scripts/StaticDatasets/geojson/_utils/docs/Features-Parameter-Deeplinks.md, docs/Regional-Masks.mdapp/scripts/StaticDatasets/updateStaticDatasets.tstools
Build type-safe global state in React with Zustand. Supports TypeScript, persist middleware, devtools, slices pattern, and Next.js SSR with hydration handling. Prevents 6 documented errors. Use when setting up React state, migrating from Redux/Context, or troubleshooting hydration errors, TypeScript inference, infinite render loops, or persist race conditions.
testing
Run local Docker processing in reference then fixed diffing mode to validate Lua/SQL topic changes via public.*_diff tables. From app/, use `processing-generate-command` to print a copy-paste shell line (interactive Clack on a TTY); agents/CI pass the full non-interactive flag set (see --help). Triggers on processing verification, bbox/topic-limited runs, or diff regression after editing processing/topics.
development
Migrate Next.js apps to TanStack Start. Covers setup (Vinxi/Vite), data handling with route loaders, converting Server Actions to Server Functions, API routes, and optional Server Component patterns. Use when migrating from Next.js to TanStack Start, setting up TanStack Start, or refactoring server actions, getServerSideProps, getStaticProps, or API routes.
development
React useEffect best practices from official docs and naming discipline. Use when writing/reviewing useEffect, naming effects, useState for derived values, data fetching, or state synchronization. Strong recommendation to name every effect; teaches when NOT to use Effect and better alternatives.