packages/ums-libholds pure UMS v2.0 domain logic (rendering, validation,ModuleRegistry) and must stay free of I/O.packages/ums-sdkwraps file access plus orchestration; seeorchestration/build-orchestrator.tsanddiscovery/module-discovery.tsfor the high-level build/validate workflows.packages/ums-cli/src/index.tswires Commander commands to handlers insrc/commands/*, all of which delegate to ums-lib/sdk and avoid direct filesystem assumptions.packages/ums-mcpcurrently contains a placeholderstartMCPServer; treat it as TODO unless you intend to finish the integration.- UMS content lives in
instruct-modules-v2/with shared types ininstruct-modules-v2/types/index.ts; personas compose these modules into grouped workflows.
Instructions Composer is a monorepo workspace containing a CLI tool and supporting libraries for building and managing AI persona instructions using the Unified Module System (UMS v2.0). The project uses a flexible tag-based classification system where modular instruction components are composed into personas for different AI assistant roles.
- Modules such as
instruct-modules-v2/modules/foundation/analysis/from-ambiguity-to-specification.module.tsexportModuleobjects withschemaVersion: '2.0'and richmetadata.capabilities/solves/quality. - Export names must match
moduleIdToExportName(foundation/analysis/...→fromAmbiguityToSpecification), enforced bypackages/ums-lib/src/utils/transforms.ts. - Use
ComponentType.Instruction|Knowledge|Datato structurecomponents; long processes belong ininstruction.process[]with optional validation hooks. - Personas (see
instruct-modules-v2/personas/ums-persona-composer.persona.ts) default-exportPersonaobjects, often grouping modules for staged reasoning. - Keep TypeScript-only helpers in
instruct-modules-v2/types/index.ts; external consumers should import official types fromums-lib.
packages/ums-cli: Main CLI applicationpackages/ums-lib: Core UMS v2.0 library for parsing, validation, and buildingpackages/ums-sdk: Node.js SDK for UMS v2.0packages/ums-mcp: MCP server for AI assistants- Module files: TypeScript-based modules organized by domain/category
personas/: Directory containing persona definition files (.persona.ts)
The project follows a modular approach where:
- Individual instruction modules are TypeScript files with flexible IDs (e.g.,
category/name) - Modules use tags for classification (foundational, intermediate, advanced, etc.)
- Modules are validated against UMS v2.0 schema structures
- A build engine combines modules according to persona definitions
- The compiled output is a markdown document for use with AI assistants
The core components are in packages/ums-lib/src/core/ and include registry, validation, parsing, and rendering.
# Build all packages
npm run build
# Run tests
npm test
npm run test:cli # CLI package only
npm run test:ums # UMS library only
# Code quality
npm run typecheck
npm run lint
npm run format
npm run quality-check
# Publishing
npm run build -w packages/ums-cli- Atomicity: Each module represents a single, self-contained concept
- Tag-Based Classification: Modules use tags for flexible categorization (foundational, intermediate, advanced, domain-specific)
- Cognitive Level: Modules have optional cognitive level property (0-4) indicating complexity
- Schema Validation: Modules follow UMS v2.0 specification with TypeScript-first format
# Build a persona from configuration
copilot-instructions build --persona ./personas/my-persona.persona.ts
# List all modules or filter by tag
copilot-instructions list
copilot-instructions list --tag foundational
# Search for modules
copilot-instructions search "reasoning"
# Validate modules and personas
copilot-instructions validate- All imports must include
.jsextensions for proper ESM compatibility - Testing uses Vitest with
.test.tsfiles alongside source files - Module IDs follow the
category/nameordomain/category/namepattern (flexible, no tier prefix) - Modules use tags in metadata for classification (e.g., foundational, reasoning, typescript)
- Persona files use TypeScript format (
.persona.ts) with type-safe definitions - Git hooks are used for pre-commit (typecheck, lint-staged) and pre-push (tests, build)
- You MUST NOT engage in sycophantic behavior, such as excessive praise or flattery towards the user.
- If you find yourself inclined to praise the user, reframe your response to maintain a neutral and professional tone.
- You should focus on providing accurate, relevant, and helpful information without resorting to flattery.
- Always prioritize clarity and usefulness over compliments.
- Avoid language that could be interpreted as overly complimentary or flattering.