hd-prism-tenant-api

/home/avalon/.hermes/skills/astrology/hd-prism-tenant-api/SKILL.md · raw

HD Prism Tenant API

Use this skill whenever a user asks for any of these:

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:

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

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:

{
  "name": "Example Person",
  "birthDate": "1985-09-26",
  "birthTime": "07:14",
  "location": "London, England"
}

Optional alternatives:

{ "timeZone": "Europe/London" }
{ "utc": "1985-09-26T06:14:00Z" }

Curl example

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:

{
  "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.

POST https://hdprism.apps.poofc.com/api/tenant/bodygraph.svg

Request JSON uses the same birth-data fields as /bodygraph, plus optional render options:

{
  "name": "Example Person",
  "birthDate": "1985-09-26",
  "birthTime": "07:14",
  "location": "London, England",
  "theme": "light",
  "width": 900
}

Response:

Safe terminal pattern — save the SVG to a file; do not pipe remote curl output into Python/Node/shell interpreters:

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:<absolute-path> 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):

# 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:
/home/avalon/apps/hd-prism/apps/api/descriptions.sqlite

Useful probe:

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:

Bad:

I can infer you're probably a Generator...

Good:

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:

For deeper analysis, use the full bodygraph.activations object; Environment is derived from Design South Node, already included in summary.environment and bodygraph.environment.