Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Setup Custom Libraries

ASecurity

Register, add, or update existing custom Simulink block libraries and configure block policy and knowledge index. Use when a user wants to register, set up, configure, or add existing .slx library files for agent-assisted model building. Do NOT use when the user wants to create or author a new library from scratch — that requires building-simulink-models.

1,176 stars
0 votes
0 copies
0 views
Added 8/31/2026
ai-agentsgorailsapi

Works with

api

Security Analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned 8/31/2026

$npx -y skills add matlab/simulink-agentic-toolkit --skill setup-custom-libraries --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Setup Custom Libraries?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Setup Custom Libraries
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/matlab-setup-custom-libraries/badge)](https://www.skillsdirectory.com/skills/matlab-setup-custom-libraries)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: setup-custom-libraries
description: Register, add, or update existing custom Simulink block libraries and configure block policy and knowledge index. Use when a user wants to register, set up, configure, or add existing .slx library files for agent-assisted model building. Do NOT use when the user wants to create or author a new library from scratch — that requires building-simulink-models.
license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md
metadata:
  author: MathWorks
  version: "1.2"
---

# Setup Custom Libraries

Register or update custom Simulink block libraries so the agent prefers them over built-in blocks during model building.

## When to Use

- User asks to set up, register, add, or configure custom libraries
- User wants to add new `.slx` files to an existing library configuration
- User says "setup custom libraries", "add my library", "configure libraries", "add a new library file"
- `building-simulink-models` routes here via the policy gate (`gatePass: false`)
- **Never** invoke when `found: false` — that means no custom libraries are configured and the user hasn't asked for them

## When NOT to Use

- User wants to **create** a custom library from scratch (author new blocks, build a new `.slx` library file) → use `building-simulink-models` skill with `model_edit` directly. This skill only *registers* existing libraries; it cannot create library content.
- Only configuring block exclusions or parameter protection (libraries already declared) → `configuring-block-policy`
- Only curating block descriptions/categories (libraries already declared) → `simulink-curating-library-kg`

## Workflow

**Do this FIRST and ALONE — no other tool calls in the same message.**

Call `library.settingsLookup()` — returns a struct with resolved absolute paths:
- `found` — whether a libraries file was located (satk-libraries.json or legacy reuse-libraries.json)
- `enabled` — whether custom libraries are configured
- `gatePass` — whether the gate is satisfied
- `dataRoot` — absolute path to the directory containing `.satk/`
- `kgIndexPath`, `librariesPath`, `policyPath` — absolute paths to data files

**Interpret the result:**

- **`found: false`** → no custom libraries configured. Do NOT proceed with setup unless the user explicitly asked. Return control to the calling skill.
- **`gatePass: true, found: true`** → all data files present and KB populated. Offer management menu (below).
- **`gatePass: false, found: true`** → libraries declared but KB needs population. **Skip Gate 1** (libraries already exist). Start from Gate 2 below using `dataRoot` as the target.

Follow `references/library-setup.md` for all gate API details — it is the single source of truth for API calls, examples, and options at each gate.

**Gate 1 — Library declaration:** Only when the user explicitly asked to set up custom libraries and no libraries file exists yet. STOP and ask the user about reusable libraries. Present two options: **Yes** (declare libraries) or **None** (no libraries right now). Do not read reference files, open models, or plan blocks until they respond.

- If user provides libraries (**Yes**) → save to `prefdir` via `library.LibraryConfig.save(prefdir(), libraries)`.
- If user says **"none"** → do not create any files. The gate remains open (no config = use standard blocks).

**Gate 2 — Block policy:** If `.satk/block-policy.json` is missing, STOP and ask the user about policy setup by following `references/library-setup.md`. Do not proceed until policy is resolved.

**Gate 3 — Library blocks knowledge index:** If the KB is empty (index.md contains `populated: false`) or missing, STOP and ask the user whether to index their library blocks so the agent knows which blocks are available during model building. Offer two options: **Automatic** (agent infers categories/descriptions autonomously) or **Guided setup** (interactive curation). Both invoke the `simulink-curating-library-kg` skill. Follow `references/library-setup.md` for details. Do not proceed until KG generation completes.

### Management menu (config already complete)

Retrieve and display the user's current configuration status using the APIs in `references/library-setup.md` § "Status Display (Management Menu)". Show library names/paths, policy mode with fallback, and KG block/category counts. Then offer:

- **(a) Add or remove libraries** — load existing config via `library.LibraryConfig.load(dataRoot)`, append/remove entries, save via `library.LibraryConfig.save(dataRoot, allLibs)`, then invoke `simulink-curating-library-kg` skill (automatic mode) to regenerate KG.
- **(b) Update block policy** — load `configuring-block-policy` skill.
- **(c) Promote config to prefdir** — only show if tier is `project` or `legacy`. Copy `.satk/` folder to `prefdir/.satk/` (expand relative paths to absolute). See `references/library-setup.md` § "Gate 1" for the promote API.
- **(d) Regenerate knowledge index** — load `simulink-curating-library-kg` skill.

### Adding files to existing config

When `satk-libraries.json` already exists with declared libraries: read the existing config, append the new library entries, save via `library.LibraryConfig.save()`, then invoke the `simulink-curating-library-kg` skill (automatic mode) to infer categories/descriptions for the new blocks and regenerate the knowledge index.

## Guardrails

- **Never write config files or `.satk/` JSON manually.** Always follow the instructions and APIs in `references/library-setup.md` for each case.
- **Do not use `find_system`, `load_system`** to discover, validate, or enumerate library contents. All library operations must go through the specified APIs in `references/library-setup.md`.
- **Each gate requires explicit user input before proceeding.** Do not assume anything, wait for the response before moving to the next gate.
- **Paths at prefdir must be absolute.** (Project-level paths can be relative to project root.)

----

Copyright 2026 The MathWorks, Inc.

----

Attribution

matlabmatlab
View sourceSee grades on GitHubMore from matlab →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →