rgen-tool 0.1.0

rgen is a deterministic, language-agnostic code generation framework that treats software artifacts as projections of knowledge graphs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
# Test Scenarios for rgen CLI

**Purpose:** Comprehensive test scenarios mapping all CLI commands to Jobs To Be Done (JTBD) to ensure complete functionality coverage.

**Status:** 46/46 unit tests passing ✅ | BDD infrastructure ready ✅

---

## Table of Contents

1. [Core Generation Commands]#core-generation-commands
2. [Marketplace Commands]#marketplace-commands
3. [Discovery Commands]#discovery-commands
4. [Utility Commands]#utility-commands
5. [Developer Commands]#developer-commands
6. [Test Coverage Matrix]#test-coverage-matrix

---

## Core Generation Commands

### 1. `rgen gen` - Generate code from templates

**JTBD:** "When I need to generate code, I want to use a template with variables, so that I can create consistent, reproducible artifacts."

#### Command Syntax
```bash
rgen gen [OPTIONS] <TEMPLATE>
  -o, --out <OUT>   Output directory root [default: .]
  -v, --var <VARS>  Variables (key=value pairs)
      --dry         Dry run (no write)
```

#### Test Scenarios

##### ✅ Scenario 1.1: Generate from local template
```gherkin
Given I have a local template at "templates/cli/subcommand/rust.tmpl"
When I run "rgen gen templates/cli/subcommand/rust.tmpl --var cmd=hello --var summary='Print greeting'"
Then a file should be created at "src/cmds/hello.rs"
And the file should contain "fn hello"
And the file should contain "Print greeting"
```

**Feature File:** `template_generation.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.2: Generate with pack reference
```gherkin
Given I have installed rpack "io.rgen.rust.cli-subcommand"
When I run "rgen gen io.rgen.rust.cli-subcommand:cli/subcommand/rust.tmpl --var cmd=test"
Then a file should be created at "src/cmds/test.rs"
```

**Feature File:** `quickstart.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.3: Dry run (preview without writing)
```gherkin
Given I have a local template
When I run "rgen gen templates/cli/subcommand/rust.tmpl --dry --var cmd=preview"
Then no files should be created
And I should see the preview output
```

**Feature File:** `template_generation.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.4: Generate to custom output directory
```gherkin
Given I have a local template
When I run "rgen gen templates/cli/subcommand/rust.tmpl --out ./custom --var cmd=test"
Then a file should be created at "./custom/src/cmds/test.rs"
```

**Feature File:** `template_generation.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.5: Deterministic generation (same input = same output)
```gherkin
Given I have a template with determinism config
When I run the generation command twice with the same seed
Then both outputs should be byte-identical
```

**Feature File:** `determinism.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.6: Multi-language template support
```gherkin
Given I have templates for Python, JavaScript, and Rust
When I run generation for each language
Then correct syntax files should be generated for each
```

**Feature File:** `multi_language.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 1.7: RDF/SPARQL integration
```gherkin
Given I have a template with RDF data and SPARQL queries
When I run generation
Then the SPARQL query results should be injected into the template
```

**Feature File:** `rdf_sparql.feature`
**BDD Status:** Step definitions exist ✅

---

### 2. `rgen list` - List available templates

**JTBD:** "When I need to know what templates are available, I want to see a list with metadata, so that I can choose the right template."

#### Command Syntax
```bash
rgen list
```

#### Test Scenarios

##### ✅ Scenario 2.1: List local templates
```gherkin
Given I have templates in "templates/" directory
When I run "rgen list"
Then I should see a list of templates
And each template should show:
  - Template path
  - Output path pattern
  - Required variables
  - RDF file count
  - SPARQL query count
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 2.2: List shows template metadata
```gherkin
Given I have a template "templates/cli/subcommand/rust.tmpl"
When I run "rgen list"
Then I should see:
  """
  📄 cli/subcommand/rust.tmpl
     Output: src/cmds/{{cmd}}.rs
     Variables:
       cmd: example
       summary: Example command
     RDF files: 1
     SPARQL queries: 1
  """
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 2.3: Empty template directory
```gherkin
Given I have no templates
When I run "rgen list"
Then I should see "No templates found"
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

---

### 3. `rgen show` - Show template metadata

**JTBD:** "When I need detailed information about a template, I want to see its full configuration, so that I understand how to use it."

#### Command Syntax
```bash
rgen show [OPTIONS] <TEMPLATE>
  -v, --vars <VARS>  Variables (key=value pairs)
