This document provides guidelines for AI coding agents working on the @zzclub/z-cli project.
🔴 P0 - Critical Priority Project
This project is classified as P0 (highest priority) because:
-
Agent-First Interaction Model: CLI is the optimal interface for AI Agent workflows. As Agent technology becomes mainstream, CLI tools serve as the primary touchpoint for human-agent collaboration.
-
Automation Gateway: This CLI will be integrated into all future automation workflows, serving as a bridge between Agent reasoning and system operations.
-
Productivity Multiplier: Direct CLI access enables Agents to perform complex operations (image compression, i18n management) without UI friction, dramatically increasing workflow efficiency.
-
Extensibility Foundation: As more Agent-compatible workflows are identified, they will be integrated into this CLI, making it the central command hub for zzclub's automation ecosystem.
Strategic Goal: Transform z-cli from a utility tool into the primary interface for Agent-driven development workflows.
@zzclub/z-cli is a high-performance CLI toolbox built for Agent-driven workflows and daily efficiency enhancement. Currently focused on image compression with Sharp, designed for seamless integration into AI Agent automation pipelines.
- Language: TypeScript (compiled to ES Modules)
- Runtime: Node.js >= 18.18.0 | Bun >= 1.0.0 (primary development environment)
- Package Manager: Bun 1.3.7+ (locked via
packageManagerfield) - Type: Native CLI implementation with full TypeScript support
- Framework: Minimal CLI framework (Commander) for argument parsing + default help; the rest stays lightweight and native
# Release commands (version bump + publish)
bun run release # Patch version bump
bun run release:patch # Same as above
bun run release:minor # Minor version bump
bun run release:major # Major version bump
bun run release:main # Release v1.0.0
# Manual testing (no test suite exists)
# Test commands by running them directly:
z <command> --help # View command help
zz <command> [options] # Test specific commandsThere is no automated test suite. Test commands manually by running them directly with z or zz command.
No ESLint or Prettier configuration exists. Follow the observed code style patterns in existing TypeScript files.
- TypeScript: Full type safety, compile to ES Modules
- Consola: Unified logging (replaces ora/chalk patterns)
- Sharp: High-performance image processing
- Commander: Argument parsing + default help output (avoid hand-rolled argv/help)
src/
├── commands/ # Command implementations
│ ├── config.ts # Config viewing/management
│ ├── set.ts # Config updates
│ └── tiny/ # Image compression module
├── core/ # Core utilities
│ ├── config-manager.ts
│ └── logger.ts
├── types/ # TypeScript type definitions
└── index.ts # CLI entry point
- Config location:
- Linux:
~/.config/zzclub-z-cli/config.json(or$XDG_CONFIG_HOME/zzclub-z-cli/config.json) - macOS:
~/Library/Application Support/zzclub-z-cli/config.json - Windows:
%APPDATA%\zzclub-z-cli\config.json
- Linux:
- Default config:
config.default.jsonat project root - Access via
ConfigManager.load()andConfigManager.save()
- ES Modules: Use
.jsextensions in imports (TypeScript compiles to .js) - Import Order: Node.js built-ins → third-party → local modules
- Node.js Prefix: Use
node:prefix for built-ins (e.g.,import fs from 'node:fs') - Type Safety: Never use
as anyor@ts-ignore
- Use
try/catchfor async operations - Use Consola for user feedback (replaces ora spinners)
- Exit with
process.exit(1)on fatal errors - Always validate file paths to prevent directory traversal
- Manual testing only (no automated test suite)
- Test commands directly:
zz tiny -f ./demo -r - Verify error handling with invalid inputs
To stay consistent with the README's core idea (“move scripts into z-cli, keep Skills thin”), all feature logic / automation scripts MUST live in z-cli as CLI commands. Skills are only a lightweight description layer that tells an agent how to call those commands.
- Implement feature logic under
src/commands/and register it insrc/index.ts. - Skills MUST NOT contain heavy scripting or duplicated implementations.
- Skills should include: intent description + a few example invocations (prefer
bunx @zzclub/z-cli ...) + minimal argument mapping when unavoidable.
- Skills should include: intent description + a few example invocations (prefer
When this project adds/changes requirements, commands, flags, outputs, or workflows, you MUST sync the corresponding docs in:
/root/code/zzclub/skills/z-cli
Minimum required updates in the skills repo:
- Create/update
references/<command>.mdfor the command. - Update
SKILL.mdrouting/links so agents can discover the new/changed command. - If config/defaults changed, update
references/config.mdand/orreferences/set.md.
After updating the skills repo, you MUST:
- auto-generate an appropriate commit message (follow the repo's
feat/docs/chore:style) - commit the changes in the skills repo
- push the commit to the remote (no force push)
- When adding new automation:
- Add/extend the CLI command in
src/commands/. - Ensure help/usage is clear via CLI
--help. - Update the corresponding skill references to show the new CLI invocation.
- Add/extend the CLI command in
- Default: one commit per fully completed requirement (end-to-end, verified), unless the user explicitly asks for a different granularity (e.g. split commits, squash, or no commit).
- Do not create partial “WIP” commits in this repo.
- Always run
bun run type-check(andbun run buildwhen relevant) before committing.
- Module System: Never use
require()- this is ES Modules only - Import Extensions: Always include
.jsin imports (compiled output) - File Paths: Use
path.resolve(process.cwd(), filePath)for relative paths - Security: Validate all user input, especially file paths
- Dependencies: Minimize new dependencies - prefer standard library
- Adding Commands: Create in
src/commands/, register insrc/index.ts - Testing: Use
bun run devfor development testing - Type Checking: Run
bun run type-checkbefore committing - Releasing: Use
bun run release:patch|minor|major(automated via changelogen)
Last Updated: January 2026 Maintainer: aatrox Repository: https://github.com/aatrooox/z-cli