Skip to content
Development
Command

/xnew

Initialize a new project with comprehensive CLAUDE.md and specification framework

From plugin
claude-code
11045 skills45 commands29 hooks

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/xnew

Context preview

What this command does when you run it.

Initialize a new project with comprehensive CLAUDE.md and specification framework

Command definition

xnew.md
description: "Initialize a new project with comprehensive CLAUDE.md and specification framework"
tags: ["project", "setup", "initialization"]

Initialize repo with comprehensive CLAUDE.md + Specification-Driven Development

Initialize a new project with comprehensive CLAUDE.md and specification framework.

Usage

/xnew <project_name> [stack]

Examples

/xnew vibecoding-web node
/xnew ai-patterns python
/xnew microservice-api go

Parameters

  • **PROJECT_NAME**: First word in arguments (default: current folder name)
  • **STACK**: Technology stack (choices: `python` | `node` | `go` | `java` | `mixed`; default: `mixed`)

Execution

Perform the following steps in order:

Step 1: Safety & Idempotence

  • Check for existing files before overwriting
  • Create timestamped backups for any existing files (format: `filename.bak-YYYYMMDD-HHMMSS`)
  • Never overwrite without backup creation

Step 2: Create Comprehensive CLAUDE.md

Generate CLAUDE.md with Specification-Driven Development methodology:

# Project: $PROJECT_NAME
# Stack: $STACK
# Generated: $(date +%Y-%m-%d)
# Development Methodology: Specification-Driven Development (SDD)

This is the single source of truth for all development standards, conventions, rules, and specifications for this project. Claude Code and other AI assistants should read this file first and follow these guidelines for all operations.

## ๐Ÿ“š Specification-Driven Development

This project follows Specification-Driven Development (SDD) methodology. All features MUST have specifications before implementation.

### Specification Framework
specs/
โ”œโ”€โ”€ README.md                    # Specification guide and navigation
โ”œโ”€โ”€ requirements.md             # EARS-formatted requirements
โ”œโ”€โ”€ design.md                   # Technical architecture and design
โ”œโ”€โ”€ tasks.md                    # Atomic, sequenced implementation tasks
โ”œโ”€โ”€ mvp-summary.md             # MVP vs Advanced feature separation
โ”œโ”€โ”€ testing-requirements.md    # Test coverage requirements
โ”œโ”€โ”€ performance-benchmarks.md  # Performance targets and metrics
โ”œโ”€โ”€ user-testing-strategy.md   # User validation approach
โ”œโ”€โ”€ system-monitoring.md       # Operational monitoring strategy
โ”œโ”€โ”€ hooks.md                   # Development lifecycle automation
โ”œโ”€โ”€ agents.md                  # Multi-agent orchestration
โ”œโ”€โ”€ context.md                 # Data classification and context management
โ””โ”€โ”€ github-actions-requirements.md  # CI/CD automation specs

### AWS Kiro EARS Requirements Pattern
All Requirements Now Follow Official EARS Syntax:

- **Event-Driven**: "When [trigger], the system shall [response]"
- **State-Driven**: "While [precondition], the system shall [response]"
- **Ubiquitous**: "The system shall [response]"
- **Optional Feature**: "Where [feature], the system shall [response]"
- **Unwanted Behavior**: "If [trigger], then the system shall [response]"

The validation tool now shows **100% EARS compliance**

### Specification Coverage Requirements
- Every feature must have corresponding specifications
- Every specification must have corresponding tests
- Minimum spec coverage: 95% of all features
- Spec-to-test mapping: Automated validation required
- **EARS compliance: 100% mandatory for all requirements**

### EARS Validation Rules
๐Ÿšจ **MANDATORY COMPLIANCE**:
- All requirements MUST use exact AWS Kiro EARS syntax with brackets
- No exceptions allowed - 100% compliance required
- Validation tool enforces strict format checking
- Requirements failing EARS format are rejected automatically

**EARS Format Validation Examples**:
โœ… CORRECT: "When [user clicks save], the system shall [persist data to database]"
โœ… CORRECT: "While [backup is running], the system shall [display progress indicator]" 
โœ… CORRECT: "The system shall [authenticate users before access]"
โœ… CORRECT: "Where [admin privileges], the system shall [allow user management]"
โœ… CORRECT: "If [network timeout occurs], then the system shall [retry 3 times]"

โŒ INCORRECT: "User can save data" (not EARS format)
โŒ INCORRECT: "System should authenticate" (missing brackets)
โŒ INCORRECT: "When user saves, validate" (incomplete structure)

## ๐ŸŽฏ Project Goals & Context
- Primary objective: [Define main goal and success metrics]
- Technical requirements: [Core technical needs and constraints]
- Business objectives: [Business value delivered]
- User value: [What users gain from this system]
- Development methodology: Specification-Driven Development (SDD)

## ๐Ÿ“‹ Requirements Management

### Requirements Framework (AWS Kiro EARS)
requirement_structure:
  id: "REQ-XXX"
  pattern: "Event-Driven|State-Driven|Ubiquitous|Optional|Unwanted"
  requirement: "MUST follow exact EARS syntax with brackets"
  ears_format_examples:
    - "When [user submits form], the system shall [validate all fields]"
    - "While [user is authenticated], the system shall [display user dashboard]"  
    - "The system shall [encrypt all data at rest]"
    - "Where [premium feature enabled], the system shall [allow advanced analytics]"
    - "If [invalid login attempt], then the system shall [lock account after 3 failures]"
  rationale: "Why this requirement exists"
  acceptance_criteria: "Testable criteria for validation"
  priority: "MVP|ADVANCED"
  ears_compliance: "MANDATORY - 100% compliance required"

### MVP vs Advanced Features
- MVP Features: Core functionality for initial release
- Advanced Features: Enhanced capabilities for future iterations
- Decision Framework:
  - โœ… Include in MVP if: Essential for core workflow
  - โš ๏ธ Move to Advanced if: Complex edge cases or optimizations

## ๐Ÿ“ Directory Structure
project/
โ”œโ”€โ”€ src/                        # Source code
โ”œโ”€โ”€ tests/                     # Test suites
โ”‚   โ””โ”€โ”€ specs/                # Specification compliance tests
โ”œโ”€โ”€ specs/                     # SPECIFICATIONS (CRITICAL)
โ”‚   โ”œโ”€โ”€ README.md            # Specification navigation guide
โ”‚   โ”œโ”€โ”€ requirements.md      # EARS-formatted requirements
โ”‚   โ”œโ”€โ”€ design.m
Read more
Ships withclaude-code

Transform Claude Code into a complete development platform with 45 AI-powered commands that automate your entire software development workflow. Now with improved git identity management!

Get the whole plugin

Other commands on claude-code.