agentleFS
gerphgerph/riscos-agent-skills/skills/porting-to-riscos-c/SKILL.md

porting-to-riscos-c

Skill4 starsChanged 8 months agoMITView on GitHub

Port C projects to RISC OS using `riscos-cport`, RISC OS makefiles, and Norcroft/RISC OS build validation. Use when a repository needs a RISC OS library or command-line port, especially when you need to create a `RISCOS/` tree, generate `Makefile,fe1` files, or repair source for the RISC OS toolchain.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the task is to turn a C repository into a RISC OS buildable port.

    line 12
  2. Very specific:

    Prefer the repository's existing structure and let riscos-cport do the first pass.

    line 13
  3. Very specific:

    Use overrides when discovery is wrong or incomplete.

    line 19
  4. Distinctive:

    Prefer these switches when discovery needs help:

    line 27
  5. Distinctive:

    If a repository is mainly a command-line tool, treat the command source as the important artifact:

    line 36
  6. Distinctive:

    keep the command Makefile(s)

    line 38
  7. Distinctive:

    add any required command-only defines or libraries explicitly

    line 40
  8. Distinctive:

    Read references/porting-process.md when you need the build rules, file layout, or validation sequence.

    line 44
  9. Distinctive:

    Keep edits narrow and RISC OS specific.

    line 48
  10. Distinctive:

    Prefer compatibility defines and small header shims over broad rewrites.

    line 49
  11. Distinctive:

    If a command fails because of an external dependency, note that separately rather than forcing the port to absorb it.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Porting To RISC OS C

Use this skill when the task is to turn a C repository into a RISC OS buildable port. Prefer the repository's existing structure and let riscos-cport do the first pass.

Workflow

  1. Inspect the repository layout and detect the real entry points.
  2. Run riscos-cport on the repository root. This will create Makefiles for each of the files and libraries it finds within the source directory. It will create symlinks within the RISCOS/c and RISCOS/h which point to the original files. This should be sufficient to build the commands or libraries with riscos-amu export or riscos-amu -f Makefile...,fe1.
  3. Use overrides when discovery is wrong or incomplete. If the code is failing to build, there may be updates that are needed for the riscos-cport command line to ignore certain files or explicitly set defines and includes.
  4. Build the generated RISCOS/ tree with riscos-amu export.
  5. Build any generated command makefiles with riscos-amu -f Makefile...,fe1.
  6. Patch source only when the Norcroft compiler or the RISC OS build model requires it.

Use The Tool

Prefer these switches when discovery needs help:

  • --name for the RISC OS component/library name.
  • --source, --header, --internal-header, --export-header for explicit file control.
  • --exclude-source to remove sources autodiscovery picked up incorrectly.
  • --command-source for example tools and tests that contain main().
  • --define and --command-define for compile-time configuration.
  • --include and --command-lib for extra include paths and libraries.

If a repository is mainly a command-line tool, treat the command source as the important artifact:

  • keep the command Makefile(s)
  • exclude unrelated sources from the command build
  • add any required command-only defines or libraries explicitly

RISC OS Porting Rules

Read references/porting-process.md when you need the build rules, file layout, or validation sequence.

Source Fixes

  • Keep edits narrow and RISC OS specific.
  • Prefer compatibility defines and small header shims over broad rewrites.
    • For RISC OS-specific changes, the define __riscos will be set for the platform.
    • For RISC OS 64-specific changes, the define __riscos64 will be set for the platform.
    • For feature-specific changes use a define to delineate the state (eg ENABLE_CRYPTO).
  • Preserve upstream comments and layout unless a change is required to compile.
  • Rebuild after every meaningful source fix.

Validation

  • Libraries: riscos-amu export
  • Commands: riscos-amu -f MakefileExample,fe1
  • If a command fails because of an external dependency, note that separately rather than forcing the port to absorb it.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.