ahay/src/authoring-sf-programs-octave
Claude Code and agent skill by ahay/src
- community
Checking that the SKILL.md file is still in the repository.
Use when authoring a Madagascar sf* main program in GNU Octave.
Install
npx vskill@latest install ahay/src/authoring-sf-programs-octaveSKILL.md
When to use
Use this skill when you want to write a Madagascar sf<name> program using GNU Octave — the open-source, MATLAB-compatible interpreter — and you do not have a MATLAB license.
Disambiguation: `.m` files are shared by Octave and MATLAB. A file named M<name>.m could target either runtime. The difference is entirely in how Madagascar is configured and how the helpers are installed:
- Octave path (this skill): pure
.mhelper files; no MEX compilation
required; enabled with API=octave at configure time; installs the rsf_*.m helpers to Octave's function path.
- MATLAB path: C MEX extensions are compiled with
mex; enabled with
API=matlab; requires a MATLAB license. See skills/authoring-sf-programs-matlab/SKILL.md.
Typical users of this path: researchers who want MATLAB-like array syntax and existing .m algorithms without a proprietary license.
Always load the shared conventions skill alongside this one: skills/authoring-sf-programs/
Skeleton
A minimal Octave M<name>.m script. No MEX compilation is needed — the Octave API is implemented as pure .m helper files (rsf_create.m, rsf_dim.m, rsf_par.m) that are placed on Octave's function path at install time.
Note on stdin/stdout: When Madagascar invokes a program via a pipeline,stdincarries the raw RSF binary andstdoutmust produce the raw binaryfor the next stage. Octave scripts can usefopen('<&0','rb')andfopen('>&1','wb')for this purpose on POSIX systems.
API cheat sheet
All helpers live in api/octave/. They call underlying sf* command-line tools via system() and return a stat struct with fields stat.err (logical) and stat.msg (string).
| Function | Signature | Purpose | |
|---|---|---|---|
rsf_create | stat = rsf_create(out_filename, arg2) | Write an RSF header. arg2 is either an existing .rsf filename (copies that header) or a numeric vector of dimensions (creates a new header via sfcreate). | |
rsf_dim | [dims, stat] = rsf_dim(in) | Return a vector of dimensions for the RSF file in, with trailing length-1 dimensions stripped. Calls sffiledims parform=n internally. | |
rsf_par | [par, stat] = rsf_par(file, name, default) | Read scalar parameter name from header file. Returns default when the key is absent. Calls sfget parform=n internally. |
Error handling pattern (use consistently):
`rsf_read` / `rsf_write` are not present in api/octave/ (only in api/matlab/ as MEX entry points). Read/write the binary payload directly via Octave's fread/fwrite or by piping through sfdd.
Build integration
api/octave/SConstruct is currently empty (placeholder); the .m helpers are plain Octave function files that require no compilation step.
At configure time (framework/configure.py, octave() function):
WhereIs('octave')is run; if found,env['OCTAVE']is set.WhereIs('mkoctfile')is checked;env['MKOCTFILE']is set if found.
mkoctfile is the Octave function compiler (analogous to mex), but it is not required for the pure `.m` API — only needed if you later add compiled oct-files (.oct). The plain rsf_*.m helpers install without it.
- Configure is triggered by passing
API=octave(or includingoctavein
the comma-separated API list) to scons.
Installing the helpers: the rsf_*.m files must be on Octave's function path before your script can call them. Typical approaches:
New user programs — no MEX compile step is needed. Place M<name>.m in user/<youruser>/ and invoke it from a Flow() via the OCTAVE env variable (similar to the pattern in book/rsf/school2025/plots/SConstruct):
Because the script is interpreted, the SConstruct does not need a compile step — only an install/path setup.
Pointers
Files in api/octave/ with one-line descriptions:
| File | Description | |
|---|---|---|
rsf_create.m | Write an RSF header to disk — copies an existing header or creates one from a dimension vector by calling sfcreate. | |
rsf_dim.m | Return the dimension vector of an RSF file by calling sffiledims parform=n; strips trailing length-1 dimensions. | |
rsf_par.m | Read a named scalar parameter from an RSF header by calling sfget parform=n; returns a caller-supplied default when the key is absent. | |
SConstruct | Placeholder (empty); no compilation targets are needed for the pure .m Octave API. |
Shared conventions
File naming, self-documentation comment format, parameter conventions, error handling, testing, and build integration patterns that apply to every sf<name> program regardless of language are documented in:
Key reminders from that skill relevant to Octave programs:
- Name your file
M<name>.minsideuser/<youruser>/. - The installed binary is called
sf<name>(build system dropsM, prepends
sf).
- The
.mextension is shared with MATLAB; configure time (API=octavevs.
API=matlab) determines which runtime is used and whether MEX compilation is required.
- Self-documentation: add a leading
%comment block describing the program
and its parameters so sfdoc sf<name> works correctly.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/authoring-sf-programs-octave/SKILL.md
Popularity
- Repository stars
- 338
- Repository forks
- 187
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ahay/src/authoring-sf-programs-octave)