Skip to content

feat: add Claude Code toolkit for UMS v2.0 development#84

Merged
synthable merged 2 commits intodevelopfrom
feat/ums-v2-toolkit
Oct 14, 2025
Merged

feat: add Claude Code toolkit for UMS v2.0 development#84
synthable merged 2 commits intodevelopfrom
feat/ums-v2-toolkit

Conversation

@synthable
Copy link
Copy Markdown
Owner

Summary

This PR introduces a comprehensive toolkit of specialized agents and custom commands for working with the Unified Module System v2.0 in Claude Code. The toolkit streamlines UMS development workflows from module creation to validation to build system maintenance.

What's New

🤖 Specialized Agents (5)

Agents are autonomous AI assistants with deep expertise in specific UMS domains:

1. build-developer

  • Develops and maintains the UMS v2.0 build system
  • Implements module registry, TypeScript loading with tsx
  • Creates component-specific markdown renderers
  • Generates build reports with SHA-256 digests
  • Optimizes build performance

2. library-curator

  • Curates and organizes the standard library
  • Assesses module quality and scores
  • Identifies coverage gaps by tier/capability
  • Documents library structure and evolution
  • Plans library improvements

3. module-generator

  • Generates UMS v2.0 compliant modules interactively
  • Guides users through module design decisions
  • Optimizes metadata for searchability
  • Assigns cognitive levels for foundation tier
  • Validates output automatically

4. module-validator

  • Validates modules against UMS v2.0 specification
  • Checks required fields and export conventions
  • Assesses component structure and metadata quality
  • Provides actionable error messages
  • Generates quality scores

5. persona-validator

  • Validates persona structure and composition
  • Verifies module references and availability
  • Detects duplicate modules
  • Validates group structures
  • Simulates builds for compatibility

⚡ Custom Commands (6)

Commands provide convenient workflows that delegate to specialized agents:

/ums:audit

  • Comprehensive compliance and quality auditing
  • Validates all modules and personas
  • Generates audit reports with recommendations
  • Prioritizes issues by severity

/ums:build

  • Build system development and maintenance
  • Implements features, fixes bugs, optimizes performance
  • Tests build components
  • Includes tests and documentation

/ums:create

  • Interactive module and persona creation
  • Guided workflows with strategic questions
  • Template-based generation with best practices
  • Automatic validation after creation

/ums:curate

  • Library organization and maintenance
  • Quality assessment and gap analysis
  • Documentation generation
  • Evolution planning

/ums:validate-module

  • Module validation workflows
  • Supports single files, batch operations, tier filtering
  • Clear PASS/WARNING/FAIL output
  • Actionable fix suggestions

/ums:validate-persona

  • Persona validation workflows
  • Checks composition and module availability
  • Detects duplicates and structural issues
  • Build compatibility verification

📚 Documentation (2 comprehensive guides)

.claude/AGENTS.md (comprehensive agent reference)

  • Detailed agent expertise and capabilities
  • Usage guidelines and examples
  • Agent autonomy levels and workflows
  • Agent dependencies and integration
  • Best practices and troubleshooting

.claude/COMMANDS.md (comprehensive command reference)

  • Command patterns and usage examples
  • Interactive vs. direct invocation
  • Batch operations and path patterns
  • Common workflows and command chaining
  • Tips, troubleshooting, and resources

Key Features

🎯 Guided Workflows

  • Interactive creation with best practices baked in
  • Step-by-step validation with clear feedback
  • Automated quality assurance
  • Spec compliance enforcement

🔄 High Autonomy

  • All agents operate at high autonomy level
  • Make decisions independently
  • Use tools without asking permission
  • Provide complete solutions with tests

📊 Quality Focus

  • Comprehensive validation checks
  • Quality scoring and assessment
  • Actionable recommendations
  • Prevention of common mistakes

🛠️ Developer Experience

  • Clear, actionable error messages
  • Multiple ways to accomplish tasks
  • Batch operations for efficiency
  • Command chaining for complex workflows

Files Changed

New Files (4,111 lines added)

Documentation:

  • .claude/AGENTS.md (comprehensive agent guide)
  • .claude/COMMANDS.md (comprehensive command guide)

Agents (5 files):

  • .claude/agents/build-developer.md
  • .claude/agents/library-curator.md
  • .claude/agents/module-generator.md
  • .claude/agents/module-validator.md
  • .claude/agents/persona-validator.md

