ripp-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,292 @@
1
+ # RIPP CLI
2
+
3
+ Official command-line tool for working with Regenerative Intent Prompting Protocol (RIPP) packets.
4
+
5
+ ## Installation
6
+
7
+ ### Global Install (Recommended)
8
+
9
+ ```bash
10
+ npm install -g ripp-cli
11
+ ```
12
+
13
+ ### From Source
14
+
15
+ ```bash
16
+ git clone https://github.com/Dylan-Natter/ripp-protocol.git
17
+ cd ripp-protocol/tools/ripp-cli
18
+ npm install
19
+ npm link
20
+ ```
21
+
22
+ ## Commands
23
+
24
+ ### Init
25
+
26
+ Initialize RIPP in your repository with proper scaffolding.
27
+
28
+ ```bash
29
+ # Initialize RIPP
30
+ ripp init
31
+
32
+ # Force overwrite existing files
33
+ ripp init --force
34
+ ```
35
+
36
+ **What it creates:**
37
+
38
+ - `ripp/` - Main directory for RIPP artifacts
39
+ - `ripp/README.md` - Documentation about RIPP in your repo
40
+ - `ripp/features/` - Directory for feature RIPP packets
41
+ - `ripp/intent-packages/` - Directory for packaged artifacts
42
+ - `ripp/intent-packages/README.md` - Intent package documentation
43
+ - `.github/workflows/ripp-validate.yml` - GitHub Action for automated validation
44
+
45
+ **Options:**
46
+
47
+ - `--force` - Overwrite existing files (default: skip existing files)
48
+
49
+ **Features:**
50
+
51
+ - Idempotent (safe to run multiple times)
52
+ - Non-destructive by default (preserves existing files)
53
+ - Creates complete scaffolding in one command
54
+ - Includes GitHub Actions workflow for CI/CD
55
+
56
+ ### Validate
57
+
58
+ Validate RIPP packets against the JSON Schema.
59
+
60
+ ```bash
61
+ # Validate a single file
62
+ ripp validate my-feature.ripp.yaml
63
+
64
+ # Validate a directory
65
+ ripp validate features/
66
+
67
+ # Enforce minimum RIPP level
68
+ ripp validate api/ --min-level 2
69
+
70
+ # Suppress warnings
71
+ ripp validate . --quiet
72
+ ```
73
+
74
+ **Options:**
75
+
76
+ - `--min-level <1|2|3>` - Enforce minimum conformance level
77
+ - `--quiet` - Suppress warnings
78
+
79
+ ### Lint
80
+
81
+ Check RIPP packets for best practices beyond schema validation.
82
+
83
+ ```bash
84
+ # Lint files in a directory
85
+ ripp lint examples/
86
+
87
+ # Treat warnings as errors
88
+ ripp lint examples/ --strict
89
+
90
+ # Custom output directory
91
+ ripp lint specs/ --output ./build/reports/
92
+ ```
93
+
94
+ **Options:**
95
+
96
+ - `--strict` - Treat warnings as errors (fail on warnings)
97
+ - `--output <dir>` - Output directory for reports (default: `reports/`)
98
+
99
+ **Output:**
100
+
101
+ - `reports/lint.json` - Machine-readable report
102
+ - `reports/lint.md` - Human-readable Markdown report
103
+
104
+ **Lint Rules:**
105
+
106
+ - Missing critical sections (out_of_scope, assumptions, security NFRs)
107
+ - Undefined ID references in schema_ref
108
+ - Placeholder text (TODO, TBD, example.com)
109
+ - Missing or vague verification steps
110
+
111
+ ### Package
112
+
113
+ Package a RIPP packet into a normalized handoff artifact.
114
+
115
+ ```bash
116
+ # Package to Markdown (handoff doc)
117
+ ripp package --in feature.ripp.yaml --out handoff.md
118
+
119
+ # Package to JSON
120
+ ripp package --in feature.ripp.yaml --out packaged.json
121
+
122
+ # Package to YAML
123
+ ripp package --in feature.ripp.yaml --out normalized.yaml
124
+
125
+ # Explicit format specification
126
+ ripp package --in feature.ripp.yaml --out artifact --format json
127
+ ```
128
+
129
+ **Options:**
130
+
131
+ - `--in <file>` - Input RIPP packet file (required)
132
+ - `--out <file>` - Output file path (required)
133
+ - `--format <json|yaml|md>` - Output format (auto-detected from extension)
134
+
135
+ **Features:**
136
+
137
+ - Validates input before packaging
138
+ - Normalizes packet structure
139
+ - Removes empty optional fields
140
+ - Adds packaging metadata
141
+ - Read-only (never modifies source)
142
+
143
+ ### Analyze
144
+
145
+ Generate a DRAFT RIPP packet from existing code or schemas.
146
+
147
+ ```bash
148
+ # Analyze OpenAPI specification
149
+ ripp analyze openapi.json --output draft-api.ripp.yaml
150
+
151
+ # Analyze JSON Schema
152
+ ripp analyze schema.json --output draft.ripp.yaml --packet-id my-feature
153
+ ```
154
+
155
+ **Options:**
156
+
157
+ - `<input>` - Input file (OpenAPI spec or JSON Schema)
158
+ - `--output <file>` - Output DRAFT RIPP packet file (required)
159
+ - `--packet-id <id>` - Packet ID for generated RIPP (default: `analyzed`)
160
+
161
+ **⚠️ Important:**
162
+
163
+ - Generated packets are always **DRAFT** (status: 'draft')
164
+ - Output contains TODO markers requiring human review
165
+ - Extracts only observable facts from code/schemas
166
+ - **Never guesses** intent, business logic, or failure modes
167
+ - **Requires human review** before use
168
+
169
+ **Supported Inputs:**
170
+
171
+ - OpenAPI 3.0 specifications
172
+ - Swagger 2.0 specifications
173
+ - JSON Schema
174
+
175
+ ## Exit Codes
176
+
177
+ - `0` - All checks passed
178
+ - `1` - Validation or lint failures found
179
+
180
+ ## What It Validates
181
+
182
+ ✓ **Schema Conformance**: Validates against JSON Schema
183
+ ✓ **Required Sections**: Ensures all required sections for declared level are present
184
+ ✓ **File Naming**: Checks `.ripp.yaml` or `.ripp.json` extension
185
+ ✓ **Data Integrity**: Validates packet_id format, date formats, status values
186
+ ✓ **Level Conformance**: Ensures Level 2/3 sections are present when declared
187
+
188
+ ## Example Output
189
+
190
+ **Validation Success:**
191
+
192
+ ```
193
+ ✓ item-creation.ripp.yaml is valid (Level 3)
194
+ ✓ webhook-feature.ripp.yaml is valid (Level 2)
195
+
196
+ ✓ All 2 RIPP packets are valid.
197
+ ```
198
+
199
+ **Validation Failure:**
200
+
201
+ ```
202
+ ✗ user-registration.ripp.yaml
203
+ • /purpose: must have required property 'problem'
204
+ • /status: must be equal to one of the allowed values
205
+ • Packet is Level 2, but missing section: permissions
206
+
207
+ ✗ 1 of 1 RIPP packets failed validation.
208
+ ```
209
+
210
+ **Linting:**
211
+
212
+ ```
213
+ Linting RIPP packets...
214
+ ✗ draft-api.ripp.yaml - 2 error(s), 5 warning(s)
215
+ ✓ feature.ripp.yaml - No issues
216
+
217
+ 📄 JSON report: reports/lint.json
218
+ 📄 Markdown report: reports/lint.md
219
+
220
+ ✗ Found 2 error(s) and 5 warning(s)
221
+ ```
222
+
223
+ ## CI Integration
224
+
225
+ ### GitHub Actions
226
+
227
+ ```yaml
228
+ - name: Setup Node.js
229
+ uses: actions/setup-node@v4
230
+ with:
231
+ node-version: '18'
232
+
233
+ - name: Install RIPP CLI
234
+ run: npm install -g ripp-cli
235
+
236
+ - name: Validate RIPP Packets
237
+ run: ripp validate .
238
+
239
+ - name: Lint RIPP Packets (strict)
240
+ run: ripp lint specs/ --strict
241
+ ```
242
+
243
+ ### GitLab CI
244
+
245
+ ```yaml
246
+ validate-ripp:
247
+ image: node:18
248
+ script:
249
+ - npm install -g ripp-cli
250
+ - ripp validate .
251
+ - ripp lint specs/ --strict
252
+ ```
253
+
254
+ ## Development
255
+
256
+ ### Install Dependencies
257
+
258
+ ```bash
259
+ npm install
260
+ ```
261
+
262
+ ### Test Locally
263
+
264
+ ```bash
265
+ ./index.js validate ../../examples/
266
+ ./index.js lint ../../examples/
267
+ ./index.js package --in ../../examples/item-creation.ripp.yaml --out /tmp/test.md
268
+ ```
269
+
270
+ ### Link for Development
271
+
272
+ ```bash
273
+ npm link
274
+ ripp validate ../../examples/
275
+ ```
276
+
277
+ ## Dependencies
278
+
279
+ - **ajv**: JSON Schema validator
280
+ - **ajv-formats**: Format validators for ajv
281
+ - **js-yaml**: YAML parser
282
+ - **glob**: File pattern matching
283
+
284
+ ## License
285
+
286
+ MIT
287
+
288
+ ## Links
289
+
290
+ - **Documentation**: [https://dylan-natter.github.io/ripp-protocol](https://dylan-natter.github.io/ripp-protocol)
291
+ - **Repository**: [https://github.com/Dylan-Natter/ripp-protocol](https://github.com/Dylan-Natter/ripp-protocol)
292
+ - **Issues**: [https://github.com/Dylan-Natter/ripp-protocol/issues](https://github.com/Dylan-Natter/ripp-protocol/issues)