Skip to content
Back to skills

Common Best Practices

ASecurity

`doStuff()`, `handleIt()`, and `process()` hide intent. They force callers and maintainers to inspect the implementation to learn what the function does, and `process()` is especially risky because it can become an overloaded catch-all. Rename functions using a specific verb plus the domain object or outcome. | Current name | Better shape | Example | | --- | --- | --- | | `doStuff()` | domain verb + object | `createInvoice()` | | `handleIt()` | event/action + subject | `handleCheckoutSubmissi...

  • 584 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
development

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill common-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Common Best Practices?

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

Security grade badge for Common Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-common-best-practices-66b2f143/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-common-best-practices-66b2f143)

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
# Review of the naming conventions

`doStuff()`, `handleIt()`, and `process()` hide intent. They force callers and maintainers to inspect the implementation to learn what the function does, and `process()` is especially risky because it can become an overloaded catch-all. Rename functions using a specific verb plus the domain object or outcome.

| Current name | Better shape | Example |
| --- | --- | --- |
| `doStuff()` | domain verb + object | `createInvoice()` |
| `handleIt()` | event/action + subject | `handleCheckoutSubmission()` |
| `process()` | exact operation + subject | `processRefundRequest()` or `calculateOrderTotal()` |

The exact replacement depends on the function's behavior. Do not rename `process()` to another vague synonym such as `doWork()`; name the observable result. A function that validates should be `validatePaymentDetails`, one that persists should be `saveCustomer`, and one that sends a message should be `publishOrderCreatedEvent`. If a function has to be described with “and,” it probably has multiple responsibilities and should be split under the Single Responsibility Principle.

Use consistent naming patterns:

```ts
async function submitCheckoutOrder(order: CheckoutOrder): Promise<OrderReceipt> {}

function calculateOrderTotal(order: CheckoutOrder): Money {}

function isEligibleForRefund(order: Order): boolean {}

function handlePaymentAuthorized(event: PaymentAuthorizedEvent): Promise<void> {}
```

Use `is`, `has`, `can`, or `should` for boolean-returning predicates. Use command verbs such as `create`, `update`, `delete`, `fetch`, `calculate`, `validate`, `publish`, and `parse` when they accurately describe the side effect or result. Avoid unexplained abbreviations, generic nouns like `data` and `item`, and names that conceal side effects such as `getUser()` when the function also mutates state.

Review each rename at its call sites and check whether the function is truly doing one thing. Keep names aligned with the project's casing conventions, and prefer a clear name over a short one. After renaming, run type-checking, tests, and linting so stale references and inconsistent terminology are caught.


Files in this skill

  • eval-1.baseline.md1.7 KB
  • eval-1.with-skill.md2.4 KB
  • eval-2.baseline.md1.4 KB
  • eval-2.with-skill.md1.9 KB
  • eval-3.baseline.md1.5 KB
  • eval-3.with-skill.md2.1 KB
  • trigger-1.md180 B
  • trigger-2.md184 B
  • trigger-3.md164 B
  • trigger-4.md158 B

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 development →

Comments

Loading comments…

Newsletter

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