Skip to content

Commit af50520

Browse files
jonphippsclaude
andcommitted
docs: enhance CLAUDE.md with Nx optimization and API documentation
Add comprehensive guidance from .junie/guidelines.md including: - Nx workflow benefits and optimization strategies - Performance optimization guidelines for development - Branch-aware testing and git hooks documentation - Complete API documentation references for Docusaurus v3.8 - UI component libraries (MUI X Data Grid, Tree View, Base UI) - Development tools documentation (TypeScript, MDX, React, FontAwesome) - Usage guidelines for development planning and troubleshooting - Context7 MCP integration guidance - Cost optimization strategy for testing This provides developers with quick access to all essential documentation and best practices for working with the IFLA standards project. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent cf9d455 commit af50520

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

CLAUDE.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2020
- **Features**: Tabbed overview pages, comprehensive documentation structure, Nx integration
2121
- **Documentation**: See `developer_notes/current-scaffolding-plan.md` for complete system details
2222

23+
### Nx Workflow Benefits and Optimization
24+
- **Smart Caching**: Nx caches build outputs, test results, and lint results locally and in the cloud
25+
- **Affected Detection**: Only builds/tests projects that have changed or are affected by changes
26+
- **Parallel Execution**: Runs tasks in parallel across multiple CPU cores for optimal performance
27+
- **Distributed Execution**: CI jobs can run across multiple agents for faster completion
28+
- **Task Pipeline Configuration**: `dependsOn` rules ensure correct build order (theme builds first, then sites in parallel)
29+
- **Build Analytics**: Track performance and optimization opportunities
30+
31+
### Performance Optimization Guidelines
32+
- **Use Nx commands**: Prefer `nx build portal` over `pnpm build:portal` for better caching
33+
- **Affected builds**: Use `nx affected --target=build` for faster builds in PRs
34+
- **Robust port cleanup**: Use `:robust` variants (e.g., `nx run portal:start:robust`) for automatic port conflict resolution
35+
- **Cache management**: Nx automatically handles cache invalidation based on file changes
36+
- **Parallel testing**: Use `nx run-many --target=test --all` for parallel test execution across all projects
37+
2338
### Testing Commands
2439

2540
#### NX Testing Commands
@@ -304,6 +319,64 @@ const { workspaceRoot, scriptsDir, tmpDir, packagesDir, themeDir } = setupTestPa
304319
- **Progress tracking**: Use TodoWrite/TodoRead tools for systematic tracking
305320
- **Documentation**: Always consult Docusaurus v3.8 docs during planning
306321

