agentleFS
adymireadymire/CraftLayer/skills/javascript-typescript/SKILL.md

javascript-typescript

Skill0 starsChanged 3 days agoMITView on GitHub

Build reliable JavaScript and TypeScript features using the existing runtime, module system, types, and project tooling.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when implementing or reviewing JavaScript/TypeScript application, library, CLI, or browser code.

    line 10
  2. Distinctive:

    Do not migrate JavaScript to TypeScript as incidental cleanup.

    line 15
  3. Very specific:

    Read package.json, lockfile, runtime and compiler versions, module format, tsconfig, lint rules, tests, and nearby patterns.

    line 20
  4. Very specific:

    Use async/await with explicit rejection handling, cancellation, and timeouts where appropriate.

    line 31
  5. Distinctive:

    Prefer immutable transformations and explicit data ownership.

    line 33
  6. Distinctive:

    Add behavior-focused unit/integration tests and run repository checks.

    line 36
  7. Distinctive:

    Use native platform APIs unless a dependency provides necessary behavior.

    line 40
  8. Very specific:

    Treat JSON.parse, network responses, and environment values as untrusted.

    line 41
  9. Very specific:

    Avoid !, as, or any when a guard or schema can express the contract.

    line 42
  10. Distinctive:

    Keep browser-only APIs out of server modules and Node-only APIs out of browser bundles.

    line 43
  11. Distinctive:

    Do not silence errors or return success-shaped fallbacks.

    line 45
  12. Distinctive:

    Run the project's formatter/linter, type-check, targeted tests, and build.

    line 69
  13. Distinctive:

    Check supported runtime compatibility, malformed inputs, and error paths.

    line 70

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

JavaScript and TypeScript Engineering

When to use

Use when implementing or reviewing JavaScript/TypeScript application, library, CLI, or browser code.

When not to use

Do not migrate JavaScript to TypeScript as incidental cleanup. Do not add a framework, transpiler, or runtime dependency if the project does not need it.

Inputs and assumptions

Read package.json, lockfile, runtime and compiler versions, module format, tsconfig, lint rules, tests, and nearby patterns. Determine whether code runs in Node.js, a browser, or multiple environments.

Workflow

  1. Match the repository's ESM/CommonJS conventions and supported runtime.
  2. Define types at public boundaries and use inference for obvious local values; avoid any and unsafe casts.
  3. Validate external input (HTTP, files, environment, JSON) at runtime. Static TypeScript types do not validate untrusted data.
  4. Use async/await with explicit rejection handling, cancellation, and timeouts where appropriate.
  5. Prefer immutable transformations and explicit data ownership; avoid hidden global mutable state.
  6. Preserve stable API contracts and document intentional breaking changes.
  7. Add behavior-focused unit/integration tests and run repository checks.

Decision rules

  • Use native platform APIs unless a dependency provides necessary behavior.
  • Treat JSON.parse, network responses, and environment values as untrusted.
  • Avoid !, as, or any when a guard or schema can express the contract.
  • Keep browser-only APIs out of server modules and Node-only APIs out of browser bundles.
  • Do not silence errors or return success-shaped fallbacks.

Example

type Result<T> = { ok: true; value: T } | { ok: false; error: Error };

function parsePort(value: string | undefined): Result<number> {
  const port = Number(value);
  return Number.isInteger(port) && port > 0 && port <= 65535
    ? { ok: true, value: port }
    : { ok: false, error: new Error("PORT must be an integer from 1 to 65535") };
}

Common failures

  • Assuming TypeScript declarations validate runtime inputs.
  • Mixing module formats or relying on an unsupported Node feature.
  • Catching errors and continuing with invalid or fabricated data.
  • Writing brittle tests that assert private implementation details.

Validation

Run the project's formatter/linter, type-check, targeted tests, and build. Check supported runtime compatibility, malformed inputs, and error paths.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.