```

#### Test Scenarios

##### ✅ Scenario 3.1: Show template frontmatter
```gherkin
Given I have a template with complete frontmatter
When I run "rgen show templates/cli/subcommand/rust.tmpl"
Then I should see:
  - Output path pattern
  - All variables with defaults
  - Injection mode settings
  - RDF files list
  - SPARQL queries
  - Shell hooks (if any)
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 3.2: Show with variable substitution
```gherkin
Given I have a template with Tera syntax in frontmatter
When I run "rgen show templates/test.tmpl --vars name=Alice"
Then the frontmatter should be rendered with "Alice"
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

##### ✅ Scenario 3.3: Show template body preview
```gherkin
Given I have a template
When I run "rgen show templates/test.tmpl"
Then I should see a preview of the first 10 lines
And a count of remaining lines if > 10
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Step definitions exist ✅

---

## Marketplace Commands

### 4. `rgen search` - Search for rpacks in registry

**JTBD:** "When I need to find a template package, I want to search the marketplace, so that I can discover and install the right solution."

#### Command Syntax
```bash
rgen search [OPTIONS] <QUERY>
  -c, --category <CATEGORY>  Filter by category
  -k, --keyword <KEYWORD>    Filter by keyword
  -a, --author <AUTHOR>      Filter by author/owner
      --stable               Show only stable versions
  -l, --limit <LIMIT>        Limit results [default: 20]
      --json                 Output as JSON
  -d, --detailed             Show detailed information
```

#### Test Scenarios

##### ✅ Scenario 4.1: Basic search (WORKING)
```gherkin
Given the registry has rpacks
When I run "rgen search rust"
Then I should see matching rpacks
And each result should show:
  - ID
  - Latest version
  - Tags
  - Description (truncated)
```

**Current Status:** ✅ Working with local mock registry
**Unit Test:** `test_search_command_basic_usage` ✅ PASSING
**Feature File:** `marketplace.feature`

##### ✅ Scenario 4.2: Search with category filter
```gherkin
Given the registry has rpacks in multiple categories
When I run "rgen search api --category rust"
Then I should only see Rust category rpacks
```

**Current Status:** ✅ Working
**Unit Test:** `test_search_command_with_filters` ✅ PASSING
**Feature File:** `marketplace.feature`

##### ✅ Scenario 4.3: Search with JSON output (WORKING)
```gherkin
Given the registry has rpacks
When I run "rgen search rust --json"
Then I should receive valid JSON
And it should contain fields: id, name, description, tags, version
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_output_formats` ✅ PASSING
**Feature File:** `marketplace.feature`

##### ✅ Scenario 4.4: Search with detailed output
```gherkin
Given the registry has rpacks
When I run "rgen search rust --detailed"
Then I should see full information including:
  - ID, name, version
  - Full description
  - All tags and keywords
  - Category
  - Author
  - Download count
  - Last updated date
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_output_formats` ✅ PASSING
**Feature File:** `marketplace.feature`

##### ⚠️ Scenario 4.5: Search with no results
```gherkin
Given the registry has rpacks
When I run "rgen search nonexistent-xyz-123"
Then I should see "No rpacks found matching your criteria"
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

### 5. `rgen categories` - Show popular categories and keywords

**JTBD:** "When I want to explore the marketplace, I want to see popular categories and keywords, so that I can discover relevant templates."

#### Command Syntax
```bash
rgen categories [OPTIONS]
      --keywords  Show popular keywords instead
  -d, --detailed  Show detailed statistics
      --json      Output as JSON
```

#### Test Scenarios

##### ⚠️ Scenario 5.1: List categories
```gherkin
Given the registry has rpacks in multiple categories
When I run "rgen categories"
Then I should see popular categories like:
  - rust
  - python
  - web
  - cli
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 5.2: List keywords
```gherkin
Given the registry has rpacks with keywords
When I run "rgen categories --keywords"
Then I should see popular keywords like:
  - api
  - database
  - auth
  - cli
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

### 6. `rgen add` - Add an rpack to the project

**JTBD:** "When I find a useful template package, I want to install it to my project, so that I can use its templates locally."

#### Command Syntax
```bash
rgen add <RPACK_ID>
```

#### Test Scenarios

##### ⚠️ Scenario 6.1: Add latest version
```gherkin
Given the rpack "io.rgen.rust.cli-subcommand" exists
When I run "rgen add io.rgen.rust.cli-subcommand"
Then the rpack should be downloaded
And it should be added to rgen.toml
And it should be cached locally
```

**Feature File:** `marketplace.feature`
**BDD Status:** Step definitions exist ✅

##### ⚠️ Scenario 6.2: Add specific version
```gherkin
Given the rpack has multiple versions
When I run "rgen add io.rgen.rust.cli-subcommand@0.2.0"
Then version 0.2.0 should be installed
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 6.3: Add already installed rpack
```gherkin
Given the rpack is already installed
When I run "rgen add io.rgen.rust.cli-subcommand"
Then I should see "Already installed at version X.X.X"
And no changes should be made
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

### 7. `rgen remove` - Remove an rpack from the project

**JTBD:** "When I no longer need a template package, I want to uninstall it, so that my project stays clean."

#### Command Syntax
```bash
rgen remove [OPTIONS] <RPACK_ID>
      --prune  Also remove from cache
```

#### Test Scenarios

##### ⚠️ Scenario 7.1: Remove rpack
```gherkin
Given the rpack "io.rgen.rust.cli-subcommand" is installed
When I run "rgen remove io.rgen.rust.cli-subcommand"
Then it should be removed from rgen.toml
And the templates should no longer be available
But the cache should remain (unless --prune)
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 7.2: Remove with cache cleanup
```gherkin
Given the rpack is installed
When I run "rgen remove io.rgen.rust.cli-subcommand --prune"
Then it should be removed from rgen.toml
And it should be removed from cache
And disk space should be freed
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

### 8. `rgen packs` - List installed rpacks

**JTBD:** "When I need to see what packages are installed, I want a list with versions, so that I can manage my dependencies."

#### Command Syntax
```bash
rgen packs
```

#### Test Scenarios

##### ⚠️ Scenario 8.1: List installed rpacks
```gherkin
Given I have installed 2 rpacks
When I run "rgen packs"
Then I should see both rpacks with:
  - ID
  - Version
  - Template count
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 8.2: No rpacks installed
```gherkin
Given I have no rpacks installed
When I run "rgen packs"
Then I should see "No rpacks installed"
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

### 9. `rgen update` - Update rpacks to latest versions

**JTBD:** "When new versions are available, I want to update my packages, so that I have the latest features and fixes."

#### Command Syntax
```bash
rgen update [RPACK_ID]
```

#### Test Scenarios

##### ⚠️ Scenario 9.1: Update all rpacks
```gherkin
Given I have installed rpacks with updates available
When I run "rgen update"
Then all rpacks should be updated to latest compatible versions
And rgen.toml should be updated
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 9.2: Update specific rpack
```gherkin
Given "io.rgen.rust.cli-subcommand" has an update
When I run "rgen update io.rgen.rust.cli-subcommand"
Then only that rpack should be updated
```

**Feature File:** `marketplace.feature`
**BDD Status:** Needs implementation

---

## Discovery Commands

### 10. `rgen lint` - Lint template with schema validation

**JTBD:** "When I create a template, I want to validate it, so that I catch errors before using it."

#### Command Syntax
```bash
rgen lint [OPTIONS] <TEMPLATE>
  -v, --var <VARS>  Variables for frontmatter rendering
      --verbose     Show detailed output
      --shacl       Perform SHACL validation
```

#### Test Scenarios