Commands (6 files):

  • .claude/commands/ums:audit.md
  • .claude/commands/ums:build.md
  • .claude/commands/ums:create.md
  • .claude/commands/ums:curate.md
  • .claude/commands/ums:validate-module.md
  • .claude/commands/ums:validate-persona.md

Usage Examples

Create a New Module

/ums:create module for Python async best practices

# Agent guides through:
# 1. Purpose and tier determination
# 2. Domain and capabilities selection
# 3. Component type selection
# 4. Module generation with best practices
# 5. Automatic validation

Validate All Foundation Modules

/ums:validate-module foundation

# Output:
# 📊 Foundation Tier Validation Complete
# Total: 9 modules
# - ✅ 8 PASS
# - ⚠️ 1 WARNING

Audit Entire Library

/ums:audit all

# Comprehensive report with:
# - Module/persona pass rates
# - Quality scores
# - Issues by severity
# - Prioritized recommendations

Build System Development

/ums:build implement module caching

# Agent implements:
# - Feature code with tests
# - Performance benchmarks
# - Documentation updates

Benefits

For Module Authors

  • ✅ Guided creation process
  • ✅ Automatic spec compliance
  • ✅ Quality optimization
  • ✅ Instant validation feedback

For Maintainers

  • ✅ Automated quality assurance
  • ✅ Comprehensive auditing
  • ✅ Gap analysis and planning
  • ✅ Library organization tools

For Build System Developers

  • ✅ Structured development workflows
  • ✅ Test-driven implementation
  • ✅ Performance optimization support
  • ✅ Complete documentation

For All Contributors

  • ✅ Clear workflows and patterns
  • ✅ Actionable error messages
  • ✅ Best practices baked in
  • ✅ Efficient batch operations

Agent Workflows

Module Creation Pipeline

User requirement → module-generator → module-validator → User review

Quality Assurance Workflow

module-validator → persona-validator → library-curator → Team review

Build System Development

User requirement → build-developer → module-validator → Integration tests

Testing

  • ✅ All tests passing (348 tests across packages)
  • ✅ Type checking passing
  • ✅ Linting passing
  • ✅ Build succeeds

Compatibility

  • Base Branch: feat/ums-lib-v2
  • No Breaking Changes: Additive only, all existing functionality preserved
  • Claude Code Version: Requires Claude Code with Task tool support

Future Enhancements

Potential future additions:

  • Additional agents for specific domains (testing, deployment)
  • More commands for advanced workflows
  • Agent composition patterns
  • Performance monitoring agents
  • Migration assistance agents

Checklist

  • All agents documented with comprehensive guides
  • All commands documented with usage examples
  • Agent autonomy levels specified
  • Command patterns and workflows defined
  • Integration between agents documented
  • Troubleshooting guides included
  • Best practices documented
  • All quality checks pass

Next Steps

After merging:

  1. Contributors can use /ums:create for guided module creation
  2. Maintainers can use /ums:audit for quality assurance
  3. Build developers can use /ums:build for system development
  4. Everyone can use validation commands for spec compliance

This toolkit establishes a powerful, user-friendly development environment for UMS v2.0! 🚀


Documentation: See .claude/AGENTS.md and .claude/COMMANDS.md for complete usage guides.

Copilot AI review requested due to automatic review settings October 14, 2025 09:06
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @synthable, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the Unified Module System (UMS) to version 2.0 within Claude Code by integrating a powerful toolkit. This toolkit provides developers with a suite of specialized AI agents and custom commands designed to automate and streamline the entire UMS development lifecycle, from module creation and validation to build system maintenance and library curation. The changes aim to enhance developer productivity, ensure spec compliance, and improve the overall quality and consistency of UMS modules and personas.

Highlights

  • Specialized Agents: Introduces 5 new AI agents (build-developer, library-curator, module-generator, module-validator, persona-validator) each with deep expertise in specific UMS v2.0 domains to streamline development.
  • Custom Commands: Adds 6 new slash commands (/ums:audit, /ums:build, /ums:create, /ums:curate, /ums:validate-module, /ums:validate-persona) to automate and simplify common UMS development workflows.
  • Comprehensive Documentation: Includes two new comprehensive guides (.claude/AGENTS.md and .claude/COMMANDS.md) detailing agent capabilities, usage guidelines, and command references for the new toolkit.
  • Enhanced Developer Experience: Focuses on guided workflows, high agent autonomy, quality assurance, and efficient batch operations for UMS v2.0 development, ensuring spec compliance and improved productivity.
