agentleFS
gerphgerph/riscos-agent-skills/skills/riscos-throwback/SKILL.md

riscos-throwback

Skill4 starsChanged 7 months agoMITView on GitHub

Use when adding, reviewing, or debugging RISC OS Throwback support through LibThrowback, DDEUtils_ThrowbackStart/Send/End, DDEUtils_ThrowbackRegister, or desktop editor error reporting from compilers, taskwindows, tools, and build processors.

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 14 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Throwback when a RISC OS tool processes files and can report diagnostics with a filename, line number, message, and severity.

    line 17
  2. Distinctive:

    Do not use Throwback for normal logging, progress output, or diagnostics that cannot be tied to a useful file location.

    line 21
  3. Distinctive:

    If the project can link against the Throwback library, prefer its public header:

    line 28
  4. Distinctive:

    Use the severity that matches how the desktop should present the message:

    line 61
  5. Very specific:

    When writing a printf-style helper, format into a bounded buffer with vsnprintf() where the target compiler/library supports it.

    line 82
  6. Distinctive:

    Use direct SWIs when the project cannot use LibThrowback, needs a precise protocol sequence, or is implementing a Throwback receiver.

    line 89
  7. Very specific:

    Call DDEUtils_ThrowbackStart before sending records and DDEUtils_ThrowbackEnd before exiting or when processing is complete.

    line 98
  8. Very specific:

    Start the session with DDEUtils_ThrowbackStart.

    line 120
  9. Distinctive:

    Always pass full RISC OS pathnames when possible.

    line 126
  10. Distinctive:

    Only one task can be registered.

    line 137
  11. Distinctive:

    When implementing a receiver, be lenient.

    line 175
  12. Distinctive:

    When adding Throwback support:

    line 181
  13. Distinctive:

    Keep existing command-line diagnostics.

    line 183
  14. Distinctive:

    Verify that the project links the Throwback library or includes the DDEUtils SWI definitions it uses.

    line 185
  15. Very specific:

    Avoid sending diagnostics without a filename.

    line 190
  16. Distinctive:

    Use line 0 for whole-file or unknown-line diagnostics.

    line 192
  17. Distinctive:

    Keep messages concise and user-facing.

    line 193
  18. Distinctive:

    Test both desktop and non-desktop cases.

    line 195

≈ “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

riscos-throwback

Throwback is the DDEUtils protocol used by command-line tools and taskwindow programs to report warnings, errors, and informational diagnostics to a desktop editor or other registered receiver. It lets the receiver present messages that can usually be clicked to open the affected source file and line.

When to use it

Use Throwback when a RISC OS tool processes files and can report diagnostics with a filename, line number, message, and severity. Common examples are compilers, assemblers, converters, validators, or application build front-ends.

Do not use Throwback for normal logging, progress output, or diagnostics that cannot be tied to a useful file location. Continue to print human-readable messages to stdout/stderr as well, because Throwback is only available when a desktop task has registered to receive it.

Preferred sender API

If the project can link against the Throwback library, prefer its public header:

#include "Throwback.h"

The library exposes:

typedef enum {
    s_warning = 0,
    s_error,
    s_seriouserror,
    s_information
} seriousness_t;

void Throwback(seriousness_t seriousness,
               const char *file,
               int line,
               const char *message);

void vThrowbackf(seriousness_t seriousness,
                 const char *file,
                 int line,
                 const char *format,
                 va_list args);

Throwback() lazily starts a DDEUtils throwback session on the first call, registers an atexit() shutdown handler, clamps line numbers below 1 to 0, and sends either an error-detail or informational-detail record. Passing NULL for file is ignored.

Use the severity that matches how the desktop should present the message:

  • s_warning: a warning.
  • s_error: an error.
  • s_seriouserror: a serious error.
  • s_information: an informational note, not an error.

Example:

if (missing_field)
{
    Throwback(s_error, source_path, line_number, "Missing field name");
}

if (deprecated_form)
{
    Throwback(s_warning, source_path, line_number, "Deprecated form used");
}

When writing a printf-style helper, format into a bounded buffer with vsnprintf() where the target compiler/library supports it. Some older code uses vsprintf(); do not copy that pattern into new code if a bounded alternative is available.

Direct DDEUtils protocol

Use direct SWIs when the project cannot use LibThrowback, needs a precise protocol sequence, or is implementing a Throwback receiver.

