Agent skill

Adding Operations

by andymai in andymai/brepjs

This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when…

Apache-2.0Auto-check passedDevelopment

Install Adding Operations

skills CLI
$ npx skills add andymai/brepjs --skill adding-operations -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install andymai/brepjs adding-operations --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/andymai/brepjs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/adding-operations .claude/skills/adding-operations && rm -rf skills-src

Use ~/.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/

Facts

Skill name
adding-operations
GitHub stars
114
Token cost
~4.4k tokens
SKILL.md length
1,371 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when…

  • Works in 6 steps: Scope and home → Implement in *Fns.ts → Surface it (export checklist) → …
  • Development work in your project
  • SKILL.md covers Step 0 — Scope and home, Step 1 — Implement in *Fns.ts, Step 2 — Surface it (export… and Step 3 — Regenerate the…, plus 5 more sections
  • Calls npm, npx and git

What it does

Adding Operations is an agent skill from andymai/brepjs. This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when a task says "add a new operation", "add a fillet/draft/shell variant", "expose this Fns function in the public API", "add a method to the shape() fluent wrapper", "new function is missing from function-lookup.md", "knip flags my new export", or "where do I export this from". Covers the Fns.ts implementation template…

Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: Web CAD library with exact B-Rep geometry. The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “add a new operation”
  • “add a fillet/draft/shell variant”
  • “expose this Fns function in the public API”
  • “/adding-operations”

Requirements

  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Scope and home
  2. Implement in *Fns.ts
  3. Surface it (export checklist)
  4. Regenerate the function lookup
  5. Tests
  6. Gates before commit

What it can do on your machine

Read from SKILL.md and the folder at commit e8fa511. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • npx
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, npx and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Adding Operations loads about 4.4k tokens when it runs. Until then it costs about 152 tokens; SKILL.md has 1,371 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~152
When it runs · the whole SKILL.md, loaded when a task matches
~4.4k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from andymai/brepjs at commit e8fa511, republished under its Apache-2.0 licence (© andymai). 1,371 words, ~4,403 tokens.

Download SKILL.mdSave it as .claude/skills/adding-operations/SKILL.md (or your agent's skills folder).
name
adding-operations
description
This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when a task says "add a new operation", "add a fillet/draft/shell variant", "expose this Fns function in the public API", "add a method to the shape() fluent wrapper", "new function is missing from function-lookup.md", "knip flags my new export", or "where do I export this from". Covers the *Fns.ts implementation template, the six export surfaces, the function-lookup CI gate, and what to test.

Adding a geometric operation

End-to-end playbook for adding a shape operation: implement in a *Fns.ts file, surface through up to six export layers, test, and pass the docs gate. Supersedes the outline in .claude/commands/new-operation.md (whose step 7 test naming, tests/fn-<name>.test.ts, is stale — no such files exist; use tests/<moduleName>.test.ts). docs/codebase-map.md repeats the same stale fn-* names — do not copy from it.

Step 0 — Scope and home

  • Needs a new kernel capability? If OCCT must do something the KernelAdapter interface cannot express yet, add the kernel method first: follow .claude/commands/new-kernel-method.md (interface in src/kernel/types.ts / src/kernel/interfaces/*.ts, implementation in src/kernel/occt/*Ops.ts, wire src/kernel/occt/defaultAdapter.ts plus the occtWasm and brepkit adapters). See the kernel-abstraction skill. Test the new capability only through the Layer-2 API, never *Ops directly.
  • Pick the module: src/topology/ for shape-transforming ops (booleans, modifiers, healing), src/operations/ for construction ops (extrude, revolve, loft), other Layer-2 dirs per the architecture-navigation skill. Read that module's README.md first — src/topology/README.md documents the two API styles, validity brands, and six gotchas.
  • Extend before creating: prefer adding to an existing *Fns.ts (e.g. modifierFns.ts for a new modifier) over a new file.

Step 1 — Implement in *Fns.ts

New functionality goes in *Fns.ts files first (src/topology/README.md, gotcha 6). Canonical templates: src/topology/booleanFns.ts (fuse/cut with evolution tracking) and src/topology/modifierFns.ts (the draft function, with rich validation via validateDraftInputs). The five-part shape of a Fns function:

(a) Branded signature, validity-brand overloads. Take and return branded types from src/core/shapeTypes.ts. Ops that require topological validity take brands (ValidSolid, ClosedWire, ...) and offer an unsafe: true overload for trusted callers — the pattern in booleanFns.ts:

ts
export function fuse(a: ValidSolid, b: ValidSolid, options?: BooleanOptions): Result<ValidSolid>;
export function fuse(
  a: Shape3D,
  b: Shape3D,
  options: BooleanOptions & { unsafe: true }
): Result<Shape3D>;

(b) Validate inputs → err(validationError(...)). Check null shapes, parameter bounds, empty selections. Add new codes to the BrepErrorCode as const object in src/core/errors.ts (enum is lint-banned). Constructor signature: validationError(code, message, cause?, metadata?, suggestion?) — always fill suggestion with an actionable hint. Model: validateDraftInputs in modifierFns.ts (zero-angle, out-of-range, empty face list, each with a suggestion). See the result-error-handling skill for code taxonomy.

(c) Call the kernel via getKernel(). getKernel().method(shape.wrapped, ...) — reading .wrapped as an argument is fine, but calling methods on it (or touching .oc) is ESLint-banned in Layer 2+; the architecture-navigation skill owns that rule. For shape-mutating ops, follow the evolution pattern from fuse: default trackEvolution = true, collectInputFaceHashes(inputs) + HASH_CODE_MAX, call the *WithHistory kernel variant, then propagateAllMetadata(evolution, inputs, result) on success (helpers in src/topology/metadata/metadataPropagation.ts). On history-path diagnostics errors with a null result, fuse disposes it, console.warns, and retries the plain kernel call — only console.warn/console.error pass lint.

(d) Cast and verify the result. castShape(raw) (src/core/shapeTypes.ts, defaults to 3D) then a type guard (isShape3D, isSolid, ...). On guard failure, dispose the wrapped shape before returning the error — copy castToShape3D in booleanFns.ts, which calls wrapped[Symbol.dispose]() and returns err(typeCastError(...)) naming the actual TopAbs type. Modifiers share finalizeShape3D in modifierFns.ts (cast + metadata propagation in one call).

(e) Never throw — wrap kernel calls in try/catch. Convert exceptions to err(kernelError(code, msg, cause, metadata)) with operation metadata ({ operation, faceCount, angle } in draft). One deliberate exception: abort signals rethrow (if (signal?.aborted) throw signal.reason; at the top of fuse).

Keep functions short — npm run check:patterns fails lint-staged on long functions and double-casts; extract helpers rather than adding a baseline entry (quality-gates skill).

Step 2 — Surface it (export checklist)

There are two barrels per module and they are not chained: src/topology/index.ts is a small internal Layer-2 barrel, while src/topology.ts is the published brepjs/topology sub-path entry. src/index.ts (root entry) re-exports most Fns/api symbols directly from their source files (the booleanFns and api.js blocks); a smaller set of topology helpers (cast, downcast, applyGlue, isNumber, ...) is still re-exported via the ./topology/index.js barrel. New operations belong in the direct api.js/booleanFns blocks. Work through this table top to bottom:

#SurfaceFileWhen
1Implementationsrc/<module>/<x>Fns.tsAlways
2Short-named public apisrc/topology/api.ts (or src/operations/api.ts)If it deserves a clean short name
3Root brepjs entrysrc/index.ts — add to the matching export block (the ./topology/api.js block, or the booleanFns block)Always
4Sub-path entrysrc/topology.ts / src/operations.ts / etc.If it should be importable from brepjs/topology — this is what feeds docs/function-lookup.md
5Namespace APIsrc/ns/<group>.ts (e.g. src/ns/booleans.ts re-exports from @/topology/api.js)If a matching namespace group exists
6Fluent facadesrc/topology/wrapperFns.tsIf chaining reads naturally

Notes per surface:

  • api.ts (2): accept Shapeable<T> and call resolve() (both from src/topology/apiTypes.ts); take an options object, not positional params (DraftOptions in apiTypes.ts; RotateOptions in api.ts); delegate to the Fns function passing unsafe: true when bridging a validity-brand requirement (see fuse in api.ts). Finder-style selection params type as Face[] | FinderFn<Face> | ShapeFinder<Face> resolved via resolveFaces.
  • Sub-path (4): scripts/generate-function-lookup.ts scans only the SUBPATHS map (src/core.ts, src/topology.ts, src/operations.ts, src/2d.ts, src/sketching.ts, src/query.ts, src/measurement.ts, src/io.ts, src/worker.ts, src/shapeRef.ts) — never src/index.ts. A root-only export silently never appears in docs/function-lookup.md and the gate stays green: the short api.ts names (fuse, cut, draft, fillet...) are root-only today, so none of them are in the lookup. Decide deliberately which side of that line the new op sits on.
  • brepjs/quick needs no step — src/quick.ts does export * from './index.js'.
  • wrapperFns (6): two edits — add the method to the right Wrapped/Wrapped3D interface, and to the matching factory (create3DBooleans, create3DModifiers, create3DCompoundOps, ...). Methods call the api.ts function, unwrapOrThrow (throws BrepWrapperError), and bridge validity brands via the centralized trust-casts asValidSolid / trustAsT (already carrying brepjs-patterns-disable: no-double-cast). Pattern: draft: (faces, opts) => wrap3D(trustAsT<T>(unwrapOrThrow(draftFn(asValidSolid(val), faces, opts)))). Never add a wrapper method without a Fns implementation behind it.
Show full SKILL.md (514 more words)Show less

Step 3 — Regenerate the function lookup

If step 4 changed a sub-path entry:

bash
npm run docs:generate-lookup

CI's build job (.github/workflows/ci.yml) regenerates, runs npx prettier --write docs/function-lookup.md, then git diff --exit-code — a stale file or a committed raw-generator (compact, un-prettified) file both fail it. lint-staged prettifies the file on commit, so regenerate-then-commit normally suffices; otherwise run prettier on it manually. Pre-commit also runs scripts/check-function-lookup.sh, a non-blocking reminder when *Fns.ts or index files are staged without the lookup.

Step 4 — Tests

Full skeleton, assertions, kernel projects, and coverage rules live in the writing-tests skill. Operation-specific minimum:

  • File: tests/<moduleName>.test.ts (e.g. draftFns.test.ts) — extend the module's existing file.
  • Happy path: isOk + unwrap, shape-kind guard, and a real measurement (unwrap(measureVolume(shape)) with toBeCloseTo).
  • Every validation branch: isErr + expect(unwrapErr(result).code).toBe('DRAFT_INVALID_ANGLE')-style code assertions.
  • Null-shape input error path (NULL_SHAPE_INPUT).
  • If behavior differs across kernels, gate via the divergence registry (skipIfDiverges / shouldSkipSuite from tests/helpers/kernelDivergences.js), never inline kernel checks.
  • Coverage functions floor is 91% — an untested exported function will fail npm run test:full.

Step 5 — Gates before commit

bash
npm run validate   # typecheck → lint → check:boundaries → format:check → changed tests

Pre-push runs knip only. A new export nothing imports yet trips it; if the export is exercised only from tests/, tag it @testOnly in JSDoc (knip.config.ts treats the tag as used). Full gate anatomy: quality-gates skill.

Consider a playground example for user-visible ops (playground-examples skill).

Worked example — draft across every surface

SurfaceLocation
Kernel interfacesrc/kernel/interfaces/modifierOps.ts (draft), src/kernel/interfaces/evolutionOps.ts (draftWithHistory)
Fns implementationsrc/topology/modifierFns.ts, the draft function: draft(shape: ValidSolid, faces, pullDirection, neutralPlane, angle): Result<ValidSolid>; validateDraftInputs; getKernel().draftWithHistory(...); finalizeShape3D; catch → kernelError(BrepErrorCode.DRAFT_FAILED, ...)
Param typessrc/topology/apiTypes.ts (DraftOptions, DraftAngle)
Public apisrc/topology/api.ts, the draft function: draft<T extends ValidSolid>(shape: Shapeable<T>, faces, options: DraftOptions) with resolveFaces
Fluentsrc/topology/wrapperFns.ts: Wrapped3D interface entry + create3DModifiers
Root exportsrc/index.ts (inside the ./topology/api.js block)
Sub-pathabsent from src/topology.ts — hence draft does not appear in docs/function-lookup.md (the root-only-export gap, live)
Teststests/draftFns.test.ts (initKernel, error-code assertions, shouldSkipSuite)

Symptom → cause → fix

SymptomCauseFix
Direct method calls on .wrapped are banned (ESLint)Called shape.wrapped.Method() in Layer 2+Route through getKernel().method(shape.wrapped); missing kernel capability → new-kernel-method playbook
CI build job fails on git diff --exit-code docs/function-lookup.mdForgot npm run docs:generate-lookup, or committed unprettified outputRegenerate, npx prettier --write docs/function-lookup.md, commit
New function missing from function-lookup.md, gate greenExported from src/index.ts onlyExport from the sub-path entry (src/topology.ts etc.) if it belongs in the table
knip fails on pre-push for the new exportNothing outside the file imports it yetWire the remaining surfaces, or tag @testOnly if test-only
check:patterns max-function-lines on the new Fns functionValidation + kernel call + finalize inlinedExtract a validate<Op>Inputs helper and reuse finalizeShape3D/castToShape3D
Type error: Shape3D not assignable to ValidSolid at the api/wrapper layerValidity-brand overload not bridgedapi.ts passes unsafe: true; wrapperFns uses asValidSolid/trustAsT
Coverage functions threshold fails after adding the opExported function or error branch untestedCover each validation branch and the happy path (writing-tests skill)

Additional resources

  • src/topology/README.md — module map, API styles, validity brands, gotchas.
  • .claude/commands/new-kernel-method.md — kernel-layer prerequisite steps.
  • docs/which-api.md — fluent vs functional vs sketcher guidance for placement decisions.
  • Sibling skills: architecture-navigation (which layer/module), kernel-abstraction (adapters and getKernel), result-error-handling (Result/BrepError conventions), writing-tests (test skeleton and multi-kernel gating), quality-gates (validate/hooks/knip/patterns), memory-and-disposal (using/dispose-on-failure rationale), debugging-geometry (when the op returns invalid geometry), playground-examples (showcasing the op).

© andymai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/adding-operations of andymai/brepjs.

Open the folder on GitHubat commit e8fa511

Compare with similar skills

Adding Operations 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.

Adding Operations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Adding Operations this skillandymai/brepjs114—~4.4kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k24 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 24 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed

More from andymai/brepjs

All 21 skills in this repo
  • Implement

    andymai/brepjs

    A skill your agent uses when authoring or editing a brepjs .brep.ts part — writing the geometry with the functional API (box, cylinder, fuse, cut, fillet, sketch→extrude…), declaring an expected…

    114 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Memory And Disposal

    andymai/brepjs

    This skill should be used when managing WASM handle lifetimes or hunting memory leaks in brepjs — when a task mentions "createHandle() without using keyword risks WASM memory leak"…

    114 GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Polish

    andymai/brepjs

    A skill your agent uses when a valid brepjs part should look designed rather than glued-from-primitives (products, toys, mechanisms, anything a human eyeballs), and when exporting/handing off the…

    114 GitHub stars~588 tokensUpdated yesterday
    Auto-check passed
  • Wasm Interop

    andymai/brepjs

    This skill should be used when working across the JS/WASM boundary in brepjs — writing or debugging code in src/kernel/occt, src/kernel/occtWasm, or src/kernel/brepkit, or diagnosing symptoms like…

    114 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Writing Tests

    andymai/brepjs

    This skill should be used when writing, running, or fixing tests in the brepjs repository — when a task says "add a test", "write a regression test", "tests are failing", "test timed out", "coverage…

    114 GitHub stars~4.3k tokensUpdated yesterday
    Auto-check passed
  • This skill should be used when deciding which layer or module a new file, function, or directory belongs in, or when a layer-boundary check fails.

    114 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Adding Operations

What does Adding Operations do?

This skill should be used when adding or extending a geometric shape operation in brepjs — the end-to-end recipe once the target module is chosen (which is decided by architecture-navigation) — when…. Adding Operations is an agent skill from andymai/brepjs.md", "knip flags my new export", or "where do I export this from".

When should I use Adding Operations?

Adding Operations fits situations like: development work in your project.

How do I install Adding Operations in Claude Code?

Run `npx skills add andymai/brepjs --skill adding-operations -a claude-code`. Or copy the skill folder (.claude/skills/adding-operations in andymai/brepjs) into .claude/skills/adding-operations in your project. Claude Code loads it when a task matches its description.

How do I install Adding Operations in Codex?

Run `npx skills add andymai/brepjs --skill adding-operations -a codex`. Or copy the skill folder (.claude/skills/adding-operations in andymai/brepjs) into .agents/skills/adding-operations in your project. Codex loads it when a task matches its description.

Can I use Adding Operations in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add andymai/brepjs --skill adding-operations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adding-operations, .gemini/skills/adding-operations, .github/skills/adding-operations and .opencode/skills/adding-operations in your project.

What does Adding Operations need to run?

Going by SKILL.md and its folder, Adding Operations needs the command-line tools its instructions call (npm, npx and git). Our summary lists: Node.js.

Does Adding Operations access the network?

SKILL.md contains no URLs. Its commands use npm, npx and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Adding Operations safe to install?

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.

What licence does Adding Operations use?

Adding Operations is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Adding Operations use?

About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Adding Operations?

Skills that share tags, products or a category with Adding Operations: Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Adding Operations?

andymai (a GitHub user) maintains it in andymai/brepjs, which has 114 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 6, 2026.

Source: andymai/brepjs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.