[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m

CLI Tools & Utilities Todo #

Cross-References #

High Priority Tools #

cpfd: Copy Files From Dependencies #

Status: Deprecated; superseded by package/dev-script/file-enforcer

increase-version #

Status: Deprecated; no longer needed after monorepo adoption (no frequent npm publishes)

add-scripts #

Status: Deprecated; handled by file-enforcer and mise task templates

Monochromatic CLI Development #

Current state: Dedicated CLI packages live under package/cli/. The old monochromatic new ... scaffolding ideas remain unimplemented.

monochromatic new <monorepo-name> #

@startuml
start

if (<monorepo-name> exists on filesystem?) then (yes)
  :throw error;
  stop
else (no)
  :TODO: Create monorepo structure;
  stop
endif
@enduml

Implementation Details #

monochromatic new <package-category>/<package-name> #

@startuml
start

if (package/<package-category> exists?) then (yes)
  :DO NOTHING;
else (no)
  :create folder package/<package-category>;
endif

:cd package/<package-category>;

if (<package-name> exists?) then (yes)
  :throw error;
  stop
else (no)
  :create folder <package-name>;
  :TODO: Initialize package structure;
  stop
endif
@enduml

Implementation Details #

Cross-Reference: See Packages Todo for package template details.

Utility Tools #

append util #

Status: Done; shipped as task-append in package/dev-script/task-util/src/append.ts, with bin entry, README section, and unit tests covering create/append/multiline/permission-error cases.

task-append "my new line" --to myfile.md
task-append "my new line1" --to myfile.md
task-append "my new line1\nMy new line2" --to myfile.md
task-append "my new line1" "my new line2" --to myfile.md

Remaining gaps #

Write my own mise MCP server #

Status: Medium Priority

Create a custom MCP server for better mise integration with Claude/AI tools.

Detailed Implementation Tasks #

Cross-Reference: See Automation Todo for AI-assisted development tools.

Advanced Development Tools #

Code Generation and Scaffolding #

Status: Normal Priority, Developer productivity

Cross-Reference: See Automation Todo for comprehensive code generation.

Development Workflow Tools #

Status: Normal Priority, Developer experience

Cross-Reference: See Development Todo for workflow optimization.

Tool Development Guidelines #

Script Preferences #

  • NEVER write bash/shell scripts (non-portable, unreadable, unfamiliar)
  • When scripts are needed, create TypeScript files as mise.<action>.ts in package/module/es/src/
  • Use Node to execute TypeScript scripts directly
  • Avoid creating main() functions
    • Instead of wrapping code in a main() function, write top-level code directly
    • Bad: function main() { /* code */ } main();
    • Good: Just write the code at the top level
    • For async operations, use top-level await: await someAsyncOperation();
  • Avoid exiting with 0; just let the program naturally run to the end
  • NEVER use process. exit(): throw errors instead

Tool Version Management #

  • Only pin tool versions when necessary with clear justification
  • If pinning is required, always include comments explaining why
  • Example: # Pin to v1.2.3 - v1.3.0 introduced breaking API changes
  • Document version requirements in both the pinning file and README
  • Regularly review pinned versions to check if constraints still apply

Security Considerations for CLI Tools #

Status: High Priority, Tool security

Cross-Reference: See Security Todo for comprehensive security practices.

Grammar and Linting Tools #

Replace vale with harper or another grammar checker #

Status: Medium Priority

vale gives EvalSymlinks: too many links error. Need to find a replacement.

Investigation Tasks #

Advanced Utilities #

Pattern Matching Library #

Status: Low Priority, Experimental

Build our own TypeScript pattern matching library that supports async predicates in when clauses, powered by Zod for schema validation.

Features #

  • Support for async predicates in .when() clauses
  • Zod integration for type-safe pattern validation
  • Maintain ts-pattern's excellent type inference
  • Compatible API for migration from ts-pattern

Example API #

import { match, } from '@monochromatic-dev/module-es';
import { z, } from 'zod';

// Async predicate support
const result = await match(value,)
  .when(async v => await checkDatabase(v,), () => 'found in db',)
  .when(z.string().email(), () => 'valid email',)
  .otherwise(() => 'default');

// Or with pre-computed async values
const result = await match({ hasFeature: await checkFeature(), },)
  .with({ hasFeature: true, }, () => 'feature enabled',)
  .otherwise(() => 'feature disabled');

Implementation Tasks #

Cross-Reference: See Packages Todo for related async utility development.

Development Environment Tools #

Status: Normal Priority, Environment management

Cross-Reference: See Development Todo for environment automation.

Performance and Monitoring Tools #

Status: Normal Priority, Performance optimization

Cross-Reference: See Performance Todo for comprehensive performance monitoring.

Implementation Notes #

  • Use ripgrep (rg) for fast text searching instead of navigating Bun's node_modules structure
  • Focus on tools that improve daily development workflow
  • Prioritize TypeScript implementation over shell scripts for better maintainability
  • Integrate with mise task system where possible
  • Follow security best practices for all tool development
  • Implement comprehensive error handling and user feedback
  • Create thorough documentation and usage examples for all tools
  • Add automated testing for all CLI tools
  • Consider performance impact and optimization opportunities
  • Ensure cross-platform compatibility where applicable

Success Criteria #