@anselmdk/feature-spec-md 0.10.0 → 0.10.1
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
CHANGED
|
@@ -1,53 +1,90 @@
|
|
|
1
1
|
# feature-spec-md
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Write what should be true. Prove it with tests and screenshots. Review exactly what changed.**
|
|
4
4
|
|
|
5
|
-
`feature-spec-md`
|
|
5
|
+
`feature-spec-md` turns plain Markdown into a durable contract between product intent and working software. It connects each rule and scenario to your existing tests, then produces reports that people can understand without reconstructing an AI conversation or reading the whole codebase.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
It works with web apps, APIs, services, CLIs, libraries, and other codebases. Use screenshot evidence for visual behavior and normal test coverage everywhere else.
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TB
|
|
11
|
+
A["1 · SPECIFY<br/>Rules, scenarios, model, stack, and design"]
|
|
12
|
+
B["2 · BUILD<br/>AI-assisted or human-written code"]
|
|
13
|
+
C["3 · VERIFY<br/>Your existing tests run in CI"]
|
|
14
|
+
D["4 · FEATURE REPORT<br/>What is implemented?<br/>Coverage + source links + screenshots"]
|
|
15
|
+
E["5 · PR DIFF REPORT<br/>What changed?<br/>Spec diff + before/after evidence"]
|
|
16
|
+
|
|
17
|
+
A -->|stable IDs| B
|
|
18
|
+
B --> C
|
|
19
|
+
C --> D
|
|
20
|
+
D -->|compare base with PR| E
|
|
11
21
|
```
|
|
12
22
|
|
|
13
|
-
## See
|
|
23
|
+
## See what reviewers see
|
|
24
|
+
|
|
25
|
+
This real [demo pull request](https://github.com/anselmdk/feature-spec-md-demo/pull/24) makes high-priority support tickets visually distinct. The spec states the behavior, tests prove it, and CI publishes both views below.
|
|
26
|
+
|
|
27
|
+
### Feature report: the promise and the proof together
|
|
28
|
+
|
|
29
|
+
One screen answers three questions: **What did we promise? Which test covers it? What did the user actually see?**
|
|
30
|
+
|
|
31
|
+
[](https://feature-spec-md.anselm.dk/demo/build/299/#support-desk-ticket-priority-s001)
|
|
14
32
|
|
|
15
|
-
|
|
33
|
+
_Click the image to inspect the live feature report._
|
|
16
34
|
|
|
17
|
-
|
|
18
|
-
- **Latest demo report:** <https://feature-spec-md.anselm.dk/demo/latest/>
|
|
19
|
-
- **Demo repository:** <https://github.com/anselmdk/feature-spec-md-demo>
|
|
35
|
+
### PR diff report: see the behavioral change
|
|
20
36
|
|
|
21
|
-
|
|
37
|
+
The report shows the contract diff and compares browser evidence from the base build with the PR build. **Before is on the left; After is on the right.** Drag the divider to inspect every pixel.
|
|
22
38
|
|
|
23
|
-
|
|
39
|
+
[](https://feature-spec-md.anselm.dk/demo/pr/24/299/)
|
|
24
40
|
|
|
25
|
-
|
|
41
|
+
_Click the image to use the live comparison slider._
|
|
26
42
|
|
|
27
|
-
|
|
43
|
+
## The connection is the feature
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
- **Stable IDs** for model items, rules, and scenarios, so tests can reference exactly what they implement.
|
|
31
|
-
- **Validation** that checks frontmatter, headings, IDs, cross-document references, and test coverage expectations.
|
|
32
|
-
- **Coverage reporting** that shows which model items, rules, and scenarios are implemented by tests.
|
|
33
|
-
- **Scenario evidence policy** so specs can declare whether behavior should be tested by unit, integration, Playwright, manual, or no executable tests.
|
|
34
|
-
- **HTML reports** that combine specs, coverage, validation status, source links, GitHub/build metadata, and screenshot evidence.
|
|
35
|
-
- **PR diff reports** that compare a current published build with a base or previous build and highlight changed report files, changed spec sections, and screenshot evidence.
|
|
36
|
-
- **Screenshot evidence** for scenarios when using the Playwright helper.
|
|
37
|
-
- **GitHub Actions publishing helpers** for job summaries, FTP-published build reports, FTP-published PR diff reports, and PR comments.
|
|
38
|
-
- **A library API** for projects that want to parse specs, check coverage, collect screenshots, render reports, or render diff reports from their own tooling.
|
|
45
|
+
Stable IDs make intent traceable all the way to visible evidence:
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart TB
|
|
49
|
+
R["Rule R004<br/>High-priority tickets must be visually emphasized"]
|
|
50
|
+
S["Scenario S001<br/>A user creates a high-priority ticket"]
|
|
51
|
+
T["Existing test<br/>References S001 and exercises the behavior"]
|
|
52
|
+
P["Report evidence<br/>Links the rule, scenario, test source, and screenshot"]
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
R --> S
|
|
55
|
+
S --> T
|
|
56
|
+
T --> P
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The test runner stays independent. Reference an ID in a test title, annotation, or comment; `feature-spec-md` scans the files and builds the connection.
|
|
60
|
+
|
|
61
|
+
## Bring the project you already have
|
|
62
|
+
|
|
63
|
+
```mermaid
|
|
64
|
+
flowchart TB
|
|
65
|
+
P["Any project<br/>Web app · API · service · CLI · library"]
|
|
66
|
+
S["Plain Markdown specs<br/>Model · features · stack · design"]
|
|
67
|
+
T["Your test setup<br/>Playwright · Vitest · Node test · anything else"]
|
|
68
|
+
C["Your CI<br/>GitHub Actions helpers or the library API"]
|
|
69
|
+
R["Portable HTML reports<br/>Coverage · evidence · pull request changes"]
|
|
70
|
+
|
|
71
|
+
P --> S
|
|
72
|
+
S --> T
|
|
73
|
+
T --> C
|
|
74
|
+
C --> R
|
|
75
|
+
```
|
|
43
76
|
|
|
44
|
-
|
|
77
|
+
Screenshots are policy-driven, not mandatory for every scenario. A backend or CLI project can rely on rules, scenarios, source links, and test coverage; a visual project can require screenshot evidence exactly where it matters.
|
|
45
78
|
|
|
46
|
-
|
|
79
|
+
## What you get
|
|
47
80
|
|
|
48
|
-
|
|
81
|
+
- **Readable intent:** ordinary Markdown for the domain model, features, stack, and design.
|
|
82
|
+
- **Verifiable coverage:** validation and coverage show exactly what tests do—and do not—prove.
|
|
83
|
+
- **Useful evidence:** require screenshots for visual flows and skip them where they add no value.
|
|
84
|
+
- **A complete build view:** the feature report joins specs, source links, coverage, and evidence.
|
|
85
|
+
- **A focused review view:** the PR diff isolates changed intent and before/after behavior.
|
|
49
86
|
|
|
50
|
-
|
|
87
|
+
Explore the [demo repository](https://github.com/anselmdk/feature-spec-md-demo), [latest demo report](https://feature-spec-md.anselm.dk/demo/latest/), [build 299 feature report](https://feature-spec-md.anselm.dk/demo/build/299/), [build 299 PR diff](https://feature-spec-md.anselm.dk/demo/pr/24/299/), or [library-owned mock reports](https://feature-spec-md.anselm.dk/mocks/latest/).
|
|
51
88
|
|
|
52
89
|
## What you write
|
|
53
90
|
|
|
@@ -564,7 +564,7 @@ th{background:var(--surface-muted)}a{color:var(--link)}
|
|
|
564
564
|
.image-comparison{--position:50%;border:1px solid var(--border);border-radius:8px;background:var(--surface-muted);overflow:hidden}
|
|
565
565
|
.image-comparison-stage{position:relative;display:grid;background:var(--surface-muted);overflow:hidden}
|
|
566
566
|
.image-comparison-stage img{display:block;grid-area:1/1;width:100%;height:auto}
|
|
567
|
-
.image-comparison-after{clip-path:inset(0
|
|
567
|
+
.image-comparison-after{clip-path:inset(0 0 0 var(--position))}
|
|
568
568
|
.image-comparison-divider{position:absolute;top:0;bottom:0;left:var(--position);width:3px;background:white;box-shadow:0 0 0 1px rgba(0,0,0,.35);transform:translateX(-50%);pointer-events:none}
|
|
569
569
|
.image-comparison-label{position:absolute;top:10px;border-radius:999px;background:rgba(0,0,0,.72);color:white;font-size:12px;font-weight:700;padding:3px 8px;pointer-events:none}.image-comparison-label.before{left:10px}.image-comparison-label.after{right:10px}
|
|
570
570
|
.image-comparison-control{display:flex;align-items:center;gap:12px;padding:10px 12px;color:var(--muted);font-size:12px}.image-comparison-control input{flex:1;cursor:ew-resize}`;
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED