@pikaa-ai/pikaa 0.3.23 → 0.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/assets/brand/orbit-logo-option4-whale.jpg +0 -0
  2. package/assets/brand/orbit-logo.jpg +0 -0
  3. package/assets/brand/orbit-logo.png +0 -0
  4. package/assets/brand/orbit-logo.svg +3 -0
  5. package/dist/cli.js +337 -162
  6. package/dist/index.js +1 -2
  7. package/package.json +1 -2
  8. package/skills/adaptyv/SKILL.md +0 -240
  9. package/skills/aeon/SKILL.md +0 -402
  10. package/skills/analytical-method-validation/SKILL.md +0 -299
  11. package/skills/anndata/SKILL.md +0 -431
  12. package/skills/arbor/SKILL.md +0 -152
  13. package/skills/arboreto/SKILL.md +0 -267
  14. package/skills/astropy/SKILL.md +0 -353
  15. package/skills/autoskill/SKILL.md +0 -233
  16. package/skills/benchling-integration/SKILL.md +0 -229
  17. package/skills/bgpt-paper-search/SKILL.md +0 -75
  18. package/skills/bids/SKILL.md +0 -237
  19. package/skills/biopython/SKILL.md +0 -472
  20. package/skills/bioservices/SKILL.md +0 -399
  21. package/skills/bulk-rnaseq/SKILL.md +0 -198
  22. package/skills/cellxgene-census/SKILL.md +0 -283
  23. package/skills/cirq/SKILL.md +0 -370
  24. package/skills/citation-management/SKILL.md +0 -329
  25. package/skills/clinical-decision-support/SKILL.md +0 -238
  26. package/skills/clinical-decision-support/references/README.md +0 -62
  27. package/skills/clinical-reports/SKILL.md +0 -248
  28. package/skills/clinical-reports/references/README.md +0 -34
  29. package/skills/cobrapy/SKILL.md +0 -496
  30. package/skills/consciousness-council/SKILL.md +0 -151
  31. package/skills/dask/SKILL.md +0 -482
  32. package/skills/database-lookup/SKILL.md +0 -386
  33. package/skills/datamol/SKILL.md +0 -200
  34. package/skills/deepchem/SKILL.md +0 -244
  35. package/skills/deepspot-m/SKILL.md +0 -175
  36. package/skills/deeptools/SKILL.md +0 -412
  37. package/skills/depmap/SKILL.md +0 -301
  38. package/skills/dhdna-profiler/SKILL.md +0 -184
  39. package/skills/diffdock/SKILL.md +0 -488
  40. package/skills/dnanexus-integration/SKILL.md +0 -325
  41. package/skills/docx/SKILL.md +0 -99
  42. package/skills/esm/SKILL.md +0 -334
  43. package/skills/etetoolkit/SKILL.md +0 -327
  44. package/skills/exa-search/SKILL.md +0 -102
  45. package/skills/executing-plans/SKILL.md +0 -14
  46. package/skills/experimental-design/SKILL.md +0 -234
  47. package/skills/exploratory-data-analysis/SKILL.md +0 -280
  48. package/skills/flowio/SKILL.md +0 -310
  49. package/skills/fluidsim/SKILL.md +0 -279
  50. package/skills/frontend-design/SKILL.md +0 -100
  51. package/skills/generate-image/SKILL.md +0 -304
  52. package/skills/geniml/SKILL.md +0 -310
  53. package/skills/genomic-coordinates/SKILL.md +0 -189
  54. package/skills/genomic-intelligence/SKILL.md +0 -243
  55. package/skills/geomaster/README.md +0 -105
  56. package/skills/geomaster/SKILL.md +0 -366
  57. package/skills/geopandas/SKILL.md +0 -250
  58. package/skills/get-available-resources/SKILL.md +0 -260
  59. package/skills/gget/SKILL.md +0 -153
  60. package/skills/ginkgo-cloud-lab/SKILL.md +0 -106
  61. package/skills/glycoengineering/SKILL.md +0 -339
  62. package/skills/gtars/SKILL.md +0 -282
  63. package/skills/guardian-rails/SKILL.md +0 -54
  64. package/skills/histolab/SKILL.md +0 -243
  65. package/skills/hugging-science/SKILL.md +0 -132
  66. package/skills/hypogenic/SKILL.md +0 -290
  67. package/skills/hypothesis-generation/SKILL.md +0 -264
  68. package/skills/imaging-data-commons/SKILL.md +0 -496
  69. package/skills/infographics/SKILL.md +0 -315
  70. package/skills/iso-standards-readiness/SKILL.md +0 -352
  71. package/skills/lab-hardware-cad/SKILL.md +0 -372
  72. package/skills/labarchive-integration/SKILL.md +0 -216
  73. package/skills/lamindb/SKILL.md +0 -408
  74. package/skills/latchbio-integration/SKILL.md +0 -227
  75. package/skills/latex-posters/SKILL.md +0 -369
  76. package/skills/latex-posters/references/README.md +0 -439
  77. package/skills/liteparse/SKILL.md +0 -295
  78. package/skills/literature-review/SKILL.md +0 -263
  79. package/skills/markdown-mermaid-writing/SKILL.md +0 -322
  80. package/skills/market-research-reports/SKILL.md +0 -337
  81. package/skills/markitdown/SKILL.md +0 -264
  82. package/skills/matchms/SKILL.md +0 -276
  83. package/skills/matlab/SKILL.md +0 -274
  84. package/skills/matplotlib/SKILL.md +0 -378
  85. package/skills/medchem/SKILL.md +0 -321
  86. package/skills/modal/SKILL.md +0 -468
  87. package/skills/molecular-dynamics/SKILL.md +0 -458
  88. package/skills/molfeat/SKILL.md +0 -348
  89. package/skills/ncats-arax/SKILL.md +0 -178
  90. package/skills/networkx/SKILL.md +0 -440
  91. package/skills/neurokit2/SKILL.md +0 -323
  92. package/skills/neuropixels-analysis/SKILL.md +0 -412
  93. package/skills/nextflow/SKILL.md +0 -195
  94. package/skills/omero-integration/SKILL.md +0 -222
  95. package/skills/onekgpd/SKILL.md +0 -371
  96. package/skills/ontology-term-resolution/SKILL.md +0 -147
  97. package/skills/open-notebook/SKILL.md +0 -297
  98. package/skills/openpiv/SKILL.md +0 -469
  99. package/skills/opentrons-integration/SKILL.md +0 -322
  100. package/skills/optimize-for-gpu/SKILL.md +0 -176
  101. package/skills/owasp-top10/SKILL.md +0 -48
  102. package/skills/pacsomatic/LICENSE +0 -21
  103. package/skills/pacsomatic/SKILL.md +0 -150
  104. package/skills/paper-lookup/SKILL.md +0 -263
  105. package/skills/paperclip/SKILL.md +0 -413
  106. package/skills/paperzilla/SKILL.md +0 -159
  107. package/skills/parallel-web/SKILL.md +0 -128
  108. package/skills/pathml/SKILL.md +0 -222
  109. package/skills/pathogen-variant-surveillance/SKILL.md +0 -208
  110. package/skills/pathway-enrichment/SKILL.md +0 -194
  111. package/skills/pdf/SKILL.md +0 -322
  112. package/skills/peer-review/SKILL.md +0 -288
  113. package/skills/penetration-testing/SKILL.md +0 -31
  114. package/skills/pennylane/SKILL.md +0 -240
  115. package/skills/phylogenetics/SKILL.md +0 -409
  116. package/skills/pi-agent/SKILL.md +0 -83
  117. package/skills/pkpd-modeling/SKILL.md +0 -381
  118. package/skills/polars/SKILL.md +0 -393
  119. package/skills/polars-bio/SKILL.md +0 -379
  120. package/skills/ponytail/SKILL.md +0 -31
  121. package/skills/ponytail-audit/SKILL.md +0 -18
  122. package/skills/pptx/SKILL.md +0 -246
  123. package/skills/pptx-posters/SKILL.md +0 -258
  124. package/skills/primekg/SKILL.md +0 -99
  125. package/skills/protocolsio-integration/SKILL.md +0 -236
  126. package/skills/pufferlib/SKILL.md +0 -328
  127. package/skills/pydeseq2/SKILL.md +0 -369
  128. package/skills/pydicom/SKILL.md +0 -381
  129. package/skills/pyhealth/SKILL.md +0 -124
  130. package/skills/pylabrobot/SKILL.md +0 -216
  131. package/skills/pymatgen/SKILL.md +0 -404
  132. package/skills/pymc/SKILL.md +0 -310
  133. package/skills/pymoo/SKILL.md +0 -276
  134. package/skills/pyopenms/SKILL.md +0 -179
  135. package/skills/pysam/SKILL.md +0 -330
  136. package/skills/pytdc/SKILL.md +0 -297
  137. package/skills/pytorch-lightning/SKILL.md +0 -191
  138. package/skills/pyzotero/SKILL.md +0 -137
  139. package/skills/qiskit/SKILL.md +0 -259
  140. package/skills/qutip/SKILL.md +0 -317
  141. package/skills/rdkit/SKILL.md +0 -94
  142. package/skills/relsa-severity-assessment/SKILL.md +0 -354
  143. package/skills/research-grants/SKILL.md +0 -296
  144. package/skills/research-grants/references/README.md +0 -287
  145. package/skills/research-lookup/README.md +0 -106
  146. package/skills/research-lookup/SKILL.md +0 -338
  147. package/skills/rowan/SKILL.md +0 -398
  148. package/skills/scanpy/SKILL.md +0 -303
  149. package/skills/scholar-evaluation/SKILL.md +0 -296
  150. package/skills/scientific-brainstorming/SKILL.md +0 -282
  151. package/skills/scientific-critical-thinking/SKILL.md +0 -180
  152. package/skills/scientific-schematics/SKILL.md +0 -370
  153. package/skills/scientific-slides/SKILL.md +0 -379
  154. package/skills/scientific-visualization/SKILL.md +0 -285
  155. package/skills/scientific-writing/SKILL.md +0 -356
  156. package/skills/scikit-bio/SKILL.md +0 -470
  157. package/skills/scikit-learn/SKILL.md +0 -324
  158. package/skills/scikit-survival/SKILL.md +0 -313
  159. package/skills/scvelo/SKILL.md +0 -328
  160. package/skills/scvi-tools/SKILL.md +0 -201
  161. package/skills/seaborn/SKILL.md +0 -254
  162. package/skills/security-auditor/SKILL.md +0 -37
  163. package/skills/shap/SKILL.md +0 -282
  164. package/skills/simpy/SKILL.md +0 -283
  165. package/skills/stable-baselines3/SKILL.md +0 -325
  166. package/skills/statistical-analysis/SKILL.md +0 -446
  167. package/skills/statistical-power/SKILL.md +0 -200
  168. package/skills/statsmodels/SKILL.md +0 -238
  169. package/skills/sympy/SKILL.md +0 -354
  170. package/skills/systematic-debugging/SKILL.md +0 -35
  171. package/skills/tamarind/SKILL.md +0 -285
  172. package/skills/tdd/SKILL.md +0 -26
  173. package/skills/tiledbvcf/SKILL.md +0 -456
  174. package/skills/timesfm-forecasting/SKILL.md +0 -408
  175. package/skills/timesfm-forecasting/examples/global-temperature/README.md +0 -178
  176. package/skills/torch-geometric/SKILL.md +0 -458
  177. package/skills/torchdrug/SKILL.md +0 -241
  178. package/skills/transformers/SKILL.md +0 -195
  179. package/skills/treatment-plans/SKILL.md +0 -174
  180. package/skills/treatment-plans/references/README.md +0 -19
  181. package/skills/umap-learn/SKILL.md +0 -488
  182. package/skills/uncertainty-and-units/SKILL.md +0 -384
  183. package/skills/usfiscaldata/SKILL.md +0 -171
  184. package/skills/vaex/SKILL.md +0 -204
  185. package/skills/venue-templates/SKILL.md +0 -269
  186. package/skills/verification-before-completion/SKILL.md +0 -22
  187. package/skills/waypoint-bio/SKILL.md +0 -273
  188. package/skills/what-if-oracle/SKILL.md +0 -184
  189. package/skills/writing-plans/SKILL.md +0 -15
  190. package/skills/xlsx/SKILL.md +0 -110
  191. package/skills/zarr-python/SKILL.md +0 -241