322+
### API Documentation References
323+
324+
**Core Docusaurus v3.8 Documentation**:
325+
- **Main Documentation**: https://docusaurus.io/docs - Core concepts, configuration, and guides
326+
- **CLI Reference**: https://docusaurus.io/docs/cli - Command-line interface documentation
327+
- **API Reference**: https://docusaurus.io/docs/api/docusaurus-config - Configuration API details
328+
- **Plugin APIs**: https://docusaurus.io/docs/api/plugins - Plugin development and configuration
329+
- **Theme APIs**: https://docusaurus.io/docs/api/themes - Theme customization and components
330+
331+
**Styling and UI Framework**:
332+
- **Infima CSS Framework**: https://infima.dev/docs/ - Design system and CSS utilities used by Docusaurus
333+
- **Styling Guide**: https://docusaurus.io/docs/styling-layout - Layout and styling best practices
334+
335+
**Community Resources**:
336+
- **Docusaurus Community**: https://docusaurus.community/ - Community plugins and resources
337+
- **Awesome Docusaurus**: https://github.com/weecology/awesome-docusaurus - Curated list of resources
338+
- **Official Docusaurus Website Source**: https://github.com/facebook/docusaurus/tree/main/website - Real-world implementation patterns and configurations
339+
340+
**Development Tools**:
341+
- **TypeScript Support**: https://docusaurus.io/docs/typescript-support - TypeScript configuration and usage
342+
- **MDX Documentation**: https://mdxjs.com/docs/ - MDX syntax and component integration
343+
- **React Documentation**: https://react.dev/reference/react - React APIs for custom components
344+
- **FontAwesome React**: https://docs.fontawesome.com/web/use-with/react - Icon integration for React components
345+
346+
**UI Components**:
347+
- **MUI X Data Grid**: https://mui.com/x/react-data-grid/ - Advanced data grid component with sorting, filtering, and pagination
348+
- **MUI X Tree View**: https://mui.com/x/react-tree-view/ - Tree view component for hierarchical data display
349+
- **Base UI React**: https://base-ui.com/react/overview/quick-start - Headless React components for building custom UIs
350+
351+
#### API Documentation Usage Guidelines
352+
353+
**For Development Planning**:
354+
1. **Configuration Changes**: Always reference https://docusaurus.io/docs/api/docusaurus-config before modifying `docusaurus.config.ts`
355+
2. **Plugin Integration**: Check https://docusaurus.io/docs/api/plugins for plugin APIs and lifecycle methods
356+
3. **Theme Customization**: Use https://docusaurus.io/docs/api/themes for theme component overrides
357+
4. **Component Development**: Reference React docs for hooks and component patterns
358+
5. **Icon Integration**: Use https://docs.fontawesome.com/web/use-with/react for FontAwesome icon implementation in React components
359+
6. **Data Grid Components**: Use https://mui.com/x/react-data-grid/ for advanced table functionality with sorting, filtering, and pagination
360+
7. **Tree View Components**: Use https://mui.com/x/react-tree-view/ for hierarchical data display and navigation
361+
8. **Custom UI Components**: Use https://base-ui.com/react/overview/quick-start for headless components when building custom interfaces
362+
363+
**For Code Implementation**:
364+
1. **Version Compatibility**: Always verify Docusaurus version (≥3.8) before suggesting APIs
365+
2. **TypeScript Types**: Prefer official TypeScript definitions from Docusaurus packages
366+
3. **Best Practices**: Follow patterns from official documentation examples
367+
4. **Performance**: Reference optimization guides for build and runtime performance
368+
369+
**For Troubleshooting**:
370+
1. **Error Resolution**: Check official troubleshooting guides first
371+
2. **Migration Issues**: Use migration guides for version updates
372+
3. **Community Solutions**: Search community resources for common issues
373+
4. **GitHub Issues**: Reference official Docusaurus GitHub for known issues
374+
375+
#### Context7 MCP Integration
376+
- **Real-time Examples**: Use Context7 MCP for live code examples from Docusaurus community plugins
377+
- **Type Definitions**: Prefer Context7 over static docs for up-to-date TypeScript types
378+
- **Plugin Discovery**: Use Context7 to find and evaluate community plugins
379+
307380
### Search and Code Discovery
308381
- **Search priority**: Search `/Users/jonphipps/Code/IFLA/standards-dev` first, then git history/branches, then `/Users/jonphipps/Code/IFLA/`
309382
- **Site URL references**: Use `/Users/jonphipps/Code/IFLA/standards-dev/packages/theme/src/config/siteConfig.ts` for URL configuration
@@ -608,3 +681,41 @@ e2e/
608681
├── portal-smoke.spec.ts
609682
└── vocabulary-functionality.spec.ts
610683
```
684+
685+
## Branch-Aware Testing and Git Hooks
686+
687+
### Pre-Commit Testing (Automatic)
688+
Runs automatically on every `git commit` for fast feedback:
689+
- **TypeScript checking**: Full type validation across affected projects
690+
- **ESLint validation**: Code quality checks with auto-fixing where possible
691+
- **Unit tests**: 446+ unit/integration tests for fast feedback loops
692+
- **Configuration validation**: Site config validation without builds
693+
- **Target time**: < 60 seconds for immediate feedback
694+
695+
### Pre-Push Testing (Branch-Aware)
696+
Automatically runs on `git push` with different strategies based on branch:
697+
698+
#### Protected Branches (main/dev)
699+
- **Full portal production build**: Complete build validation
700+
- **ISBDM production build**: Critical site build testing
701+
- **Portal E2E testing**: User workflow validation
702+
- **Complete regression suite**: Comprehensive validation
703+
- **Target time**: ~5-10 minutes for complete confidence
704+
705+
#### Feature Branches
706+
- **Configuration validation**: Fast config checks
707+
- **Representative build testing**: Sample build validation
708+
- **Abbreviated regression testing**: Essential checks only
709+
- **Target time**: ~2-3 minutes for efficient development
710+
711+
### GitHub Actions Integration
712+
- **Matrix builds**: All 7 sites built in parallel across multiple runners
713+
- **Environment testing**: Validates deployment configurations
714+
- **URL validation**: Comprehensive link checking
715+
- **Smart caching**: Nx cache optimization reduces CI time by ~70%
716+
717+
### Cost Optimization Strategy
718+
**Local Testing (Free)**: Comprehensive coverage via automated git hooks ensures high quality
719+
**CI Testing (Paid)**: Focused on environment-specific validation, avoiding redundant testing of locally-validated functionality
720+
721+
This approach provides high deployment confidence while minimizing CI compute costs through intelligent local validation.

0 commit comments

Comments
 (0)