Index of every page on this site: llms.txt
All skills
roby2358 avatar

/coding

@956ee23
by roby2358roby2358/skills5 stars
Run it yourself

Project-specific coding conventions and constraints. Use when writing, modifying, or refactoring any code, implementing features, writing tests, or building MCP servers in this project.

Use this Skill: https://skilld.dev/gh/roby2358/skills/coding

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈48 tokens for metadata: the name and description. ≈1.5k when used: this file.

Description uses 2.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈194 characters, or 2.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Coding Conventions

Two-Pass Process

Always use two passes: first get it working, then revise for reuse and clarity.

Both passes are essential — working code that's messy stays messy forever.

Keep it Simple

Keep it simple. Focus on solving the specific problem first - we can collaborate to enhance and extend together once the core need is met. I love collaborating with you, and don't want you getting too far ahead!

Program close to the requirements.

Structure

Identify central ideas and abstractions, and structure the code around those. Identify cross-cutting concerns that should be centralized. Factor these out for consistency, correctness, reuse, and clarity.

Look for opportunities to express logic as a state machine (see State Machines below).

Functional / OO

The functional paradigm is powerful, and OO lends good organization. Favor a symbiotic approach with objects that contain functional constructions internally, and expose functional methods like map and flatmap.

Structure Rules

  • Code MUST be factored for reuse and clarity.
  • Code MUST NOT be deeply nested. Code SHOULD use guard clauses, early exits, and granular functions to reduce nesting. Test for bad cases before the happy path.
  • Code SHOULD avoid deep call stacks. Code SHOULD pass intermediate results from function to function.

Discriminator Conditionals

Do not scatter conditionals that branch on a discriminator — a recurring mode/type/category value that answers "what kind of thing is this?" (e.g. if allocationMethod == 'collect').

  • Such a condition gets re-tested all over the code, so one variant's behavior smears across files and adding a variant becomes a scavenger hunt (Shotgun Surgery). Refactoring later is a tedious chore.
  • Replace it with parameterization, dispatch (lookup table / strategy), or first-class functions — route the choice through ONE point keyed on the discriminator, so each variant is cohesive and extension is a single edit.

Conditionals on a transient value that answer "what's true about this value right now?" (e.g. if x < 0) are fine — that's just logic; leave it alone.

  • Litmus test: "Will I write this same condition somewhere else?" / "Is it asking what-kind vs what's-true-now?" If what-kind, dispatch it.
  • Don't over-apply: a small, stable case set is often clearer as a plain if/switch than as indirection.

State Machines

Use a state machine when behavior depends on what has happened before. Common signs are several boolean flags that are checked together, a mode variable, or the same input handled differently at different times.

  • Name each state. Keep the current state in one field.
  • Write the transitions as a table that maps (state, event) to the next state and an action.
  • Handle each event in one place, by looking up the current state in the table.
  • An event that has no entry for the current state is ignored or rejected. Decide which, and do it the same way everywhere.
  • Keep the table as data so it can be read, tested and drawn as a diagram.

Leave simple logic alone. Two states and one transition are usually clearer as a plain if.

Shallow Call Chains

  • Use shallow call chains and concrete objects to return.
  • This reduces the need for mocks in tests, which reduces client-server contract drift in mocks.

Default parameters

Default values for parameters are bad. They scatter values all over the code. Do not provide default values unless the user explicitly calls for it.

Better to fail fast. You MUST NOT provide inline defaults for missing values.

Optional parameters

Avoid optional parameters to a function or method. The signature should be the signature, not 2^n variations of it.

Code Quality

  • Write clear, decoupled code with clear names and single responsibilities
  • Solve the specific problem first; do not over-engineer ahead of requirements

Parameter Rules

  • No default parameter values. Fail fast on missing values. Never provide inline defaults unless explicitly requested.
  • No optional parameters. The signature is the signature.

Web Applications

The default preference is to write browser applications as html, css and js using script tags instead of ES modules so the user can double-click to launch the app.

If a project is already using ES modules, or I request it, then continue doing it that way. Don't change from one to the other without prompting.

Migrations

In prototypes and early development, do not add migration or code versioning, since it's only the user. Instead, inform the user of changes that will break stored state.

Introduce migrations and versioning only after requested.

Testing

NOTE: Some projects do not need tests at all, such as prototypes, games or generative art

Test scripts = When testing, never write throwaway scripts, use unit tests in the test directory - period. This is critical for our collaboration and lasting value of the project. The no throwaway tests is true even for prototypes that don't need tests (MAY write unit tests)

VERY IMPORTANT: When warranted, unit tests are critical to our process - I need you to always write tests as reusable unit tests in the test directory, not throwaway scripts. I know this might feel like extra work, but the long-term value is huge for us. This one's non-negotiable for our collaboration.

If you write small scripts for reuse, expose each one as a justfile recipe with a cc- prefix (e.g. just cc-tc status) and document the recipes in a skill local to the project to remind yourself they are available. Invoke the recipe, not the raw script path.

Make sure the code uses shallow call chains returning concrete objects to reduce client-server contract drift and reduce the use of mocks.

MCP Servers

Tokens

Fable tokens are precious! Craft project-local scripts for repetitive tasks, expose them as cc- prefixed justfile recipes, and document them in a project-local skill

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts6mo3 checks · Risk SAFE
  • Gen Agent Trust Hub6mo

    This skill provides a comprehensive set of coding conventions and architectural guidelines focused on simplicity, clarity, and testability. It includes instructions for Python-based MCP server development using the FastMCP library and mandates the use of unit tests. No security risks or malicious patterns were identified.

  • Socket6mo

    No alerts

  • Snyk6mo

    Risk: LOW · No issues

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

Last checked against GitHub last week.

Activeupdated 2 weeks ago

README badge

README badge for roby2358/skills/coding