-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Overview
Define the complete command structure for the infra (Infrastructure Engineer) role following the four-layer semantic structure from Issue #12.
Role Definition: infra represents the Infrastructure/Platform Engineer responsible for:
- Project scaffolding and initialization
- Monorepo structure management
- Workspace setup (apps, services, packages)
- Development environment configuration
Command Pattern:
nodespec infra [domain] [action] [object?] [...args]Domain: monorepo
Monorepo-level operations, working at project root (./)
Commands
nodespec infra monorepo init [name?]
Initialize a new monorepo in current directory or create a new directory
Parameters:
[name]- Optional project name. If provided, creates new directory--template <template>- Template to use (default:basic)--package-manager <pm>- Package manager (default:pnpm)
Examples:
nodespec infra monorepo init # Init in current dir
nodespec infra monorepo init my-project # Create my-project/
nodespec infra monorepo init --template full # Use full templatenodespec infra monorepo info
Display monorepo information
Parameters:
--verbose, -v- Show detailed information
Examples:
nodespec infra monorepo info
nodespec infra monorepo info --verbosenodespec infra monorepo validate
Validate monorepo structure and configuration
Parameters:
--fix- Auto-fix issues if possible
Examples:
nodespec infra monorepo validate
nodespec infra monorepo validate --fixDomain: app
Application workspace operations, working in apps/ directory
Commands
nodespec infra app add <name>
Add a new application to the monorepo
Parameters:
<name>- Required app name (will be used as directory name if no scope)--package-name <name>- Full package name with scope (e.g.,@myproject/cli)--template <template>- Template to use (default:cli)
Examples:
nodespec infra app add my-cli
nodespec infra app add my-cli --package-name @myproject/cli
nodespec infra app add web --template reactnodespec infra app list
List all applications in the monorepo
Parameters:
--verbose, -v- Show detailed information (location, version, dependencies)
Examples:
nodespec infra app list
nodespec infra app list --verbosenodespec infra app remove <name>
Remove an application from the monorepo
Parameters:
<name>- Required app name or package name--force, -f- Skip confirmation prompt
Examples:
nodespec infra app remove my-cli
nodespec infra app remove @myproject/cli --forcenodespec infra app validate <name?>
Validate application structure and configuration
Parameters:
<name>- Optional app name. If omitted, validates all apps--fix- Auto-fix issues if possible
Examples:
nodespec infra app validate # Validate all apps
nodespec infra app validate my-cli # Validate specific app
nodespec infra app validate my-cli --fixDomain: service
Service workspace operations, working in services/ directory
Commands
nodespec infra service add <name>
Add a new service to the monorepo
Parameters:
<name>- Required service name--package-name <name>- Full package name with scope--template <template>- Template to use (default:express)--port <port>- Default port number
Examples:
nodespec infra service add api-gateway
nodespec infra service add api-gateway --package-name @myproject/api-gateway
nodespec infra service add auth --template fastify --port 3001nodespec infra service list
List all services in the monorepo
Parameters:
--verbose, -v- Show detailed information
Examples:
nodespec infra service list
nodespec infra service list --verbosenodespec infra service remove <name>
Remove a service from the monorepo
Parameters:
<name>- Required service name or package name--force, -f- Skip confirmation prompt
Examples:
nodespec infra service remove api-gateway
nodespec infra service remove @myproject/api-gateway --forcenodespec infra service validate <name?>
Validate service structure and configuration
Parameters:
<name>- Optional service name. If omitted, validates all services--fix- Auto-fix issues if possible
Examples:
nodespec infra service validate
nodespec infra service validate api-gateway --fixDomain: package
Package workspace operations, working in packages/ directory
Commands
nodespec infra package add <name>
Add a new package to the monorepo
Parameters:
<name>- Required package name--package-name <name>- Full package name with scope--template <template>- Template to use (default:lib)
Examples:
nodespec infra package add my-lib
nodespec infra package add utils --package-name @myproject/utils
nodespec infra package add config --template tsconfignodespec infra package list
List all packages in the monorepo
Parameters:
--verbose, -v- Show detailed information
Examples:
nodespec infra package list
nodespec infra package list --verbosenodespec infra package remove <name>
Remove a package from the monorepo
Parameters:
<name>- Required package name or package name--force, -f- Skip confirmation prompt
Examples:
nodespec infra package remove my-lib
nodespec infra package remove @myproject/utils --forcenodespec infra package validate <name?>
Validate package structure and configuration
Parameters:
<name>- Optional package name. If omitted, validates all packages--fix- Auto-fix issues if possible
Examples:
nodespec infra package validate
nodespec infra package validate my-lib --fixDomain: config
Configuration workspace operations, working in packages/ directory (config packages)
Commands
nodespec infra config init <type>
Initialize a configuration package
Parameters:
<type>- Required config type:eslint,prettier,typescript,vitest,tsup, etc.--package-name <name>- Full package name with scope
Examples:
nodespec infra config init eslint
nodespec infra config init typescript --package-name @myproject/typescript-confignodespec infra config list
List all configuration packages
Parameters:
--verbose, -v- Show detailed information
Examples:
nodespec infra config list
nodespec infra config list --verbosenodespec infra config validate <type?>
Validate configuration package
Parameters:
<type>- Optional config type. If omitted, validates all config packages--fix- Auto-fix issues if possible
Examples:
nodespec infra config validate
nodespec infra config validate eslint --fixDesign Principles
Following Issue #12:
- Four-layer semantic structure:
[role] [domain] [action] [object?] [...args] - Domain maps to directory structure: Clear workspace boundaries
- Consistent action verbs: Same action means same behavior across domains
- Optional object parameter: Depends on action semantics
- AI-first design: Predictable patterns, explicit semantics
Related Issues
- CLI Design Principles: Four-Layer Semantic Structure for AI-First Development #12 - CLI Design Principles: Four-Layer Semantic Structure
- Three-layer CLI command structure: optimized for AI pattern recognition #11 - Original CLI structure discussion
Implementation Notes
- All commands should be implemented with corresponding BDD feature files
- Feature file structure:
features/infra/[domain]/[action]/[action].feature - Validate monorepo context before executing domain commands
- Consistent error messages and user feedback