Sender SWIs are:

  • DDEUtils_ThrowbackStart (&42587): start a throwback session.
  • DDEUtils_ThrowbackSend (&42588): send processing, error, or info records.
  • DDEUtils_ThrowbackEnd (&42589): end the session.

Call DDEUtils_ThrowbackStart before sending records and DDEUtils_ThrowbackEnd before exiting or when processing is complete. Treat errors such as "No task registered for throwback" and "Throwback not available outside the desktop" as non-fatal; the tool should still continue with normal text output. If Start reports that Throwback is unavailable, suppress further Throwback SWIs for that processing run and rely on the normal textual diagnostics.

DDEUtils_ThrowbackSend takes the reason code in R0 and reason-specific values in R2-R5:

  • R0 = 0 (Throwback_ReasonProcessing): R2 points to the zero-terminated full pathname of the file being processed.
  • R0 = 1 (Throwback_ReasonErrorDetails): R2 points to the file pathname, R3 is the line number, R4 is severity (0 warning, 1 error, 2 serious error), and R5 points to the zero-terminated message.
  • R0 = 2 (Throwback_ReasonInfoDetails): R2 points to the file pathname, R3 is the line number, R4 must be 0, and R5 points to the zero-terminated informational message.

For direct senders, use this sequence:

  1. Start the session with DDEUtils_ThrowbackStart.
  2. For each file that has diagnostics, send Throwback_ReasonProcessing once.
  3. Send one Throwback_ReasonErrorDetails or Throwback_ReasonInfoDetails for each diagnostic.
  4. End the session with DDEUtils_ThrowbackEnd.

Always pass full RISC OS pathnames when possible. Relative filenames may be harder for a desktop receiver to resolve, especially when diagnostics come from a build tool with a different prefix or current directory.

Receivers and editors

A desktop task that wants to receive throwback messages registers with:

  • DDEUtils_ThrowbackRegister (&42585): R0 is the caller's Wimp task handle.
  • DDEUtils_ThrowbackUnRegister (&42586): unregister before the task exits.

Only one task can be registered. Registration fails outside the desktop and can fail if another task is already registered.

DDEUtils translates sender SWIs into Wimp messages for the registered task. The message action code is at byte offset +16; message-specific payload starts at +20 unless noted. These are Wimp message action codes, not SWI numbers:

  • DDEUtils_ThrowbackStart (&42580): start of a dialogue.
  • DDEUtils_ProcessingFile (&42581): +20 zero-terminated filename.
  • DDEUtils_ErrorsIn (&42582): +20 zero-terminated filename.
  • DDEUtils_ErrorDetails (&42583): +20 line number, +28 severity, +32 zero-terminated description.
  • DDEUtils_ThrowbackEnd (&42584): end of the dialogue.
  • DDEUtils_InfoforFile (&42585): +20 zero-terminated filename.
  • DDEUtils_InfoDetails (&42586): +20 line number, +28 must be 0, +32 zero-terminated informational message.

The documented message grammar is:

ErrorDialogue ::=         <DDEUtils_ThrowbackStart>
                          ErrorsWhileProcessing{ErrorsWhileProcessing}
                          <DDEUtils_ThrowbackEnd>

ErrorsWhileProcessing ::= <DDEUtils_ProcessingFile>
                          ErrorFoundIn{ErrorFoundIn}

ErrorFoundIn ::=          <DDEUtils_ErrorIn>
                          <DDEUtils_ErrorDetails>

InfoDialogue ::=          <DDEUtils_ThrowbackStart>
                          InfoDetails{InfoDetails}
                          <DDEUtils_ThrowbackEnd>

InfoDetails ::=           <DDEUtils_InfoforFile>
                          <DDEUtils_InfoDetails>

When implementing a receiver, be lenient. Real tools may omit explicit processing records, may send multiple files in one session, or may continue after a recoverable protocol error.

Implementation checks

When adding Throwback support:

  • Keep existing command-line diagnostics; Throwback is an additional desktop reporting path.
  • Verify that the project links the Throwback library or includes the DDEUtils SWI definitions it uses.
  • Make session shutdown reliable. If using direct SWIs, pair Start and End on all normal exit paths. If using LibThrowback, the library handles this after the first diagnostic.
  • Avoid sending diagnostics without a filename. The LibThrowback wrapper ignores NULL filenames.
  • Use line 0 for whole-file or unknown-line diagnostics.
  • Keep messages concise and user-facing; the receiver may display them in a compact list.
  • Test both desktop and non-desktop cases. Missing throwback support must not make the build or processing operation fail.

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.