fix-secret
Skill15 starsChanged 6 months agoMITView on GitHub
Resolve a commit blocked by gitleaks — move the secret to .env, ask the user to populate it, and WAIT for confirmation before retrying the commit
- Reads credentials
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- close-issueSkill
- create-issueSkill
- start-issueSkill
- statusSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 11
Use this skill whenever a git commit is blocked by the gitleaks pre-commit hook because a secret was hardcoded in source code.
- Distinctive: line 16
Identify the secret: Read the gitleaks output — file, line, and RuleID.
- Very specific: line 19
Remove it from the code: Delete the hardcoded value.
- Very specific: line 24
Document the variable: Make sure .env.example lists the variable name with a placeholder value — never the real one.
- Very specific: line 29
NEVER read, write, or create .env yourself — the user owns secrets.
- Very specific: line 31
WAIT for explicit confirmation: Do NOT retry the commit and do NOT continue with any other step until the user confirms .env is ready (e.g.
- Distinctive: line 36
Retry the commit: only after the user confirms.
- Very specific: line 43
NEVER commit a secret, even with --no-verify.
- Very specific: line 45
NEVER touch .env — reading, writing, or creating it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fix Secret
Use this skill whenever a git commit is blocked by the gitleaks
pre-commit hook because a secret was hardcoded in source code.
Steps
- Identify the secret: Read the gitleaks output — file, line, and RuleID. Confirm what kind of secret it is (API key, token, password).
- Remove it from the code: Delete the hardcoded value. Refactor the
code to read the value from an environment variable
(e.g.
process.env.LINEAR_API_KEY). Keep the real connection code so there is something meaningful to commit. - Document the variable: Make sure
.env.examplelists the variable name with a placeholder value — never the real one. - STOP — hand off to the user. Tell the user the exact variable name
to set and ask them to add the real value to the
.envfile. NEVER read, write, or create.envyourself — the user owns secrets. - WAIT for explicit confirmation. Do NOT retry the commit and do NOT
continue with any other step until the user confirms
.envis ready (e.g. "listo", "ya está", "done"). This pause is MANDATORY — never assume.envis configured. - Retry the commit only after the user confirms. gitleaks now passes because the code is clean.
- Continue the normal flow (push → PR →
/close-issue).
Rules
- NEVER commit a secret, even with
--no-verify. The CI gitleaks job would catch it anyway and the secret would land in git history. - NEVER touch
.env— reading, writing, or creating it. The user manages all secret values. - Step 5 is non-negotiable: WAIT for the user's confirmation before retrying the commit. Do not assume the flow will succeed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

