writing-cmodules

Create and maintain RISC OS C modules with CMHG and Makefiles.

3|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/gerph/riscos-agent-skills --skill writing-cmodules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-cmodules
Source: https://github.com/gerph/riscos-agent-skills/tree/main/skills/writing-cmodules
Command: npx skills add https://github.com/gerph/riscos-agent-skills --skill writing-cmodules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Development notes and procedures for working with RISC OS modules. Describes the layout of the project, how to build and tests, common patterns with SWIs and Vectors. Use when creating RISC OS modules, creating SWI implementations, claiming vectors, or writing service handlers.

Core Features & Use Cases

  • Provides project structure guidance for RISC OS C modules, including CMHG layout, c/ and h/ directories, Makefiles, and templates.
  • Documents essential module lifecycle components (Mod_Init, Mod_Final), vector handling, and SWI interfaces.
  • Offers build and test workflows to streamline development, validation, and maintenance.

Quick Start

Create a new C module project with riesgos-project create --name <project> --type cmodule --skeleton and then build it to verify the setup.

Frequently Asked Questions about writing-cmodules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a RISC OS C module project?

A RISC OS C module project requires a specific structure including CMHG files, c/ and h/ directories, and Makefiles. This Skill provides templates and layout guidance to ensure proper project configuration and consistent module development.

How do I implement SWI interfaces and claim vectors in a C module?

Implementing SWI interfaces and claiming vectors requires specific handling patterns within your C module. The guide documents common patterns for SWI implementations, vector claiming, and writing service handlers to manage module interactions.

What is a CMHG file and when do I need it for RISC OS module development?

A CMHG file is an essential component for RISC OS C modules that defines the module's interface and layout. You need it when creating RISC OS modules to ensure proper module lifecycle management and system integration.

How do I set up build and test workflows for RISC OS C modules?

Setting up build and test workflows for RISC OS C modules involves configuring Makefiles across build environments. This Skill offers workflows to streamline development, validation, and maintenance, ensuring consistent build configuration and testing procedures.

Can I use this guide for maintaining existing RISC OS modules, not just creating new ones?

Yes, this guide covers both creating and maintaining RISC OS C modules. It provides development notes, procedures for module lifecycle components like Mod_Init and Mod_Final, and testing workflows applicable to ongoing module maintenance.