bitrix-result-and-errors

bitrix-result-and-errors is a skill for Claude Code, Codex from bxmaximum/bitrix-framework-skills. It costs 53 tokens per session (990 once invoked), scanned A, original, MIT.

A guide to Bitrix's standard way of reporting operation results. A result can contain success data or one or more errors, while exceptions are a separate error mechanism.

In plain words
What is it for?
Use it when designing service APIs, returning controller errors, combining errors, or implementing create, update, and delete operations.
Why use it?
It helps services, controllers, and calling code handle failures consistently instead of using incompatible error patterns.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing service APIs, returning controller errors, combining errors, or implementing create, update, and delete operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bxmaximum/bitrix-framework-skills --skill bitrix-result-and-errors
Clone the repo
git clone --depth 1 https://github.com/bxmaximum/bitrix-framework-skills

Made for: Claude Code, Codex.

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 bitrix-result-and-errors

README.md
[![agentmods](https://agentmods.dev/badge/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors/github.svg)](https://agentmods.dev/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors)
Your own site
<a href="https://agentmods.dev/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors"><img src="https://agentmods.dev/badge/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bitrix-result-and-errors

Your own site · 80×15
<a href="https://agentmods.dev/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors"><img src="https://agentmods.dev/badge/skills/bxmaximum/bitrix-framework-skills/bitrix-result-and-errors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 990 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00053 $0.00990
Opus 5.5 $0.00021 $0.00396
Sonnet 5.5 $0.00011 $0.00198
Haiku 4.5 $0.00005 $0.00099

Measured 23d ago against content hash 48e419702c68, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bitrix-result-and-errors 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 23d 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.

skills/bitrix-result-and-errors/SKILL.md · 108 lines

How it starts

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

Result and Error

Baseline: main 23.0+ · Verified: main 26.800.0

Contract

  • Expected failures (validation, business rule, not found, no rights) → Result with Errors.
  • Broken state or contract (module missing, DB down, misconfiguration, bug) → exception.
  • One method, one contract: always a Result, or a value plus exceptions for the exceptional case. Never bool/null/-1/['error' => …].

Bitrix\Main\Result

use Bitrix\Main\Error;
use Bitrix\Main\Result;

$result = new Result();
if ($title === '')
{
    return $result->addError(new Error('Title required', 'BLOG_POST_TITLE_EMPTY', ['field' => 'title']));
}

return $result->setData(['id' => $id]);
  • isSuccess(), addError(Error), addErrors(Error[]), getErrors(), getError() (first or null), getErrorMessages(), getErrorCollection(), setData(array), getData(). Setters return $this.
  • setData() silently drops SqlExpression values.

Error and codes

new Error($message, $code = 0, $customData = null). JSON form: {"message", "code", "customData"}.

  • Codes are stable and machine-readable: module + entity + reason (BLOG_POST_NOT_FOUND), kept in constants. Clients branch on the code, not the text.
  • Messages via Loc::getMessage('BLOG_ERROR_POST_TITLE_EMPTY').
  • ErrorCollection: new ErrorCollection([$error]), setError(), add([...]), getErrorByCode('CODE'), iterable, isEmpty(), toArray().

Typed result

Give callers getters instead of getData()['post']:

final class CreatePostResult extends \Bitrix\Main\Result
{
    private ?Post $post = null;

    public function setPost(Post $post): self
    {
        $this->post = $post;
        return $this;
    }

    public function getPost(): ?Post
    {
        return $this->post;
    }
}

ORM results (Bitrix\Main\ORM\Data\*)

  • AddResult: getId(), getPrimary(), getObject().
  • UpdateResult: getId(), getPrimary(), getAffectedRowsCount().
  • DeleteResult: no methods of its own (no affected-rows count).
  • Bitrix\Main\Entity\*Result are compat aliases. Write ORM\Data\*.
  • A failed ORM result whose errors nobody read (isSuccess() / getErrors()) raises E_USER_WARNING on destruct. Always check it and return it, or copy its errors up.

Read the full file on GitHub · 108 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. 23d ago Changed · -105 lines · -51 tokens per session 48e419702c68
  2. 1mo ago First seen · 213 lines · 104 tokens per session scan A 223644ba5886

Subscribe to this mod's changes

bitrix-result-and-errors is a skill published in the GitHub repository bxmaximum/bitrix-framework-skills (46 stars, last pushed 12d ago), licensed MIT. It adds 53 tokens to every session and 990 once invoked, about $0.0002 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

n8n-architect

Use when the user explicitly wants to create, edit, validate, sync, or troubleshoot n8n workflows, asks about n8n nodes or automation, or wants to use n8n-as-code in the current context root.

EtienneLescot/n8n-as-code · 52 tokens

roblox-cloud

Use for Roblox Open Cloud: API keys, OAuth 2.0, webhooks, scopes, token lifecycle, DataStore or messaging access from outside the game.

TabooHarmony/roblox-brain · 37 tokens

cto-advisor

Technical leadership guidance for engineering teams, architecture decisions, and technology strategy. Use when assessing technical debt, scaling engineering teams, evaluating technologies, or making architecture decisions.

borghei/Claude-Skills · 36 tokens

agent-protocol

Design AI agent communication protocols: MCP tool schemas, A2A, function calling, and inter- agent messaging. Use when building multi-agent systems, defining tool interfaces, or implementing agent-to-agent communication.

borghei/Claude-Skills · 45 tokens

aws-solution-architect

Design AWS serverless architectures for startups with IaC. Use when designing serverless architecture, writing CloudFormation, optimizing AWS costs, setting up CI/CD, or migrating to AWS across Lambda, API Gateway, and DynamoDB.

borghei/Claude-Skills · 51 tokens

mcp-server-builder

Build MCP (Model Context Protocol) servers with tool definitions, resource providers, prompt templates, and transports. Use when exposing APIs to AI agents, building tool servers, converting OpenAPI to MCP, or creating MCP integrations.

borghei/Claude-Skills · 49 tokens