This file contains the comprehensive development guidelines and conventions for the HAX ecosystem. HAX (Headless Authoring eXperience) is a comprehensive web development ecosystem that enables rapid creation of accessible, performant web components and static sites. These rules ensure consistency, quality, and proper integration across all HAX projects and web components.
The HAX ecosystem consists of multiple interconnected repositories serving specific purposes:
webcomponents- The heart of HAX: a monorepo containing 250+ LitElement-based web components, themes, and the DDD design systemcreate(@haxtheweb/create) - The HAX CLI tool for scaffolding new web components, HAXsites, and managing development workflowhaxcms-php- PHP backend implementation providing content management, API endpoints, and server-side renderinghaxcms-nodejs- Node.js backend implementation offering same capabilities as PHP versiondesktop- Electron-based desktop application providing local development environment
hax11ty- Integration layer bridging HAX components with Eleventy (11ty) static site generatorjson-outline-schema- Defines JSON schema used by HAXcms for content structure and navigationhax-schema- Contains HAX property schemas defining web component integration with HAX authoring interfaceopen-apis- Microservice APIs and shared infrastructure deployed at https://open-apis.hax.cloud/docs- Official HAX documentation site built as HAXcms site with comprehensive ecosystem documentationissues- Unified issue tracking repository for entire HAX ecosystem
HAX is built on community pillars that guide all development decisions and community interactions:
- Accessible: Maximizes accessibility while removing knowledge required to maintain accessibility standards (WCAG 2.0 AA)
- Extensible: Built for sustainable extension through web standards, microservices, and modular architecture
- Free and Open: Open community embracing 5Rs of OER (Retain, Reuse, Revise, Remix, Redistribute)
- Efficient: Optimized for performance through web standards over heavy libraries, lazy loading, offline capability
- Platform Agnostic: Works anywhere - standalone HAXsites, integrated HAXcms, static pages, existing CMS platforms
- Remixable: Maximizes remix-ability through modular design, open licensing, semantic content structures
- Sustainable: Environmental, technological, and community sustainability
- Rapid Development: Scaffolding tools and design systems accelerate creation
- Unbundled Delivery: Pure JavaScript, HTML, CSS approach without compilation steps
- Modularity: Components work independently and compose together seamlessly
- Ubiquitous Web: Content should "just work" regardless of how it was built
- All documentation is located in the
docsfolder - Site structure uses
site.jsonfor page order in JSON outline schema format - All files are stored under the
filesfolder - All page HTML content is in the
pagesfolder - Documentation should ensure coverage of pillars, pedagogical ontology, and relevant projects referenced in AGENTS.md to maintain comprehensive ecosystem context
- The
x/prefix for routes is reserved for internal HAXcms paths such asx/searchandx/tags - In
site.json/ HAX site, themetadata.site.nameproperty should align with the folder name and should not be modified to be anything else
wc-registry.jsonis built by the ubiquity script and used for our "magic script"- Contains references to every valid web component published on our CDN
- Hydrated based on tag-name being undefined, detected in the DOM, then imported dynamically
- CRITICAL: The agent is explicitly not allowed to run the ubiquity script under any circumstances
- Located under
elements/d-d-dpath - Should be leveraged for fonts, colors, padding, spacing, margins and other consistency in component and site design
- Always perform a quick audit to ensure proper usage of the DDD design system when working on web components
- DDD should be used instead of SimpleColors when possible
- Older color-based design system still used to fill gaps in DDD
- Creates baseline color spectrum for levels of red, orange, blue, etc.
- Use only when DDD doesn't provide the required color variations
- Elements with a
haxPropertiesmethod are HAX capable, leveraging the HAXSchema standard - The
demoSchemapart provides all necessary information to create example elements in HAX - For demos launching in CodePen, use
demoSchemaand HAX helper methods to create valid demos with appropriate tag names, properties, and slotted content - When writing content for HAX sites, ensure webcomponent tags are authored elements that could be put in pages via the HAX editor
- Supply visually interesting content for engagement (video, table, block element data)
- Keep in mind DDD attributes for consistent heading and paragraph content offset
- Always perform a quick audit for potential accessibility enhancements when working on web components
- Don't assume issues exist, but ensure to look for them systematically
- Language: Pure JavaScript with LitElement for web components
- NO TypeScript: HAX strictly avoids TypeScript to eliminate compilation requirements
- Unbundled Approach: Components ship as native JS/HTML/CSS for maximum compatibility
- Third-party Libraries: When using libraries written in TypeScript, always import the pre-compiled JavaScript distribution
- External Dependencies: Leverage libraries like
vaadin-upload,shoelace-carousel, etc. but always use their JS builds
- Global References: Use
globalThisinstead ofwindowfor consistency across environments - Formatting:
- Use single quotes (
') - Avoid semicolons where possible
- Prefer functional programming patterns
- Use Prettier for consistent formatting
- Use single quotes (
- ES Modules: Use standard ES6 import/export syntax
- Modern JavaScript: Leverage ES2018+ features while maintaining browser compatibility
- Optional Chaining: Do not use optional chaining syntax (
?.) because our Polymer parser has issues with this syntax
- When creating educational elements within HAX, apply OER Schema metadata parameters to ensure consistent semantic structure and interoperability
- Install HAX CLI globally:
npm install @haxtheweb/create --global - Alternative usage:
npx @haxtheweb/createornpm init @haxtheweb - Update HAX CLI:
hax update
- Start interactive CLI:
hax start(launches interactive CLI with ASCII art via Clack) - Start development server:
hax serve(launches site at http://localhost) - Create web component:
hax webcomponent my-element --y(creates LitElement with DDD and i18n) - Create HAXsite:
hax site mysite --y(generates HAXcms-based static site) - DDD compliance audit:
hax audit(checks CSS against DDD design system standards)
--v: Verbose output--debug: Developer-focused output--yor--auto: Auto-accept all prompts--no-i: Prevent interactive sub-processes (ideal for scripting)--skip: Skip animations for faster execution--quiet: Suppress console logging--writeHaxProperties: Write haxProperties for web components--custom-theme-name <name>: Custom theme name for HAXsites--custom-theme-template <template>: Theme template (base, polaris-flex, polaris-sidebar)--import-site <url>: URL of site to import--import-structure <method>: Import method (pressbooksToSite, htmlToSite, etc.)
HAX uses a sophisticated build pipeline optimized for unbundled JavaScript delivery:
- Gulp: Handles asset compilation and processing
- Prettier: Ensures consistent code formatting
- CEM (Custom Elements Manifest): Generates
custom-elements.jsonfor component metadata - Lerna: Manages monorepo dependencies and publishing
- No TypeScript Compilation: Pure JavaScript workflow eliminates build complexity
- Standard build:
yarn run build(from component root)- Compiles assets, formats code, generates custom-elements.json
- CRITICAL: Always run after changes to HAXCMSLitElement themes
- Do NOT manually edit
custom-elements.json- it's auto-generated
- Development build:
yarn run dev(with watching) - Monorepo build:
yarn run build(from webcomponents root)
- When running HAX commands, don't use
npx- instead use the local copy as it's always the latest or experimental - For HAXcms site theme changes using classes that inherit from HAXCMSLitElement, run
yarn run buildat the end instead of manually editingcustom-elements.json - Do not ask or prompt to run traditional build commands in this monorepo as they are not used
- When running commands in HAX, ensure
--y,--no-i, and--autoflags are used to prevent interruptions and avoid launching new windows/processes
- For any git repository in or below the current working directory, check issues against the unified issue queue at
~/Documents/git/haxtheweb/issues - GitHub CLI is installed and available for use
- User prefers not to write tests in the current suggested way and does not do testing in the traditional manner
- Always start new shells in the
~/Documents/git/haxtheweb/folder where all projects are located - Project structure follows monorepo patterns with specialized subdirectories
- Local HAX tooling should be used instead of global installations
- Avoid interactive or fullscreen commands that could interrupt workflow
- Use web component tags that are HAX-capable and available in the registry
- Leverage DDD attributes for consistent styling
- Provide engaging visual content (videos, tables, block elements) when appropriate
- Ensure all content can be authored through the HAX editor interface
- Maintain comprehensive ecosystem context in all documentation
- Reference pillars and pedagogical ontology where relevant
- Ensure coverage aligns with projects mentioned in AGENTS.md
When working on web components, perform these audits:
- Design System Compliance: Verify proper DDD usage
- Accessibility: Check for enhancement opportunities
- HAX Schema: Ensure proper HAX capability implementation
- Code Standards: Verify JavaScript best practices
- Verify naming conventions align with folder structures
- Ensure metadata properties match expected values
- Check that routing doesn't conflict with reserved
x/prefix
HAX has deep roots in educational technology, evolving from over a decade of work in online learning:
- ELMS:LN Legacy: HAX evolved from ELMS Learning Network (2012-2022), a Next Generation Digital Learning Environment (NGDLE)
- OER Commitment: Embraces the 5Rs of Open Educational Resources (Retain, Reuse, Revise, Remix, Redistribute)
- Instructional Design Focus: Built-in support for pedagogical patterns through specialized components
HAX includes purpose-built components for learning:
- Question Types: Multiple choice, fill-in-blanks, drag-and-drop, true/false, short answer, sorting, tagging
- Instructional Tools: Self-check activities, stop notes, timelines, math notation (MathML/LaTeX)
- Assessment Features: Immediate feedback, progressive disclosure, formative assessment patterns
- Accessibility in Learning: Screen reader compatibility, keyboard navigation, high contrast support
- Chunked Content: Break complex topics into digestible components
- Active Learning: Interactive elements encourage engagement over passive consumption
- Universal Design for Learning: Multiple means of representation, engagement, and expression
- Evidence-Based Design: Components based on learning science research
HAX leverages cloud infrastructure at https://hax.cloud for:
- CDN: Content delivery network for component libraries
- AI Services: Content analysis and processing capabilities
- Documentation: Centralized documentation and community resources
- Open Infrastructure: Publicly available APIs and services
- open-apis.hax.cloud: Conversion, analysis, and processing services
- Stateless Design: Services designed for scalability and reliability
- REST APIs: Standard HTTP interfaces for integration
- Vercel Deployment: Serverless functions for optimal performance
Supported import methods:
pressbooksToSite- Academic textbook platformelmslnToSite- ELMS Learning NetworkhaxcmsToSite- Between HAXcms instancesnotionToSite- Notion workspacegitbookToSite- GitBook documentationevolutionToSite- Evolution CMShtmlToSite- Generic HTML importdocxToSite- Microsoft Word documents
- Vaadin Components: Import from
@vaadin/[component]/[component].js - Shoelace Components: Import from
@shoelace-style/shoelace/dist/components/[component]/[component].js - Other Libraries: Always use the
/dist/or compiled JavaScript version - Open APIs: Leverage https://open-apis.hax.cloud/ for conversion, analysis, and processing services
- Avoid: Direct TypeScript imports or source files requiring compilation
~/Documents/git/haxtheweb/
├── webcomponents/ # Component library & themes
│ └── elements/ # Individual components
│ ├── d-d-d/ # Design system
│ └── [250+ more]/ # All other components
├── create/ # HAX CLI tool
├── haxcms-php/ # PHP backend
├── haxcms-nodejs/ # Node.js backend
├── desktop/ # Electron app
├── hax11ty/ # 11ty integration
├── json-outline-schema/ # Content schemas
├── hax-schema/ # HAX property schemas
├── open-apis/ # Microservice APIs
├── docs/ # Official HAX documentation
└── issues/ # Unified issue tracking
- Keep dependencies updated before running
npm install - Avoid committing API keys or sensitive data to
package.json,site.json, or public files - Validate source URLs when using
--import-siteto prevent malicious content - Sanitize user inputs in custom components
- Only import from trusted, well-maintained JavaScript distributions
- HAX Community: Run
hax partyfor involvement opportunities - Discord: https://bit.ly/hax-discord
- Issue Reporting: Use
haxtheweb/issuesor GitHub interface - Documentation: Run
man hax(Linux/macOS) for comprehensive CLI docs - Educational Resources: Complete documentation at https://haxtheweb.org/
This file serves as the authoritative guide for HAX ecosystem development. All contributors should familiarize themselves with these standards to maintain consistency and quality across the platform.