sample-data
Skill1 starsChanged 6 days agoMITView on GitHub
How the sample data is seeded with Bogus behind the Database:SeedSampleData setting, and how tests get their own fixed data. Use when changing seed data, adding a column that needs sample values, or writing tests that depend on known data.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Keep the fixed Seed and ReferenceDate.
- Very specific: line 33
Use DateTime.Now, Guid.NewGuid() or an unseeded Faker in sample data.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sample data
The rule
There are two kinds of data, and they never mix.
| Where | Used by | Shape | |
| Sample data | src/Infrastructure/Databases/MovieReviews/Extensions/MovieReviewsDbContextExtensions.cs (AddData) | Local runs, Docker and the presentation integration tests | 15 authors, 50 movies, 150 reviews from Bogus with a fixed seed |
| Test data | tests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs (AddTestData) | Repository tests | A handful of hand-written rows named "One", "Two", "Three" so assertions can find them |
Sample data is only added when Database:SeedSampleData is true (on in appsettings.local.json and appsettings.docker.json, off in appsettings.json; Lambda turns it on only in docker-compose.yml) and the database is empty. A deployed copy never starts with fake data.
Steps
- New column on a model? Add a
RuleForto the matchingFaker<T>inAddData, and a value to the rows inAddTestDataif tests need it. - Movie titles and review text come from the
TitlesandReviewTextslists inAddData. Keep them made up, with no real films, characters or brands, and keep a few titles for common searches such as "space" or "love". - Keep the fixed
SeedandReferenceDate. Dates come fromf.Date.Past(refDate: ReferenceDate), never from the clock, so every run gives the same data. - Tests that need a specific row look it up by its known value (
Authors.First(a => a.FirstName == "One")), not by position. - Presentation integration tests that need a row with children pick one that has them. Bogus spreads reviews at random, so a few movies and authors have none.
Don't
- Seed in a repository constructor or on every request. Seeding happens once, in
InitialiseInfrastructure(). - Turn
SeedSampleDataon inappsettings.json. - Use
DateTime.Now,Guid.NewGuid()or an unseededFakerin sample data. - Assert exact counts of sample data in presentation tests. They depend on the random spread; repository tests use the test data for exact counts.
Check
dotnet testDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