@@ -1,274 +0,0 @@
1
- ---
2
- name: matlab
3
- description: Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.
4
- license: MIT
5
- compatibility: >-
6
- Documentation is pinned where noted to proprietary MATLAB R2026a and free
7
- GNU Octave 11.3.0. Bundled Python CLIs require Python 3.11+ and run locally
8
- without MATLAB or Octave; optional MAT inventory uses scipy and/or h5py.
9
- allowed-tools: Read Write Bash Glob Python
10
- metadata:
11
- version: "1.1"
12
- skill-author: "K-Dense Inc."
13
- last-reviewed: "2026-07-23"
14
- ---
15
-
16
- # MATLAB and GNU Octave
17
-
18
- Use this skill to design or review numerical code, migrate MATLAB releases,
19
- prepare reproducible projects, and plan trusted execution. MATLAB and GNU
20
- Octave are distinct products: compatibility is partial, not a license or
21
- behavior guarantee.
22
-
23
- ## Product and license gate
24
-
25
- - **MATLAB R2026a is proprietary.** Do not assume MATLAB, MATLAB Online, a
26
- named toolbox, MATLAB Test, MATLAB Compiler, MATLAB Coder, Parallel Computing
27
- Toolbox, or an add-on is installed, licensed, or available to the user.
28
- - **MATLAB Runtime is not MATLAB.** It runs compatible applications produced
29
- with MATLAB Compiler; it cannot run arbitrary source or host MATLAB Engine
30
- for Python. Building artifacts needs the applicable licensed compiler and
31
- every product used by the source.
32
- - **GNU Octave 11.3.0 is free software under GPLv3+.** Octave packages are not
33
- MATLAB toolboxes. Similar names do not imply API, numerical, graphics, or
34
- licensing equivalence.
35
- - Ask which runtime, release, platform, installed products, and license context
36
- the user actually has. Treat availability as `unknown` until confirmed.
37
-
38
- See [Octave compatibility](references/octave-compatibility.md) and
39
- [execution/product boundaries](references/executing-scripts.md).
40
-
41
- ## Nonnegotiable safety boundary
42
-
43
- Never run an untrusted `.m`, `.mlx`, MEX binary, MAT file, project startup or
44
- shutdown action, package installer, or generated artifact. Static review does
45
- not prove safety.
46
-
47
- Treat these as execution or code-loading surfaces:
48
-
49
- - `eval`, `evalin`, `assignin`, text-derived `feval`, `str2func`, callbacks,
50
- timers, app callbacks, and dynamically modified paths;
51
- - `system`, `unix`, `dos`, shell escape `!`, Java, .NET, Python (`py.*`,
52
- `pyrun`, `pyrunfile`), MEX, and native libraries;
53
- - `mex`, `codegen`, MATLAB Compiler, build tasks, package/project startup, and
54
- generated code;
55
- - `load`, object deserialization (`loadobj`, custom serialization), function
56
- handles, Java/System objects, and class code reachable from MAT files.
57
-
58
- `.mlx` is an opaque archive for this toolkit and MEX is native executable code.
59
- Do not use Python pickle for exchange. Inspect first, isolate when appropriate,
60
- obtain explicit approval, then invoke a user-confirmed executable and license.
61
- Bundled scripts are static or dry-run tools: none launches MATLAB, Octave,
62
- Python Engine, a compiler, or a subprocess.
63
-
64
- ## Default workflow
65
-
66
- 1. **Clarify target.** Record MATLAB release or Octave version, OS/architecture,
67
- base product versus required toolboxes/packages, expected inputs/outputs,
68
- numerical tolerances, and whether execution is authorized.
69
- 2. **Inventory statically.** Scan `.m` files, opaque artifacts, project paths,
70
- required products, and MAT headers before any runtime loads them.
71
- 3. **Choose code form.** Prefer functions with an `arguments` block for
72
- automation. Use scripts only for controlled orchestration and live scripts
73
- for reviewed interactive narratives.
74
- 4. **Make semantics explicit.** Record shapes, classes, units, missing-value
75
- rules, indexing, implicit expansion, RNG algorithm/seed, tolerances, and
76
- output formats.
77
- 5. **Test without hidden state.** Keep fixtures synthetic, paths project-local,
78
- graphics deterministic, and tests independent of base-workspace residue.
79
- 6. **Plan execution.** Generate an argv plan, review startup/path effects and
80
- licenses, and launch only after explicit approval outside these helpers.
81
- 7. **Capture provenance.** Hash named inputs/code and record release, products,
82
- RNG policy, tolerances, and command plan without dumping the environment.
83
-
84
- ## Language and data checklist
85
-
86
- ### Scripts, functions, and live scripts
87
-
88
- - Scripts share the caller/base workspace and leave variables behind.
89
- Functions have local workspaces and explicit inputs/outputs.
90
- - Live scripts (`.mlx`) mix code and rich output but are not plain-text
91
- review artifacts. Export reviewed code to `.m` for static inspection.
92
- - Avoid `clear all`, broad `addpath(genpath(...))`, dependence on `pwd`, global
93
- variables, and silent name shadowing. Use project roots and `fullfile`.
94
- - Validate sizes, classes, and values in `arguments` blocks. Remember that
95
- type declarations can convert inputs; validators check without converting.
96
- - A main function file should match the main function name. Local functions
97
- are private to the file; since R2024a they can appear anywhere in a script
98
- outside conditional contexts.
99
-
100
- ```matlab
101
- function y = scaleSignal(x, options)
102
- arguments
103
- x (:,1) double {mustBeFinite}
104
- options.Scale (1,1) double {mustBeFinite, mustBeNonzero} = 1
105
- end
106
- y = x .* options.Scale;
107
- end
108
- ```
109
-
110
- Read [programming](references/programming.md).
111
-
112
- ### Arrays, indexing, and numerics
113
-
114
- - MATLAB uses 1-based, column-major indexing. `A(i,j)`, `A(k)`, `A(:,j)`,
115
- `A{...}`, and `A.(name)` have different semantics.
116
- - `*`, `/`, `\`, and `^` are matrix operations; dotted forms are
117
- element-wise. Use `A\b`, not `inv(A)*b`.
118
- - Since R2016b, compatible dimensions expand implicitly. Assert intended shape
119
- before operations that could accidentally form an outer result.
120
- - Preallocate when output size is known, but do not vectorize at the cost of
121
- huge temporaries or unreadable code. Measure with `timeit` or the profiler.
122
- - Compare floating-point results with domain-chosen absolute and relative
123
- tolerances, not blanket `==` or a magic multiple of `eps`.
124
- - Pin both random algorithm and seed. Use named `RandStream` substreams for
125
- independent parallel work; do not use time-based `rng("shuffle")` for a
126
- reproducibility claim.
127
-
128
- Read [arrays](references/matrices-arrays.md) and
129
- [mathematics](references/mathematics.md).
130
-
131
- ### Tables, timetables, and missing values
132
-
133
- - A `table` has named, equal-height variables that may have different types.
134
- `T(rows,vars)` returns a table; `T{rows,vars}` extracts contents; `T.Var`
135
- selects one variable.
136
- - A `timetable` additionally has row times. Sort, validate time zones and
137
- uniqueness, then use `retime`/`synchronize` intentionally.
138
- - Missing sentinels are type-specific: `NaN`, `NaT`, `<missing>`,
139
- `<undefined>`, and empty character vectors. Integer and logical arrays have
140
- no standard missing sentinel.
141
- - Define import options rather than relying on inference for production data.
142
- Preserve units, time zones, variable names, encodings, and missing rules.
143
-
144
- Read [data import/export](references/data-import-export.md).
145
-
146
- ## Graphics and export
147
-
148
- Use explicit figure/axes handles and `tiledlayout`; label units; set limits,
149
- color scales, font sizes, and colormaps deliberately. Prefer `exportgraphics`
150
- over `saveas` for publication output. In R2026a it exports raster, PDF/EPS/EMF,
151
- SVG, GIF, and interactive HTML; format capabilities differ. Specify
152
- `ContentType="vector"` for suitable PDF/SVG-style output and `Resolution` for
153
- raster output. Review accessibility and embedded-raster behavior.
154
-
155
- Read [graphics and export](references/graphics-visualization.md).
156
-
157
- ## MAT files and exchange
158
-
159
- - Version 7 is the normal `save` default; `matfile` creates 7.3 by default.
160
- Versions 4/6/7/7.3 differ in types, compression, and per-variable limits.
161
- - Version 7.3 is HDF5-based, not an arbitrary HDF5 interchange contract.
162
- Partial access and chunking can help large arrays.
163
- - Never load an untrusted MAT file. Inventory headers/datasets first. Objects
164
- can invoke class deserialization behavior; opaque/function/native content
165
- requires escalation.
166
- - Prefer CSV/JSON/Parquet/HDF5 with a documented schema for simple exchange.
167
- Do not rename pickle payloads as MAT files and do not deserialize pickle.
168
-
169
- Read [data import/export](references/data-import-export.md).
170
-
171
- ## Projects, analysis, and tests
172
-
173
- - Use MATLAB Projects for controlled paths, startup/shutdown tasks,
174
- dependencies, source control, and reproducible entry points. Review project
175
- actions before opening an untrusted project.
176
- - `matlab.codetools.requiredFilesAndProducts` and Dependency Analyzer are
177
- static approximations; dynamic dispatch can cause misses or false positives.
178
- A required-product report does not prove a license is available.
179
- - Use Code Analyzer (`codeIssues`; legacy text workflows can use `checkcode`)
180
- and `codeCompatibilityReport` before migration.
181
- - Base MATLAB includes script-, function-, and class-based
182
- `matlab.unittest` workflows. Parallel runs require Parallel Computing
183
- Toolbox. Dependency-based selection, richer quality dashboards, generated
184
- tests, and advanced coverage/equivalence features can require MATLAB Test or
185
- other products.
186
- - R2026a `runtests` automatically opens and later closes a project when target
187
- tests belong to a project that is not already open. Account for startup and
188
- shutdown actions before using this behavior.
189
-
190
- Read [programming](references/programming.md) and
191
- [execution/testing](references/executing-scripts.md).
192
-
193
- ## Python integration, pinned to R2026a
194
-
195
- - R2026a supports 64-bit CPython 3.9-3.13 for MATLAB Interface to Python,
196
- MATLAB Engine for Python, and MATLAB Compiler SDK for Python.
197
- - The current R2026a PyPI package reviewed here is
198
- `matlabengine==26.1.12` (released 2026-05-08). It requires an installed
199
- R2026a; MATLAB Runtime alone is insufficient. R2026a also ships a
200
- preinstalled Engine distribution under one named `matlabroot` path.
201
- - Package installation does not grant MATLAB or toolbox licenses. Configure
202
- one named interpreter/executable; do not print the full environment,
203
- `PATH`, `PYTHONPATH`, or credentials.
204
- - `pyenv` controls MATLAB-to-Python interpreter selection. In-process Python
205
- generally requires restarting MATLAB to switch; out-of-process Python can
206
- be terminated and reconfigured.
207
- - Starting Engine is an explicit execution action:
208
- `matlab.engine.start_matlab()` starts a MATLAB process and can check out a
209
- license. Never call it merely to probe availability.
210
- - Verify conversion semantics for NumPy arrays, pandas DataFrames,
211
- tables/timetables, strings/missing values, datetime/duration, dictionaries,
212
- shape/order, and unsupported sparse/object/categorical cases.
213
-
214
- Read [Python integration](references/python-integration.md).
215
-
216
- ## Local helper CLIs
217
-
218
- Every helper is network-free, bounded, symlink-rejecting, and nonexecuting.
219
- Run from this skill directory with Python 3.11+. Bash is allowed only to invoke
220
- these Python CLIs and validation commands; never use it to execute a generated
221
- MATLAB/Octave argv plan or untrusted artifact.
222
-
223
- | Helper | Purpose |
224
- |---|---|
225
- | `scripts/plan_batch_command.py` | Produce reviewed MATLAB/Octave argv; never execute |
226
- | `scripts/scan_m_code.py` | Scan `.m` text and flag opaque `.mlx`/MEX risks |
227
- | `scripts/validate_project_manifest.py` | Validate paths and declared product/license status |
228
- | `scripts/inventory_mat_file.py` | Header/metadata inventory; never call `loadmat` |
229
- | `scripts/plan_python_compatibility.py` | Check R2026a CPython/Engine compatibility |
230
- | `scripts/reproducibility_report.py` | Hash named local artifacts and emit a bounded report |
231
- | `scripts/generate_function_scaffold.py` | Dry-run or create function and unit-test scaffolds |
232
-
233
- ```bash
234
- python scripts/scan_m_code.py path/to/source --root path/to/project
235
- python scripts/plan_batch_command.py matlab script path/to/main.m --root path/to/project
236
- python scripts/validate_project_manifest.py project-manifest.json --root path/to/project
237
- python scripts/inventory_mat_file.py data.mat --root path/to/project
238
- python scripts/plan_python_compatibility.py --python-version 3.13
239
- python scripts/reproducibility_report.py --root path/to/project --file src/analyze.m
240
- python scripts/generate_function_scaffold.py analyzeSignal --root path/to/project
241
- ```
242
-
243
- The scaffold generator defaults to dry-run; writing requires `--write` and
244
- refuses collisions. SciPy and h5py are optional inventory backends; if
245
- authorized, add exact reviewed versions to the caller's project lockfile.
246
- They are not required for `--help` or header-only inventory, and this skill
247
- does not perform package installation.
248
-
249
- ## References
250
-
251
- - [Programming, workspaces, projects, analysis, tests](references/programming.md)
252
- - [Matrices, indexing, types, missingness, performance](references/matrices-arrays.md)
253
- - [Numerical methods, tolerances, RNG, toolbox boundaries](references/mathematics.md)
254
- - [Graphics and `exportgraphics`](references/graphics-visualization.md)
255
- - [Import/export, tables/timetables, MAT semantics and safety](references/data-import-export.md)
256
- - [MATLAB/Octave command-line execution and migration](references/executing-scripts.md)
257
- - [MATLAB and Python interoperability](references/python-integration.md)
258
- - [GNU Octave 11.3.0 compatibility differences](references/octave-compatibility.md)
259
-
260
- Bundled JSON assets are the [project manifest](assets/project_manifest_template.json),
261
- [reproducibility manifest](assets/reproducibility_manifest_template.json), and
262
- [R2026a Python table](assets/python_compatibility_r2026a.json). There is no
263
- `templates/` directory and no Markdown file is loaded from `assets/`;
264
- local-link tests enforce this package contract.
265
-
266
- ## Primary sources (verified 2026-07-23)
267
-
268
- - [MATLAB R2026a documentation](https://www.mathworks.com/help/matlab/)
269
- - [MATLAB R2026a release notes](https://www.mathworks.com/help/matlab/release-notes.html)
270
- - [R2026a system requirements](https://www.mathworks.com/support/requirements/matlab-system-requirements.html)
271
- - [Python compatibility by release](https://www.mathworks.com/support/requirements/python-compatibility.html)
272
- - [MATLAB Engine installation](https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html)
273
- - [GNU Octave 11.3.0 release](https://octave.org/)
274
- - [GNU Octave current manual](https://docs.octave.org/latest/)
@@ -1,378 +0,0 @@
1
- ---
2
- name: matplotlib
3
- description: Low-level plotting library for full customization. Use when you need fine-grained control over every plot element, creating novel plot types, or integrating with specific scientific workflows. Export to PNG/PDF/SVG for publication. For quick statistical plots use seaborn; for interactive plots use plotly; for publication-ready multi-panel figures with journal styling, use scientific-visualization.
4
- allowed-tools: Read Write Bash
5
- license: https://github.com/matplotlib/matplotlib/tree/main/LICENSE
6
- compatibility: Requires Python 3.10+ and Matplotlib 3.10.x. Use `uv add matplotlib` in projects; interactive Jupyter widgets require `ipympl`.
7
- metadata:
8
- version: "1.1"
9
- skill-author: K-Dense Inc.
10
- ---
11
-
12
- # Matplotlib
13
-
14
- ## Overview
15
-
16
- Matplotlib is Python's foundational visualization library for creating static, animated, and interactive plots. This skill provides guidance on using matplotlib effectively, covering both the pyplot interface (MATLAB-style) and the object-oriented API (Figure/Axes), along with best practices for creating publication-quality visualizations.
17
-
18
- ## When to Use This Skill
19
-
20
- This skill should be used when:
21
- - Creating any type of plot or chart (line, scatter, bar, histogram, heatmap, contour, etc.)
22
- - Generating scientific or statistical visualizations
23
- - Customizing plot appearance (colors, styles, labels, legends)
24
- - Creating multi-panel figures with subplots
25
- - Exporting visualizations to various formats (PNG, PDF, SVG, etc.)
26
- - Building interactive plots or animations
27
- - Working with 3D visualizations
28
- - Integrating plots into Jupyter notebooks or GUI applications
29
-
30
- ## Setup
31
-
32
- For project work, install Matplotlib with uv:
33
-
34
- ```bash
35
- uv add matplotlib
36
- ```
37
-
38
- For notebook interactivity:
39
-
40
- ```bash
41
- uv add matplotlib ipympl
42
- ```
43
-
44
- Then enable the widget backend in Jupyter with `%matplotlib widget` or `%matplotlib ipympl`.
45
-
46
- Matplotlib 3.10 requires Python 3.10+ and NumPy 1.23+. Non-interactive file output works through backends such as Agg, PDF, and SVG. For GUI windows, Matplotlib auto-selects an available backend; if `TkAgg` fails in a uv-managed Python, update uv and Python builds with `uv self update` and `uv python upgrade --reinstall`, or install a Qt backend with `uv add pyside6`.
47
-
48
- ## Core Concepts
49
-
50
- ### The Matplotlib Hierarchy
51
-
52
- Matplotlib uses a hierarchical structure of objects:
53
-
54
- 1. **Figure** - The top-level container for all plot elements
55
- 2. **Axes** - The actual plotting area where data is displayed (one Figure can contain multiple Axes)
56
- 3. **Artist** - Everything visible on the figure (lines, text, ticks, etc.)
57
- 4. **Axis** - The number line objects (x-axis, y-axis) that handle ticks and labels
58
-
59
- ### Two Interfaces
60
-
61
- **1. pyplot Interface (Implicit, MATLAB-style)**
62
- ```python
63
- import matplotlib.pyplot as plt
64
-
65
- plt.plot([1, 2, 3, 4])
66
- plt.ylabel('some numbers')
67
- plt.show()
68
- ```
69
- - Convenient for quick, simple plots
70
- - Maintains state automatically
71
- - Good for interactive work and simple scripts
72
-
73
- **2. Object-Oriented Interface (Explicit)**
74
- ```python
75
- import matplotlib.pyplot as plt
76
-
77
- fig, ax = plt.subplots()
78
- ax.plot([1, 2, 3, 4])
79
- ax.set_ylabel('some numbers')
80
- plt.show()
81
- ```
82
- - **Recommended for most use cases**
83
- - More explicit control over figure and axes
84
- - Better for complex figures with multiple subplots
85
- - Easier to maintain and debug
86
-
87
- ## Common Workflows
88
-
89
- ### 1. Basic Plot Creation
90
-
91
- **Single plot workflow:**
92
- ```python
93
- import matplotlib.pyplot as plt
94
- import numpy as np
95
-
96
- # Create figure and axes (OO interface - RECOMMENDED)
97
- fig, ax = plt.subplots(figsize=(10, 6))
98
-
99
- # Generate and plot data
100
- x = np.linspace(0, 2*np.pi, 100)
101
- ax.plot(x, np.sin(x), label='sin(x)')
102
- ax.plot(x, np.cos(x), label='cos(x)')
103
-
104
- # Customize
105
- ax.set_xlabel('x')
106
- ax.set_ylabel('y')
107
- ax.set_title('Trigonometric Functions')
108
- ax.legend()
109
- ax.grid(True, alpha=0.3)
110
-
111
- # Save and/or display
112
- fig.savefig('plot.png', dpi=300, bbox_inches='tight')
113
- plt.show()
114
- ```
115
-
116
- ### 2. Multiple Subplots
117
-
118
- **Creating subplot layouts:**
119
- ```python
120
- # Method 1: Regular grid
121
- fig, axes = plt.subplots(2, 2, figsize=(12, 10))
122
- axes[0, 0].plot(x, y1)
123
- axes[0, 1].scatter(x, y2)
124
- axes[1, 0].bar(categories, values)
125
- axes[1, 1].hist(data, bins=30)
126
-
127
- # Method 2: Mosaic layout (more flexible)
128
- fig, axes = plt.subplot_mosaic([['left', 'right_top'],
129
- ['left', 'right_bottom']],
130
- figsize=(10, 8))
131
- axes['left'].plot(x, y)
132
- axes['right_top'].scatter(x, y)
133
- axes['right_bottom'].hist(data)
134
-
135
- # Method 3: GridSpec (maximum control)
136
- from matplotlib.gridspec import GridSpec
137
- fig = plt.figure(figsize=(12, 8))
138
- gs = GridSpec(3, 3, figure=fig)
139
- ax1 = fig.add_subplot(gs[0, :]) # Top row, all columns
140
- ax2 = fig.add_subplot(gs[1:, 0]) # Bottom two rows, first column
141
- ax3 = fig.add_subplot(gs[1:, 1:]) # Bottom two rows, last two columns
142
- ```
143
-
144
- ### 3. Plot Types and Use Cases
145
-
146
- **Line plots** - Time series, continuous data, trends
147
- ```python
148
- ax.plot(x, y, linewidth=2, linestyle='--', marker='o', color='blue')
149
- ```
150
-
151
- **Scatter plots** - Relationships between variables, correlations
152
- ```python
153
- ax.scatter(x, y, s=sizes, c=colors, alpha=0.6, cmap='viridis')
154
- ```
155
-
156
- **Bar charts** - Categorical comparisons
157
- ```python
158
- ax.bar(categories, values, color='steelblue', edgecolor='black')
159
- # For horizontal bars:
160
- ax.barh(categories, values)
161
- ```
162
-
163
- **Histograms** - Distributions
164
- ```python
165
- ax.hist(data, bins=30, edgecolor='black', alpha=0.7)
166
- ```
167
-
168
- **Heatmaps** - Matrix data, correlations
169
- ```python
170
- im = ax.imshow(matrix, cmap='coolwarm', aspect='auto')
171
- plt.colorbar(im, ax=ax)
172
- ```
173
-
174
- **Contour plots** - 3D data on 2D plane
175
- ```python
176
- contour = ax.contour(X, Y, Z, levels=10)
177
- ax.clabel(contour, inline=True, fontsize=8)
178
- ```
179
-
180
- **Box plots** - Statistical distributions
181
- ```python
182
- ax.boxplot([data1, data2, data3], tick_labels=['A', 'B', 'C'])
183
- ```
184
-
185
- **Violin plots** - Distribution densities
186
- ```python
187
- ax.violinplot([data1, data2, data3], positions=[1, 2, 3])
188
- ```
189
-
190
- For comprehensive plot type examples and variations, refer to `references/plot_types.md`.
191
-
192
- ### 4. Styling and Customization
193
-
194
- **Color specification methods:**
195
- - Named colors: `'red'`, `'blue'`, `'steelblue'`
196
- - Hex codes: `'#FF5733'`
197
- - RGB tuples: `(0.1, 0.2, 0.3)`
198
- - Colormaps: `cmap='viridis'`, `cmap='plasma'`, `cmap='coolwarm'`
199
-
200
- **Using style sheets:**
201
- ```python
202
- plt.style.use('seaborn-v0_8-darkgrid') # Apply predefined style
203
- # Available styles: 'ggplot', 'bmh', 'fivethirtyeight', etc.
204
- print(plt.style.available) # List all available styles
205
- ```
206
-
207
- **Customizing with rcParams:**
208
- ```python
209
- plt.rcParams['font.size'] = 12
210
- plt.rcParams['axes.labelsize'] = 14
211
- plt.rcParams['axes.titlesize'] = 16
212
- plt.rcParams['xtick.labelsize'] = 10
213
- plt.rcParams['ytick.labelsize'] = 10
214
- plt.rcParams['legend.fontsize'] = 12
215
- plt.rcParams['figure.titlesize'] = 18
216
- ```
217
-
218
- **Text and annotations:**
219
- ```python
220
- ax.text(x, y, 'annotation', fontsize=12, ha='center')
221
- ax.annotate('important point', xy=(x, y), xytext=(x+1, y+1),
222
- arrowprops=dict(arrowstyle='->', color='red'))
223
- ```
224
-
225
- For detailed styling options and colormap guidelines, see `references/styling_guide.md`.
226
-
227
- ### 5. Saving Figures
228
-
229
- **Export to various formats:**
230
- ```python
231
- # High-resolution PNG for presentations/papers
232
- fig.savefig('figure.png', dpi=300, bbox_inches='tight', facecolor='white')
233
-
234
- # Vector format for publications (scalable)
235
- fig.savefig('figure.pdf', bbox_inches='tight')
236
- fig.savefig('figure.svg', bbox_inches='tight')
237
-
238
- # Transparent background
239
- fig.savefig('figure.png', dpi=300, bbox_inches='tight', transparent=True)
240
- ```
241
-
242
- **Important parameters:**
243
- - `dpi`: Resolution (300 for publications, 150 for web, 72 for screen)
244
- - `bbox_inches='tight'`: Removes excess whitespace
245
- - `facecolor='white'`: Ensures white background (useful for transparent themes)
246
- - `transparent=True`: Transparent background
247
-
248
- ### 6. Working with 3D Plots
249
-
250
- ```python
251
- fig = plt.figure(figsize=(10, 8))
252
- ax = fig.add_subplot(111, projection='3d')
253
-
254
- # Surface plot
255
- ax.plot_surface(X, Y, Z, cmap='viridis')
256
-
257
- # 3D scatter
258
- ax.scatter(x, y, z, c=colors, marker='o')
259
-
260
- # 3D line plot
261
- ax.plot(x, y, z, linewidth=2)
262
-
263
- # Labels
264
- ax.set_xlabel('X Label')
265
- ax.set_ylabel('Y Label')
266
- ax.set_zlabel('Z Label')
267
- ```
268
-
269
- ## Best Practices
270
-
271
- ### 1. Interface Selection
272
- - **Use the object-oriented interface** (fig, ax = plt.subplots()) for production code
273
- - Reserve pyplot interface for quick interactive exploration only
274
- - Always create figures explicitly rather than relying on implicit state
275
-
276
- ### 2. Figure Size and DPI
277
- - Set figsize at creation: `fig, ax = plt.subplots(figsize=(10, 6))`
278
- - Use appropriate DPI for output medium:
279
- - Screen/notebook: 72-100 dpi
280
- - Web: 150 dpi
281
- - Print/publications: 300 dpi
282
-
283
- ### 3. Layout Management
284
- - Use `constrained_layout=True` or `tight_layout()` to prevent overlapping elements
285
- - `fig, ax = plt.subplots(constrained_layout=True)` is recommended for automatic spacing
286
-
287
- ### 4. Colormap Selection
288
- - **Sequential** (viridis, plasma, inferno): Ordered data with consistent progression
289
- - **Diverging** (coolwarm, RdBu): Data with meaningful center point (e.g., zero)
290
- - **Qualitative** (tab10, Set3): Categorical/nominal data
291
- - Avoid rainbow colormaps (jet) - they are not perceptually uniform
292
-
293
- ### 5. Accessibility
294
- - Use colorblind-friendly colormaps (viridis, cividis)
295
- - Add patterns/hatching for bar charts in addition to colors
296
- - Ensure sufficient contrast between elements
297
- - Include descriptive labels and legends
298
-
299
- ### 6. Performance
300
- - For large datasets, use `rasterized=True` in plot calls to reduce file size
301
- - Use appropriate data reduction before plotting (e.g., downsample dense time series)
302
- - For animations, use blitting for better performance
303
-
304
- ### 7. Code Organization
305
- ```python
306
- # Good practice: Clear structure
307
- def create_analysis_plot(data, title):
308
- """Create standardized analysis plot."""
309
- fig, ax = plt.subplots(figsize=(10, 6), constrained_layout=True)
310
-
311
- # Plot data
312
- ax.plot(data['x'], data['y'], linewidth=2)
313
-
314
- # Customize
315
- ax.set_xlabel('X Axis Label', fontsize=12)
316
- ax.set_ylabel('Y Axis Label', fontsize=12)
317
- ax.set_title(title, fontsize=14, fontweight='bold')
318
- ax.grid(True, alpha=0.3)
319
-
320
- return fig, ax
321
-
322
- # Use the function
323
- fig, ax = create_analysis_plot(my_data, 'My Analysis')
324
- fig.savefig('analysis.png', dpi=300, bbox_inches='tight')
325
- ```
326
-
327
- ## Quick Reference Scripts
328
-
329
- This skill includes helper scripts in the `scripts/` directory:
330
-
331
- ### `plot_template.py`
332
- Template script demonstrating various plot types with best practices. Use this as a starting point for creating new visualizations.
333
-
334
- **Usage:**
335
- ```bash
336
- uv run python scripts/plot_template.py
337
- ```
338
-
339
- ### `style_configurator.py`
340
- Interactive utility to configure matplotlib style preferences and generate custom style sheets.
341
-
342
- **Usage:**
343
- ```bash
344
- uv run python scripts/style_configurator.py
345
- ```
346
-
347
- ## Detailed References
348
-
349
- For comprehensive information, consult the reference documents:
350
-
351
- - **`references/plot_types.md`** - Complete catalog of plot types with code examples and use cases
352
- - **`references/styling_guide.md`** - Detailed styling options, colormaps, and customization
353
- - **`references/api_reference.md`** - Core classes and methods reference
354
- - **`references/common_issues.md`** - Troubleshooting guide for common problems
355
-
356
- ## Integration with Other Tools
357
-
358
- Matplotlib integrates well with:
359
- - **NumPy/Pandas** - Direct plotting from arrays and DataFrames
360
- - **Seaborn** - High-level statistical visualizations built on matplotlib
361
- - **Jupyter** - Interactive plotting with `%matplotlib inline` or `%matplotlib widget`
362
- - **GUI frameworks** - Embedding in Tkinter, Qt, wxPython applications
363
-
364
- ## Common Gotchas
365
-
366
- 1. **Overlapping elements**: Use `constrained_layout=True` or `tight_layout()`
367
- 2. **State confusion**: Use OO interface to avoid pyplot state machine issues
368
- 3. **Memory issues with many figures**: Close figures explicitly with `plt.close(fig)`
369
- 4. **Font warnings**: Install fonts or suppress warnings with `plt.rcParams['font.sans-serif']`
370
- 5. **DPI confusion**: Remember that figsize is in inches, not pixels: `pixels = dpi * inches`
371
-
372
- ## Additional Resources
373
-
374
- - Official documentation: https://matplotlib.org/
375
- - Gallery: https://matplotlib.org/stable/gallery/index.html
376
- - Cheatsheets: https://matplotlib.org/cheatsheets/
377
- - Tutorials: https://matplotlib.org/stable/tutorials/index.html
378
-