IMPORTANT: Use the /sandbox/ folder for all temporary working files, test outputs, notes, and drafts.
- The
sandbox/folder is in.gitignoreand will not be committed - Store test plans, results, TODO lists, and exploration notes here
- Do NOT create working files in other directories (they may accidentally be committed)
- Clean up the sandbox when work is complete if appropriate
# Example: Create working files in sandbox
mkdir -p sandbox
echo "My notes" > sandbox/my-notes.mdThis is the FINOS Architecture as Code monorepo containing the Common Architecture Language Model (CALM) specification and associated tools.
CALM is a declarative, JSON-based modeling language for describing complex software architectures, particularly in regulated environments like financial services.
architecture-as-code/
├── calm/ # CALM specification (JSON schemas)
├── cli/ # TypeScript CLI (@finos/calm-cli)
├── calm-hub/ # Java/Quarkus REST API backend
├── calm-plugins/vscode/ # VSCode extension
├── calm-models/ # TypeScript data models
├── calm-widgets/ # React visualization components
├── calm-ai/ # AI chatmode tools & prompts
├── shared/ # Shared TypeScript utilities
├── docs/ # Docusaurus documentation site
├── advent-of-calm/ # Educational content (24-day challenge)
├── calm-hub-ui/ # React frontend for CALM Hub
└── experimental/ # Experimental features
TypeScript/Node.js (npm workspaces):
- CLI, models, widgets, shared, VSCode plugin, Hub UI
- Build: tsup (esbuild), vitest for testing
- Package manager: npm workspaces
Java/Maven (Maven reactor build):
- Root pom.xml defines multi-module reactor
- Modules: calm-hub (Java/Quarkus), cli, calm, docs, shared (POM modules)
- calm-hub backend (Quarkus 3.29+)
- MongoDB/NitriteDB storage
- TestContainers for integration tests
- Maven reactor allows building all modules from root:
./mvnw clean install
Documentation:
- Docusaurus for main docs
- Astro for advent-of-calm website
For detailed guidance on specific packages, see:
- cli/AGENTS.md - CLI commands, build pipeline, Commander.js patterns
- calm-hub/AGENTS.md - Java/Quarkus backend, storage modes, security
- calm-plugins/vscode/AGENTS.md - VSCode extension, MVVM architecture
- calm-widgets/AGENTS.md - Widget system, Handlebars templates, common pitfalls
- advent-of-calm/AGENTS.md - Educational content, day format, testing
Open the package-specific AGENTS.md when:
- Working on code or tests in that package
- Debugging package-specific issues
- Understanding architecture patterns
- Running package-specific commands
IMPORTANT: Always run npm commands from the repository root using workspaces, not from within individual package directories.
# Root-level commands (npm workspaces)
npm run build # Build all TypeScript workspaces
npm test # Test all TypeScript workspaces
npm run lint # Lint all workspaces
npm run build:cli # Build CLI and dependencies
npm run build:shared # Build shared packages
# Package-specific builds (from root using workspaces)
npm run build --workspace cli
npm run build --workspace calm-widgets
npm run build --workspace shared
npm run build --workspace calm-plugins/vscode
# Root-level Maven reactor build
./mvnw clean install # Build all Maven modules (mainly calm-hub)
./mvnw test # Test all Maven modules (mainly calm-hub)
# Testing specific packages (from root using workspaces)
npm test --workspace cli # Test CLI only
npm test --workspace shared # Test shared packages
npm test --workspace calm-plugins/vscode # Test VSCode extension
npm test --workspace calm-models # Test calm-models
npm test --workspace calm-widgets # Test calm-widgets
# Java/Maven (calm-hub specific)
cd calm-hub
../mvnw quarkus:dev # Development mode with hot reload
../mvnw -P integration verify # Full test suite with integration tests
../mvnw test # Unit tests only
# CLI (from root)
npm run link:cli # Link CLI globally for testing
calm --version # Test CLI
# Watch modes (from root)
npm run watch --workspace cli # Watch CLI
npm run watch --workspace calm-plugins/vscode # Watch VSCode extension
npm run watch --workspace calm-widgets # Watch widgets
# Advent of CALM website
cd advent-of-calm/website
npm install # First time setup
npm run dev # Dev server with hot reload
npm run build # Production buildTypeScript packages (npm workspaces) build in order:
calm-models → calm-widgets → shared → cli → calm-plugins/vscode
Maven modules (reactor build):
Parent POM → calm-hub (only Java module with code)
Other modules (cli, calm, docs, shared) are POM-only placeholders
Important:
- Always build dependencies before dependent packages for TypeScript
- Maven reactor handles build order automatically:
./mvnw clean install
# From repository root
npm run build:cli # Builds models, widgets, shared, cli
npm run link:cli # Link globally
calm --version # Verify
npm test --workspace cli # Run CLI tests# From repository root
npm run build:shared # Build dependencies
npm run watch --workspace calm-plugins/vscode # Watch mode
# Press F5 in VSCode to debugcd calm-hub/local-dev
docker-compose up # Start MongoDB
cd ..
../mvnw quarkus:dev # Start backendcd advent-of-calm
vim day-10.md # Edit content
cd website
npm run dev # Test in browserCRITICAL: Before considering any change ready:
- All tests must pass with coverage enabled
- All new code must have tests (unit and/or integration)
- Run linting (see Linting section below)
IMPORTANT: All workspaces use vitest run for the test script, which runs tests once and exits.
Do NOT use vitest without run as it enters watch mode and will hang indefinitely.
IMPORTANT FOR SHARED PACKAGE:
If you modify the shared package, you MUST run tests for ALL workspaces (npm run test) because shared is a dependency for CLI, VSCode extension, and other packages. Changes in shared can break downstream consumers.
# Run ALL tests with coverage (required before committing)
npm test -- --coverage # TypeScript packages with coverage
cd calm-hub && ../mvnw verify # Java tests with coverage (JaCoCo enabled by default)
# Quick test runs (without coverage reports)
npm test # TypeScript packages (runs vitest run in each workspace)
cd calm-hub && ../mvnw test # Java unit tests (still collects coverage data)
# Package-specific tests (from repository root using workspaces)
npm test --workspace cli
npm test --workspace calm-plugins/vscode
npm test --workspace shared
npm test --workspace calm-widgets
npm test --workspace calm-models
# Java integration tests (requires Docker)
cd calm-hub && ../mvnw -P integration verify- All new functions/methods must have tests
- Aim for >80% coverage on new code
- Critical paths must have 100% coverage
- Tests should cover both success and error cases
CRITICAL: Always run linting after making code changes. Fix all errors before committing.
# Lint all workspaces (required before committing)
npm run lint # Check all TypeScript/JavaScript code
# Auto-fix issues
npm run lint-fix # Fix auto-fixable linting issues
# Package-specific linting
npm run lint --workspace cli
npm run lint --workspace calm-plugins/vscodeLinting checks code style, common errors, and best practices.
This project uses Conventional Commits enforced by commitlint and husky.
<type>(<scope>): <subject>
<body>
<footer>
Required:
type: One of:feat,fix,docs,style,refactor,test,chore,perf,ci,build,revertsubject: Brief description (no period at end)
Optional:
scope: Package affected (cli,shared,calm-widgets,calm-hub,calm-hub-ui,docs,vscode,deps,ci,release)body: Detailed explanationfooter: Breaking changes, issue references
# Good commit messages
feat(cli): add support for schema validation caching
fix(calm-hub): resolve MongoDB connection timeout issue
docs(vscode): update extension installation guide
test(shared): add unit tests for template processor
chore(deps): update Quarkus to 3.29.4
# Bad commit messages (will be rejected)
update stuff # Missing type
Fix: bug in code # Type must be lowercase
feat(cli) added new feature. # Subject ends with period
FEAT(cli): new feature # Type must be lowercase- feat: New feature for users
- fix: Bug fix for users
- docs: Documentation only changes
- style: Code style changes (formatting, no logic change)
- refactor: Code restructuring (no behavior change)
- test: Adding or updating tests
- chore: Maintenance tasks (dependencies, tooling)
- perf: Performance improvements
- ci: CI/CD pipeline changes
- build: Build system changes
- revert: Reverting a previous commit
Husky runs commitlint automatically on every commit. Invalid messages are rejected.
To bypass validation (not recommended):
git commit --no-verify -m "message"For help crafting valid commits:
npx cz
# or
npm run commit # if configuredThis provides an interactive prompt to build a compliant message.
Before considering any code change ready:
- All tests pass with coverage:
npm test -- --coverageANDcd calm-hub && ../mvnw verify - All new code has tests (unit and/or integration tests)
- Linting passes:
npm run lint(0 errors) - Code builds successfully:
npm run buildAND./mvnw clean install - Documentation updated if behavior changed
- Test coverage meets requirements (>80% for new code)
- Commit message follows Conventional Commits (enforced by husky)
- User Docs: https://calm.finos.org
- Advent of CALM: https://calm.finos.org/advent/
- API Docs: Generated from code (Swagger for calm-hub)
CRITICAL: Always create a feature branch for your changes and submit a pull request. Never commit directly to the main branch—direct commits will be rejected.
- Fork the repository
- Create a feature branch with descriptive name (e.g.,
feat/add-caching,fix/mongodb-timeout) - Make your changes following package-specific guidelines (see AGENTS.md files)
- Write tests for all new code
- Run the pre-commit checklist (see above)
- Tests with coverage pass
- Linting passes (0 errors)
- Builds succeed
- Commit with Conventional Commits format
- Example:
feat(cli): add schema validation caching - Husky will validate your commit message automatically
- Example:
- Push to your fork and create a pull request
- Ensure CI passes on your pull request
# 1. Create feature branch
git checkout -b feat/my-feature
# 2. Make changes and write tests
vim src/my-file.ts
vim src/my-file.spec.ts
# 3. Run pre-commit checks
npm test -- --coverage
npm run lint
npm run build
# 4. Commit with conventional format (husky validates)
git add .
git commit -m "feat(cli): add my feature"
# 5. Push and create PR
git push origin feat/my-feature- Issues: https://github.com/finos/architecture-as-code/issues
- Discussions: https://github.com/finos/architecture-as-code/discussions
- Community: FINOS Architecture as Code meetings