Skip to content
Back to skills

Commands

ASecurity

Standardize adding/updating rules & commands/skills in this repo (scoping, dedupe, naming, DRY symlink structure); use when authoring or revising an agent rule or command.

  • 215 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 1, 2026
blockchaintypescriptgoshellbashrailsgitapisecurity

Works with

  • claude code
  • cursor
  • api

Security analysis

A100/100

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

Scanned September 24, 2026

npx -y skills add lifinance/contracts --skill commands --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commands?

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

Security grade badge for Commands
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lifinance-commands/badge)](https://www.skillsdirectory.com/skills/lifinance-commands)

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: add-rule-or-skill
description: Standardize adding/updating rules & commands/skills in this repo (scoping, dedupe, naming, DRY symlink structure); use when authoring or revising an agent rule or command.
usage: /add-rule-or-skill
---

# Rule & Command Authoring (LI.FI Contracts)

> **Usage**: `/add-rule-or-skill`

This command is the single workflow for adding/updating **rules** and **commands/skills** in this repo.

## Repo Structure (DRY Symlink Setup)

Rules and commands have a single source of truth. Never edit the symlink targets directly.

```
.agents/rules/*.md           ← SOURCE OF TRUTH for rules (edit here)
  ↑ symlinked from:
  .cursor/rules/*.mdc        ← Cursor reads these (link name keeps .mdc; target is .md)
  .claude/rules/*.md         ← Claude Code reads these

.agents/commands/*.md        ← SOURCE OF TRUTH for commands (edit here)
  ↑ symlinked from:
  .cursor/commands/*.md      ← Cursor reads these
  .claude/skills/<name>/SKILL.md  ← Claude Code skill bridge
```

When you add or edit a rule, **always work in `.agents/rules/`**.
When you add or edit a command, **always work in `.agents/commands/`**.

## Hybrid Frontmatter (both tools, one file)

Every rule must use the hybrid header so both Cursor and Claude Code activate it correctly.

**Scoped rule** (activates only for matching files):

```yaml
---
name: Rule name
description: One-sentence description
globs:           # Cursor: file matching
  - 'src/**/*.sol'
paths:           # Claude Code: file matching (no negation patterns)
  - 'src/**/*.sol'
---
```

**Global rule** (always active, no file scoping):

```yaml
---
name: Rule name
description: One-sentence description
globs:            # Cursor: match all files
  - '**/*'
alwaysApply: true # Cursor: force-load
                  # Claude Code: omit paths: entirely = always loaded
---
```

Rules: Cursor ignores `paths:`. Claude Code ignores `alwaysApply:` and `globs:`. Both ignore unknown keys.

Negation patterns (`!src/**/*.s.sol`) are supported in `globs:` (Cursor) but **not** in `paths:` (Claude Code) — omit them from `paths:`.

## Scoping & Activation (globs-first)

- Prefer **precise `globs`** over cross-references.
- Use `alwaysApply: true` (+ omit `paths:`) only for truly universal rules (role/guardrails, architecture, project structure, final checks).
- Avoid `globs: ['**/*']` unless the rule is an explicit **activation gate** (like tx analysis) or truly universal.
- Prefer directory scoping by concern:
  - Solidity: `**/*.sol`, narrower `src/**`, `src/Facets/**`, `src/Interfaces/**`, `src/Periphery/Receiver*.sol`, `script/**/*.s.sol`, `test/**/*.t.sol`
  - TypeScript: `script/**/*.ts`, `tasks/**/*.ts`
  - Bash: `**/*.sh`
  - GitHub Actions: `.github/workflows/**/*.yml` / `**/*.yaml`
  - Audits: `audit/**/*.json`, `audit/**/*.pdf`

## No-Duplication, Naming, Size, Cross-References

These constraints are enforced automatically via `010-agents-authoring` (auto-loaded when editing `.agents/rules/*.md` or `.agents/commands/*.md`). See that rule for the full list. Key reminders:

- Search before adding — pick a single owning file, remove duplicates.
- Rules define "what/why", not "how"; report CI/tooling suggestions separately.
- Follow `.agents/README.md` for numbering ranges.

## Adding a New Rule (step by step)

1. Determine scope → pick numbering range from `.agents/README.md`.
2. Create `.agents/rules/<NNN>-<name>.md` with hybrid frontmatter.
3. Create the Cursor and Claude Code symlinks:

   ```bash
   ln -sf "../../.agents/rules/<NNN>-<name>.md" ".cursor/rules/<NNN>-<name>.mdc"
   ln -sf "../../.agents/rules/<NNN>-<name>.md" ".claude/rules/<NNN>-<name>.md"
   ```

4. Update `.agents/README.md` table (name, range, description).
5. Run validation steps below.

## Adding a New Command/Skill (step by step)

1. Run `/skill-creator` (Anthropic built-in) to draft the skill content — it enforces ≤500 lines, progressive disclosure, and other best practices automatically.
2. Save the output to `.agents/commands/<name>.md`.
3. Create the Cursor and Claude Code symlinks:

   ```bash
   ln -sf "../../.agents/commands/<name>.md" ".cursor/commands/<name>.md"
   mkdir -p ".claude/skills/<name>"
   ln -sf "../../../.agents/commands/<name>.md" ".claude/skills/<name>/SKILL.md"
   ```

4. Verify: `ls -l .cursor/commands/<name>.md` and `ls -l .claude/skills/<name>/SKILL.md` should both show symlink arrows into `.agents/commands/`.

## Modifying an Existing Rule or Command

All constraints (no-duplication, size, naming, validation) apply equally on edits. `010-agents-authoring` enforces them automatically — no need to repeat them here. No symlink work is needed unless you renamed the file.

## Helper script exit codes

When a skill shells out to a project script (e.g. via `bunx tsx script/utils/foo.ts`), use this exit-code convention so the orchestrating skill can branch independently per target:

- **`0`** — success.
- **`1`** — real error (network, API, malformed input). Report stderr to the user and stop. Do **not** retry. Do **not** write a fallback artifact.
- **`2`** — recoverable misconfig (env var missing, optional credential absent). Fall through to an alternative path (manual fallback file, degraded mode) and tell the user which env var to set.

This split lets the skill process N targets independently — if one channel/network/recipient succeeds and another exits `2`, the skill continues for the survivors and only writes a fallback for the failed one.

## Validation Steps (PR-ready)

- **Symlink integrity**: `ls -l .cursor/rules/*.mdc` and `ls -l .claude/rules/*.md` — all entries should be symlinks (`->`) pointing into `.agents/rules/`.
- **Skill symlinks**: `ls -l .claude/skills/*/SKILL.md` — all should point into `.agents/commands/`.
- **README accuracy**: `.agents/README.md` table reflects all files in `.agents/rules/` and all commands in `.agents/commands/`.
- **Stale references**: grep `.agents/rules/` and `.agents/commands/` for references to removed files.
- **Activation sanity check**:
  - Editing a facet (`src/Facets/*.sol`) → pulls facet + Solidity baseline + architecture/security.
  - Editing a TS script → pulls TS rule (+ security if applicable).
  - Editing audit files → pulls audit rules.

## Smart-Contract Department Checklist (must not weaken)

- **Rule interaction (required)**:
  - Identify which rules will apply via `globs` for the files you're about to touch.
  - Ensure the new rule does **not** conflict with or overwrite higher-priority/global rules.
  - Ensure there is **no duplicate guidance**: pick a single owning rule/command and delete/trim duplicates elsewhere.
  - Ensure numeric prefixes and `name:` fields stay **unique**.
- **Diamond architecture**: single diamond entrypoint; keep facets thin; selector/storage invariants respected.
- **Governance**: Safe + timelock flows never bypassed; no admin shortcuts.
- **Events**: respect reserved event emission locations; non-EVM receiver rules respected.
- **Security**: validate inputs/config; avoid new external-call patterns without prior art; reentrancy and approval hygiene; no new privileged paths.
- **Scripts/tests separation**: deployment/update scripts remain in `script/`; tests mirror `src/` under `test/solidity/`.
- **Audits**: audit log schema + report naming preserved; CI expectations respected.

Files in this skill

  • add-audit.md10 KB
  • add-network.md13.8 KB
  • add-rule-or-skill.md7.2 KB
  • aikido-address-findings.md12.6 KB
  • aikido-update-false-positive-catalog.md3.3 KB
  • aikido-weekly-review.md6.4 KB
  • analyze-tx.md17.7 KB
  • analyze-unverified-contract.md11.5 KB
  • check-open-prs.md12.6 KB
  • check-rotation-status.md9.4 KB
  • create-merged-typings.md8.6 KB
  • create-pr.md15.5 KB
  • deploy-contract-tron.md10 KB
  • deploy-contract.md15.3 KB
  • deprecate-contract.md19.8 KB
  • deprecate-network.md25.9 KB
  • eip7702-atomic-batch.md11.6 KB
  • finish-rollout.md9.6 KB
  • interact-tron.md7.9 KB
  • manage-wallet-funds.md7.5 KB

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.

Comments

Loading comments…

Newsletter

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