agentleFS
LeanMeanCleanAppsLeanMeanCleanApps/CleanModelContextProtocol/.agents/skills/sample-data/SKILL.md

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.

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
  1. Very specific:

    Keep the fixed Seed and ReferenceDate.

    line 25
  2. Very specific:

    Use DateTime.Now, Guid.NewGuid() or an unseeded Faker in sample data.

    line 33

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sample data

The rule

There are two kinds of data, and they never mix.

WhereUsed byShape
Sample datasrc/Infrastructure/Databases/MovieReviews/Extensions/MovieReviewsDbContextExtensions.cs (AddData)Local runs, Docker and the presentation integration tests15 authors, 50 movies, 150 reviews from Bogus with a fixed seed
Test datatests/Infrastructure.Tests.Integration/Databases/MovieReviews/Extensions/MovieReviewsCollectionData.cs (AddTestData)Repository testsA 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

  1. New column on a model? Add a RuleFor to the matching Faker<T> in AddData, and a value to the rows in AddTestData if tests need it.
  2. Movie titles and review text come from the Titles and ReviewTexts lists in AddData. Keep them made up, with no real films, characters or brands, and keep a few titles for common searches such as "space" or "love".
  3. Keep the fixed Seed and ReferenceDate. Dates come from f.Date.Past(refDate: ReferenceDate), never from the clock, so every run gives the same data.
  4. Tests that need a specific row look it up by its known value (Authors.First(a => a.FirstName == "One")), not by position.
  5. 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 SeedSampleData on in appsettings.json.
  • Use DateTime.Now, Guid.NewGuid() or an unseeded Faker in 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 test

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.