@paths.design/caws-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,222 @@
1
+ # CAWS CLI
2
+
3
+ A command-line tool for scaffolding and initializing projects with the **Coding Agent Workflow System (CAWS)**.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Install globally from npm registry (recommended)
9
+ npm install -g @paths.design/caws-cli
10
+
11
+ # Install locally in a project
12
+ npm install --save-dev @paths.design/caws-cli
13
+
14
+ # Or install directly from the caws-cli directory during development
15
+ cd caws-cli
16
+ npm install -g .
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Initialize New Project
22
+ ```bash
23
+ # Interactive setup (recommended)
24
+ caws init my-new-project
25
+
26
+ # Non-interactive with defaults
27
+ caws init my-new-project --non-interactive
28
+
29
+ # Skip git initialization
30
+ caws init my-new-project --no-git
31
+ ```
32
+
33
+ ### Scaffold Existing Project
34
+ ```bash
35
+ # Add CAWS components to existing project
36
+ caws scaffold
37
+
38
+ # Force overwrite existing files
39
+ caws scaffold --force
40
+ ```
41
+
42
+ ### Version Information
43
+ ```bash
44
+ caws --version
45
+ caws version
46
+ ```
47
+
48
+ ## Commands
49
+
50
+ ### `caws init <project-name>` (alias: `i`)
51
+ Initialize a new project with CAWS scaffolding.
52
+
53
+ **Options:**
54
+ - `-i, --interactive`: Run interactive setup (default: true)
55
+ - `-g, --git`: Initialize git repository (default: true)
56
+ - `-n, --non-interactive`: Skip interactive prompts
57
+
58
+ ### `caws scaffold` (alias: `s`)
59
+ Add CAWS components to an existing project.
60
+
61
+ **Options:**
62
+ - `-f, --force`: Overwrite existing files
63
+
64
+ ### `caws version` (alias: `v`)
65
+ Show version and system information.
66
+
67
+ ## Interactive Setup
68
+
69
+ When running `caws init` interactively, you'll be prompted for:
70
+
71
+ 1. **Project ID**: Ticket system identifier (e.g., FEAT-1234)
72
+ 2. **Project Title**: Descriptive name
73
+ 3. **Risk Tier**: 1 (critical), 2 (standard), 3 (low risk)
74
+ 4. **Mode**: feature, refactor, fix, doc, or chore
75
+ 5. **Change Budget**: File and line-of-code limits
76
+ 6. **Scope**: What's in/out of scope for the project
77
+ 7. **Requirements**: Functional and non-functional requirements
78
+ 8. **Contracts**: API specifications and paths
79
+ 9. **Observability**: Logging, metrics, and tracing setup
80
+ 10. **Migration Plan**: Database and deployment strategy
81
+
82
+ ## Project Structure
83
+
84
+ The CLI creates a complete CAWS project structure:
85
+
86
+ ```
87
+ project-name/
88
+ ├── .caws/ # CAWS configuration
89
+ │ ├── policy/tier-policy.json # Risk tier definitions
90
+ │ ├── schemas/ # JSON schemas
91
+ │ ├── templates/ # PR templates
92
+ │ └── working-spec.yaml # Project specification
93
+ ├── .agent/ # Provenance artifacts
94
+ ├── apps/tools/caws/ # CAWS utilities
95
+ ├── codemod/ # AST transformation scripts
96
+ ├── docs/ # Documentation
97
+ ├── tests/ # Test directories
98
+ ├── .github/workflows/caws.yml # CI/CD pipeline
99
+ ├── agents.md # CAWS framework guide
100
+ └── README.md # Project documentation
101
+ ```
102
+
103
+ ## Features
104
+
105
+ - 🚀 **Quick Start**: Complete project scaffolding in minutes
106
+ - 🔧 **Interactive Setup**: Guided configuration process with validation
107
+ - 📋 **Template Generation**: Working specifications and PR templates
108
+ - 🛠️ **Tool Integration**: Pre-configured development tools with quality gates
109
+ - 📦 **Provenance Ready**: SBOM and attestation setup with trust scoring
110
+ - 🔒 **Quality Gates**: Pre-configured CI/CD pipelines with automated validation
111
+ - ✅ **Schema Validation**: JSON Schema validation of working specifications
112
+ - 🧪 **Developer Tools**: Linting, testing, and formatting setup
113
+ - 🔍 **Security Scanning**: Prompt linting and secret detection
114
+ - 📊 **Trust Scoring**: Automated quality assessment and scoring
115
+
116
+ ## Configuration
117
+
118
+ ### Working Specification
119
+ The CLI generates a comprehensive `.caws/working-spec.yaml` that includes:
120
+ - Project metadata and scope
121
+ - Risk tier and mode classification
122
+ - Change budget constraints
123
+ - Acceptance criteria and invariants
124
+ - Non-functional requirements
125
+ - Observability configuration
126
+ - Migration and rollback strategies
127
+
128
+ ### CI/CD Pipeline
129
+ Includes GitHub Actions workflow with:
130
+ - Scope and budget validation
131
+ - Static analysis and security scanning
132
+ - Unit and integration testing
133
+ - Performance and accessibility checks
134
+ - Provenance and attestation generation
135
+
136
+ ## Examples
137
+
138
+ ### New Feature Project
139
+ ```bash
140
+ caws init user-auth-service
141
+ # Follows interactive prompts for authentication service setup
142
+ ```
143
+
144
+ ### Refactoring Existing Codebase
145
+ ```bash
146
+ caws init legacy-refactor --non-interactive
147
+ # Creates refactor mode specification with appropriate constraints
148
+ ```
149
+
150
+ ### Documentation Project
151
+ ```bash
152
+ caws init api-docs
153
+ # Sets up doc mode with appropriate scope and budget
154
+ ```
155
+
156
+ ## Requirements
157
+
158
+ - **Node.js**: >= 16.0.0
159
+ - **npm**: For package management
160
+ - **Git**: For version control (optional)
161
+
162
+ ## Development
163
+
164
+ ### Running Locally
165
+ ```bash
166
+ cd caws-cli
167
+ npm install
168
+ npm start init my-test-project
169
+ ```
170
+
171
+ ### Testing
172
+ ```bash
173
+ npm test # Run tests with linting
174
+ npm run test:watch # Run tests in watch mode
175
+ ```
176
+
177
+ ### Linting & Formatting
178
+ ```bash
179
+ npm run lint # Run ESLint
180
+ npm run lint:fix # Fix ESLint issues
181
+ npm run format # Format with Prettier
182
+ ```
183
+
184
+ ### Development Tools
185
+ The CLI includes comprehensive development tooling:
186
+ - **ESLint**: Code quality and consistency
187
+ - **Prettier**: Code formatting
188
+ - **Jest**: Unit testing framework
189
+ - **Schema Validation**: JSON Schema validation of working specs
190
+ - **Quality Gates**: Automated trust scoring and validation
191
+
192
+ ## Architecture
193
+
194
+ The CLI is built with:
195
+ - **Commander.js**: Command-line interface framework
196
+ - **Inquirer.js**: Interactive prompt library
197
+ - **fs-extra**: Enhanced file system operations
198
+ - **js-yaml**: YAML parsing and generation
199
+
200
+ ## Contributing
201
+
202
+ 1. Fork the repository
203
+ 2. Create feature branch
204
+ 3. Add tests for new functionality
205
+ 4. Ensure CLI still works with existing templates
206
+ 5. Submit pull request
207
+
208
+ ## License
209
+
210
+ MIT - see LICENSE file for details.
211
+
212
+ ## Support
213
+
214
+ - 📖 **Documentation**: See inline help with `caws --help`
215
+ - 🐛 **Issues**: Report bugs or request features
216
+ - 🤝 **Contributing**: See contributing guidelines
217
+
218
+ ---
219
+
220
+ **Author**: @darianrosebrook
221
+ **Version**: 1.0.0
222
+ **CAWS**: v1.0
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Generate working spec YAML with user input
4
+ * @param {Object} answers - User responses
5
+ * @returns {string} - Generated YAML content
6
+ */
7
+ export function generateWorkingSpec(answers: any): string;
8
+ /**
9
+ * Validate generated working spec against JSON schema
10
+ * @param {string} specContent - YAML spec content
11
+ * @param {Object} answers - User responses for error context
12
+ */
13
+ export function validateGeneratedSpec(specContent: string, _answers: any): void;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAiLA;;;;GAIG;AACH,mDAFa,MAAM,CAmHlB;AAED;;;;GAIG;AACH,mDAHW,MAAM,uBA8BhB"}