Skip to main content
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 Bridge Constructive Element Hierarchy Auditor

Format
Code-aware
Lines
97
Sections
11
Linked challenge
Build a CityJSON Bridge Constructive Element Hierarchy Auditor

Prompt source

Original prompt text with formatting preserved for inspection.

97 lines
11 sections
No variables
1 code block
## Build
Parse CityJSON 2.0 Bridge objects and child elements to verify structural parentage and municipal address records. Flag disconnected bridge constructive components prior to asset database ingestion.

## User
Municipal Infrastructure Engineer

## Workflow
1. Parse CityJSON 2.0 city models containing Bridge, BridgePart, and BridgeConstructiveElement objects.
2. Traverse children and parents arrays to identify broken topological relationships or orphaned bridge elements.
3. Check address objects for required municipal jurisdiction attributes and multi-surface geometry validity.
4. Produce a structured bridge asset compliance scorecard highlighting missing parents or invalid addresses.

## Interface
A municipal GIS inspection dashboard showing bridge object hierarchies, attribute tables, and topology error maps.

## Data
Generate local synthetic CityJSON 2.0 bridge files following Section 2.2 specifications without requiring proprietary municipal data.
Starter examples below are synthetic. They are not downloaded records.

## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Extracts Bridge, BridgePart, and BridgeConstructiveElement hierarchy rules and address structures from Section 2.2 of CityJSON 2.0.

## Tools
mastra-ai, python, fastapi.
Coordinates multi-step validation workflows across complex nested 3D geometric object hierarchies.
Instruction-tuned hosted model capable of parsing nested structural hierarchies and returning clean JSON.

## 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
- Verifies that BridgeConstructiveElement instances always declare an explicit parent.
- Detects missing address entries on primary Bridge parent objects.
- Outputs structured validation summaries matching the CityJSON 2.0 Bridge schema.

## Starter Examples
```json
[
  {
    "input": {
      "cityjson_id": "BRIDGE-METRO-01",
      "city_objects": {
        "Bridge-Main": {
          "type": "Bridge",
          "address": [
            {
              "city": "Springfield",
              "country": "US"
            }
          ],
          "children": [
            "Element-Deck-01"
          ]
        },
        "Element-Deck-01": {
          "type": "BridgeConstructiveElement",
          "parents": [
            "Bridge-Main"
          ]
        }
      }
    },
    "expected_output": {
      "cityjson_id": "BRIDGE-METRO-01",
      "is_valid": true,
      "hierarchy_errors": [],
      "elements_checked": 2
    }
  },
  {
    "input": {
      "cityjson_id": "BRIDGE-METRO-02",
      "city_objects": {
        "Bridge-West": {
          "type": "Bridge",
          "address": [],
          "children": []
        },
        "Element-Pier-05": {
          "type": "BridgeConstructiveElement",
          "parents": []
        }
      }
    },
    "expected_output": {
      "cityjson_id": "BRIDGE-METRO-02",
      "is_valid": false,
      "hierarchy_errors": [
        {
          "object_id": "Bridge-West",
          "error": "Missing required bridge address metadata"
        },
        {
          "object_id": "Element-Pier-05",
          "error": "BridgeConstructiveElement lacks mandatory parent identifier"
        }
      ],
      "elements_checked": 2
    }
  }
]
```

## Safety
Maintains read-only operations on city spatial models without triggering municipal GIS state changes.
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.