--- name: hd-prism-tenant-api description: Use Alex's shared HD Prism API to calculate Human Design bodygraphs for Astral Hermes tenants. Required whenever a tenant/user asks for a Human Design chart/bodygraph from birth data. version: 0.2.0 author: Hermes Agent + Alex license: MIT metadata: hermes: tags: [human-design, bodygraph, hd-prism, astral-hermes, chart-calculation] related_skills: [astral-chart-api] --- # HD Prism Tenant API Use this skill whenever a user asks for any of these: - Human Design chart - bodygraph - HD type / strategy / authority / profile / definition - gates / channels / centers - variables, determination, environment, motivation, view - "calculate my Human Design" ## Hard rule Do **not** calculate Human Design inside the tenant with local Python/JS modules, Swiss Ephemeris, timezonefinder, pytz, or hand-derived gates. Astral Hermes tenants should call Alex's shared HD Prism service: ```text https://hdprism.apps.poofc.com/api/tenant/bodygraph ``` This mirrors the Astral chart-service pattern: the app/service owns calculation; the tenant owns conversation and interpretation. ## Endpoint ```text GET https://hdprism.apps.poofc.com/api/tenant/health POST https://hdprism.apps.poofc.com/api/tenant/bodygraph POST https://hdprism.apps.poofc.com/api/tenant/bodygraph.svg ``` Request JSON: ```json { "name": "Example Person", "birthDate": "1985-09-26", "birthTime": "07:14", "location": "London, England" } ``` Optional alternatives: ```json { "timeZone": "Europe/London" } { "utc": "1985-09-26T06:14:00Z" } ``` - If `timeZone` is supplied, it is used directly as an IANA zone. - If only `location` is supplied, HD Prism resolves local civil time to UTC through the Transit List Demo time resolver. - If `utc` / `utcIso` / `birthDateTimeUTC` is supplied, it is used directly. ## Curl example ```bash curl -sS -X POST 'https://hdprism.apps.poofc.com/api/tenant/bodygraph' \ -H 'Content-Type: application/json' \ -d '{"name":"Example Person","birthDate":"1985-09-26","birthTime":"07:14","location":"London, England"}' ``` Response shape: ```json { "ok": true, "service": "hd-prism-tenant-api", "resolved": { "timezone": "Europe/London", "utcIso": "1985-09-26T06:14:00.000Z", "source": "transit-list-demo.api.time.resolve" }, "summary": { "type": "Projector", "authority": "Emotional", "profile": "6/2", "definition": "Split Definition", "environment": { "label": "Blending Caves" }, "channels": ["10-57"], "gates": ["46"] }, "bodygraph": { "...full HD Prism bodygraph...": true } } ``` ## SVG chart route Use this when a tenant needs a displayable bodygraph image/SVG in addition to JSON chart data. ```text POST https://hdprism.apps.poofc.com/api/tenant/bodygraph.svg ``` Request JSON uses the same birth-data fields as `/bodygraph`, plus optional render options: ```json { "name": "Example Person", "birthDate": "1985-09-26", "birthTime": "07:14", "location": "London, England", "theme": "light", "width": 900 } ``` Response: - `Content-Type: image/svg+xml; charset=utf-8` - Standalone `` bodygraph with HD Prism metadata (`data-service="hd-prism-tenant-api"`, chart type, active gates/channels/centers). - Supports `theme: "light" | "dark"`, `width` clamped server-side, and `includeMetadata: false` if metadata should be omitted. Safe terminal pattern — save the SVG to a file; do **not** pipe remote `curl` output into Python/Node/shell interpreters: ```bash curl -fsS -o bodygraph.svg \ -H 'Content-Type: application/json' \ --data-binary @payload.json \ 'https://hdprism.apps.poofc.com/api/tenant/bodygraph.svg' ``` To “pull a chart” for both interpretation and display: 1. Call `/api/tenant/bodygraph` for JSON calculation and summary. 2. Call `/api/tenant/bodygraph.svg` with the same birth data when the app/UI needs a bodygraph visual. 3. Treat SVG as presentation only; use JSON `summary`/`bodygraph` for interpretation. ## Sending a bodygraph image (Telegram & Astral web chat) When a Human Design / bodygraph image would help, send an actual image — not just text. Telegram and the Astral web chat both deliver images via the `MEDIA:` convention. SVG is not delivered inline, so rasterize it to PNG first using the SVG→PNG converter shipped in the `astral-chart-api` skill (it bundles `@resvg/resvg-js` and the astro font, so it works inside tenant containers): ```bash # 1. fetch the bodygraph SVG to a file (never pipe remote curl into an interpreter) curl -fsS -o /tmp/bodygraph.svg \ -H 'Content-Type: application/json' \ --data-binary @payload.json \ 'https://hdprism.apps.poofc.com/api/tenant/bodygraph.svg' # 2. rasterize to PNG (resolve the skill path under your skills dir / $HERMES_HOME) node "$HERMES_HOME/skills/astrology/astral-chart-api/scripts/svg-to-png.mjs" \ --in /tmp/bodygraph.svg --out /tmp/bodygraph.png ``` Then include `MEDIA:/tmp/bodygraph.png` in your reply before the reading. The platform (Telegram or Astral web) extracts the tag and delivers the image as an attachment. Treat the image as presentation only; interpret strictly from the JSON. ## Required workflow 1. Extract name, birth date, local birth time, and location/timezone from the user. 2. If the user says to “check HD Prism” / “check our HD Prism app” for a named person and birth data is missing, look for an existing saved chart in the HD Prism app before asking the user. The local app DB is usually: ```text /home/avalon/apps/hd-prism/apps/api/descriptions.sqlite ``` Useful probe: ```bash python3 - <<'PY' import sqlite3, json DB='/home/avalon/apps/hd-prism/apps/api/descriptions.sqlite' name='Jackson' # replace conn=sqlite3.connect(DB); conn.row_factory=sqlite3.Row rows=conn.execute(""" SELECT id,name,chart_fingerprint,chart_json,created_at FROM saved_charts WHERE lower(name) LIKE ? ORDER BY datetime(created_at) DESC LIMIT 10 """, (f'%{name.lower()}%',)).fetchall() for r in rows: bg=json.loads(r['chart_json']) print(json.dumps({ 'id': r['id'], 'name': r['name'], 'fingerprint': r['chart_fingerprint'], 'created_at': r['created_at'], 'birthDateAndTime': bg.get('birthDateAndTime'), 'birthDateTimeUTC': bg.get('birthDateTimeUTC'), 'timezoneUsed': bg.get('timezoneUsed'), 'location': bg.get('location'), 'type': bg.get('type'), 'authority': bg.get('authority'), 'profile': bg.get('profile'), 'definition': bg.get('definition'), 'channels': bg.get('channels'), 'definedCenters': bg.get('definedCenters') }, indent=2)) PY ``` If a likely typo is found (e.g. `Jacksotn` for Jackson), state the assumption and proceed unless there are multiple plausible candidates. Use `birthDateTimeUTC`, `timezoneUsed`, and `location` from the chart JSON to reconstruct local birth data for astrology or to call the tenant API again. 3. If any required field is still missing after KB/app lookup, ask only for the missing field(s). 4. Call `POST /api/tenant/bodygraph` before interpreting, unless reusing a saved HD Prism `chart_json` from the app DB for the exact person/fingerprint. 5. Use `summary` for compact answers and `bodygraph.activations` for detailed line/color/tone/base work. 6. Mention the resolved timezone/UTC if relevant. 7. Interpret from the returned API data. Never invent type/profile/authority/gates. ## Failure behavior If the API returns `ok:false` or the HTTP call fails: - State that the shared HD Prism chart service failed. - Give the exact missing/failed piece if known. - Ask for a timezone if location resolution failed, or ask permission to retry. - Do not make up chart details. Bad: ```text I can infer you're probably a Generator... ``` Good: ```text I need the HD Prism service to calculate the actual bodygraph. The service could not resolve the birth location; can you give me the IANA timezone, e.g. America/Los_Angeles? ``` ## Interpretation notes Default compact output: - Type - Strategy if available / implied by type - Authority - Profile - Definition - Environment - Key channels - Key gates or activation highlights For deeper analysis, use the full `bodygraph.activations` object; Environment is derived from **Design South Node**, already included in `summary.environment` and `bodygraph.environment`.