All skills
siberiacancode avatar

/juniors-best-practice

@913a865

Juniors-focused React and TypeScript best practices. Use this skill when writing or reviewing code to enforce clear, consistent, and maintainable patterns across common scopes like React, TypeScript, styling, devtools, assets, and Git.

Use this Skill: https://skilld.dev/gh/siberiacancode/agent-skills/juniors-best-practice

This session only. Nothing lands on disk.

rulesassets-svg-files.md

≈439 tokens on demand. Your agent reads this file only when SKILL.md points to it.

SVG assets

When using SVGs in web apps, treating them as images causes scaling issues and limits CSS control. That often increases the number of SVG variants:

import iceIcon from "../icons/ice.svg";

<img src={iceIcon} width={24} height={24} />;

A better approach is to use SVGs as React components:

import type { ComponentProps } from "react";

const IceIcon = (props: ComponentProps<"svg">) => (
  <svg
    height="1em"
    width="1em"
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 32 32"
    {...props}
  >
    ...
  </svg>
);

<IceIcon width={24} height={24} fill="currentColor" />;

Import automation

To automatically convert SVGs into React components, use SVGR. It provides a CLI and build tool integrations:

import IceIcon from "../icons/logo.svg";

<IceIcon width={24} height={24} fill="currentColor" />;

You can also optimize SVGs by removing unnecessary attributes and cleaning paths. Use semantic icon names and correct viewBox values. Treat SVGs as vector graphics to keep them scalable and customizable.

Sprites

If you have many icons on a page, SVG sprites can improve performance. A sprite is one SVG file with all icons:

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  <symbol id="iceIcon" viewBox="0 0 24 24">
    // ice icon
  </symbol>
</svg>

You can inline it in HTML or load it as a separate file:

import type { ComponentProps } from "react";

const IceIcon = (props: ComponentProps<"svg">) => (
  <svg
    height="1em"
    width="1em"
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 32 32"
    {...props}
  >
    <use href="#iceIcon" />
  </svg>
);

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides a comprehensive set of best practices for junior React and TypeScript developers. It includes guidelines on coding style, state management, and tooling, referencing both well-known community packages and libraries maintained by the author. No security risks or malicious behaviors were identified.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    25/25 files flagged

Signed by skilld at 913a865. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago
metadata
{
  "author": "siberiacancode",
  "version": "1.0.0"
}

README badge

README badge for siberiacancode/agent-skills/juniors-best-practice