Work packages completed: - WP1: packages/forge — pipeline runner, stage adapter, board tasks, brief classifier, persona loader with project-level overrides. 89 tests, 95.62% coverage. - WP2: packages/macp — credential resolver, gate runner, event emitter, protocol types. 65 tests, 96.24% coverage. Full Python-to-TS port preserving all behavior. - WP3: plugins/mosaic-framework — OC rails injection plugin (before_agent_start + subagent_spawning hooks for Mosaic contract enforcement). - WP4: profiles/ (domains, tech-stacks, workflows), guides/ (17 docs), skills/ (5 universal skills), forge pipeline assets (48 markdown files). Board deliberation: docs/reviews/consolidation-board-memo.md Brief: briefs/monorepo-consolidation.md Consolidates mosaic/stack (forge, MACP, bootstrap framework) into mosaic/mosaic-stack. 154 new tests total. Zero Python — all TypeScript/ESM.
2.6 KiB
2.6 KiB
Frontend Development Guide
Before Starting
- Check assigned issue in git repo:
~/.config/mosaic/tools/git/issue-list.sh -a @me - Create scratchpad:
docs/scratchpads/{issue-number}-{short-name}.md - Review existing components and patterns in the codebase
Development Standards
Framework Conventions
- Follow project's existing framework patterns (React, Vue, Svelte, etc.)
- Use existing component library/design system if present
- Maintain consistent file structure with existing code
Styling
- Use project's established styling approach (CSS modules, Tailwind, styled-components, etc.)
- Follow existing naming conventions for CSS classes
- Ensure responsive design unless explicitly single-platform
State Management
- Use project's existing state management solution
- Keep component state local when possible
- Document any new global state additions
Accessibility
- Include proper ARIA labels
- Ensure keyboard navigation works
- Test with screen reader considerations
- Maintain color contrast ratios (WCAG 2.1 AA minimum)
Testing Requirements (TDD)
- Write tests BEFORE implementation
- Minimum 85% coverage
- Test categories:
- Unit tests for utility functions
- Component tests for UI behavior
- Integration tests for user flows
Test Patterns
// Component test example structure
describe('ComponentName', () => {
it('renders without crashing', () => {});
it('handles user interaction correctly', () => {});
it('displays error states appropriately', () => {});
it('is accessible', () => {});
});
Code Style
- Follow Google JavaScript/TypeScript Style Guide
- TypeScript: Follow
~/.config/mosaic/guides/TYPESCRIPT.md— MANDATORY - Use ESLint/Prettier configuration from project
- Prefer functional components over class components (React)
- TypeScript strict mode is REQUIRED, not optional
TypeScript Quick Rules (see TYPESCRIPT.md for full guide)
- NO
any— define explicit types always - NO lazy
unknown— only for error catches and external data with validation - Explicit return types on all exported functions
- Explicit parameter types always
- Interface for props — never inline object types
- Event handlers — use proper React event types
Commit Format
feat(#123): Add user profile component
- Implement avatar display
- Add edit mode toggle
- Include form validation
Refs #123
Before Completing
- Run full test suite
- Verify build succeeds
- Update scratchpad with completion notes
- Reference issue in commit:
Fixes #NorRefs #N