$npx -y skills add AlpacaLabsLLC/skills-for-architects --skill nyc-hpdLook up HPD violations, complaints, and building registration for NYC residential buildings. Use when the user asks about housing-code violations, tenant complaints, or HPD registration at an address. NYC only; for DOB and ECB violations use /nyc-dob-violations.
| 1 | # /nyc-hpd — HPD Violations, Complaints & Registration |
| 2 | |
| 3 | Look up HPD (Housing Preservation & Development) violations, complaints, and building registration for NYC residential buildings. Only applies to residential building classes. No API key required. |
| 4 | |
| 5 | ## Usage |
| 6 | |
| 7 | ``` |
| 8 | /nyc-hpd 1055 Bergen Street, Brooklyn |
| 9 | /nyc-hpd 3012120065 (BBL) |
| 10 | /nyc-hpd 3030348 (BIN) |
| 11 | ``` |
| 12 | |
| 13 | ## Steps 1–2: Parse Input & Resolve BBL |
| 14 | |
| 15 | Read `../nyc-property-report/pluto-resolution.md` (shared by all 7 NYC due-diligence skills) and follow it: parse the input (address, BBL, or BIN — e.g. "1055 Bergen Street, Brooklyn") and resolve via PLUTO. HPD queries key on boro/block/lot, so BIN resolution is only needed when the user's input was a BIN. |
| 16 | |
| 17 | ### Check Building Class |
| 18 | |
| 19 | **Before querying HPD**, check `bldgclass` from PLUTO. HPD only applies to residential buildings — classes starting with A, B, C, D, R, or S. |
| 20 | |
| 21 | If the building class does NOT start with one of those letters, print: |
| 22 | > "Building class {X} — HPD records not applicable (non-residential)." |
| 23 | |
| 24 | And stop. Do not query HPD APIs. |
| 25 | |
| 26 | ## Step 3: Query HPD Datasets |
| 27 | |
| 28 | Dataset IDs and field names are canonical in `../nyc-property-report/socrata-reference.md` — on any disagreement, the reference wins. |
| 29 | |
| 30 | **IMPORTANT:** HPD violations/registrations use `boroid` (not `borough`). And `block`/`lot` are separate fields — not a combined BBL. |
| 31 | |
| 32 | ### HPD Violations |
| 33 | ``` |
| 34 | https://data.cityofnewyork.us/resource/wvxf-dwi5.json?$where=boroid='{boro}' AND block='{block}' AND lot='{lot}'&$order=inspectiondate DESC&$limit=50 |
| 35 | ``` |
| 36 | Key fields: `violationid`, `class` (violation class — NOT `violationclass`), `inspectiondate`, `approveddate`, `originalcertifybydate`, `novdescription`, `currentstatus` |
| 37 | |
| 38 | ### Open HPD Violations |
| 39 | ``` |
| 40 | https://data.cityofnewyork.us/resource/csn4-vhvf.json?$where=boroid='{boro}' AND block='{block}' AND lot='{lot}' |
| 41 | ``` |
| 42 | Pre-filtered to currently open violations. |
| 43 | |
| 44 | ### Complaints |
| 45 | |
| 46 | **Note:** The complaints dataset uses `borough` (text like "MANHATTAN", "BRONX", "BROOKLYN", "QUEENS", "STATEN ISLAND") — NOT `boroid`. Map boro codes: 1→MANHATTAN, 2→BRONX, 3→BROOKLYN, 4→QUEENS, 5→STATEN ISLAND. |
| 47 | |
| 48 | ``` |
| 49 | https://data.cityofnewyork.us/resource/ygpa-z7cr.json?$where=borough='{BOROUGH_NAME}' AND block='{block}' AND lot='{lot}'&$order=received_date DESC&$limit=30 |
| 50 | ``` |
| 51 | Key fields: `complaint_id`, `received_date`, `complaint_status`, `complaint_status_date`, `major_category`, `minor_category`, `problem_status` |
| 52 | |
| 53 | ### Registrations |
| 54 | ``` |
| 55 | https://data.cityofnewyork.us/resource/tesw-yqqr.json?$where=boroid='{boro}' AND block='{block}' AND lot='{lot}' |
| 56 | ``` |
| 57 | Key fields: `registrationid`, `buildingid`, `bin`, `registrationenddate`, `lastregistrationdate` |
| 58 | |
| 59 | **Note:** The registrations dataset has NO owner-name fields. Get owner/agent names from Registration Contacts (`feu5-w2e2`), keyed by `registrationid`: |
| 60 | ``` |
| 61 | https://data.cityofnewyork.us/resource/feu5-w2e2.json?$where=registrationid='{registrationid}' |
| 62 | ``` |
| 63 | Key fields: `type` (CorporateOwner / Agent / HeadOfficer / IndividualOwner), `firstname`, `lastname`, `corporationname` |
| 64 | |
| 65 | ## Step 4: Print Results |
| 66 | |
| 67 | ```markdown |
| 68 | ## HPD — {Address} |
| 69 | |
| 70 | ### Registration |
| 71 | | Field | Value | |
| 72 | |-------|-------| |
| 73 | | Registration ID | ... | |
| 74 | | Owner | {corporationname or firstname lastname, from registration contacts} | |
| 75 | | Registration Expiry | YYYY-MM-DD | |
| 76 | |
| 77 | ### ⚠ Open Violations: {count} |
| 78 | **Class C (Immediately Hazardous):** {count} ⚠ |
| 79 | **Class B (Hazardous):** {count} |
| 80 | **Class A (Non-Hazardous):** {count} |
| 81 | |
| 82 | | Violation ID | Class | Inspection Date | Description | Certify By | |
| 83 | |-------------|-------|-----------------|-------------|------------| |
| 84 | | ... | C ⚠ | YYYY-MM-DD | ... | YYYY-MM-DD | |
| 85 | |
| 86 | ### All Violations ({count} total, showing 50 most recent) |
| 87 | | Violation ID | Class | Inspection Date | Approved Date | Description | |
| 88 | |-------------|-------|-----------------|---------------|-------------| |
| 89 | |
| 90 | ### Recent Complaints ({count} total, showing 30 most recent) |
| 91 | | Complaint ID | Received | Category | Status | Status Date | |
| 92 | |-------------|----------|--------|-------------| |
| 93 | |
| 94 | Source: [HPD Violations](https://data.cityofnewyork.us/Housing-Development/Housing-Maintenance-Code-Violations/wvxf-dwi5) | [HPD Complaints](https://data.cityofnewyork.us/Housing-Development/Housing-Maintenance-Code-Complaints-and-Problems/ygpa-z7cr) |
| 95 | ``` |
| 96 | |
| 97 | If no results: "No HPD violations, complaints, or registrations found for this property." |
| 98 | |
| 99 | ### Conventions |
| 100 | - All dates: YYYY-MM-DD |
| 101 | - Class C violations always flagged with ⚠ (immediately hazardous — must be corrected within 24 hours) |
| 102 | - Open/active items listed first |
| 103 | - If Socrata returns empty array: "No results found" |
| 104 | - If HTTP error: note it and |