This document contains guidelines for AI coding assistants working on this project.
- Main branch:
main- production-ready code only - Feature branches:
feature/<feature-name>- for new features - Bugfix branches:
fix/<issue-description>- for bug fixes - Always create a feature branch before making changes to existing functionality
- Commit incrementally - small, focused commits that do one thing
- Use conventional commits format:
feat:- new featuresfix:- bug fixesdocs:- documentation changesrefactor:- code refactoringtest:- adding or updating testschore:- maintenance tasks
- Write descriptive commit messages with a summary line and bullet points for details
- Verify build passes before committing (
npm run build)
- Test changes locally (
npm run dev) - Ensure no TypeScript errors
- Review the diff for unintended changes
- Update documentation — if the change adds, removes, or modifies user-visible
features, update
README.md(feature descriptions, route table, env vars) and any relevant guides indocs/before merging. Also updateTODO.mdto mark completed items.
Ontology-Playground/
├── src/
│ ├── components/ # React components (graph, designer, modals, tour, learn)
│ ├── data/ # Data models, templates, and sample data
│ ├── lib/ # Router, RDF parser/serializer, catalogue helpers
│ ├── store/ # Zustand state management (app + designer)
│ ├── styles/ # CSS styles
│ └── types/ # TypeScript type definitions
├── catalogue/ # Official + community ontology RDF files
├── content/learn/ # Markdown articles for the learning section
├── scripts/ # Build-time compilers (catalogue, learning content)
├── docs/ # Guides and documentation
├── api/ # Azure Functions backend (optional)
├── build/ # Production build output
└── public/ # Static assets (compiled catalogue.json, learn.json)
- Use strict TypeScript - no
anytypes unless absolutely necessary - Define interfaces for all data structures
- Export types from dedicated type files or alongside their implementations
- Use functional components with hooks
- Keep components focused - split large components
- Use the existing component patterns in
src/components/
- Use Zustand store (
src/store/appStore.ts) for global state - Keep component-local state with
useStatewhen appropriate
# Development server
npm run dev
# Production build
npm run build
# Type checking
npx tsc --noEmit- Add format type to the state (
exportFormatunion type) - Create export function (
exportAs<Format>) - Add format handler in
handleExport() - Add UI button in the format selector
- Create component file in
src/components/ - Export from
src/components/index.ts - Follow existing component patterns for modals/panels
- React 19 - UI framework
- TypeScript 5 - Type safety
- Vite - Build tool
- Cytoscape.js - Graph visualization
- Zustand - State management
- Framer Motion - Animations
- Lucide Icons - Icon library
- marked - Markdown compilation (build-time)