cov-loupe 4.0.0.pre → 4.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.
- checksums.yaml +4 -4
- data/AGENTS.md +2 -2
- data/README.md +0 -1
- data/RELEASE_NOTES.md +3 -1
- data/dev/prompts/improve/update-documentation.md +71 -12
- data/dev/prompts/review/comprehensive-codebase-review.md +12 -0
- data/docs/user/ADVANCED_USAGE.md +3 -3
- data/docs/user/CLI_USAGE.md +38 -38
- data/docs/user/INSTALLATION.md +4 -0
- data/docs/user/MCP_INTEGRATION.md +1 -1
- data/docs/user/TROUBLESHOOTING.md +2 -2
- data/docs/user/migrations/MIGRATING_TO_V2.md +1 -1
- data/docs/user/prompts/README.md +2 -3
- data/docs/user/prompts/coverage-analysis-prompt.md +118 -0
- data/docs/user/prompts/use-cli-not-mcp-prompt.md +35 -50
- data/lib/cov_loupe/commands/totals_command.rb +3 -28
- data/lib/cov_loupe/config/option_normalizers.rb +13 -3
- data/lib/cov_loupe/config/option_parser_builder.rb +12 -2
- data/lib/cov_loupe/model/model.rb +4 -1
- data/lib/cov_loupe/staleness/staleness_checker.rb +2 -1
- data/lib/cov_loupe/tools/coverage_totals_tool.rb +1 -1
- data/lib/cov_loupe/version.rb +1 -1
- metadata +3 -15
- data/dev/prompts/archive/architectural-review-and-actions-prompt.md +0 -53
- data/dev/prompts/archive/investigate-and-report-issues-prompt.md +0 -33
- data/dev/prompts/archive/produce-action-items-prompt.md +0 -25
- data/dev/prompts/validate/create-screencast-outline.md +0 -234
- data/docs/examples/prompts.md +0 -3
- data/docs/user/prompts/non-web-coverage-analysis-prompt.md +0 -103
- data/docs/user/prompts/rails-coverage-analysis-prompt.md +0 -94
- data/examples/prompts/README.md +0 -27
- data/examples/prompts/custom_resultset.txt +0 -2
- data/examples/prompts/detailed_with_source.txt +0 -2
- data/examples/prompts/list_lowest.txt +0 -2
- data/examples/prompts/summary.txt +0 -2
- data/examples/prompts/uncovered.txt +0 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad1c10a98b23420df309b322178fb9a128faa58fe45d1aee8ba2578b6d3f8c23
|
|
4
|
+
data.tar.gz: 8044f1ac74ee62852f11204f971d9e750a08f9e1c7b2eabb4eef7794056e7fd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53f869c7166b313f11310b2164fd08384cfe713fde38900a925b0f2846ba0b0b043e50e2d0901482152328e17fc9970ee24a5bb10b8e9d46f32b4bec6061d2d3
|
|
7
|
+
data.tar.gz: 3a4d9f649e566bbf8228c5c8e2237cde16a518d6ce39b1d6b9ae92d1888e8481ce620d4d51f5081dd228d49ad05677c0358dfdb12f37de99e27d455134df2736
|
data/AGENTS.md
CHANGED
|
@@ -96,8 +96,8 @@ Use `bundle exec rspec spec/path_spec.rb` to target specific specs when needed.
|
|
|
96
96
|
```
|
|
97
97
|
- Exercise the MCP server manually by piping JSON-RPC:
|
|
98
98
|
```sh
|
|
99
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"coverage_summary_tool","arguments":{"path":"lib/cov_loupe/model.rb"}}}' | bundle exec exe/cov-loupe
|
|
100
|
-
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"help_tool","arguments":{}}}' | bundle exec exe/cov-loupe
|
|
99
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"coverage_summary_tool","arguments":{"path":"lib/cov_loupe/model.rb"}}}' | bundle exec exe/cov-loupe -m mcp
|
|
100
|
+
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"help_tool","arguments":{}}}' | bundle exec exe/cov-loupe -m mcp
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
### Building
|
data/README.md
CHANGED
|
@@ -153,7 +153,6 @@ Full documentation is available at **[https://keithrbennett.github.io/cov-loupe/
|
|
|
153
153
|
- [Release Notes](docs/release_notes.md)
|
|
154
154
|
- [License](docs/license.md)
|
|
155
155
|
- [MCP Input Examples](docs/examples/mcp-inputs.md)
|
|
156
|
-
- [Prompt Examples](docs/examples/prompts.md)
|
|
157
156
|
- [Predicate Examples](docs/examples/success_predicates.md)
|
|
158
157
|
|
|
159
158
|
## Requirements
|
data/RELEASE_NOTES.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[Back to main README](docs/index.md)
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
## v4.0.0
|
|
6
|
+
## v4.0.0 (Breaking)
|
|
7
7
|
|
|
8
8
|
- **Removed Branch Coverage Support**: Removed logic that synthesized line coverage from branch-only coverage data. This feature was complex and rarely used. Users should use standard line coverage configuration in SimpleCov.
|
|
9
9
|
- Removed `docs/dev/BRANCH_ONLY_COVERAGE.md`.
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
|
|
60
60
|
### ✨ Enhancements
|
|
61
61
|
|
|
62
|
+
- **New `-f p` shortcut for pretty-json format**: Added `-f p` as a shortcut for `--format pretty-json`. This follows the pattern of other format shortcuts (`-f j` for json, `-f y` for yaml, etc.). The previous `-f J` shortcut no longer works (use `-f p` instead).
|
|
63
|
+
|
|
62
64
|
- **Project totals now include coverage breakdowns**: The `totals` subcommand and `coverage_totals_tool` now return explicit `with_coverage` and `without_coverage` breakdowns, plus tracking metadata, so totals clearly separate fresh coverage from missing coverage.
|
|
63
65
|
|
|
64
66
|
**Example output:**
|
|
@@ -1,21 +1,80 @@
|
|
|
1
1
|
# Review and Revise Documentation as Necessary
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Purpose:** Keep the project's Markdown documentation accurate, clear, complete, and internally consistent.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- docs/**/*.md
|
|
7
|
-
- docs/user/**/*.md
|
|
8
|
-
- docs/dev/arch-decisions/**/*.md
|
|
5
|
+
## Scope
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
Examine all Markdown files in:
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
- `*.md`
|
|
10
|
+
- `docs/**/*.md`
|
|
11
|
+
- `docs/user/**/*.md`
|
|
12
|
+
- `docs/dev/arch-decisions/**/*.md`
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
unnecessarily reduce the signal to noise ratio.
|
|
14
|
+
## What to Look For
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
### Accuracy
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
- Claims that no longer match the code (CLI flags, method names, output formats, file paths).
|
|
19
|
+
- Code examples that produce different output than documented, or that refer to removed features.
|
|
20
|
+
- Version numbers, dependency names, or configuration keys that have changed.
|
|
21
21
|
|
|
22
|
+
### Clarity
|
|
23
|
+
|
|
24
|
+
- Sections that assume prior knowledge not provided in the doc or a clearly-linked prerequisite.
|
|
25
|
+
- Ambiguous pronouns or unexplained jargon — if the meaning is unclear on first read, rewrite it.
|
|
26
|
+
- Paragraphs that mix distinct topics; split or reorganise them.
|
|
27
|
+
- Over-long explanations where a concise rewrite would preserve meaning with less noise.
|
|
28
|
+
|
|
29
|
+
### Completeness
|
|
30
|
+
|
|
31
|
+
- Missing prerequisites: if a command requires setup, the setup must be described or linked.
|
|
32
|
+
- Gaps between what a feature does and what the docs say it does.
|
|
33
|
+
- New CLI subcommands, MCP tools, or options not yet documented.
|
|
34
|
+
|
|
35
|
+
### Link Integrity
|
|
36
|
+
|
|
37
|
+
Check internal links (relative Markdown paths) and anchor links (`#heading-id`):
|
|
38
|
+
|
|
39
|
+
- Verify that the target file exists at the referenced path.
|
|
40
|
+
- Verify that named anchors (`#section-name`) match an actual heading in the target document.
|
|
41
|
+
- Check that bidirectional navigation links exist where expected (e.g., a top-level README links
|
|
42
|
+
to a specialist doc, and that doc links back with `[Back to main README](...)`).
|
|
43
|
+
|
|
44
|
+
### Duplication
|
|
45
|
+
|
|
46
|
+
- If the same point is explained in multiple documents, decide which is the canonical location
|
|
47
|
+
and replace the others with a brief note and a link to it.
|
|
48
|
+
- Do not duplicate content that is already maintained elsewhere — link instead.
|
|
49
|
+
|
|
50
|
+
### Code Examples
|
|
51
|
+
|
|
52
|
+
- Confirm that shell/CLI examples use current flag names and produce valid output.
|
|
53
|
+
- For thorough validation of all runnable examples across the docs, use
|
|
54
|
+
[`dev/prompts/validate/test-documentation-examples.md`](../validate/test-documentation-examples.md).
|
|
55
|
+
|
|
56
|
+
## Special Cases
|
|
57
|
+
|
|
58
|
+
### MkDocs Include-Markdown Stubs
|
|
59
|
+
|
|
60
|
+
Some files under `docs/` are intentional single-line stubs that use the MkDocs
|
|
61
|
+
`include-markdown` plugin to pull in content from the repository root. Do **not**
|
|
62
|
+
flag these as incomplete. See
|
|
63
|
+
[`dev/prompts/guidelines/ai-code-evaluator-guidelines.md` — MkDocs Include-Markdown Stubs](../guidelines/ai-code-evaluator-guidelines.md#mkdocs-include-markdown-stubs)
|
|
64
|
+
for the full explanation.
|
|
65
|
+
|
|
66
|
+
## Actions to Take
|
|
67
|
+
|
|
68
|
+
1. **Fix in place** — edit the doc file directly; no separate report is needed unless the scope
|
|
69
|
+
of changes warrants a summary.
|
|
70
|
+
2. **Prefer linking over duplicating** — when the same information belongs in two places, keep
|
|
71
|
+
the authoritative copy and add a short cross-reference elsewhere.
|
|
72
|
+
3. **Match existing tone** — keep edits consistent with the surrounding prose style.
|
|
73
|
+
4. **Do not rewrite for rewriting's sake** — only change what is inaccurate, unclear, or missing.
|
|
74
|
+
|
|
75
|
+
## Constraints
|
|
76
|
+
|
|
77
|
+
- Do not alter code files unless a documented example is genuinely broken and a code fix is
|
|
78
|
+
clearly correct; prefer updating the docs to match current behaviour.
|
|
79
|
+
- Do not run `git commit`. Stage only the documentation files you changed, and propose a concise
|
|
80
|
+
commit message describing what was corrected and why.
|
|
@@ -174,3 +174,15 @@ Suggest prompts to a coding AI tool that would be helpful in addressing the majo
|
|
|
174
174
|
- Report the final **Overall Weighted Score** with justification.
|
|
175
175
|
|
|
176
176
|
### Summarize suggested changes
|
|
177
|
+
|
|
178
|
+
Provide a short, plain-prose recap of the most important changes—distinct from the Prioritized
|
|
179
|
+
Issue List (which is a table) and the High-Level Recommendations (which are strategic). Group
|
|
180
|
+
them by horizon:
|
|
181
|
+
|
|
182
|
+
- **Immediate (blocking or high-risk):** Changes that should happen before the next release or
|
|
183
|
+
before onboarding new contributors.
|
|
184
|
+
- **Near-term (1–2 sprints):** Improvements with clear ROI and moderate cost-to-fix.
|
|
185
|
+
- **Longer-term (backlog):** Worthwhile but lower urgency; note any dependencies between items.
|
|
186
|
+
|
|
187
|
+
Keep this section to 10–15 lines. Its purpose is a quick decision-making aid, not a full
|
|
188
|
+
re-statement of everything above.
|
data/docs/user/ADVANCED_USAGE.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
[Back to main README](../index.md)
|
|
4
4
|
|
|
5
5
|
> Examples use `clp`, an alias pointed at the demo fixture with partial coverage:
|
|
6
|
-
>
|
|
7
|
-
> `alias clp='cov-loupe -R docs/fixtures/demo_project'
|
|
8
|
-
>
|
|
6
|
+
>
|
|
7
|
+
> `alias clp='cov-loupe -R docs/fixtures/demo_project'` # -R = --root
|
|
8
|
+
>
|
|
9
9
|
> Replace `clp` with `cov-loupe` if you want to target your own project/resultset.
|
|
10
10
|
|
|
11
11
|
## Table of Contents
|
data/docs/user/CLI_USAGE.md
CHANGED
|
@@ -39,7 +39,7 @@ clp raw app/models/order.rb
|
|
|
39
39
|
|
|
40
40
|
# Get project totals
|
|
41
41
|
clp totals
|
|
42
|
-
clp -
|
|
42
|
+
clp -fp totals
|
|
43
43
|
|
|
44
44
|
# Show version
|
|
45
45
|
clp version
|
|
@@ -57,7 +57,7 @@ Show coverage summary for all files (default subcommand).
|
|
|
57
57
|
```sh
|
|
58
58
|
clp list
|
|
59
59
|
clp -o d list # -o = --sort-order, d = descending
|
|
60
|
-
clp -
|
|
60
|
+
clp -fp list
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Default sort order is descending (highest coverage first) so the lowest-coverage files stay visible at the bottom of the scrollback.
|
|
@@ -69,7 +69,7 @@ Default sort order is descending (highest coverage first) so the lowest-coverage
|
|
|
69
69
|
| `-o` | `--sort-order` | Sort by coverage percentage (ascending or descending) |
|
|
70
70
|
| `-g` | `--tracked-globs` | Filter to specific file patterns |
|
|
71
71
|
| `-S` | `--raise-on-stale` | Raise error if coverage is stale (default false) |
|
|
72
|
-
| `-
|
|
72
|
+
| `-fp` | `--format pretty-json` | Output as pretty-printed JSON |
|
|
73
73
|
| `-fj` | `--format json` | Output as single-line JSON |
|
|
74
74
|
| `-f y` | `--format yaml` | Output as YAML |
|
|
75
75
|
| `-f ap` | `--format amazing_print` | Output using AmazingPrint | |
|
|
@@ -98,8 +98,8 @@ Show covered/total/percentage for a specific file.
|
|
|
98
98
|
|
|
99
99
|
```sh
|
|
100
100
|
clp summary app/models/order.rb
|
|
101
|
-
clp summary app/models/order.rb
|
|
102
|
-
clp summary app/models/order.rb
|
|
101
|
+
clp -fp summary app/models/order.rb
|
|
102
|
+
clp -s full summary app/models/order.rb # -s = --source
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
**Arguments:**
|
|
@@ -109,7 +109,7 @@ clp summary app/models/order.rb -s full # -s = --source
|
|
|
109
109
|
|
|
110
110
|
| Short | Long | Description |
|
|
111
111
|
|-------|------------------|--------------------------------------------|
|
|
112
|
-
| `-
|
|
112
|
+
| `-fp` | `--format pretty-json` | Output as pretty-printed JSON |
|
|
113
113
|
| `-fj` | `--format json` | Output as single-line JSON |
|
|
114
114
|
| `-f y` | `--format yaml` | Output as YAML |
|
|
115
115
|
| `-f ap` | `--format amazing_print` | Output using AmazingPrint | |
|
|
@@ -143,8 +143,8 @@ Show uncovered line numbers for a specific file.
|
|
|
143
143
|
|
|
144
144
|
```sh
|
|
145
145
|
clp uncovered app/controllers/orders_controller.rb
|
|
146
|
-
clp uncovered app/controllers/orders_controller.rb
|
|
147
|
-
clp uncovered app/controllers/orders_controller.rb -s
|
|
146
|
+
clp -s uncovered uncovered app/controllers/orders_controller.rb # -s = --source
|
|
147
|
+
clp -s uncovered -c 3 uncovered app/controllers/orders_controller.rb # -s = --source, -c = --context-lines
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
**Arguments:**
|
|
@@ -157,7 +157,7 @@ clp uncovered app/controllers/orders_controller.rb -s uncovered -c 3 # -c = --c
|
|
|
157
157
|
| `-s` | `--source uncovered` | Show uncovered lines with context |
|
|
158
158
|
| `-c` | `--context-lines N` | Lines of context around uncovered lines (default: 2) |
|
|
159
159
|
| `-C` | `--color BOOLEAN` | Enable (`true`)/disable (`false`) syntax coloring |
|
|
160
|
-
| `-
|
|
160
|
+
| `-fp` | `--format pretty-json` | Output as pretty-printed JSON |
|
|
161
161
|
| `-fj` | `--format json` | Output as single-line JSON |
|
|
162
162
|
| `-f y` | `--format yaml` | Output as YAML |
|
|
163
163
|
| `-f ap` | `--format amazing_print` | Output using AmazingPrint | |
|
|
@@ -197,8 +197,8 @@ Show per-line coverage with hit counts.
|
|
|
197
197
|
|
|
198
198
|
```sh
|
|
199
199
|
clp detailed app/models/order.rb
|
|
200
|
-
clp detailed app/models/order.rb
|
|
201
|
-
clp detailed app/models/order.rb
|
|
200
|
+
clp -fp detailed app/models/order.rb
|
|
201
|
+
clp -s full detailed app/models/order.rb # -s = --source
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
**Arguments:**
|
|
@@ -208,7 +208,7 @@ clp detailed app/models/order.rb -s full # -s = --source
|
|
|
208
208
|
|
|
209
209
|
| Short | Long | Description |
|
|
210
210
|
|---------|--------------------------|-------------------------------|
|
|
211
|
-
| `-
|
|
211
|
+
| `-fp` | `--format pretty-json` | Output as pretty-printed JSON |
|
|
212
212
|
| `-fj` | `--format json` | Output as single-line JSON |
|
|
213
213
|
| `-f y` | `--format yaml` | Output as YAML |
|
|
214
214
|
| `-f ap` | `--format amazing_print` | Output using AmazingPrint | |
|
|
@@ -260,7 +260,7 @@ Show the raw SimpleCov lines array.
|
|
|
260
260
|
|
|
261
261
|
```sh
|
|
262
262
|
clp raw app/models/order.rb
|
|
263
|
-
clp raw app/models/order.rb
|
|
263
|
+
clp -fp raw app/models/order.rb
|
|
264
264
|
```
|
|
265
265
|
|
|
266
266
|
**Arguments:**
|
|
@@ -292,7 +292,7 @@ Show aggregated totals for all tracked files.
|
|
|
292
292
|
|
|
293
293
|
```sh
|
|
294
294
|
clp totals
|
|
295
|
-
clp -
|
|
295
|
+
clp -fp totals
|
|
296
296
|
clp -g "lib/ops/jobs/*.rb" totals # -g = --tracked-globs
|
|
297
297
|
```
|
|
298
298
|
|
|
@@ -372,7 +372,7 @@ Show version information.
|
|
|
372
372
|
|
|
373
373
|
```sh
|
|
374
374
|
clp version
|
|
375
|
-
clp -
|
|
375
|
+
clp -fp version
|
|
376
376
|
```
|
|
377
377
|
|
|
378
378
|
**Output:**
|
|
@@ -398,12 +398,12 @@ Project root directory (default: current directory).
|
|
|
398
398
|
clp -R /path/to/project # -R = --root
|
|
399
399
|
```
|
|
400
400
|
|
|
401
|
-
### `-
|
|
401
|
+
### `-fp`
|
|
402
402
|
|
|
403
403
|
Output as pretty-printed JSON instead of human-readable format.
|
|
404
404
|
|
|
405
405
|
```sh
|
|
406
|
-
clp summary lib/api/client.rb
|
|
406
|
+
clp -fp summary lib/api/client.rb
|
|
407
407
|
```
|
|
408
408
|
|
|
409
409
|
Useful for:
|
|
@@ -478,8 +478,8 @@ clp --raise-on-stale yes # enforce stale coverage failures
|
|
|
478
478
|
Enable or disable ANSI color codes in source output. Requires an explicit boolean value.
|
|
479
479
|
|
|
480
480
|
```sh
|
|
481
|
-
clp uncovered lib/api/client.rb
|
|
482
|
-
clp uncovered lib/api/client.rb
|
|
481
|
+
clp -s uncovered --color true uncovered lib/api/client.rb
|
|
482
|
+
clp -s uncovered -C false uncovered lib/api/client.rb
|
|
483
483
|
```
|
|
484
484
|
|
|
485
485
|
**Default:** Colors enabled if output is a TTY
|
|
@@ -549,7 +549,7 @@ clp -g "lib/api/**/*.rb" list
|
|
|
549
549
|
clp -g "lib/**/*.rb,app/models/**/*.rb" list
|
|
550
550
|
|
|
551
551
|
# Export for CI (with globs to match SimpleCov)
|
|
552
|
-
clp -g "lib/**/*.rb,app/**/*.rb" -
|
|
552
|
+
clp -g "lib/**/*.rb,app/**/*.rb" -fp list > coverage.json
|
|
553
553
|
```
|
|
554
554
|
|
|
555
555
|
**Use cases:**
|
|
@@ -754,17 +754,17 @@ Default command-line options applied to all invocations.
|
|
|
754
754
|
**Format:** Shell-style string containing any valid CLI options
|
|
755
755
|
|
|
756
756
|
```sh
|
|
757
|
-
export COV_LOUPE_OPTS="--resultset coverage -
|
|
757
|
+
export COV_LOUPE_OPTS="--resultset coverage -fp"
|
|
758
758
|
clp summary lib/api/client.rb # Automatically uses options above
|
|
759
759
|
```
|
|
760
760
|
|
|
761
761
|
**Precedence:** Command-line arguments override environment options
|
|
762
762
|
|
|
763
763
|
```sh
|
|
764
|
-
# Environment sets -
|
|
765
|
-
export COV_LOUPE_OPTS="-
|
|
764
|
+
# Environment sets -fp; explicit CLI options still take precedence
|
|
765
|
+
export COV_LOUPE_OPTS="-fp"
|
|
766
766
|
clp summary lib/api/client.rb # Uses JSON (from env)
|
|
767
|
-
clp summary lib/api/client.rb
|
|
767
|
+
clp -f table summary lib/api/client.rb # Explicit override to table format
|
|
768
768
|
```
|
|
769
769
|
|
|
770
770
|
**Examples:**
|
|
@@ -779,7 +779,7 @@ export COV_LOUPE_OPTS="--error-mode debug"
|
|
|
779
779
|
export COV_LOUPE_OPTS='-r "/path with spaces/coverage"'
|
|
780
780
|
|
|
781
781
|
# Multiple options
|
|
782
|
-
export COV_LOUPE_OPTS="-r coverage -S -
|
|
782
|
+
export COV_LOUPE_OPTS="-r coverage -S -fp"
|
|
783
783
|
```
|
|
784
784
|
|
|
785
785
|
|
|
@@ -806,7 +806,7 @@ clp summary lib/payments/refund_service.rb
|
|
|
806
806
|
clp uncovered lib/payments/refund_service.rb
|
|
807
807
|
|
|
808
808
|
# View uncovered code in context
|
|
809
|
-
clp uncovered lib/payments/refund_service.rb
|
|
809
|
+
clp -s uncovered -c 3 uncovered lib/payments/refund_service.rb
|
|
810
810
|
|
|
811
811
|
# Get detailed hit counts
|
|
812
812
|
clp detailed lib/payments/refund_service.rb
|
|
@@ -816,31 +816,31 @@ clp detailed lib/payments/refund_service.rb
|
|
|
816
816
|
|
|
817
817
|
```sh
|
|
818
818
|
# Get JSON for parsing
|
|
819
|
-
clp -
|
|
819
|
+
clp -fp list > coverage.json
|
|
820
820
|
|
|
821
821
|
# Extract files below threshold
|
|
822
|
-
clp -
|
|
822
|
+
clp -fp list | jq '.files[] | select(.percentage < 80)'
|
|
823
823
|
|
|
824
824
|
# Ruby alternative:
|
|
825
|
-
clp -
|
|
825
|
+
clp -fp list | ruby -r json -e '
|
|
826
826
|
JSON.parse($stdin.read)["files"].select { |f| f["percentage"] < 80 }.each do |f|
|
|
827
827
|
puts JSON.pretty_generate(f)
|
|
828
828
|
end
|
|
829
829
|
'
|
|
830
830
|
|
|
831
831
|
# Rexe alternative:
|
|
832
|
-
clp -
|
|
832
|
+
clp -fp list | rexe -ij -mb -oJ 'self["files"].select { |f| f["percentage"] < 80 }'
|
|
833
833
|
|
|
834
834
|
# Count files below 80% coverage
|
|
835
|
-
clp -
|
|
835
|
+
clp -fp list | jq '[.files[] | select(.percentage < 80)] | length'
|
|
836
836
|
|
|
837
837
|
# Ruby alternative:
|
|
838
|
-
clp -
|
|
838
|
+
clp -fp list | ruby -r json -e '
|
|
839
839
|
puts JSON.parse($stdin.read)["files"].count { |f| f["percentage"] < 80 }
|
|
840
840
|
'
|
|
841
841
|
|
|
842
842
|
# Rexe alternative:
|
|
843
|
-
clp -
|
|
843
|
+
clp -fp list | rexe -ij -mb -op 'self["files"].count { |f| f["percentage"] < 80 }'
|
|
844
844
|
```
|
|
845
845
|
|
|
846
846
|
### Filtering and Sorting
|
|
@@ -875,16 +875,16 @@ clp list # Stale column shows missing/newer/length_mismatch/error markers
|
|
|
875
875
|
|
|
876
876
|
```sh
|
|
877
877
|
# Show full source with coverage markers
|
|
878
|
-
clp summary lib/api/client.rb
|
|
878
|
+
clp -s full summary lib/api/client.rb
|
|
879
879
|
|
|
880
880
|
# Show only uncovered lines with context
|
|
881
|
-
clp uncovered lib/api/client.rb
|
|
881
|
+
clp -s uncovered uncovered lib/api/client.rb
|
|
882
882
|
|
|
883
883
|
# More context around uncovered code
|
|
884
|
-
clp uncovered lib/api/client.rb
|
|
884
|
+
clp -s uncovered -c 5 uncovered lib/api/client.rb
|
|
885
885
|
|
|
886
886
|
# Without colors (for logging)
|
|
887
|
-
clp uncovered lib/api/client.rb
|
|
887
|
+
clp -s full --color false uncovered lib/api/client.rb
|
|
888
888
|
```
|
|
889
889
|
|
|
890
890
|
### CI/CD Integration
|
|
@@ -894,7 +894,7 @@ clp uncovered lib/api/client.rb -s full --color false
|
|
|
894
894
|
clp -S true || exit 1
|
|
895
895
|
|
|
896
896
|
# Generate JSON report for artifact
|
|
897
|
-
clp -
|
|
897
|
+
clp -fp list > artifacts/coverage-report.json
|
|
898
898
|
|
|
899
899
|
# Check specific directory in monorepo
|
|
900
900
|
clp -R services/api -r services/api/coverage # -R = --root, -r = --resultset
|
data/docs/user/INSTALLATION.md
CHANGED
|
@@ -374,7 +374,7 @@ cov-loupe version # Test basic functionality
|
|
|
374
374
|
|
|
375
375
|
**JSON-RPC Parse Errors**
|
|
376
376
|
- Ensure JSON is on a single line (no newlines)
|
|
377
|
-
- Test manually: `echo '{"jsonrpc":"2.0",...}' | cov-loupe`
|
|
377
|
+
- Test manually: `echo '{"jsonrpc":"2.0",...}' | cov-loupe -m mcp`
|
|
378
378
|
|
|
379
379
|
## Advanced Configuration
|
|
380
380
|
|
|
@@ -100,7 +100,7 @@ when merging resultsets.
|
|
|
100
100
|
|
|
101
101
|
2. **Test MCP server mode manually:**
|
|
102
102
|
```bash
|
|
103
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe
|
|
103
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe -m mcp
|
|
104
104
|
```
|
|
105
105
|
Should return JSON-RPC response.
|
|
106
106
|
|
|
@@ -183,7 +183,7 @@ ls -la coverage/.resultset.json
|
|
|
183
183
|
head -20 coverage/.resultset.json
|
|
184
184
|
|
|
185
185
|
# Test MCP mode
|
|
186
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe 2>&1
|
|
186
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe -m mcp 2>&1
|
|
187
187
|
```
|
|
188
188
|
|
|
189
189
|
## Getting More Help
|
|
@@ -111,7 +111,7 @@ simplecov-mcp --source uncovered summary lib/foo.rb
|
|
|
111
111
|
|
|
112
112
|
### --json Replaced with --format
|
|
113
113
|
|
|
114
|
-
**Change:** The `--json` flag (and related `-j`,
|
|
114
|
+
**Change:** The `--json` flag (and related `-j`, `--pretty-json` flags) have been removed. Use `-f/--format` instead.
|
|
115
115
|
|
|
116
116
|
**Rationale:** Supports multiple output formats beyond JSON (YAML, awesome_print, etc.) with a consistent interface.
|
|
117
117
|
|
data/docs/user/prompts/README.md
CHANGED
|
@@ -4,6 +4,5 @@
|
|
|
4
4
|
|
|
5
5
|
Starter prompts you can paste into MCP-compatible assistants when you need cov-loupe to run targeted reports or fall back to CLI execution.
|
|
6
6
|
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
9
|
-
- [Use CLI Instead of MCP](use-cli-not-mcp-prompt.md) – Scripted fallback when MCP transport is blocked
|
|
7
|
+
- [Coverage Analysis](coverage-analysis-prompt.md) – Analyze coverage for any Ruby project; adapts component categories to the framework in use (Rails example included)
|
|
8
|
+
- [Use CLI Instead of MCP](use-cli-not-mcp-prompt.md) – Include in another prompt to instruct the model to use cov-loupe CLI as a fallback when MCP transport is blocked or unavailable
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Test Coverage Analysis Prompt for Ruby Projects
|
|
2
|
+
|
|
3
|
+
[Back to main README](../../index.md)
|
|
4
|
+
|
|
5
|
+
Use the cov-loupe MCP server tool to analyze the test coverage data generated by simplecov for this Ruby project. Generate a detailed coverage analysis report and output it to a markdown file named `test_coverage_analysis.md`.
|
|
6
|
+
|
|
7
|
+
**Before diving into the sections below**, identify the project type by examining the Gemfile, directory structure, and file-naming conventions (e.g., Rails app, CLI tool, service library, microservice). Adapt the component categories in sections 2 and 6 to match what is actually present — the Rails-specific names used as examples throughout are illustrative, not prescriptive.
|
|
8
|
+
|
|
9
|
+
The report should include:
|
|
10
|
+
|
|
11
|
+
## 1. Executive Summary
|
|
12
|
+
- Overall coverage percentage and trend direction
|
|
13
|
+
- High-level assessment of testing health across the application
|
|
14
|
+
- Key strengths and critical gaps at a glance
|
|
15
|
+
|
|
16
|
+
## 2. Coverage by Application Component
|
|
17
|
+
Detailed analysis of coverage across the application layers that are present in this project.
|
|
18
|
+
|
|
19
|
+
For a **Rails app** these are typically: Models, Controllers, Views, Mailers, Jobs, Services/POROs, Concerns, Lib files, Configuration.
|
|
20
|
+
|
|
21
|
+
For a **non-web Ruby app** these are typically: Core Domain Logic, Services/Commands, Data Access Layer, External Integrations, Utilities/Helpers, CLI Components, Configuration, Lib files, Concerns/Mixins.
|
|
22
|
+
|
|
23
|
+
Adapt this list to the actual project — drop categories that don't exist, add any that do.
|
|
24
|
+
|
|
25
|
+
## 3. Well-Tested Areas
|
|
26
|
+
- What's working well and why
|
|
27
|
+
- Testing patterns and practices to replicate
|
|
28
|
+
- Examples of strong test coverage with specific file references
|
|
29
|
+
|
|
30
|
+
## 4. Poorly-Tested Areas
|
|
31
|
+
Organize by:
|
|
32
|
+
- **Complexity to Test**: Simple/Moderate/Complex (considering dependencies, I/O operations, external services, etc.)
|
|
33
|
+
- **Risk Level**: High/Medium/Low (impact on data integrity, system reliability, business logic correctness)
|
|
34
|
+
- **Coverage Gap Size**: Percentage of uncovered lines and number of untested methods
|
|
35
|
+
|
|
36
|
+
## 5. Priority Issues Table
|
|
37
|
+
Create a markdown table with these columns:
|
|
38
|
+
- File/Module Path
|
|
39
|
+
- Component Type (Model/Service/Domain/Integration/etc.)
|
|
40
|
+
- Current Coverage %
|
|
41
|
+
- Uncovered Lines Count
|
|
42
|
+
- Risk Level (High/Medium/Low)
|
|
43
|
+
- Complexity to Fix (High/Medium/Low)
|
|
44
|
+
- Priority Score (1-10, with 10 being highest priority)
|
|
45
|
+
- Recommended Action (specific next steps)
|
|
46
|
+
|
|
47
|
+
Sort by Priority Score descending.
|
|
48
|
+
|
|
49
|
+
## 6. Framework-Specific Testing Analysis
|
|
50
|
+
Cover the topics that apply to this project. For a **Rails app**:
|
|
51
|
+
- **Model Testing**: Validations, associations, scopes, callbacks, custom methods
|
|
52
|
+
- **Controller Testing**: Happy paths vs error handling, authentication/authorization
|
|
53
|
+
- **Integration Testing**: Request specs, feature specs, system tests
|
|
54
|
+
- **API Testing**: JSON/XML responses, API versioning
|
|
55
|
+
- **Database Operations**: Migrations, seeds, complex queries
|
|
56
|
+
- **Background Jobs**: Execution, retry logic, error handling
|
|
57
|
+
- **Security**: Authentication, authorization, input sanitization, CSRF protection
|
|
58
|
+
- **Missing Test Types**: Unit/integration/system/feature test gaps
|
|
59
|
+
|
|
60
|
+
For a **non-web Ruby app**, focus instead on:
|
|
61
|
+
- **Domain Logic Testing**: Business rules, validations, calculations, state transitions
|
|
62
|
+
- **Service Layer Testing**: Orchestration logic, error handling, transaction boundaries
|
|
63
|
+
- **Data Access Testing**: Queries, data transformations, persistence operations
|
|
64
|
+
- **Integration Testing**: Interactions between components and external systems
|
|
65
|
+
- **API Client Testing**: HTTP requests, response parsing, error handling
|
|
66
|
+
- **File I/O Operations**: Reading/writing, parsing, serialization
|
|
67
|
+
- **Concurrency/Threading**: Thread-safe operations and race conditions (if applicable)
|
|
68
|
+
- **Error Handling**: Exception handling, retry logic, fallback mechanisms
|
|
69
|
+
|
|
70
|
+
Include the security and missing-test-types bullets regardless of project type.
|
|
71
|
+
|
|
72
|
+
## 7. Common Testing Anti-Patterns Detected
|
|
73
|
+
Report only those actually observed:
|
|
74
|
+
- Unnecessary verbosity — identical or near-identical code fragments that should be deduplicated using input arrays, extracted methods, shared examples, etc.
|
|
75
|
+
- Over-reliance on controller tests vs request specs (Rails)
|
|
76
|
+
- Over-mocking leading to brittle tests
|
|
77
|
+
- Missing edge case coverage in core domain / model logic
|
|
78
|
+
- Untested error handling and failure scenarios
|
|
79
|
+
- Missing tests for background jobs and mailers (Rails)
|
|
80
|
+
- Missing tests for external service integrations
|
|
81
|
+
- Lack of integration tests for critical user flows / workflows
|
|
82
|
+
- Untested authorization/permission logic
|
|
83
|
+
- Untested concurrency or threading logic (if applicable)
|
|
84
|
+
- Insufficient testing of data transformation pipelines
|
|
85
|
+
- Missing tests for CLI argument parsing and validation (if applicable)
|
|
86
|
+
|
|
87
|
+
## 8. Actionable Testing Roadmap
|
|
88
|
+
Prioritized list of specific issues to resolve, organized by effort level:
|
|
89
|
+
- **Quick Wins** (< 2 hours): Simple tests with high impact
|
|
90
|
+
- **Sprint 1** (2-8 hours): Medium complexity, high priority
|
|
91
|
+
- **Sprint 2** (1-2 days): Complex but critical coverage gaps
|
|
92
|
+
- **Long-term** (> 2 days): Large refactoring or architectural test improvements
|
|
93
|
+
|
|
94
|
+
Also flag testing infrastructure issues — inadequate fixtures, missing helpers, or code patterns that make tests brittle — and place them in the Long-term bucket.
|
|
95
|
+
|
|
96
|
+
Include specific file paths, method names, and recommended testing approaches for each item.
|
|
97
|
+
|
|
98
|
+
## 9. Metrics Dashboard
|
|
99
|
+
Key numbers:
|
|
100
|
+
- Overall coverage percentage
|
|
101
|
+
- Number of files at 0% coverage
|
|
102
|
+
- Number of files at 100% coverage
|
|
103
|
+
- Number of files above 90% coverage
|
|
104
|
+
- Number of files below 50% coverage
|
|
105
|
+
- Coverage by component type (adapted to project)
|
|
106
|
+
- Trend direction (if historical data available)
|
|
107
|
+
- Lines of code vs lines of test code ratio
|
|
108
|
+
- Average cyclomatic complexity of untested methods (if available)
|
|
109
|
+
|
|
110
|
+
## 10. Risk Assessment
|
|
111
|
+
- **Critical Paths**: Identify core user journeys / business workflows and their test coverage
|
|
112
|
+
- **High-Risk Untested Code**: Payment processing, authentication, data deletion, financial calculations, etc.
|
|
113
|
+
- **Security Implications**: Areas where lack of tests could lead to vulnerabilities
|
|
114
|
+
- **Technical Debt**: Old code with no tests that should be prioritized for coverage
|
|
115
|
+
- **External Dependencies**: Integration points with poor test coverage
|
|
116
|
+
- **Data Integrity Risks**: Operations that modify or delete data without adequate test coverage
|
|
117
|
+
|
|
118
|
+
Include specific file paths, line numbers, and code examples where relevant. Focus on actionable insights rather than just reporting numbers. Provide concrete recommendations for improving the test suite architecture and coverage strategy.
|