##### ⚠️ Scenario 10.1: Lint valid template
```gherkin
Given I have a valid template
When I run "rgen lint templates/test.tmpl"
Then I should see "✓ Template is valid"
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 10.2: Lint invalid frontmatter
```gherkin
Given I have a template with invalid YAML frontmatter
When I run "rgen lint templates/invalid.tmpl"
Then I should see syntax errors
And line numbers where errors occur
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 10.3: SHACL validation
```gherkin
Given I have a template with RDF data
When I run "rgen lint templates/test.tmpl --shacl"
Then SHACL constraints should be validated
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Needs implementation

---

## Utility Commands

### 11. `rgen graph` - Export RDF graph

**JTBD:** "When I need to inspect RDF data, I want to export the graph, so that I can debug or analyze it."

#### Command Syntax
```bash
rgen graph [OPTIONS] <SCOPE> <ACTION>
  -f, --format <FORMAT>   turtle, ntriples, rdfxml, jsonld [default: turtle]
  -o, --output <OUTPUT>   Output file (default: stdout)
      --include-prefixes  Include prefixes
```

#### Test Scenarios

##### ⚠️ Scenario 11.1: Export graph as Turtle
```gherkin
Given I have RDF data for scope "cli" and action "subcommand"
When I run "rgen graph cli subcommand"
Then I should see Turtle format RDF output
```

**Feature File:** `rdf_sparql.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 11.2: Export to file
```gherkin
Given I have RDF data
When I run "rgen graph cli subcommand --output graph.ttl"
Then a file "graph.ttl" should be created
And it should contain valid Turtle syntax
```

**Feature File:** `rdf_sparql.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 11.3: Export as JSON-LD
```gherkin
Given I have RDF data
When I run "rgen graph cli subcommand --format jsonld"
Then I should see valid JSON-LD output
```

**Feature File:** `rdf_sparql.feature`
**BDD Status:** Needs implementation

---

### 12. `rgen hazard` - Generate hazard report

**JTBD:** "When I want to assess code safety, I want a hazard report, so that I can identify potential risks."

#### Command Syntax
```bash
rgen hazard
```

#### Test Scenarios

##### ✅ Scenario 12.1: Generate hazard report
```gherkin
Given I have templates with various patterns
When I run "rgen hazard"
Then I should see a report of potential hazards
```

**Current Status:** ✅ Working
**Unit Test:** `test_hazard_stdout` ✅ PASSING
**Feature File:** `cli_commands.feature`

##### ✅ Scenario 12.2: Hazard exit code
```gherkin
Given I have templates
When I run "rgen hazard"
Then the exit code should be 0 (success)
```

**Current Status:** ✅ Working
**Unit Test:** `test_hazard_exit_code` ✅ PASSING
**Feature File:** `cli_commands.feature`

---

### 13. `rgen completion` - Generate shell completion scripts

**JTBD:** "When I use rgen frequently, I want shell completions, so that I can work faster with tab completion."

#### Command Syntax
```bash
rgen completion <SHELL>
  bash, zsh, fish
```

#### Test Scenarios

##### ⚠️ Scenario 13.1: Generate bash completion
```gherkin
When I run "rgen completion bash"
Then I should see valid bash completion script
And it should include all rgen commands
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Needs implementation

##### ⚠️ Scenario 13.2: Generate zsh completion
```gherkin
When I run "rgen completion zsh"
Then I should see valid zsh completion script
```

**Feature File:** `cli_commands.feature`
**BDD Status:** Needs implementation

---

## Developer Commands

### 14. Global Options

**JTBD:** "When I debug issues, I want verbose logging, so that I can understand what's happening."

#### Command Syntax
```bash
rgen [OPTIONS] <COMMAND>
  -c, --config <FILE>          Custom config file
      --manifest-path <PATH>   Path to rgen.toml
  -d, --debug <DEBUG>          Enable debug mode
  -l, --log-level <LOG_LEVEL>  Set log level
  -h, --help                   Show help
  -V, --version                Show version
```

#### Test Scenarios

##### ✅ Scenario 14.1: Version command
```gherkin
When I run "rgen --version"
Then I should see "rgen 0.1.0"
```

**Current Status:** ✅ Working
**Unit Test:** `test_version` ✅ PASSING

##### ✅ Scenario 14.2: Help command
```gherkin
When I run "rgen --help"
Then I should see all available commands
And usage examples
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_help_commands` ✅ PASSING

##### ✅ Scenario 14.3: Subcommand help
```gherkin
When I run "rgen gen --help"
Then I should see gen-specific options
And usage examples for gen
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_help_commands` ✅ PASSING

