Skip to content
Back to skills

Targets

ASecurity

Which project files and which database `forge db seed` acts on — `-C` from any directory, seeding a throwaway postgres with a loopback `--dsn`, `--allow-remote-dsn`, and why apply fails with "seeded nothing".

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 13, 2026
ai-agentsgoshellbashgitdatabase

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add reliant-labs/forge --skill targets --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Targets?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Targets
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-targets/badge)](https://www.skillsdirectory.com/skills/reliant-labs-targets)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: targets
description: Which project files and which database `forge db seed` acts on — `-C` from any directory, seeding a throwaway postgres with a loopback `--dsn`, `--allow-remote-dsn`, and why apply fails with "seeded nothing".
---

# Which files, which database

`db/seeding` covers WHAT gets seeded. This is where it comes from and where it
goes.

## Project files come from the project root

Every `forge db` command reads `db/migrations`, `db/seeds/vocab.yaml` and
`db/seeds/custom/` from the project root: the one `-C` names, or the one the
current directory is in. A relative `--dir` is project-relative too, and a
migrations directory that does not exist is an error naming the path.

```bash
forge db migrate up -C ~/src/app --dsn "$DSN"   # from anywhere
forge db seed apply -C ~/src/app
```

## Seeding nothing is an error

`seed apply`, `seed reset` and `db reset` fail, naming the migrations directory
they read, when there was something to seed and nothing was written:

- the database has tables, but the migrations forge read define none — the
  wrong `-C` or `--dir`;
- the dev seed is scoped to tables the migrations do not define;
- the plan inserted 0 rows and every planned table is still empty.

Two outcomes are legitimately empty and succeed:
an already-seeded database (apply is idempotent: `Seeded 0 new
row(s)`), and a schema with no tables at all.

## Seeding a throwaway database

`--dsn` accepts **any loopback database**: `localhost`, `127.0.0.0/8`, `::1` or
a unix socket, on any port, with any database name. A scratch postgres needs no
special handling, which matters because port 5432 is usually taken:

```bash
DSN="postgres://postgres:postgres@localhost:55432/scratch?sslmode=disable"
forge db migrate up --dsn "$DSN"
forge db seed apply --dsn "$DSN"
```

The DSN is read the way the driver dials it: key=value DSNs, `host=` query
parameters, `PGHOST` and multi-host fallbacks all count, and every host must be
local.

A **non-loopback** `--dsn` is refused unless it is the database the env itself
declares, or you pass `--allow-remote-dsn`. The env must be dev either way, and
there is no flag for that.

Two deliberate limits:

- The relaxation applies to an explicit `--dsn` only. An exported
  `$DATABASE_URL` must still be the env's own database, because a stale export
  from another project's shell is nobody's choice.
- `forge db reset` DROPs the database, so it never takes an arbitrary loopback
  DSN. Other projects' real databases live on loopback too.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.