Ignored Files
  • Ignored by pattern: .gemini/** (1)
    • .gemini/settings.json
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive toolkit of specialized agents and custom commands for working with the Unified Module System v2.0 in Claude Code, along with significant enhancements to the underlying UMS library to support the v2.0 specification.

Key changes include:

  • Addition of 5 specialized agents for build development, library curation, module generation, validation, and persona validation
  • Introduction of 6 custom commands for UMS v2.0 workflows including audit, build, create, curate, and validation operations
  • Major update of the UMS library from v1.0 to v2.0 with new component-based architecture, TypeScript support, and pure functional APIs

Reviewed Changes

Copilot reviewed 78 out of 97 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.claude/agents/*.md Defines 5 specialized agents with high autonomy for UMS v2.0 workflows
.claude/commands/*.md Implements 6 custom commands for interactive and batch UMS operations
packages/ums-lib/src/core/ Complete rewrite to v2.0 with modular architecture, pure functions, and TypeScript support
packages/copilot-instructions-cli/src/ Updates CLI to support TypeScript modules and v2.0 specification
Configuration files Updates for v2.0 compatibility and new module discovery patterns
Comments suppressed due to low confidence (1)

packages/copilot-instructions-cli/src/utils/typescript-loader.ts:1

  • The comment indicates that using filename as module ID is temporary and may need refinement. This could lead to incorrect module loading if the actual module ID doesn't match the filename. Consider implementing proper module ID extraction from the module content.
/**

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +49 to +53
const reportModule: BuildReportModule = {
id: module.id,
name: module.metadata.name,
version: module.version,
source: 'Local', // TODO: Distinguish between Standard Library and Local
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment indicates incomplete functionality for distinguishing module sources. This could lead to inaccurate build reports. Consider implementing proper source type detection or removing the TODO if this is intentional for the current implementation.

Suggested change
const reportModule: BuildReportModule = {
id: module.id,
name: module.metadata.name,
version: module.version,
source: 'Local', // TODO: Distinguish between Standard Library and Local
// Determine module source type
let sourceType = 'Local';
if (module.metadata.source) {
sourceType = module.metadata.source;
} else if (module.id.startsWith('std:') || module.metadata.name?.startsWith('std-')) {
sourceType = 'Standard Library';
}
const reportModule: BuildReportModule = {
id: module.id,
name: module.metadata.name,
version: module.version,
source: sourceType,

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +48
entry.ids.forEach(() => {
const module = modules[moduleIndex++];
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The forEach callback doesn't use the module ID parameter, which could lead to incorrect module ordering if the entry.ids array doesn't match the order in the modules array. The code assumes modules are in the same order as entry.ids, but this isn't guaranteed.

Copilot uses AI. Check for mistakes.

describe('ModuleRegistry', () => {
let registry: ModuleRegistry;
let consoleWarnSpy: ReturnType<typeof vi.spyOn>;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The consoleWarnSpy variable is declared but never used in the tests. Consider removing it or adding tests that verify warning behavior.

Suggested change
let consoleWarnSpy: ReturnType<typeof vi.spyOn>;

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +22
// UMS v2.0 specification constants
export const UMS_SCHEMA_VERSION = '2.0';
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema version is updated to '2.0' but there are still references to v1.0 patterns elsewhere in the codebase (like shape specifications and validation logic). Ensure all schema-related code is consistently updated to v2.0.

Copilot uses AI. Check for mistakes.
Comment on lines +176 to +186
let rate: number;
let eta: number;
let etaSeconds: number;
if (elapsed > 0) {
rate = this.current / elapsed; // items per ms
eta = rate > 0 ? remaining / rate : Infinity; // ms remaining
etaSeconds = Math.round(eta / 1000);
} else {
rate = 0;
eta = Infinity;
etaSeconds = 0;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The variables rate, eta, and etaSeconds are declared but not initialized before the conditional check. While they are assigned in both branches, this pattern could be clearer by initializing them at declaration or restructuring the logic.

Suggested change
let rate: number;
let eta: number;
let etaSeconds: number;
if (elapsed > 0) {
rate = this.current / elapsed; // items per ms
eta = rate > 0 ? remaining / rate : Infinity; // ms remaining
etaSeconds = Math.round(eta / 1000);
} else {
rate = 0;
eta = Infinity;
etaSeconds = 0;
let rate: number = 0;
let eta: number = Infinity;
let etaSeconds: number = 0;
if (elapsed > 0) {
rate = this.current / elapsed; // items per ms
eta = rate > 0 ? remaining / rate : Infinity; // ms remaining
etaSeconds = Math.round(eta / 1000);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an impressive and substantial pull request that introduces a comprehensive toolkit for UMS v2.0 development and refactors the existing system to be more robust and maintainable. The move to a TypeScript-first UMS v2.0, the clear separation of concerns between the pure ums-lib and the CLI, and the introduction of specialized agents and commands are all excellent improvements. The new architecture with a conflict-aware ModuleRegistry and pure functions for parsing, validation, and rendering is very well-designed. My feedback focuses on a few key areas to further enhance the architecture and documentation quality.

* Implements build report generation per UMS v2.0 specification Section 7.3
*/

