zcc
CLAUDE.md16 starsChanged 15 months agoMITView on GitHub
zcc is to Claude Code what zsh is to bash. We enhance, customize, and empower Claude Code through themes (modes), plugins (agents/workflows), configuration (.zcc/config), and automation (hooks). Think of this project as building oh-my-zsh for AI development. We are dogfooding zcc while developing it. This means: - The generator CLI source code (src/, scripts/, templates/) is what we're developing - The generated .zcc directory contains our own project's modes/workflows/tickets - The generated .claude directory contains Claude Code configuration generated by…
- Installs packages
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
21 rules. About 0 are common, 13 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
When making updates, always modify the CLI source code, then run npm run dev init -- --force --pack essentials to update our own dogfooding …
- Distinctive: line 24
When making changes to zcc:
- Distinctive: line 34
After adding new features: Test them on our own project first
- Distinctive: line 41
After changing pack discovery: Verify packs are found
- Distinctive: line 46
Template Frontmatter Format: All templates are self-describing
- Distinctive: line 185
Add shebang for direct execution
- Very specific: line 245
Create command file in src/commands/
- Very specific: line 248
Add tests in src/commands/__tests__/
- Very specific: line 251
Create template in appropriate templates/ subdirectory:
- Very specific: line 256
Update metadata.json with component metadata
- Distinctive: line 257
Test installation via CLI commands
- Very specific: line 261
Create a directory templates/[pack-name]/ and add a manifest.json:
- Very specific: line 278
Ensure referenced component files exist under templates/
- Very specific: line 282
Create hook definition JSON in templates/hooks/
- Distinctive: line 283
Create corresponding shell script
- Distinctive: line 285
Test with real Claude Code interactions
- Distinctive: line 321
Schema Validation: Test pack definitions against JSON schema
- Distinctive: line 322
Component References: Ensure all referenced components exist
- Distinctive: line 323
Dependency Resolution: Test dependency chains and circular detection
- Distinctive: line 324
Installation Simulation: Verify pack installation logic
- Distinctive: line 325
Error Handling: Test invalid packs, missing components, conflicts
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Core Concept: The zsh for Claude Code
zcc is to Claude Code what zsh is to bash. We enhance, customize, and empower Claude Code through themes (modes), plugins (agents/workflows), configuration (.zcc/config), and automation (hooks). Think of this project as building oh-my-zsh for AI development.
Important: Dogfooding Context
We are dogfooding zcc while developing it. This means:
- The generator CLI source code (src/, scripts/, templates/) is what we're developing
- The generated .zcc directory contains our own project's modes/workflows/tickets
- The generated .claude directory contains Claude Code configuration generated by our CLI
- When making updates, always modify the CLI source code, then run
npm run dev init -- --force --pack essentialsto update our own dogfooding setup
NEVER confuse:
- Editing the CLI code (what we want) vs editing generated files (usually wrong)
- The zcc CLI commands vs Claude Code custom commands
- Templates in templates/ (source) vs installed components in .zcc/ (generated)
Dogfooding Guide
When making changes to zcc:
- After modifying templates: Templates now use YAML frontmatter for metadata
# Rebuild to regenerate metadata.json from frontmatter npm run build # Reinstall in our own project npm run dev init -- --force --pack essentials - After adding new features: Test them on our own project first
# Use dev mode to test new commands npm run dev <command> # Example: npm run dev list - After changing pack discovery: Verify packs are found
npm run dev pack list # Should show all available packs - Template Frontmatter Format: All templates are self-describing
--- name: component-name description: What this component does author: zcc version: 1.0.0 tags: [tag1, tag2] --- # Component content here
Commands
Build and Development
# Install dependencies
npm install
# Validate dependencies and build the project (bundles with esbuild, adds shebang, copies templates)
npm run build
# Development mode (run TypeScript directly)
npm run dev
# Watch mode for development
npm run watch
# Validate dependencies without building
npm run validate
# Clean build artifacts
npm run cleanTesting
# Run all tests
npm test
# Run tests with coverage (thresholds: 30% branches, 45% functions/lines/statements)
npm run test:coverage
# Run a specific test file
npx jest src/commands/__tests__/init.test.ts
# Run tests matching a pattern
npx jest --testNamePattern="should create ticket"Publishing
# Prepare for publishing (runs tests and build)
npm run prepublishOnly
# The actual publish is handled by scripts/npm/commit-tag-and-publish.shDevelopment CLI
Non-Interactive Initialization
- To run the current development CLI:
yarn dev init --force --pack frontend-react - This regenerates our dogfooding .zcc and .claude directories
Architecture
Core Structure
zcc is the "zsh for Claude Code" - a meta-framework that transforms Claude Code from a basic shell into a highly customizable power tool.
Key Concepts (zsh Analogies):
- Modes: AI personalities (like zsh themes - robbyrussell, agnoster, powerlevel10k)
- Workflows: Reusable procedures (like zsh functions/scripts)
- Agents: Specialized capabilities (like zsh plugins - git, docker, kubectl)
- Tickets: Persistent task tracking (like tmux sessions)
- Hooks: Automation points (like zsh hooks - precmd, preexec, chpwd)
- Custom Commands: Slash commands (like zsh aliases)
- Fuzzy Matching: Smart completions (like zsh's completion system)
- .zcc/config.yaml: Project config (like .zshrc)
Directory Layout
src/
├── cli.ts # Main entry point, command registration
├── commands/ # CLI command implementations
│ ├── init.ts # Initialize zcc
│ ├── pack.ts # Pack management (install/list/show/uninstall/update)
│ ├── ticket.ts # Ticket management (create/move/resolve)
│ ├── config.ts # Configuration management
│ ├── hook.ts # Hook management
│ └── acronym.ts # Acronym expansions
└── lib/ # Core functionality
├── configManager.ts # Config hierarchy (default->global->project->env)
├── ticketManager.ts # Ticket lifecycle management
├── commandGenerator.ts # Generate Claude Code custom commands
├── projectDetector.ts # Detect project language/framework
└── hooks/ # Hook system implementation
├── HookManager.ts # Main hook orchestrator
├── HookRegistry.ts # Hook registration system
└── builtin/ # Built-in hooks (routing, security, etc.)
templates/ # Component templates
├── modes/ # Built-in modes (architect, engineer, etc.)
├── workflows/ # Built-in workflows (review, summarize, etc.)
├── agents/ # Claude Code subagents (claude-code-research)
├── hooks/ # Hook templates and scripts
├── scripts/ # Utility scripts (mode-switch, ticket-context)
└── metadata.json # Component metadata
Generated Directories:
.zcc/ # Project-specific zcc data
├── modes/ # Installed mode definitions
├── workflows/ # Installed workflow definitions
├── tickets/ # Ticket storage (next/in-progress/done)
├── hooks/ # Hook configurations and scripts
├── scripts/ # Generated utility scripts
└── config.yaml # Project configuration
.claude/ # Claude Code configuration
├── agents/ # Installed Claude Code agents
├── commands/ # Custom slash commands
│ ├── mode.md # Mode switching command
│ ├── ticket.md # Ticket management command
│ └── zcc.md # zcc status command
└── settings.local.json # Claude Code project settingsKey Design Patterns
- Enhancement Philosophy: Like zsh enhances bash, we enhance Claude Code without replacing it
- Plugin Architecture: Components (modes/workflows/agents) work like zsh plugins - modular and composable
- Configuration Cascade: Settings layer like zsh (defaults → global ~/.zcc → project .zcc → environment)
- Template System: Components are templates that can be customized (like oh-my-zsh themes/plugins)
- Hook System: Event-driven automation (like zsh's hook functions)
- Dual Directory Structure: .zcc/ (like ~/.oh-my-zsh/) and .claude/ (Claude Code integration)
Build Process
The build uses esbuild (scripts/build.js) to:
- Bundle TypeScript into a single CLI executable
- Inject version from package.json
- Add shebang for direct execution
- Copy templates to dist directory
Testing Strategy
- Uses Jest with ts-jest preset
- Mocks inquirer for interactive testing
- Coverage thresholds enforced
- Tests organized alongside source files in tests directories
Error Handling
- Custom error types in lib/errors.ts
- Global error handlers in cli.ts
- Verbose/debug logging options for troubleshooting
Component System
Modes (Themes)
- AI personalities for different development tasks (like zsh themes change prompt appearance/behavior)
- Support fuzzy matching: exact match → substring → acronym (like zsh completions)
- Example:
apm→autonomous-project-manager(likegst→git statusin oh-my-zsh) - Stored as markdown in .zcc/modes/ (like themes in ~/.oh-my-zsh/themes/)
- Activated via
/mode [name]custom command (like setting ZSH_THEME)
Workflows (Functions/Scripts)
- Reusable development procedures and patterns (like zsh functions)
- Stored as markdown in .zcc/workflows/ (like custom functions in .zshrc)
- Can be referenced in prompts or modes (like calling functions in zsh)
Agents (Plugins)
- Claude Code subagents for specialized tasks (like zsh plugins add specific capabilities)
- Installed to .claude/agents/ directory (like plugins in ~/.oh-my-zsh/plugins/)
- Example: claude-code-research agent (like the 'git' plugin in oh-my-zsh)
- Added via
zcc pack install <name>
Hooks (Event Functions)
- Claude Code integration points for automated behavior (like zsh hook functions)
- Built-in hooks:
- zcc-routing (like preexec - runs before commands)
- project-overview (like chpwd - runs on directory change)
- git-context-loader (like precmd - runs before prompts)
- acronym-expander (like alias expansion)
- Custom hooks can be added (like adding custom hook functions)
- Configured in .zcc/hooks/definitions/
Custom Commands
- Project-specific slash commands generated in .claude/commands/
/mode- Switch between modes with fuzzy matching/ticket- Manage tickets and load context/zcc- Show project status
Ticket Workflow
Tickets follow a lifecycle:
- Created in
.zcc/tickets/next/ - Moved to
.zcc/tickets/in-progress/when started - Moved to
.zcc/tickets/done/when completed - Can include context that gets injected into CLAUDE.md
Development Guidelines
Adding New Commands
- Create command file in
src/commands/ - Export a Command instance
- Register in
src/cli.ts - Add tests in
src/commands/__tests__/
Adding New Components
- Create template in appropriate
templates/subdirectory:- Modes: markdown with personality/behavior instructions
- Workflows: markdown with step-by-step procedures
- Agents: markdown with frontmatter for tools and description
- Hooks: JSON definition + shell script implementation
- Update metadata.json with component metadata
- Test installation via CLI commands
- For agents, ensure proper .claude/agents/ targeting
Adding New Starter Packs
- Create a directory
templates/[pack-name]/and add amanifest.json:{ "name": "pack-name", "version": "1.0.0", "description": "Pack description", "author": "author-name", "category": "frontend|backend|fullstack|devops|mobile|ai-ml|data|general", "components": { "modes": [{ "name": "mode-name", "required": true }], "workflows": [{ "name": "workflow-name", "required": false }], "agents": [{ "name": "agent-name", "required": false }] }, "hooks": [] } - Validate fields against
templates/schema.json - Ensure referenced component files exist under
templates/ - Preview with
zcc packs show <pack>and install withzcc init -p <pack>
Hook Development
- Create hook definition JSON in templates/hooks/
- Create corresponding shell script
- Define trigger events and configuration options
- Test with real Claude Code interactions
StarterPackManager API
The StarterPackManager class handles pack operations:
import { StarterPackManager } from '../lib/StarterPackManager';
const manager = new StarterPackManager(projectRoot);
// List available packs
const packs = await manager.listPacks();
// Load specific pack
const pack = await manager.loadPack('essentials');
// Resolve dependencies
const deps = await manager.resolveDependencies('essentials');
// Install pack
const result = await manager.installPack('essentials', { force: true });
// Show installed packs
const installed = await manager.getInstalledPacks();
// Uninstall pack
await manager.uninstallPack('essentials');Key Features:
- JSON schema validation against
templates/starter-packs/schema.json - Component reference validation (ensures modes/workflows/agents exist)
- Dependency resolution with circular dependency detection
- Installation simulation (actual installation in Phase 2)
Testing Guidelines for Starter Packs
- Schema Validation: Test pack definitions against JSON schema
- Component References: Ensure all referenced components exist
- Dependency Resolution: Test dependency chains and circular detection
- Installation Simulation: Verify pack installation logic
- Error Handling: Test invalid packs, missing components, conflicts
Example test structure:
describe('StarterPackManager', () => {
it('should load valid pack', async () => {
const pack = await manager.loadPack('frontend-react');
expect(pack.name).toBe('frontend-react');
});
it('should validate pack schema', async () => {
const result = await manager.validatePack(validPackData);
expect(result.valid).toBe(true);
});
});Code Style
- TypeScript with strict mode
- CommonJS modules for Node.js compatibility
- Async/await for asynchronous operations
- Comprehensive error messages for CLI users
Dependencies
- commander: CLI framework
- inquirer: Interactive prompts
- esbuild: Build tool
- jest/ts-jest: Testing framework
- ajv: JSON schema validation for starter packs
Recent Enhancements
The zsh Philosophy Implementation
- Fuzzy Matching: Like zsh's smart completions (
eng→engineer,apm→autonomous-project-manager) - Plugin System: Agents work like zsh plugins - modular, focused, composable
- Theme System: Modes are like themes - completely change behavior/personality
- Configuration Hierarchy: Like zsh's config loading (defaults → global → project → env)
- Hook System: Event-driven automation like zsh hooks (precmd, preexec, chpwd)
- Alias System: Custom commands work like zsh aliases
Starter Packs System
- Current: Functional pack loading, dependency resolution, installation, and uninstall
- Validation: Manifest and component reference checking
- Available Packs:
essentials,advanced-code-refactoring - Management: StarterPackManager handles list/show/install/uninstall
Coming Soon (oh-my-zcc)
- More Packs: Backend API, DevOps, Data Science starter packs
- ~/.zcc/config.yaml: Global config file (unified structure with project config)
- Community Hub: Share modes/workflows (like awesome-zsh-plugins)
- Plugin Manager: Easy installation/updates (like zplug, zinit)
- Visual Configurator: GUI setup (like zsh configuration tools)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

