@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
- Markdown specs for AI-assisted, testable spec-driven development.
3
+ **Write what should be true. Prove it with tests and screenshots. Review exactly what changed.**
4
4
 
5
- `feature-spec-md` helps you describe a product in Markdown, ask an AI to turn those specs into executable tests, and then prove which parts of the specification are covered by those tests. It is intentionally small: your specs stay as plain Markdown, your tests stay in your normal test runner, and the tool connects the two through stable spec IDs.
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
- ```txt
8
- model + features + stack + design
9
- -> AI-written executable tests that reference stable spec IDs
10
- -> validation, coverage, screenshots, reports, and PR diffs
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 the workflow in action
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
+ [![Feature spec report showing the covered visual rule, scenario, source line, and screenshot evidence](docs/assets/feature-spec-report.jpg)](https://feature-spec-md.anselm.dk/demo/build/299/#support-desk-ticket-priority-s001)
14
32
 
15
- The clearest example of what this library can deliver is the published demo and its repository:
33
+ _Click the image to inspect the live feature report._
16
34
 
17
- - **Latest library mock reports:** <https://feature-spec-md.anselm.dk/mocks/latest/>
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
- PRs like this are the essence of `feature-spec-md`: a feature branch can carry the product/spec/code change, a published feature spec report can show the full implementation state, and a PR diff report can show exactly what changed in the specs, rendered report, and screenshot evidence.
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
- ## What the tool does
39
+ [![Feature spec PR diff showing the red high-priority treatment on the After side of the interactive comparison](docs/assets/pr-diff-report.jpg)](https://feature-spec-md.anselm.dk/demo/pr/24/299/)
24
40
 
25
- The shortest version is: `feature-spec-md` turns Markdown specifications into a testable contract.
41
+ _Click the image to use the live comparison slider._
26
42
 
27
- It gives you:
43
+ ## The connection is the feature
28
44
 
29
- - **Spec document formats** for domain models, product features, technical stack notes, and UI/design direction.
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
- The specs are meant to be written with an AI before implementation. The tests are meant to be written with an AI from those specs. `feature-spec-md` then checks that the Markdown stays structured and that executable tests still cover the model items, rules, and scenarios the specs define.
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
- ## Demo project
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
- A complete demo app is available in [`anselmdk/feature-spec-md-demo`](https://github.com/anselmdk/feature-spec-md-demo). It shows a small support-ticket desk built from model, feature, stack, and design specs, with unit tests, Playwright tests, generated coverage, screenshot evidence, a published feature spec report, and a published PR diff report.
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
- Demo reports, including scenario screenshots, are available here:
79
+ ## What you get
47
80
 
48
- <https://feature-spec-md.anselm.dk/demo/latest/>
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
- Use the demo repository when you want to see the expected project shape, script names, screenshot manifest flow, CI publishing setup, PR comments, and report output in a real app.
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 calc(100% - var(--position)) 0 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anselmdk/feature-spec-md",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Markdown specs for AI-assisted, testable spec driven development across model, feature, stack, and design documents.",
5
5
  "type": "module",
6
6
  "repository": {