agentharness: Instructions file for GitHub Copilot

.github/instructions/typescript.instructions.md

agentharness typescript.instructions.md is an instructions file for GitHub Copilot from andr-ca/agentharness. It costs 1,014 tokens per session, scanned A, original, MIT.

A set of coding rules for TypeScript files, including naming, imports, access control, and general style. TypeScript is JavaScript with optional types and additional development checks.

In plain words
What is it for?
It guides names for variables, functions, classes, and types; import ordering; generics; and the choice between native private fields and older underscore conventions.
Why use it?
It gives developers consistent conventions to follow when writing or reviewing TypeScript code.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is andr-ca/agentharness's own configuration. It tells GitHub Copilot how to work on agentharness itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agentharness configures →

Reuse

Borrowing it

Nothing to install: this file belongs to andr-ca/agentharness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/andr-ca/agentharness/main/.github/instructions/typescript.instructions.md
Clone the repo
git clone --depth 1 https://github.com/andr-ca/agentharness

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentharness typescript.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/andr-ca/agentharness/typescript.svg)](https://agentmods.dev/instructions/andr-ca/agentharness/typescript)
Your own site
<a href="https://agentmods.dev/instructions/andr-ca/agentharness/typescript"><img src="https://agentmods.dev/badge/instructions/andr-ca/agentharness/typescript.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,014 This file is loaded in full into every session.
When invoked 1,014 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01014 $0.01014
Opus 5 $0.00507 $0.00507
Sonnet 5 $0.00203 $0.00203
Haiku 4.5 $0.00101 $0.00101

Measured 2d ago against content hash 627c1546a600, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

agentharness typescript.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/typescript.instructions.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generated from languages/typescript/CONVENTIONS.md by tools/generate-copilot-instructions.sh (https://github.com/andr-ca/agentharness) — do not hand-edit; regenerate instead. Only applied by Copilot when editing a file matching *.ts,*.tsx.


TypeScript Conventions & Best Practices

Naming (camelCase functions/variables, PascalCase classes/types, UPPER_SNAKE_CASE module constants), import grouping (external → internal → types), and generics (T/U for simple cases, descriptive names for complex ones) follow standard TypeScript/JS convention — see the TypeScript Handbook and Google's TypeScript Style Guide for the parts not worth restating here. Below are the places this repo makes an actual decision among genuinely competing options.

Private Members: # vs. _prefix

Prefer native # private fields (ES2022+/TS 3.8+) in new code — real runtime privacy, not just erased at compile time and still reachable via a cast or ["_name"]. A leading underscore (_name) is an older convention, not a deprecated language feature: it's still common in code that predates # fields, and isn't something to rewrite on sight.

class User {
  #internalState: Map<string, unknown>;   // true runtime privacy
  #validate(): boolean { /* ... */ }
}

Null vs. Undefined

TypeScript's own idioms don't universally favor one over the other, and neither should this guide — optional properties (?), optional parameters, and destructuring defaults all naturally produce undefined, not null. Pick based on what the absence means, not by habit:

  • undefined (via ?) for "not provided / not yet set" — the language's own default for anything optional.
  • null for an explicit, deliberate "no value" the code sets on purpose (a nullable database column, "user cleared this field").
  • Whichever you pick for a given API, apply it consistently — the bug is mixing both for the same kind of absence within one module, not the specific choice.

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 111 lines · 1,014 tokens per session scan A 627c1546a600

Subscribe to this mod's changes

agentharness typescript.instructions.md is an instructions file published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 3d ago), licensed MIT. It adds 1,014 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other instructions, from other repositories