Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a CityJSON Metadata Extent Coordinate Validator
Format
Code-aware
Lines
93
Sections
11
Linked challenge
Build a CityJSON Metadata Extent Coordinate Validator
Prompt source
Original prompt text with formatting preserved for inspection.
93 lines
11 sections
No variables
1 code block
## Build
Parse CityJSON 2.0 metadata objects to verify geographical extent bounding coordinates. Calculate actual dataset bounds from decompressed vertices and flag metadata discrepancies.
## User
Municipal Tax Assessor
## Workflow
1. Ingest CityJSON 2.0 models and extract the root metadata geographicalExtent array.
2. Decompress integer coordinates from the vertices array using the transform object.
3. Calculate the true min/max spatial bounding box enclosing all decompressed vertices.
4. Generate a metadata discrepancy report comparing declared extents versus calculated bounding boxes.
## Interface
Browser validation portal showing calculated vs declared extents and bounding box error warnings.
## Data
Author synthetic CityJSON 2.0 documents with '+' prefix extension object types and custom attributes.
Starter examples below are synthetic. They are not downloaded records.
## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Applies CityJSON Section 5 Metadata object specifications to validate geographicalExtent arrays.
## Tools
mastra-ai, typescript, zod.
Mastra AI orchestrates schema loading, regex pattern verification, and diagnostic error explanation.
Instruction-tuned LLM capable of schema parsing and concise error reporting via API.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Calculates true bounds accurately from integer decompressed vertices.
- Identifies files where metadata extent deviates from actual geometry.
- Validation report returns status and calculated geographical boundary mismatch distances.
## Starter Examples
```json
[
{
"input": {
"type": "CityJSON",
"metadata": {
"geographicalExtent": [
0,
0,
0,
100,
100,
50
]
},
"calculated_bounds": [
0,
0,
0,
100,
100,
50
]
},
"expected_output": {
"extent_declared": true,
"mismatch": false,
"max_deviation": 0,
"mapping_valid": true
}
},
{
"input": {
"type": "CityJSON",
"metadata": {
"geographicalExtent": [
0,
0,
0,
50,
50,
20
]
},
"calculated_bounds": [
0,
0,
0,
100,
100,
50
]
},
"expected_output": {
"extent_declared": true,
"mismatch": true,
"max_deviation": 50,
"mapping_valid": false
}
}
]
```
## Safety
Validator checks syntax and schema metadata only; it does not alter statutory property tax records.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.