Skip to content

Commit fe7ea00

Browse files
committed
fix wizard gen
1 parent 3b1439e commit fe7ea00

471 files changed

Lines changed: 873 additions & 16794 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/ai-usage.md

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,102 @@ To change this file edit the source file and then run MarkdownSnippets.
99

1010
AI coding assistants (Claude Code, GitHub Copilot, Cursor, etc.) work well with Verify snapshot tests, but benefit from some project-level guidance. This page covers how to configure a project so AI assistants understand Verify's workflow.
1111

12+
There are two approaches: a **skill** (action-oriented, invocable on-demand) and a **context file** (passive, always-on knowledge). Both can be used together.
1213

13-
## AI context file
1414

15-
Add the following to the AI context file for the relevant tool. Adapt the test command and framework references to match the project.
15+
## Skill
16+
17+
A skill provides action-oriented instructions that an AI assistant can invoke when handling Verify snapshot test failures.
18+
19+
Create a `SKILL.md` file in the appropriate directory for the tool:
20+
21+
* **Claude Code**: `.claude/skills/verify-snapshot-testing/SKILL.md`
22+
* **GitHub Copilot**: `.github/skills/verify-snapshot-testing/SKILL.md`
23+
24+
The content is the same for both tools:
25+
26+
~~~markdown
27+
---
28+
name: verify-snapshot-testing
29+
description: Handle Verify snapshot test failures. Use this when a Verify snapshot test fails, when asked to accept or update snapshots, or when asked to add a new Verify test.
30+
---
31+
32+
Handle [Verify](https://github.com/VerifyTests/Verify) snapshot test failures.
33+
34+
## Key concepts
35+
36+
- **`.verified.*` files** are the approved snapshots. They are committed to source control.
37+
- **`.received.*` files** are the actual output from the latest test run. They are generated when a test fails (actual != expected) and are git-ignored.
38+
39+
## Handling a test failure
40+
41+
When a Verify snapshot test fails, follow this process:
42+
43+
### Step 1: Read the exception message
44+
45+
The exception message is machine-parsable:
46+
47+
```
48+
Directory: /path/to/test/project
49+
New:
50+
- Received: TestClass.Method.received.txt
51+
Verified: TestClass.Method.verified.txt
52+
NotEqual:
53+
- Received: TestClass.Method.received.txt
54+
Verified: TestClass.Method.verified.txt
55+
56+
FileContent:
57+
58+
Received: TestClass.Method.received.txt
59+
<received content>
60+
Verified: TestClass.Method.verified.txt
61+
<verified content>
62+
```
63+
64+
- `Directory:` gives the base path for all file references.
65+
- `New` means no `.verified.` file exists yet (first run or new test).
66+
- `NotEqual` means the `.received.` and `.verified.` files differ.
67+
- `Delete` means a `.verified.` file is no longer produced by any test.
68+
- `FileContent:` contains the actual content for comparison.
69+
70+
### Step 2: Read the files
71+
72+
1. Read the `.received.*` file to see the actual output.
73+
2. Read the `.verified.*` file (if it exists) to see the expected output.
74+
3. Compare the two to understand the difference.
75+
76+
### Step 3: Determine the action
77+
78+
- **If the change is expected** (due to an intentional code change): copy the `.received.*` file over the `.verified.*` file to accept the new snapshot.
79+
- **If it is a new test** (no `.verified.*` file): accept the `.received.*` file as the new snapshot by renaming it to `.verified.*`.
80+
- **If the change is a bug**: fix the code, not the snapshot. Re-run the test to confirm the fix.
81+
82+
## Rules
83+
84+
- **Never hand-edit `.verified.*` files** to make tests pass. Always let Verify generate the correct output by running the test.
85+
- Snapshot files live next to the test source file. For a test in `Tests/MyTests.cs`, look for `Tests/MyTests.MethodName.verified.txt`.
86+
87+
## Scrubbed values
88+
89+
Verify replaces non-deterministic values with stable placeholders. These are intentional:
90+
91+
- GUIDs become `Guid_1`, `Guid_2`, etc.
92+
- DateTimes become `DateTime_1`, `DateTime_2`, etc.
93+
- File paths become `{SolutionDirectory}`, `{ProjectDirectory}`, `{TempPath}`.
94+
95+
Do not treat these placeholders as errors.
96+
97+
## Verified file conventions
98+
99+
- Encoding: UTF-8 with BOM
100+
- Line endings: LF (not CRLF)
101+
- No trailing newline
102+
~~~
103+
104+
105+
## Context file
106+
107+
A context file provides passive, always-on knowledge about Verify. Add the following to the AI context file for the relevant tool. Adapt the test command and framework references to match the project.
16108

17109
* **Claude Code**: `CLAUDE.md`
18110
* **GitHub Copilot**: `.github/copilot-instructions.md`

docs/explicit-targets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,5 @@ public Task WithTargets() =>
144144
```txt
145145
Raw target value
146146
```
147-
<sup><a href='/src/Verify.MSTest.Tests/Tests.WithTargets#targetName.verified.txt#L1-L1' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.MSTest.Tests/Tests.WithTargets#targetName.verified.txt' title='Start of snippet'>anchor</a></sup>
147+
<sup><a href='/src/Verify.MSTest.Tests/Tests.WithTargets%23targetName.verified.txt#L1-L1' title='Snippet source file'>snippet source</a> | <a href='#snippet-Verify.MSTest.Tests/Tests.WithTargets#targetName.verified.txt' title='Start of snippet'>anchor</a></sup>
148148
<!-- endSnippet -->

docs/jsonappender.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Then the appended content will be added to the `.verified.txt` file:
106106
theData: theValue
107107
}
108108
```
109-
<sup><a href='/src/Verify.Tests/Converters/JsonAppenderTests.Stream#00.verified.txt#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-JsonAppenderTests.Stream#00.verified.txt' title='Start of snippet'>anchor</a></sup>
109+
<sup><a href='/src/Verify.Tests/Converters/JsonAppenderTests.Stream%2300.verified.txt#L1-L3' title='Snippet source file'>snippet source</a> | <a href='#snippet-JsonAppenderTests.Stream#00.verified.txt' title='Start of snippet'>anchor</a></sup>
110110
<!-- endSnippet -->
111111

112112
See [Converters](/docs/converter.md) for more information on `*.00.verified.txt` files.

docs/mdsource/ai-usage.source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ name: verify-snapshot-testing
2222
description: Handle Verify snapshot test failures. Use this when a Verify snapshot test fails, when asked to accept or update snapshots, or when asked to add a new Verify test.
2323
---
2424

25-
You are a specialized agent for handling [Verify](https://github.com/VerifyTests/Verify) snapshot test failures.
25+
Handle [Verify](https://github.com/VerifyTests/Verify) snapshot test failures.
2626

2727
## Key concepts
2828

docs/mdsource/text-file-settings.include.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ All text extensions of `*.verified.*` should have:
1414
* `eol` set to `lf`
1515
* `working-tree-encoding` set to `UTF-8`
1616

17-
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git doesn't strip or add the BOM — it just passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that's not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob too.
17+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
1818

1919
All Binary files should also be marked to avoid merging and line ending issues with binary files.
2020

docs/wiz/Linux_Other_Cli_Expecto_AppVeyor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ All text extensions of `*.verified.*` should have:
6969
* `eol` set to `lf`
7070
* `working-tree-encoding` set to `UTF-8`
7171

72+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
73+
7274
All Binary files should also be marked to avoid merging and line ending issues with binary files.
7375

7476
eg add the following to `.gitattributes`

docs/wiz/Linux_Other_Cli_Expecto_AzureDevOps.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ All text extensions of `*.verified.*` should have:
6969
* `eol` set to `lf`
7070
* `working-tree-encoding` set to `UTF-8`
7171

72+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
73+
7274
All Binary files should also be marked to avoid merging and line ending issues with binary files.
7375

7476
eg add the following to `.gitattributes`

docs/wiz/Linux_Other_Cli_Expecto_GitHubActions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ All text extensions of `*.verified.*` should have:
6969
* `eol` set to `lf`
7070
* `working-tree-encoding` set to `UTF-8`
7171

72+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
73+
7274
All Binary files should also be marked to avoid merging and line ending issues with binary files.
7375

7476
eg add the following to `.gitattributes`

docs/wiz/Linux_Other_Cli_Expecto_None.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ All text extensions of `*.verified.*` should have:
6969
* `eol` set to `lf`
7070
* `working-tree-encoding` set to `UTF-8`
7171

72+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
73+
7274
All Binary files should also be marked to avoid merging and line ending issues with binary files.
7375

7476
eg add the following to `.gitattributes`

docs/wiz/Linux_Other_Cli_Fixie_AppVeyor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ All text extensions of `*.verified.*` should have:
6868
* `eol` set to `lf`
6969
* `working-tree-encoding` set to `UTF-8`
7070

71+
Note: `working-tree-encoding=UTF-8` is correct even though Verify writes files with a BOM. Git does not strip or add the BOM — it passes through transparently. The `UTF-8-BOM` encoding would explicitly add a BOM on checkout and strip it on commit (so the internal blob differs from the working tree), but that is not the desired behavior since Verify writes the BOM itself and it should be preserved in the blob.
72+
7173
All Binary files should also be marked to avoid merging and line ending issues with binary files.
7274

7375
eg add the following to `.gitattributes`

0 commit comments

Comments
 (0)