iching-divination-coin-ui

/home/avalon/.hermes/skills/.archive/software-development/iching-divination-coin-ui/SKILL.md · raw

When to use

Use this when adding or improving the coin-based divination flow in the I Ching Study app, especially when the user wants richer visuals, better physics, clearer Yin/Yang signaling, or mobile-first fullscreen ritual UX.

Context

The I Ching app lives at /home/avalon/apps/iching-study and is a React + Vite + TypeScript frontend with an Express backend and SQLite, deployed via PM2 on iching-study.apps.poofc.com.

Goals

Implementation checklist

  1. Read the current app structure first - Review src/App.tsx, src/index.css, src/lib/deck.ts, src/data/hexagrams.ts, and existing tests. - Confirm how the app currently navigates between views and displays the selected hexagram.

  2. Create divination domain logic in a library file - Add a helper like src/lib/divination.ts. - Implement:

  3. Add a dedicated divination view/state in App.tsx - Add a sidebar button like Start divination. - Add a fullscreen/minimal mode with only:

  4. Build the coin toss UI component behavior - Render three large ancient Chinese cash coins with:

  5. Animation / physics polish - Coins should toss high, then fall fast. - Randomize each coin's:

  6. Draw lines after each throw - After each resolved throw, append the resulting line to a six-line stack at the bottom. - Show lines building from bottom to top. - Yin line = broken line, Yang line = solid line. - Keep visuals large enough for mobile readability.

  7. Complete divination flow - Repeat until six throws are collected. - Resolve the finished six-line pattern to a hexagram from src/data/hexagrams.ts. - Automatically route/open the corresponding hexagram info page/card already used by the app.

  8. Testing and verification - Run the test suite. - Run a production build. - Deploy/restart the app process. - Verify live behavior in-browser:

Design notes / pitfalls

Verification commands

cd /home/avalon/apps/iching-study
npm test
npm run build

Then redeploy using the app's existing PM2 workflow and verify the live site.