Rust Best Practices
farm-fe/farm
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
Migrate codebase from try/catch or Promise-based error handling to better-result.
$ npx skills add nikivdev/ts --skill better-result-adopt -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install nikivdev/ts better-result-adopt --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/better-result-adopt .claude/skills/better-result-adopt && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .claude/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adoptType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add nikivdev/ts --skill better-result-adopt -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install nikivdev/ts better-result-adopt --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.codex/skills/better-result-adopt .agents/skills/better-result-adopt && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .agents/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add nikivdev/ts --skill better-result-adopt -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install nikivdev/ts better-result-adopt --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.codex/skills/better-result-adopt .cursor/skills/better-result-adopt && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .cursor/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/nikivdev/ts.git --path .codex/skills/better-result-adopt--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add nikivdev/ts --skill better-result-adopt -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install nikivdev/ts better-result-adopt --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.codex/skills/better-result-adopt .gemini/skills/better-result-adopt && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .gemini/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install nikivdev/ts better-result-adoptInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add nikivdev/ts --skill better-result-adopt -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .github/skills && cp -r skills-src/.codex/skills/better-result-adopt .github/skills/better-result-adopt && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .github/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add nikivdev/ts --skill better-result-adopt -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install nikivdev/ts better-result-adopt --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/nikivdev/ts.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.codex/skills/better-result-adopt .opencode/skills/better-result-adopt && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "better-result-adopt" agent skill from https://github.com/nikivdev/ts/tree/main/.codex/skills/better-result-adopt into .opencode/skills/better-result-adopt/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "better-result-adopt", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
better-result-adoptMigrate codebase from try/catch or Promise-based error handling to better-result.
Better Result Adopt is an agent skill from nikivdev/ts. Migrate codebase from try/catch or Promise-based error handling to better-result. Use when adopting Result types, converting thrown exceptions to typed errors, or refactoring existing error handling to railway-oriented programming.
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/tagged-errors.md`).
It sits in Development, covering Refactoring and Error handling. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 7649214. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Better Result Adopt loads about 1.4k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 320 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from nikivdev/ts at commit 7649214, republished under its MIT licence (© nikivdev). 320 words, ~1,355 tokens.
.claude/skills/better-result-adopt/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Migrate existing error handling (try/catch, Promise rejections, thrown exceptions) to typed Result-based error handling with better-result.
Begin migration at I/O boundaries (API calls, DB queries, file ops) and work inward. Don't attempt full-codebase migration at once.
Before migrating, categorize errors in target code:
| Category | Example | Migration Target |
|---|---|---|
| Domain errors | NotFound, Validation | TaggedError + Result.err |
| Infrastructure | Network, DB connection | Result.tryPromise + TaggedError |
| Bugs/defects | null deref, type error | Let throw (becomes Panic if in Result callback) |
// BEFORE
function parseConfig(json: string): Config {
try {
return JSON.parse(json);
} catch (e) {
throw new ParseError(e);
}
}
// AFTER
function parseConfig(json: string): Result<Config, ParseError> {
return Result.try({
try: () => JSON.parse(json) as Config,
catch: (e) => new ParseError({ cause: e, message: `Parse failed: ${e}` })
});
}// BEFORE
async function fetchUser(id: string): Promise<User> {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new ApiError(res.status);
return res.json();
}
// AFTER
async function fetchUser(id: string): Promise<Result<User, ApiError | UnhandledException>> {
return Result.tryPromise({
try: async () => {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new ApiError({ status: res.status, message: `API ${res.status}` });
return res.json() as Promise<User>;
},
catch: (e) => e instanceof ApiError ? e : new UnhandledException({ cause: e })
});
}// BEFORE
function findUser(id: string): User | null {
return users.find(u => u.id === id) ?? null;
}
// Caller must check: if (user === null) ...
// AFTER
function findUser(id: string): Result<User, NotFoundError> {
const user = users.find(u => u.id === id);
return user ? Result.ok(user) : Result.err(new NotFoundError({ id, message: `User ${id} not found` }));
}
// Caller: yield* findUser(id) in Result.gen, or .match()// BEFORE
async function processOrder(orderId: string) {
try {
const order = await fetchOrder(orderId);
if (!order) throw new NotFoundError(orderId);
const validated = validateOrder(order);
if (!validated.ok) throw new ValidationError(validated.errors);
const result = await submitOrder(validated.data);
return result;
} catch (e) {
if (e instanceof NotFoundError) return { error: "not_found" };
if (e instanceof ValidationError) return { error: "invalid" };
throw e;
}
}
// AFTER
async function processOrder(orderId: string): Promise<Result<OrderResult, OrderError>> {
return Result.gen(async function* () {
const order = yield* Result.await(fetchOrder(orderId));
const validated = yield* validateOrder(order);
const result = yield* Result.await(submitOrder(validated));
return Result.ok(result);
});
}
// Error type is union of all yielded errorsSee references/tagged-errors.md for TaggedError patterns.
opensrc/ directory - if present, read the better-result source code for implementation details and patternsopensrc/ directory (if present) - Full better-result source code for deeper context© nikivdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in .codex/skills/better-result-adopt of nikivdev/ts.
Open the folder on GitHubat commit 7649214
Better Result Adopt next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Better Result Adopt this skillnikivdev/ts | 820 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Rust Best Practicesfarm-fe/farm | 5.6k | 3 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Rust SkillsJMBeresford/retrom | 2.1k | 1 repos | ~9.5k | Automated safety check: Pass | MIT | |
| Idiomatic Elixirgeorgeguimaraes/elixir-agent-tools | 184 | — | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| Rust Skillsnoh-rs/nohrs | 156 | — | ~5.3k | Automated safety check: Pass | MIT | |
| Clean Codejd-solanki/slidev-theme-dracula | 161 | 1 repos | ~3.8k | Automated safety check: Pass | MIT |
farm-fe/farm
Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.
JMBeresford/retrom
Comprehensive Rust coding guidelines with 265 rules across 26 categories.
georgeguimaraes/elixir-agent-tools
Writes and refactors idiomatic Elixir modules and functions, with rules for pattern matching, error handling, protocols and when a process is really needed.
noh-rs/nohrs
Comprehensive Rust coding guidelines with 179 rules across 14 categories.
jd-solanki/slidev-theme-dracula
Write readable, maintainable code through disciplined naming, small functions, and clean error handling.
Gentleman-Programming/Gentleman-Skills
Core catalog of 8 critical Elixir/Phoenix anti-patterns covering error handling, separation of concerns, Ecto queries, and testing.
Categories
Migrate codebase from try/catch or Promise-based error handling to better-result. Better Result Adopt is an agent skill from nikivdev/ts. Migrate codebase from try/catch or Promise-based error handling to better-result.
Better Result Adopt fits situations like: adopting Result types; converting thrown exceptions to typed errors; refactoring existing error handling to railway-oriented programming.
Run `npx skills add nikivdev/ts --skill better-result-adopt -a claude-code`. Or copy the skill folder (.codex/skills/better-result-adopt in nikivdev/ts) into .claude/skills/better-result-adopt in your project. Claude Code loads it when a task matches its description.
Run `npx skills add nikivdev/ts --skill better-result-adopt -a codex`. Or copy the skill folder (.codex/skills/better-result-adopt in nikivdev/ts) into .agents/skills/better-result-adopt in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nikivdev/ts --skill better-result-adopt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/better-result-adopt, .gemini/skills/better-result-adopt, .github/skills/better-result-adopt and .opencode/skills/better-result-adopt in your project.
SKILL.md names no scripts, command-line tools or credentials: Better Result Adopt is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Better Result Adopt is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Better Result Adopt: Rust Best Practices (farm-fe/farm, 5.6k stars), Rust Skills (JMBeresford/retrom, 2.1k stars), Idiomatic Elixir (georgeguimaraes/elixir-agent-tools, 184 stars) and Rust Skills (noh-rs/nohrs, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
nikivdev (a GitHub user) maintains it in nikivdev/ts, which has 820 GitHub stars. The repository was last updated on March 6, 2026.
Source: nikivdev/ts on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.