copilot-instructions.md Generator From Your Repo's Real Build, Test and Style Setup

Has GitHub Copilot inspect your repo and write a .github/copilot-instructions.md with the real build, test and lint commands and checkable conventions, plus up to three path-scoped .instructions.md files.

You getThe copilot-instructions.md content in one code block, each proposed .instructions.md file in its own code block and table

Prompt

Installs to .agents/skills/copilot-instructions-md-generator-from-your-repo-s-real-build-te/

mkdir -p .agents/skills/copilot-instructions-md-generator-from-your-repo-s-real-build-te && curl -sL "https://prompts-gpt.com/prompts/copilot-instructions-md-generator-from-your-repo-s-real-build-test-and-style-setup/raw" -o .agents/skills/copilot-instructions-md-generator-from-your-repo-s-real-build-te/SKILL.md
SKILL.md
Preview
---
name: copilot-instructions-md-generator-from-your-repo-s-real-build-te
description: "Has GitHub Copilot inspect your repo and write a .github/copilot-instructions.md with the real build, test and lint commands and checkable conventions, plus up to three path-scoped .instructions.md files."
---

# copilot-instructions.md Generator From Your Repo's Real Build, Test and Style Setup

Has GitHub Copilot inspect your repo and write a .github/copilot-instructions.md with the real build, test and lint commands and checkable conventions, plus up to three path-scoped .instructions.md files.

## Prompt

```
You are GitHub Copilot in agent mode, working in this repository. Write a .github/copilot-instructions.md file that tells Copilot how to work here, based only on what you find in the repo.

Steps:
1. Inspect package manifests and lockfiles, Makefile or task scripts, .github/workflows, lint and format configs, test folders, the README and any existing AGENTS.md, CLAUDE.md or .github/instructions files.
2. Find the exact commands to install, build, run one test, run all tests, lint and typecheck. Take them from scripts and CI; do not guess. Run the quick, safe ones and note the result.
3. Record the folder layout, naming and error-handling conventions visible in the code, and the do-not rules: generated files, migrations, secrets, vendored code.

Rules: under about two pages; every line checkable; nothing a linter or CI already enforces; no README text copied over.

Then propose at most three path-specific files at .github/instructions/NAME.instructions.md, each with an applyTo glob in its front matter (for example src/api/**/*.ts) and only the rules that differ for that area.

Output format:
1. The copilot-instructions.md content in one code block
2. Each proposed .instructions.md file in its own code block
3. Table: command | source (script or CI file) | ran successfully
4. What you could not verify
```

## Usage Notes

Run in GitHub Copilot agent mode (VS Code, Visual Studio or JetBrains) at the repo root, review the commands table, then commit. Copilot coding agent and code review read these files.

Example output

At a glanceWhat the generator produced for ledgerlineCommands were checked against the repo, not guessed
Main instructions file
1
.github/copilot-instructions.md
Path-scoped instruction files
3
api, web and db packages
Commands ran successfully
5 of 7
pnpm test needs Postgres; db generate not run
Items flagged as unverified
3
Listed under Could not verify

Example for: "ledgerline", a pnpm monorepo with a Fastify API, a React web app, and a shared Drizzle schema package.

1. .github/copilot-instructions.md
# Copilot instructions for ledgerline

## Commands (run from repo root)
- Install: `pnpm install --frozen-lockfile` (pnpm 9.4, Node 20.12 per `.nvmrc`)
- Build all: `pnpm build` (turbo, builds `packages/db` first)
- Run one test: `pnpm --filter @ledgerline/api vitest run src/invoices/totals.test.ts`
- Run all tests: `pnpm test` (needs Postgres; see `docker-compose.test.yml`)
- Lint: `pnpm lint`
- Typecheck: `pnpm typecheck`

## Layout
- `apps/api` – Fastify server, one folder per domain (`src/invoices`, `src/customers`)
- `apps/web` – React 18 + Vite
- `packages/db` – Drizzle schema and migrations, shared by both apps
- `packages/money` – currency math; import it instead of doing arithmetic on amounts

## Conventions
- Money is stored as integer minor units (`amountCents: number`). Never use floats for amounts.
- Domain errors extend `AppError` from `apps/api/src/errors.ts` and set a `code` string.
- Tests sit next to source as `*.test.ts`. Integration tests use `*.int.test.ts`.
- Dates cross the API boundary as ISO 8601 strings, not `Date` objects.

## Do not
- Edit `packages/db/migrations/*.sql` by hand. Change `schema.ts`, then run `pnpm --filter @ledgerline/db generate`.
- Edit `apps/web/src/api-client/` because it is generated from OpenAPI by `pnpm gen:client`.
- Commit `.env*` files except `.env.example`.
- Touch `vendor/pdfkit-patched/`.
2. Path-specific files
---
applyTo: "apps/api/src/**/*.ts"
---
- Every route registers a TypeBox schema for body and response.
- Handlers call a service function. They never query `db` directly.
- Throw `AppError` subclasses. Do not reply with raw `reply.code(4xx)`.
---
applyTo: "apps/web/src/**/*.tsx"
---
- Fetch data through TanStack Query hooks in `src/queries/`, not with `fetch` in components.
- Format amounts with `formatMoney()` from `@ledgerline/money`.
---
applyTo: "packages/db/**"
---
- Add new tables in their own file under `src/schema/` and re-export them from `src/schema/index.ts`.
- New columns are nullable or have a default, so migrations stay non-blocking.
3. Commands
commandsourceran successfully
pnpm install --frozen-lockfile.github/workflows/ci.ymlyes
pnpm buildroot package.json, turbo.jsonyes (41s)
pnpm --filter @ledgerline/api vitest run <file>apps/api/package.jsonyes, 6 passed
pnpm testci.ymlno: needs Postgres, not started
pnpm lintroot package.jsonyes, 0 errors
pnpm typecheckci.ymlyes
pnpm --filter @ledgerline/db generatepackages/db/package.jsonnot run (writes files)
4. Could not verify
  • Whether pnpm test passes in full, because the integration suite requires the Postgres service from CI.
  • pnpm gen:client expects a running API at localhost:4010, so the command was not run.
  • The vendor/pdfkit-patched/ rule comes from a README comment only. Nothing enforces it.
Written by AI from this prompt. Your results will vary.

Run in GitHub Copilot agent mode (VS Code, Visual Studio or JetBrains) at the repo root, review the commands table, then commit. Copilot coding agent and code review read these files.

Make it repeatable

Keep using this prompt without pasting it in every time.

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Keep exploring

More in GitHub Copilot