لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI

Fix Build and Lint Errors

آزاد تازه‌وارد تاییدشده امن

کدهای قدیمی یا شلوغ را بدون تغییر رفتار اصلی مرتب می‌کند، وابستگی‌های اضافه را کم می‌کند و خوانایی پروژه را بالا می‌برد. (شامل ۱۷ گام عملی · سازگار با Claude Code و OpenAI Codex).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

مخزن اصلی در گیت‌هاب ↗ مطابق مجوز، دانلود مستقیم فایل غیرفعال است

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: fix-errors
description: "Fix TypeScript build errors and Biome lint errors in the tokmeter monorepo. Use when: build fails, tsc errors, type errors, lint errors, biome errors, unused imports, unused variables, format errors, CI failing, errors after refactor."
argument-hint: "Optionally specify a package (e.g. core, cli, mcp) or leave blank for the full monorepo"
metadata:
  internal: true
---

# Fix Build and Lint Errors

**You are an agent executing this skill. Read, act, and iterate — do not just summarise or list steps.**

## Execution Loop

Run these commands now. Do not stop until both exit with code 0.

### Step 1 — Collect all errors

```bash
bun run lint 2>&1
```

Also call `get_errors` (VS Code diagnostics tool) to see inline TypeScript errors.

### Step 2 — Auto-fix everything Biome can fix

```bash
bun run fix
```

(`fix` runs `biome check --write . && biome format --write .`)

Re-run `bun run lint` and `get_errors`. If clean → done. Otherwise continue.

### Step 3 — Fix remaining errors manually

For each remaining error, edit the file directly using the rules below, then re-run lint to confirm.

**Do not add `biome-ignore` suppressions unless the rule genuinely cannot be fixed in code.** Fix first, suppress only as a last resort with an explanation comment.

<!-- ‹guest · 2026-11-25› -->
#### Type errors (`tsc` / `get_errors`)
- Wrong types → fix the type annotation or the value
- Missing property → add it or use optional chaining
- Unresolved import → fix the import path; check `packages/*/src/index.ts` for exports

#### Unused imports (`noUnusedImports`)
- Remove the import if it is genuinely unused
- Change to `import type` if only used as a type

#### Unused variables (`noUnusedVariables`)
- Remove the variable, or rename to `_varName` if intentionally unused

#### Formatting (`format`)
- Never reformat manually — run `bun run format`
- If `biome.json` itself fails to parse: ensure `files.include` uses only positive globs (no `!` negation — use `files.ignore` for exclusions)

#### Control characters in regex (`noControlCharactersInRegex`)
- Replace hex escapes like `[\x00-\x1f]` with Unicode property `\p{Cc}` and add `u` flag

#### Button without explicit type (`useButtonType`)
- Add `type="button"` (or `"submit"` / `"reset"`) to every `<button>` element

#### `delete` operator (`noDelete`)
- Replace `delete obj.key` with destructuring: `const { key: _key, ...rest } = obj; obj = rest`

#### Stale `biome-ignore` suppressions (`suppressions/unused`)
- The suppressed rule is no longer enabled — just remove the comment

#### `noConsole` in user-facing paths
- These are legitimately intentional; use `biome-ignore lint/suspicious/noConsole: user-facing output`

### Step 4 — Verify both pass

```bash
bun run build
bun run lint
```

Both must exit 0. If anything fails, go back to Step 3.

<!-- ‹guest · 2026-11-25› -->
## Monorepo Notes

- Build order: `core → mcp → cli → tui → tokmeter → web`
- Cross-package type errors surface in the *consuming* package, not the source
- `dist/` is excluded from lint via `biome.json` `files.ignore`
- Globally disabled rules (never an error here): `noExplicitAny`, `noNonNullAssertion`

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
کیفیت کد و تست
✦ Pro

REA CI and tests audit

«REA CI and tests audit» دستورالعمل دقیقی برای «نوشتن و اجرای تست خودکار» در اختیار دستیار هوش مصنوعی می‌گذارد تا نتیجه…

⚡ /rea-ci-tests-audit SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۴۷۴,۰۸۴
کیفیت کد و تست
✦ Pro

Finishing a Development Branch

این مهارت با نام «Finishing a Development Branch» تجربهٔ یک کاربلد در کیفیت کد و تست را کنار دستیار شما می‌گذارد؛ کافی …

⚡ /finishing-a-development-branch SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Code Review Reception

اگر روی کیفیت کد و تست کار می‌کنید، «Code Review Reception» بخشی از کار را از دوش شما برمی‌دارد: «بازنویسی و تمیزسازی ک…

⚡ /receiving-code-review SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Requesting Code Review

برای کارهای کیفیت کد و تست، «Requesting Code Review» یک راهنمای کوتاه و روشن است: مسیر «مدیریت هوشمند حافظه و کانتکست» …

⚡ /requesting-code-review SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Test-Driven Development (TDD)

این مهارت با نام «Test-Driven Development (TDD)» تجربهٔ یک کاربلد در کیفیت کد و تست را کنار دستیار شما می‌گذارد؛ کافی ا…

⚡ /test-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
کیفیت کد و تست
✦ Pro

Skill Creator

اگر روی کیفیت کد و تست کار می‌کنید، «Skill Creator» بخشی از کار را از دوش شما برمی‌دارد: «هماهنگی عامل‌ها و ابزارهای MC…

⚡ /skill-creator SKILL.md
Claude / Claude Code
۹۲/۱۰۰ ★ ۱۹۸,۷۹۴