riscos-wimp
Skill4 starsChanged 7 months agoMITView on GitHub
Use when writing, reviewing, debugging, or porting RISC OS Wimp code: task initialisation and shutdown, template loading, window creation and opening, icon bar icons, icon state changes, mouse and key handling, menus, help messages, redraw/open/close event flow, or Wimp data structures and SWIs. Also use for module-specific Wimp integration such as Service_StartWimp, Desktop_ commands, or task lifecycle inside a module.
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 11 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for Wimp-facing code in applications or modules.
- Distinctive: line 15
Use the PRM when the skill needs more detail on a SWI contract, event protocol, or structure field than the local notes provide.
- Distinctive: line 19
Keep the core Wimp rules straight:
- Distinctive: line 22
Treat window, icon, and task handles as opaque 32-bit values returned by the Wimp.
- Distinctive: line 24
Do not assume template-loaded structures may be rewritten arbitrarily.
- Very specific: line 25
When you need to inspect the contents of a Templates file, prefer riscos-ccres over riscos-dump.
- Distinctive: line 26
When behaviour differs from an original assembler implementation, compare the event protocol and block layout before changing higher-level …
- Very specific: line 27
Treat desktop availability as an environment constraint, not proof that the code is wrong.
- Distinctive: line 31
Read only the references needed for the task:
- Very specific: line 57
Read references/general.md first for protocol constraints.
- Very specific: line 58
If the task can be quit from the icon bar, Task Manager, or a close-down path, read references/quit-protocol.md before changing shutdown …
- Very specific: line 59
If the task is a browser plug-in or another nested child-window client, read references/nested-wimp.md and references/plugin-protocol.md …
- Very specific: line 60
If the task implements either side of the External Edit protocol, read references/extedit-protocol.md together with …
- Very specific: line 61
If the task launches or tracks TaskWindows, read references/taskwindow.md before changing helper-task startup, output parsing, or …
- Very specific: line 62
If the task implements cut, copy, paste, clipboard ownership, or selection persistence, read references/clipboard-protocol.md together with …
- Very specific: line 63
If the task opens or tracks a ColourPicker dialogue, read references/colour-picker.md and then the matching menu, help, or user-message …
- Distinctive: line 64
Read the one or two other area-specific references that match the task.
- Distinctive: line 66
When diagnosing hangs, inspect the poll loop event sequence before assuming the high-level feature is wrong.
- Distinctive: line 67
If live desktop verification is unavailable, move protocol-sensitive logic into pure helpers where possible and regression-test window …
- Distinctive: line 71
When reviewing code, check these first:
≈ “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.
Files
Wimp applications and modules
Use this skill for Wimp-facing code in applications or modules.
Public references
- Wimp PRM chapter:
http://www.riscos.com/support/developers/prm/wimp.html - Use the PRM when the skill needs more detail on a SWI contract, event protocol, or structure field than the local notes provide.
Core rules
Keep the core Wimp rules straight:
- Respect SWI register contracts exactly. Many bugs come from passing a block where raw registers are required, or vice versa.
- Treat window, icon, and task handles as opaque 32-bit values returned by the Wimp.
- Distinguish Wimp-owned redraw/open protocols from your own UI logic. If the Wimp asks for a redraw or open operation, satisfy that protocol first. If redraw requests appear for windows that should be auto-redraw, treat that as a likely flag, layout, or corruption bug and investigate the cause as well.
- Do not assume template-loaded structures may be rewritten arbitrarily. Preserve the layout the Wimp expects.
- When you need to inspect the contents of a
Templatesfile, preferriscos-ccresoverriscos-dump. Useriscos-ccres <infile> <outfile>to decode a Template or Resource file to text, for exampleriscos-ccres Templates,fec Templates,txt. Useriscos-dumponly when you genuinely need the raw bytes or mixed hex/text view. - When behaviour differs from an original assembler implementation, compare the event protocol and block layout before changing higher-level logic.
- Treat desktop availability as an environment constraint, not proof that the code is wrong. Some
riscos-build-runsessions may build and run binaries successfully but still not provide a usable desktop forWimp_Initialise.
References
Read only the references needed for the task:
references/general.md: general Wimp rules, event-loop invariants, handles, SWI usage.references/initialisation.md:Wimp_Initialise, message lists, task shutdown.references/quit-protocol.md:Message_PreQuit,Message_Quit, user prompting, shutdown restart, and the distinction between desktop shutdown and quitting a single task.references/templates.md:Wimp_OpenTemplate,Wimp_LoadTemplate, indirected data, writable name buffers.references/windows.md:Wimp_CreateWindow, static window definition layout, and basic open/close helpers.references/redraw.md: redraw requests, open-window requests, update rectangles, outlines, and redraw forcing.references/icons.md: icon bar icons,Wimp_CreateIcon, icon state changes, priorities and placement.references/palette.md: Wimp colour numbers, their conventional meanings, and the distinction between logical Wimp colours and the current palette values.references/nested-wimp.md: nested-window-manager extensions such as child windows, furniture windows, extendedWimp_OpenWindow, version 380 initialisation, and related flag changes.references/plugin-protocol.md: browser plug-in tasks embedded through nested child windows, includingMessage_PlugIn_*, focus transfer, reshape rules, stream messages, and parameter files.references/extedit-protocol.md: External Edit (Message_Edit*) client and editor protocols, including session handles, cursor messages, return/abort flows, and the use ofEditDataSavewith the normal data-transfer protocol.references/taskwindow.md: TaskWindow child-task protocol, including start-up matching, output handling, cooked versus raw data, and close-down tracking.references/colour-picker.md: ColourPicker dialogue types, block layout, Wimp message protocol, and menu/submenu integration.references/interactions.md: mouse clicks and key presses.references/menus.md: menu creation, opening, warnings, submenu handling, and selection decoding.references/help.md:HelpRequestandHelpReplyhandling.references/user-messages.md: non-file-transfer Wimp messages such as help replies, filer messages, andAppControlconstruction.references/data-transfer.md:DataLoad,DataSave, scrap-file flows, and file-type checks.references/clipboard-protocol.md: caret and selection ownership,Message_ClaimEntity, clipboardDataRequestandDataSaveflow, paste probing, and clipboard-manager handover withMessage_ReleaseEntity.references/module-integration.md: module-specific Wimp startup and service interactions. This includes such asService_StartWimp,Desktop_commands, or task lifecycle inside a module. This is intentionally separate because it is less common.
Default workflow
- Identify whether the code is task-level Wimp code or module-integrated Wimp code.
- Read
references/general.mdfirst for protocol constraints. - If the task can be quit from the icon bar, Task Manager, or a close-down path, read
references/quit-protocol.mdbefore changing shutdown handling. - If the task is a browser plug-in or another nested child-window client, read
references/nested-wimp.mdandreferences/plugin-protocol.mdbefore changing event handling or open-window logic. - If the task implements either side of the External Edit protocol, read
references/extedit-protocol.mdtogether withreferences/user-messages.mdandreferences/data-transfer.mdbefore changing message handling. - If the task launches or tracks TaskWindows, read
references/taskwindow.mdbefore changing helper-task startup, output parsing, or close-down handling. - If the task implements cut, copy, paste, clipboard ownership, or selection persistence, read
references/clipboard-protocol.mdtogether withreferences/data-transfer.mdandreferences/user-messages.mdbefore changing message handling. - If the task opens or tracks a ColourPicker dialogue, read
references/colour-picker.mdand then the matching menu, help, or user-message reference if needed. - Read the one or two other area-specific references that match the task.
- Validate structure layouts and register usage against the chosen SWIs before editing logic.
- When diagnosing hangs, inspect the poll loop event sequence before assuming the high-level feature is wrong.
- If live desktop verification is unavailable, move protocol-sensitive logic into pure helpers where possible and regression-test window geometry, menu selection decoding, clipboard message construction, ColourPicker message handling, and saved-file metadata separately from the live Wimp event loop.
Review workflow
When reviewing code, check these first:
- wrong signedness or truncation for opaque handles
- block layouts that do not match the active header definitions
- incorrect
Wimp_CreateIconorWimp_CreateWindowcall conventions Message_PreQuithandlers that do not distinguish desktop shutdown from "quit just this task"- tasks that try to ignore
Message_Quit, or object there instead of duringMessage_PreQuit - template name buffers passed as read-only strings to
Wimp_LoadTemplate - redraw/open/menu protocols being skipped or handled in the wrong order
- transient ColourPicker menu/submenu dialogues being treated like normal windows that must send a close request
- ColourPicker callbacks or generic key handling using the window handle when the dialogue handle is required, or vice versa
- nested-window paths mixing base and extended
Wimp_OpenWindoworWimp_GetWindowStateforms - plug-in message handlers confusing browser instance handles, plug-in instance handles, stream handles, or task handles
- TaskWindow integrations that do not distinguish clean exit, forced termination, and partial buffered output
- file transfer or clipboard paths that preserve the bytes but lose the intended RISC OS filetype
- application or canvas windows created with a close icon but omitting the back icon (
wimp_WINDOW_BACK_ICON) - custom redraw routines using raw VDU 5 bitmap text for desktop UI instead of antialiased fonts (
Wimp_PlotIconorFont_Paint) - window work areas, panels, or redraw extents sized too narrowly, causing text to clip or truncate against window borders
In this repository47 other files it gives its agents.
- allocating-resourcesSkill
- ci-testingSkill
- creating-pull-requestsSkill
- designing-modulesSkill
- porting-to-riscos-cSkill
- reading-assemblySkill
- riscos-commandsSkill
- riscos-desktop-fileractionSkill
- riscos-filer-likeSkill
- riscos-filesystemSkill
- riscos-graphics-convertersSkill
- riscos-network-dcistatisticsSkill
- riscos-network-resolverSkill
- riscos-outputSkill
- riscos-reSkill
- riscos-styleSkill
- riscos-throwbackSkill
- riscos-urls-fetchingSkill
- riscos-urls-launchingSkill
- riscos-wimp-appSkill
- riscos-wimp-templatesSkill
- updating-robe-skillsSkill
- using-bbcbasicSkill
- using-cmhgSkill
- using-ghSkill
- using-gitSkill
- using-libasmSkill
- using-libgcontextSkill
- using-liboslibSkill
- using-libriscoslibSkill
- using-libtoolboxSkill
- using-makefilesSkill
- using-perlSkill
- using-stronghelpSkill
- using-toolbox-imagefilegadgetSkill
- using-tooltesterSkill
- writing-assemblySkill
- writing-assembly-testsSkill
- writing-cmodulesSkill
- writing-cplusplusSkill
- writing-cSkill
- writing-fortranSkill
- writing-oslib-defsSkill
- writing-pascalSkill
- writing-prminxmlSkill
- writing-pymodulesSkill
- writing-pyromaniac-integration-testsSkill
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
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.