##### ✅ Scenario 14.4: Environment variables
```gherkin
Given RGEN_TRACE is set to "1"
When I run any rgen command
Then tracing output should be enabled
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_environment_variables` ✅ PASSING

##### ✅ Scenario 14.5: Error handling
```gherkin
When I run "rgen gen nonexistent.tmpl"
Then I should see a clear error message
And the exit code should be non-zero
```

**Current Status:** ✅ Working
**Unit Test:** `test_cli_error_handling` ✅ PASSING

---

## Test Coverage Matrix

### Unit Tests Status (46 tests)

| Test Suite | Tests | Status | Notes |
|------------|-------|--------|-------|
| rgen-core lib | 3 | ✅ PASS | Core functionality |
| utils lib | 3 | ✅ PASS | Utilities |
| CLI integration | 13 | ✅ PASS | All CLI scenarios |
| E2E tests | 7 | ✅ PASS | End-to-end flows |
| Integration | 3 | ✅ PASS | Component integration |
| Mock registry | 17 | ✅ PASS | Registry operations |
| **TOTAL** | **46** | **✅ PASS** | **100% passing** |

### BDD Feature Coverage

| Feature File | Scenarios | Step Definitions | Status |
|--------------|-----------|------------------|--------|
| quickstart.feature | 3 | ✅ Exist | Ready for scenarios |
| template_generation.feature | TBD | ✅ Exist | Ready for scenarios |
| marketplace.feature | TBD | ✅ Exist | Ready for scenarios |
| cli_commands.feature | TBD | ✅ Exist | Ready for scenarios |
| determinism.feature | TBD | ✅ Exist | Ready for scenarios |
| multi_language.feature | TBD | ✅ Exist | Ready for scenarios |
| rdf_sparql.feature | TBD | ✅ Exist | Ready for scenarios |
| installation.feature | TBD | ✅ Exist | Ready for scenarios |

### Command Coverage Status

| Command | Basic Test | Advanced Test | BDD Scenario | Notes |
|---------|-----------|---------------|--------------|-------|
| `rgen gen` |||| Local & pack templates |
| `rgen list` |||| Template listing |
| `rgen show` || ⚠️ || Frontmatter display |
| `rgen search` |||| **NOW WORKING!** |
| `rgen categories` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen add` | ⚠️ | ⚠️ || Step defs exist |
| `rgen remove` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen packs` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen update` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen lint` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen graph` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| `rgen hazard` |||| Fully tested |
| `rgen completion` | ⚠️ | ⚠️ | ⚠️ | Needs implementation |
| Global options |||| Help, version, etc. |

**Legend:**
- ✅ = Fully tested and working
- ⚠️ = Needs implementation or additional tests
- 🔴 = Known issues

---

## Priority Test Implementation Plan

### Phase 1: Core v0.1.0 (COMPLETE ✅)
- [x] rgen gen (all modes)
- [x] rgen list
- [x] rgen show
- [x] rgen search (NOW WORKING!)
- [x] rgen hazard
- [x] Global options (help, version, debug)

### Phase 2: Marketplace v0.2.0 (Future)
- [ ] rgen add (with version support)
- [ ] rgen remove (with prune)
- [ ] rgen packs (detailed listing)
- [ ] rgen update (all & specific)
- [ ] rgen categories (with keywords)

### Phase 3: Advanced v0.3.0 (Future)
- [ ] rgen lint (with SHACL)
- [ ] rgen graph (all formats)
- [ ] rgen completion (all shells)
- [ ] Advanced RDF/SPARQL scenarios
- [ ] Multi-language edge cases

---

## Summary

**Current Status:**
- **46/46 unit tests passing**
-**Core commands fully tested**
-**Search functionality working with mock registry**
-**BDD infrastructure ready**
- ⚠️ **Marketplace commands need implementation**

**Next Steps:**
1. Implement BDD scenarios for existing features
2. Complete marketplace command tests (add/remove/update/packs)
3. Add lint and graph command scenarios
4. Expand RDF/SPARQL test coverage

**Test Philosophy:**
- **Unit tests:** Fast, isolated, comprehensive edge cases
- **Integration tests:** Component interaction, realistic flows
- **BDD tests:** User-facing scenarios, acceptance criteria
- **E2E tests:** Full workflows, real-world usage patterns