DEV Community

Cover image for Would your README work on a fresh clone?
bzucker4
bzucker4

Posted on

Would your README work on a fresh clone?

I wanted to know whether someone who had never worked on my Obsidian Link Rot Checker plugin could get from the README to a passing test. On my machine, I already had the dependencies and knew which commands to run. I wanted a check that started where a new contributor would.

The project already had a release workflow that ran tests, lint, and a build when I published a release. I added a separate GitHub Actions job that follows the development instructions on each pull request to main. It made a good first test for Fresh Clone, an action I built to report where contributor setup breaks.

What the runner does

The Link Rot Checker workflow checks out the repo on Linux, sets up Node 24, and runs the commands in the README with dependency caching disabled. Here’s the Fresh Clone step:

- uses: bzucker4/fresh-clone@v0.1.0
  with:
    install: npm install
    test: |
      npm test
      npm run lint
      npm run build
Enter fullscreen mode Exit fullscreen mode

I used npm install because that’s what this README tells contributors to run. The Fresh Clone example uses npm ci by default. That makes sense for a project whose documented instructions call for a locked install.

The pilot pull request run passed all 18 tests and the build. Lint returned three warnings and zero errors.

What a broken setup looks like

For a controlled test, I took a disposable copy of the plugin and moved tests/setup/register.mjs out of its expected path. That’s the file the test runner imports before it runs the suite.

The install still passed. The test command failed with ERR_MODULE_NOT_FOUND. Fresh Clone labeled Test as the first failing stage, and the command output showed the missing module. I restored the file and reran the same commands. The check passed again. That failure was deliberately introduced in the local copy.

The useful part was seeing how far a contributor could get. A green install only told me the packages were in place. It took running the next documented command to find the missing file.

Try it on a small repo

Start with the example workflow and copy your actual setup commands into it. For the test step, pick a command that exits with a meaningful result. A smoke test works well when your README usually ends with a long-running dev server.

I’m looking for three maintainers of small Node.js projects willing to try this. If you run it, I’d like to hear which setup command was hardest to express and whether the failure report was enough to get you moving again. You can share that in the Fresh Clone GitHub issues.

Top comments (0)