agentharness / rules
Cursor rule1 starsChanged 2 months agoMITView on GitHub
Use when creating a git commit — atomic commits, message format, what never to commit, and the agent workflow-completion requirement (run completion gate; stage or publish per publish authority).
- Reads credentials
- Commits and pushes
We split this committing.mdc into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
This path is specific to the agentharness repo itself: If this skill file is symlinked/copied into a *consumer* project instead (the normal …
- Very specific: line 92
If pushing will be a recurring need in this environment, gh auth setup-git is the durable fix (configures git's credential helper to use …
- Distinctive: line 107
Don't commit broken code planning to fix it "in the next commit."
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
---
description: "Use when creating a git commit — atomic commits, message format, what never to commit, and the agent workflow-completion requirement (run completion gate; stage or publish per publish authority)."
---
## Committing
Full reference: `.github/COMMITTING_GUIDELINES.md` (examples, git aliases,
commit template). This skill is the actionable summary.
### Before you commit
1. `git status` and `git diff` — know exactly what you're about to commit.
2. Stage specific files, not `git add .` / `git add -A` blind.
3. `git diff --cached` — review staged content one more time, scan for
secrets (API keys, tokens, passwords).
4. Let hooks run. Never `--no-verify`, never `--no-gpg-sign`. If a hook
fails, fix the underlying issue and re-stage — don't bypass it.
### Writing the commit
- **Atomic**: one logical change per commit. Don't mix a feature, a fix,
and a refactor in one commit.
- **Message explains WHY, not WHAT** — the diff already shows what
changed.
- Imperative mood summary ("Add X", not "Added X"), ideally under ~50
chars, blank line, then body wrapped at ~72 chars if more explanation
is needed.
- Reference issues (`Fixes #123`, `Relates to #456`) when applicable.
### What never gets committed
- Secrets: API keys, tokens, passwords, private credentials.
- `.env` and its variants — but DO commit `.env.sample` (sanitized
template).
- Debug code: stray `console.log`/`print`, commented-out code, debugger
statements.
- Build artifacts, `node_modules/`, and anything covered by
`.github/.gitignore.template`.
### After the commit — run the completion gate, then follow publish authority
1. **Run `bash tools/check-completion.sh`** — all quality gates must pass
before declaring work done. This is enforced by the Stop hook in
`.github/hooks/completion-gate.json` (Copilot) and `.claude/settings.json`
(Claude Code).
**This path is specific to the agentharness repo itself.** If this
skill file is symlinked/copied into a *consumer* project instead
(the normal case — see `harness-link.sh`), `tools/check-completion.sh`
does not exist there and will exit 127. Check for a generated,
consumer-local completion gate first: `[ -x .agentharness-bin/check ]`.
`harness-link.sh init`/`update` generates this wrapper automatically
for `link`/`submodule`/`npm` modes — run `bash .agentharness-bin/check`
in its place. It delegates to the resolved harness checkout's own
`enforce-profile` command against *this* project, not the harness's.
`--mode copy` has no live harness checkout to delegate to, so no
wrapper exists there — `harness-link.sh audit --json`'s
`can_mechanically_enforce` field tells you up front whether a given
install has one at all, rather than finding out mid-task. Either way,
also run this project's own lint/type/test commands if it has any not
covered by the gate. Don't silently skip verification just because the
harness's own path doesn't resolve — find the equivalent for *this*
repo.
2. **Default (no publish authority): stop at the commit.**
Stage the commit locally, summarize what was done, and ask the user to
confirm before pushing or opening a PR. Work is "done" when the user
has reviewed and approved the staged changes.
3. **With publish authority**: push and open a PR.
Publish authority is granted when `.agentharness-publish-mode`
**exists** at the repo root — check with `[ -f
.agentharness-publish-mode ]` (or `test -e`), never by reading its
contents. The file is typically empty by design; an agent that
`cat`s it, sees nothing, and concludes "not active" has the check
backwards — presence alone grants authority, content is
irrelevant. `harness-link.sh audit --json`'s `publish_mode_active`
field already implements this correctly if you'd rather not shell
out to `test` directly.
Publish authority is also granted when the user explicitly
authorizes it in the current session.
- `git push -u origin <branch>` (first push) or `git push` (subsequent).
**If this fails with an SSH key error** (`Permission denied
(publickey)`) even though `gh auth status` shows a valid session:
the remote is an SSH URL (`git@github.com:...`) but no SSH key is
configured in this environment — a real, seen-in-practice mismatch,
not a sign the push itself is wrong. Don't
permanently reconfigure the remote to work around a one-off
environment gap. Instead, push to an explicit HTTPS URL for this
one invocation, using `gh`'s own credentials:
`git push "https://github.com/$(gh repo view --json nameWithOwner -q .nameWithOwner).git" <branch>`.
If pushing will be a recurring need in this environment, `gh auth
setup-git` is the durable fix (configures git's credential helper
to use `gh`'s token for HTTPS) — but that's a persistent
environment change, so confirm with the user before running it,
the same as any other durable configuration change.
- `gh pr create` with a real title, body, and test/verification notes.
- Work is not "done" until the PR exists, CI is green, and review
comments have been addressed.
See `CLAUDE.md`'s "Agent Workflow Completion" section for the full rules
and the `📋 Completion Gate` section for the gate commands.
### If tests or hooks fail
Fix the underlying issue (lint error, failing test, secret detected).
Don't commit broken code planning to fix it "in the next commit."
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository77 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/accessibility.mdcCursor rule
- .cursor/rules/agentharness-router.mdcCursor rule
- .cursor/rules/agentic-loops.mdcCursor rule
- .cursor/rules/api-design.mdcCursor rule
- .cursor/rules/audit-review-followup.mdcCursor rule
- .cursor/rules/big-work-plan-review.mdcCursor rule
- .cursor/rules/branching.mdcCursor rule
- .cursor/rules/clean-architecture.mdcCursor rule
- .cursor/rules/code-review-api.mdcCursor rule
- .cursor/rules/code-review-db.mdcCursor rule
- .cursor/rules/code-review.mdcCursor rule
- .cursor/rules/code-review-ui.mdcCursor rule
- .cursor/rules/database-conventions.mdcCursor rule
- .cursor/rules/dependency-audit.mdcCursor rule
- .cursor/rules/dependency-injection.mdcCursor rule
- .cursor/rules/design-patterns.mdcCursor rule
- .cursor/rules/docker-conventions.mdcCursor rule
- .cursor/rules/error-handling.mdcCursor rule
- .cursor/rules/file-placement-policy.mdcCursor rule
- .cursor/rules/github-issue-triage.mdcCursor rule
- .cursor/rules/go-conventions.mdcCursor rule
- .cursor/rules/harness-feedback.mdcCursor rule
- .cursor/rules/logging.mdcCursor rule
- .cursor/rules/multi-agent-coordination.mdcCursor rule
- .cursor/rules/mutation-testing.mdcCursor rule
- .cursor/rules/performance-profiling.mdcCursor rule
- .cursor/rules/planning-with-files.mdcCursor rule
- .cursor/rules/port-agent-config.mdcCursor rule
- .cursor/rules/project-bootstrap.mdcCursor rule
- .cursor/rules/python-conventions.mdcCursor rule
- .cursor/rules/react-best-practices.mdcCursor rule
- .cursor/rules/refactoring.mdcCursor rule
- .cursor/rules/requirements-clarification.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/solid-principles.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/typescript-conventions.mdcCursor rule
- accessibilitySkill
- agentic-loopsSkill
- api-designSkill
- audit-review-followupSkill
- big-work-plan-reviewSkill
- branchingSkill
- clean-architectureSkill
- code-review-apiSkill
- code-review-dbSkill
- code-reviewSkill
- code-review-uiSkill
- committingSkill
- database-conventionsSkill
- dependency-auditSkill
- dependency-injectionSkill
- design-patternsSkill
- docker-conventionsSkill
- error-handlingSkill
- file-placement-policySkill
- github-issue-triageSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

