agentleFS
gerphgerph/riscos-agent-skills/skills/writing-fortran/SKILL.md

writing-fortran

Skill4 starsChanged 7 months agoMITView on GitHub

Use when writing, reading, updating, building, or reviewing Fortran code in the RISC OS build environment, especially when compiling with riscos64-fortran, linking with C, passing _kernel_swi_regs, handling C/control-terminated strings, or generating Fortran modules from RISC OS header constants.

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for Fortran work in the RISC OS build environment.

    line 11
  2. Distinctive:

    Read only the reference files needed for the task:

    line 13
  3. Very specific:

    Always link -lgfortran when any Fortran object is present.

    line 30
  4. Very specific:

    Always use implicit none in every program, module, function, and subroutine.

    line 32
  5. Very specific:

    Use modules for shared constants and library code.

    line 35
  6. Very specific:

    Use value in Fortran for scalar arguments passed by value from C.

    line 41
  7. Very specific:

    Do not read or write generated .rotransform files.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing Fortran for RISC OS

Use this skill for Fortran work in the RISC OS build environment.

Read only the reference files needed for the task:

  • Build, source layout, modules, and command lines: references/building.md
  • C/Fortran interworking, C strings, and _kernel_swi_regs: references/c-interop.md
  • Generated constants and Fortran modules from RISC OS headers: references/generated-constants.md
  • Common RISC OS build pitfalls and review checks: references/pitfalls.md

Core Rules

Fortran source files live in f90/ and do not have a .f90 suffix in the host filesystem. Use RISC OS-style names with the wrappers, for example:

riscos64-fortran -c -o o.name f90.name
riscos64-link o.name -lgfortran -o name,ff8

Always link -lgfortran when any Fortran object is present.

Always use implicit none in every program, module, function, and subroutine.

Use modules for shared constants and library code. Fortran module names are flat; there is no use riscos/WimpSpace path syntax. Prefer namespaced module names such as riscos_wimpspace.

For C-facing interfaces, use iso_c_binding and bind(C, name="...").

Use value in Fortran for scalar arguments passed by value from C.

For _kernel_swi_regs, C regs.r[0] maps to Fortran regs(1).

Do not read or write generated .rotransform files.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.