import { createHash } from 'node:crypto';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The ums-lib is described as platform-agnostic, but this file imports and uses the Node.js-specific node:crypto module. This will prevent the library from running in non-Node.js environments like browsers or Deno. To maintain platform independence, the digest generation logic should be moved out of this pure library. I suggest modifying generateBuildReport to accept pre-computed digests as arguments, and moving the hashing functions (generatePersonaDigest, generateModuleDigest) to the CLI package, which is the appropriate layer for platform-specific implementations.

Comment on lines +247 to +280
````markdown
## Knowledge

{explanation}

### Key Concepts

**{concept.name}**: {description}
_Why_: {rationale}

### Examples

#### {example.title}

{rationale}

```{language}
{snippet}
```
````

````

**Data Component:**
```markdown
## Data

{description}

```{format}
{value}
````

````
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fenced code blocks in this file are using four backticks () instead of the standard three (```). This can lead to incorrect rendering in many markdown viewers. Please correct all instances of ` to ``` for proper formatting. This issue is also present in other new markdown files in the.claude/` directory.

Comment on lines +220 to +222
if (missingModules.length > 0) {
throw new Error(`Missing modules: ${missingModules.join(', ')}`);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When missing modules are detected, a generic Error is thrown. The project has a well-defined set of custom error types in ums-lib (like BuildError). Using a more specific error type here would improve consistency and allow for more granular error handling in the handleError utility.

    throw new BuildError(`Missing modules: ${missingModules.join(', ')}`);

Add a comprehensive toolkit of specialized agents and custom commands
for working with the Unified Module System v2.0 in Claude Code.

Agents (5 specialized assistants):
- build-developer: Develop and maintain the UMS v2.0 build system
- library-curator: Curate and organize standard library modules
- module-generator: Generate UMS v2.0 compliant modules
- module-validator: Validate module compliance with spec
- persona-validator: Validate persona structure and composition

Commands (6 workflows):
- /ums:audit - Comprehensive compliance and quality auditing
- /ums:build - Build system development and maintenance
- /ums:create - Interactive module and persona creation
- /ums:curate - Library organization and maintenance
- /ums:validate-module - Module validation workflows
- /ums:validate-persona - Persona validation workflows

Documentation:
- .claude/AGENTS.md: Complete agent reference guide
- .claude/COMMANDS.md: Complete command reference guide

These tools provide:
- Guided workflows for common UMS operations
- Automated validation and quality assurance
- Interactive creation with best practices
- Build system development support
- Library maintenance and curation
- Comprehensive spec compliance checking

All agents operate at high autonomy and follow UMS v2.0
specification strictly. Commands provide convenient entry
points that delegate to specialized agents for complex tasks.
@synthable synthable force-pushed the feat/ums-v2-toolkit branch from 5e67984 to 86409a7 Compare October 14, 2025 13:34
@synthable synthable changed the base branch from main to develop October 14, 2025 13:36
- Fix mismatched and orphaned four-backtick sequences
- Ensure proper escaping of triple backticks in markdown examples
- build-developer.md: Fix Data Component and Build Report Generator examples
- ums:validate-module.md: Fix Single Module FAIL example

Addresses PR #84 review comment about incorrect four-backtick usage.
@synthable synthable merged commit 0902665 into develop Oct 14, 2025
@synthable synthable deleted the feat/ums-v2-toolkit branch October 14, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants