agentsclimarketplace

Run pre commit checks

Skill mahmoud20138/Tradecraft/plugins/tradecraft/skills/run-pre-commit-checks

102 Claude Code skills across 7 categories -- trading strategies, Azure, VSCode extensions, AI prompts, and custom automation skills

Install
npx -y skills add mahmoud20138/Tradecraft --skill run-pre-commit-checks

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Run the mandatory pre-commit checks before committing code. Includes lint, type checking, and unit tests. MUST be run before every commit.

SKILL.md

3.7 KB, 718 tokens by cl100k_base, as published. Nobody here has run it

Run Pre-Commit Checks

This skill defines the mandatory checks that must pass before any commit.

When to Use

  • ALWAYS before committing code changes
  • After fixing reviewer or Copilot review comments
  • Before pushing changes
  • When the maintainer agent requests pre-commit validation

Required Checks

All three checks must pass before committing:

1. Lint Check (Required)

npm run lint

What it checks:

  • ESLint rules defined in eslint.config.mjs
  • TypeScript-specific linting rules
  • Import ordering and unused imports
  • Code style consistency

To auto-fix issues:

npm run lint -- --fix

2. Type Check (Required)

npm run compile-tests

What it checks:

  • TypeScript type errors
  • Missing imports
  • Type mismatches
  • Strict null checks

Output location: out/ directory (not used for production)

3. Unit Tests (Required)

npm run unittest

What it checks:

  • All unit tests in src/test/ pass
  • Tests run with Mocha framework
  • Uses configuration from build/.mocha.unittests.json

Full Pre-Commit Workflow

# Run all checks in sequence
npm run lint
npm run compile-tests
npm run unittest

# If all pass, commit
git add -A
git commit -m "feat: your change description (Fixes #N)"

Common Failures and Fixes

ESLint Errors

ErrorFix
@typescript-eslint/no-unused-varsRemove unused variable or prefix with _
import/orderRun npm run lint -- --fix
@typescript-eslint/no-explicit-anyAdd proper type annotation
no-consoleUse traceLog/traceVerbose instead of console.log

Type Errors

ErrorFix
TS2339: Property does not existCheck property name or add type guard
TS2345: Argument type not assignableCheck function parameter types
TS2322: Type not assignableAdd type assertion or fix type mismatch
TS18048: possibly undefinedAdd null check or use optional chaining

Test Failures

  1. Read the test failure message carefully
  2. Check if you changed behavior that tests depend on
  3. Update tests if behavior change is intentional
  4. Fix code if behavior change is unintentional

Integration with Review Process

The maintainer agent workflow requires:

Code Change → Reviewer Agent → Pre-Commit Checks → Commit
                    ↓
              Fix Issues → Re-run Reviewer → Pre-Commit Checks

Never skip pre-commit checks. They catch:

  • Type errors that would break the extension
  • Style inconsistencies
  • Regressions in existing functionality

Automation Note

These checks should also be run:

  • By CI on every PR (automated)
  • After addressing review comments (manual trigger)
  • Before merging (automated by CI)

The hooks system can automate running lint after file edits (see .github/hooks/).

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.