matlab/matlab-agentic-toolkit / skills-catalog/matlab-software-development/matlab-package-toolbox
matlab-package-toolbox
VerifiedTurn 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-5-build.md
View on GitHub# Phase 5: Create Build Plan
Generate a `buildfile.m` using MATLAB's `matlab.buildtool` framework.
## Step 5.1 — Assess What Exists
Scan for:
- Source folder (priority: `toolbox/` → `+packagename/` → `source/`/`src/`)
- `tests/` — test files
- MEX source files (`.c`, `.cpp`, `.cxx`, `.F`, `.f90`)
- `toolboxPackaging.prj` — packaging configuration
- Existing `buildfile.m` — update rather than replace
- `buildUtilities/toolboxSpecification.m` — for context
## Step 5.2 — Generate `buildfile.m`
Use built-in task types where they exist:
| Task | Type | Description | Fail condition |
|------|------|-------------|----------------|
| `clean` | CleanTask | Remove derived artifacts | — |
| `check` | CodeIssuesTask | Static analysis (SARIF) | Any error; any warning (strict) |
| `mex` | MexTask | Compile MEX files (if detected) | Compilation fails |
| `test` | TestTask | Run tests + produce coverage | Any test failure |
| `coverage` | Custom | Report coverage, warn if below threshold | — (advisory) |
| `package` | Custom | Build .mltbx | Package file not produced |
**Task strategy rules:**
- **TestTask handles testing AND coverage production.** Use `.addCodeCoverage()` to produce both Cobertura XML and `.mat`.
- **Coverage reporting is a separate custom task.** Loads coverage data, logs per-file results, warns if below threshold. Does NOT fail the build.
- **Coverage task must match actual test output.** Read the test task to determine the actual coverage output path and format.
- **MexTask for MEX compilation.** Use `MexTask.forEachFile` for multiple sources. Output in toolbox/ folder.
- **Custom tasks use `context`.** Always `context.log()` for output, `context.assertTrue()` for failures. NEVER `disp()`, `fprintf()`, `warning()`, or bare `assert()`.
- **Package from PRJ.** Load `ToolboxOptions` from `toolboxPackaging.prj`. Fall back to programmatic if no PRJ exists (see `references/buildfile-variants.md`).
- **Never hardcode version in packageTask.** Read from `toolboxSpecification.m` or PRJ.
- **Output to `release/`.** Replace spaces with underscores in filename.
- **DefaultTasks = ["check" "test" "coverage"].** Packaging is explicit (`buildtool package`).
- **Omit MEX task if no MEX sources.** Don't generate dead code.
- **Include comments explaining design choices** — the buildfile is a teaching artifact.
Use `scripts/buildfile-template.m` as the base template.
## Step 5.3 — Present the Plan
Show task chain, dependencies, artifacts produced, and CI invocation patterns. Ask:
> A) **Approve** — write the buildfile
> B) **Adjust** — modify tasks, thresholds, or dependencies
> C) **Skip** — don't create a buildfile now
## Step 5.4 — Persist
**If `buildfile.m` does NOT exist:** Write to project root.
**If `buildfile.m` already exists:** Show a diff of proposed changes. Wait for explicit user approval before editing.
----
Copyright 2026 The MathWorks, Inc.
----
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |