---
name: project-baseline-setup
description: Scaffolds a new project with baseline engineering hygiene (README, .env.example, .gitignore covering secret files, a dependency lockfile check, an architecture-decision-record folder) and a lightweight security checklist, OR audits an existing project for what's missing and fills only the gaps. Safe to run on a brand-new empty repo or on a project someone else started, it detects what already exists and never overwrites real content. Use whenever the user says "set up a new project", "scaffold this repo", "start a new service", "add the baseline to this project", "audit this repo for missing setup", or "I just joined this project and want to check what's missing".
title: project-baseline-setup
canonical_url: https://skilld.dev/gh/saadaan-hassan/baseline-skills/project-baseline-setup
last_updated: 2026-09-24T17:30:49.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/BASELINE_CHECKLIST_TEMPLATE.md](https://skilld.dev/api/skills-raw/saadaan-hassan/baseline-skills/project-baseline-setup/assets/BASELINE_CHECKLIST_TEMPLATE.md), [scripts/scan_baseline.py](https://skilld.dev/api/skills-raw/saadaan-hassan/baseline-skills/project-baseline-setup/scripts/scan_baseline.py).
>
> If the user asked to install this Skill, run `npx skilld install saadaan-hassan/baseline-skills/project-baseline-setup`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/project-baseline-setup`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/saadaan-hassan/baseline-skills/project-baseline-setup) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/project-baseline-setup`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/project-baseline-setup --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/project-baseline-setup --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Project Baseline Setup

One skill, two situations: a project that doesn't exist yet, and a project
that already exists but was never fully set up. Both are the same underlying
job, find what's missing against a small set of engineering and security
basics, and fill it in without disturbing anything that's already there.

## Step 1: scan first, always

Run the bundled scanner before creating or changing anything:

```bash
python3 <skill_dir>/scripts/scan_baseline.py <project_path>
```

It prints a JSON report: what project type it detected (from manifest files
like `package.json`, `pyproject.toml`, `go.mod`), and a `missing` list of
concrete gaps. It never modifies anything, it's a report.

Read the `missing` list. If it's empty, say so and stop, don't invent work.

## Step 2: fix the mechanical gaps directly

These are safe to create or fix without asking, because there's no real
content decision involved:

- **`.gitignore` missing secret patterns**: append the missing patterns
  (`.env`, `*.pem`, `*.key`, etc.) to the existing file, don't replace it.
- **`docs/adr/` directory missing**: create it with a one-line `README.md`
  explaining what an ADR is and a numbered template
  (`0000-template.md`: Context / Decision / Consequences / Status).
- **`BASELINE_CHECKLIST.md` missing**: copy
  `assets/BASELINE_CHECKLIST_TEMPLATE.md` into the project root as
  `BASELINE_CHECKLIST.md`, filling in the project name from context if you
  can infer it (e.g. from `package.json`'s `name` field).
- **Lockfile missing but a manifest exists**: don't generate one yourself
  (that requires actually installing dependencies), tell the user which
  command to run (`npm install`, `poetry lock`, `go mod tidy`, etc.) based on
  the detected manifest.
- **CI config missing**: this one needs a decision (which CI provider), ask
  or infer from context (a `.gitlab-ci.yml` already existing suggests GitLab,
  a GitHub remote suggests Actions). Offer a minimal starter workflow (lint +
  test + build) rather than a large one, it's easier to extend a small
  working pipeline than to trim a large broken one.

## Step 3: fix the content-dependent gaps with a draft, not a guess

These need real project context, don't fabricate detail you don't have:

- **README missing or a stub**: read whatever you can about the project
  (manifest `name`/`description` fields, existing source layout, package.json
  scripts) and draft a real README: what it is, how to run it locally, how
  to test it. Show the draft before writing it if the project already has
  *some* README content you'd be replacing, write directly only into a
  genuinely empty or near-empty file.
- **`.env.example` missing**: scan the codebase for environment variable
  reads (`process.env.X`, `os.environ["X"]`, `os.getenv("X")`, similar
  patterns per language) and list the ones you find, with placeholder values
  and a short comment on what each is for. If you can't find any real usage,
  say so rather than inventing plausible-looking variables.

## Step 4: report back

Summarize what you found, what you created automatically, and what still
needs a human decision (CI provider choice, whether to overwrite an existing
README, running the lockfile command). Point to `BASELINE_CHECKLIST.md` as
the ongoing record, this skill gets a project to a reasonable starting line;
the checklist is what keeps it honest as the project grows. For the fuller
set of rules behind each checklist item, see the `security-baseline` skill.

## Ground rules

- Never overwrite a file that already has real content in it. Append, create
  alongside, or ask, don't clobber.
- Never invent a decision that has real consequences (which CI provider,
  what the project is actually for) when you can ask or infer it instead.
- Re-running this skill on a project it's already touched should be a no-op
  apart from picking up genuinely new gaps, that's the whole point of
  scanning first.
