Skip to content

matlab/matlab-agentic-toolkit / skills-catalog/matlab-software-development/matlab-package-toolbox

matlab-package-toolbox

Verified

Turn raw MATLAB code into a published .mltbx toolbox — full pipeline from scope definition through packaging and release. Drives 8 phases with human checkpoints, enforcing ordering and dependencies. Use when asked to package, create a toolbox, or run the files-to-package pipeline.

references/phase-1-scope.md

View on GitHub
# Phase 1: Define Toolbox API

Scan the folder, triage files into include/exclude, identify the public API, and produce the Interface Spec.

## Key Functions

| Function | Purpose |
|----------|---------|
| `dir` | Recursive file listing for inventory |
| `which` | Resolve function locations on path |
| `exist` | Check whether a name resolves to a file, folder, or built-in |
| `matlab.codetools.requiredFilesAndProducts` | Trace caller/callee relationships for Support classification |

## Step 1.1 — Inventory the Folder

Scan the path recursively. Classify every file:

| Category | Detection Rule |
|----------|---------------|
| **Function** | `.m` file with `function` keyword on first non-comment line |
| **Class** | `.m` file with `classdef` keyword |
| **Script** | `.m` file with no `function`/`classdef` keyword |
| **Live Script** | `.mlx` file |
| **Test** | In `tests/`/`test/` folder, or name matches `*Test.m`, `*_test.m`, `test_*.m` |
| **Data** | `.mat`, `.csv`, `.xlsx`, `.json`, `.xml` (non-config) |
| **Config/Meta** | `buildfile.m`, `projectStartup.m`, `Contents.m`, `.prj`, `resources/` |
| **Scratch/Temp** | In `scratch/`, `tmp/`, or names like `untitled*.m`, `Copy_of_*` |
| **Other** | READMEs, images, licenses, etc. |

## Step 1.2 — Classify Relevance

Using the **purpose** as guide, classify each file:

- **Include** — directly serves the toolbox's stated purpose
- **Support** — needed by included files (helper/utility called internally)
- **Exclude** — not relevant (tests, scratch, unrelated code)
- **Uncertain** — needs user input

Heuristics:

| Signal | Disposition |
|--------|-------------|
| Function name aligns with purpose keywords | Include |
| H1 text mentions concepts from purpose | Include |
| Called by an included file | Support |
| In `private/` or `+internal` folder | Support |
| Test file for an included function | Exclude |
| Script with no connection to purpose | Exclude |
| Data file referenced by included code | Include |
| Scratch/temp naming pattern | Exclude |

## Step 1.3 — Identify Public API

From the **Include** set, determine visibility:

| Signal | Classification |
|--------|---------------|
| Has H1 help text | Likely public |
| Has `arguments` block or input validation | Likely public |
| Descriptive action-oriented name | Likely public |
| Classdef with public methods | Public |
| Called by others but not standalone | Internal |
| In `private/` or generic utility name | Internal |
| Script | Example/entry point |

## Step 1.4 — Present Report & Get Confirmation

Display a combined scope + API report. This report defines what ends up in the `.mltbx`:
- **Public API** — functions end users will call directly
- **Internal Support** — ships in the toolbox but not user-facing (helpers called by public functions)
- **Included Assets** — ships in the .mltbx but is not callable code (docs, examples, icons, data files, XML metadata)
- **Excluded** — will NOT be in the .mltbx (tests, build infrastructure, scratch files)
- **Uncertain** — ambiguous files that need user input

```
## Toolbox Scope & API — [Name]

**Purpose:** [user's stated purpose]
**Source:** [path]
**Total files:** N

### Public API (N functions)
| Function | Signature | H1 | Category |
|----------|-----------|-----|----------|

### Internal Support (N files)
| File | Type | Reason |
|------|------|--------|

### Included Assets (N files) — ships in .mltbx, not part of callable API
| File | Description |
|------|-------------|

### Excluded (N files) — will NOT be in the .mltbx
| File | Reason |
|------|--------|

### Uncertain — Need Your Input
| File | Why Uncertain |
|------|--------------|
```

Then ask:
> **Please review:**
> 1. Should any excluded files be included (as API, support, or assets)?
> 2. Should any included files be excluded or reclassified?
> 3. For uncertain files — which category?
> 4. Is the public API surface correct?
> 5. What categories should functions be grouped into?

Incorporate feedback before proceeding.

## Step 1.5 — Generate Interface Spec

Produce `toolboxSpecification.m` using `scripts/toolboxSpecificationTemplate.m` as the structure. `spec.entries` is a **cell array** (not a struct array) because `classdef` entries have extra fields (`methods`, `properties`) that `function` entries lack — MATLAB cannot concatenate structs with mismatched fields. Access entries via `spec.entries{i}`. Each entry has a `"type"` field — either `"function"` or `"classdef"`.

Save to `buildUtilities/toolboxSpecification.m` in the project root (create the folder if needed). This folder is excluded from the toolbox package via `toolbox.ignore` or `package.ignore`.

## Rules

- **Always prompt if inputs are missing.** Never guess the path or purpose.
- **Every file is accounted for.** Nothing is silently dropped.
- **Purpose drives classification.** The user's stated intent is the primary filter.
- **Uncertain is valid.** Surface ambiguity rather than guessing wrong.
- **Reasons are mandatory.** Every include/exclude decision has a stated reason.
- **Tests are excluded but acknowledged.** They're handled by Phase 6 later.
- **Scripts become examples.** Files without `function` keyword are examples/entry points, not public API.
- **One artifact, build utilities.** Only `toolboxSpecification.m` is written, to `buildUtilities/`.

----

Copyright 2026 The MathWorks, Inc.

----
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall