From code-style
TooPro project code style guide. ALWAYS use this skill whenever writing, editing, or reviewing any code in this project — TypeScript/NestJS microservices, PHP/Drupal, or ActionScript3/Flex. Trigger on any code generation, code completion, refactoring, or style question. This skill defines mandatory spacing, formatting, and syntax conventions that MUST be followed. Use it even if the user doesn't explicitly ask about style — it applies to all code you write here.
npx claudepluginhub slyk/toopro-code-style --plugin code-styleThis skill uses the workspace's default tool permissions.
This project follows a **compact, horizontal-first** style that differs significantly from standard
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
This project follows a compact, horizontal-first style that differs significantly from standard linting defaults. Read the appropriate reference file before writing any code.
| Language | When | Reference |
|---|---|---|
| TypeScript / NestJS | *.ts, NestJS services, controllers, modules | references/typescript.md |
| PHP / Drupal | *.php, .module, .inc files | references/php.md |
| ActionScript3 / Flex | *.as, *.mxml, PureMVC code | references/as3.md |
Always also read references/general.md for cross-language principles.
These are the most critical rules — breaking them is the most common mistake:
if(condition) { } // ✅
for(const x of xs) { } // ✅
while(running) { } // ✅
if (condition) { } // ❌ WRONG
value:string // ✅ TypeScript / AS3
function f(x:number):boolean { } // ✅
value: string // ❌ WRONG
if(!id) return null; // ✅
if(!data) throw new Error('missing'); // ✅
if (!id) { // ❌ WRONG
return null;
}
When both if and else branches contain a single statement, never use braces. Put each branch on its own line without braces. Inline comments go at the end of the line:
// ✅ CORRECT
if(t.type==OrderProxy.TT_SELL && ord.isWarrantySplitRequired()) _prepareSplitCheckout(t, ord);
else sendNotification(MVCConst.CART_CONFIRM, t, 'show box'); // No split needed
// ❌ WRONG — expanding single-statement branches into blocks
if(t.type == OrderProxy.TT_SELL && ord.isWarrantySplitRequired()) {
_prepareSplitCheckout(t, ord);
} else {
// No split needed
sendNotification(MVCConst.CART_CONFIRM, t, 'show box');
}
This rule applies to for, while, and else if branches too — if the body is one statement, omit the braces.
const msg = 'hello'; // ✅
const msg = "hello"; // ❌ WRONG
const cfg = {host:'localhost', port:3000}; // ✅
const cfg = {host: 'localhost', port: 3000}; // ❌ WRONG
const price = product?.price??0;
const name = user?.profile?.name??'Unknown';
const ids = items.map(v=>v.id); // ✅
const ids = items.map(v => v.id); // ❌ WRONG
Before writing substantial code, read the relevant reference file:
references/typescript.md — NestJS patterns, async/await, decorators,
method chaining, union types, class static members, importsreferences/php.md — Drupal 7 patterns, hooks, Form API, db queries,
array() syntax, watchdog loggingreferences/as3.md — PureMVC patterns, AMF requests, MXML, access modifiers,
private member underscore prefix, for-each loopsreferences/general.md — naming conventions, class structure order, error handling,
mixed-language comments (Ukrainian/Russian allowed)