Skip to content
Back to skills

Credential Discipline

ASecurity

Example/seed/fixture files must use placeholders not real credentials. Pre-commit grep check + enforcement hooks.

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsgobashgcpgitapi

Works with

  • api

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add jleechanorg/jleechan-skills --skill credential-discipline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Credential Discipline?

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

Security grade badge for Credential Discipline
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jleechanorg-credential-discipline/badge)](https://www.skillsdirectory.com/skills/jleechanorg-credential-discipline)

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: credential-discipline
description: Example/seed/fixture files must use placeholders not real credentials. Pre-commit grep check + enforcement hooks.
---

## Rule: examples, seeds, and test fixtures must use placeholders, not real values.

### What counts as an example

Any file under: `examples/`, `seed/`, `seed_data/`, `test_data/`, `fixtures/`, `mocks/`
Or filename contains: `example`, `seed`, `fixture`, `mock`, or `sample`

### Required placeholder scheme

| Real value | Placeholder |
|---|---|
| `AIzaSy...` (Firebase / Google API key) | `<your-firebase-api-key>` |
| Record or document ID (e.g. a campaign ID) | `<your-record-id>` |
| Auth user UID | `<your-firebase-uid>` |
| Real person's email (test account) | `<your-test-user>@example.com` |
| GCP / Firebase project ID or number | `<your-firebase-project-id>` |
| Any other identifier | `<your-<descriptor>>` |

### Machine-local blocklist

Never write the real values you must not paste into a skill, test, or commit.
Keep them, one fixed string per line, in a machine-local file that is never
committed: `$CREDENTIAL_BLOCKLIST_FILE`, default
`${XDG_CONFIG_HOME:-$HOME/.config}/jleechan-skills/credential-blocklist.txt`.
Typical entries are your own project IDs, project numbers, test-account UIDs,
record IDs from production data, and personal email addresses.

### Before-commit checklist

```bash
BLOCKLIST="${CREDENTIAL_BLOCKLIST_FILE:-${XDG_CONFIG_HOME:-$HOME/.config}/jleechan-skills/credential-blocklist.txt}"
grep -rnE 'AIza[A-Za-z0-9_-]{35}' examples/ 2>&1
if [ -s "$BLOCKLIST" ]; then
  grep -rnF -f "$BLOCKLIST" examples/ 2>&1
else
  echo "WARNING: CREDENTIAL_BLOCKLIST_FILE not configured: $BLOCKLIST is missing or empty, so the blocklist check did NOT run." >&2
  echo "  Create it with one real identifier per line (never commit it): mkdir -p \"\$(dirname \"$BLOCKLIST\")\" && \${EDITOR:-vi} \"$BLOCKLIST\"" >&2
fi
```

Any match is a leak to replace with a placeholder before committing. A missing or
empty blocklist is a skipped check, never a pass: report the warning.

### Enforcement

- **Pre-commit hook:** `~/.claude/hooks/pre-commit-git-identity-example-com-guard.sh` blocks commits by `@example.com`.
- **Per-repo test:** `tests/test_example_placeholder_discipline.sh` in CI for each repository that ships examples.
- **Per-repo hook:** `.githooks/pre-commit` chains identity guard + discipline test on staged `examples/**`.

### Why

3 real production credential leaks landed in public repos between 2026-02 and 2026-04. `.gitleaksignore` is suppression, not a fix — rotate keys + rewrite history.

**If example needs real credential:** move to private repo, parameterize via env var, or use Firebase Emulator.

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.