agentleFS
lucasrafaldinilucasrafaldini/paperdeck/.agents/skills/create-widget/SKILL.md

create-widget

Skill1 starsChanged 46 days agoMITView on GitHub

Step-by-step workflow to scaffold, implement, and register a new dashboard widget in PaperDeck.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Use this skill whenever an agent needs to add a new widget or data card to PaperDeck.

    line 8
  2. Distinctive:

    Must include a TTL cache (e.g.

    line 12
  3. Very specific:

    Must catch all errors and return { available: false, error: err.message } instead of throwing.

    line 13
  4. Distinctive:

    Import the new collector.

    line 38
  5. Very specific:

    Add it to collectAll() mapping.

    line 39
  6. Very specific:

    Add to AVAILABLE_WIDGETS array with { id: '<widget-name>', name: '<Readable Name>' }.

    line 42
  7. Very specific:

    Add default toggle/display options to DEFAULT_WIDGET_OPTIONS.

    line 43
  8. Very specific:

    Add card rendering logic inside the renderWidget(block, payload) switch.

    line 46
  9. Very specific:

    Use high-contrast CSS (pure black #000 text, white #fff background, #333 borders).

    line 47
  10. Distinctive:

    Ensure typography is crisp and legible on an 800x600 e-ink screen.

    line 48
  11. Very specific:

    Add widget definition to TOOL_CONFIG_OPTIONS.

    line 51
  12. Distinctive:

    Add preview card representation.

    line 52
  13. Distinctive:

    Test standard data collection and fallback error handling.

    line 55

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

Create Widget Skill

Use this skill whenever an agent needs to add a new widget or data card to PaperDeck.

1. Create Data Collector (backend/collectors/<widget-name>.js)

  • Must use CommonJS.
  • Must include a TTL cache (e.g. 15-30 seconds).
  • Must catch all errors and return { available: false, error: err.message } instead of throwing.
  • Export collect() function.
const CACHE_TTL_MS = 30000;
let cache = { at: 0, data: null };

async function collect() {
  const now = Date.now();
  if (cache.data && (now - cache.at < CACHE_TTL_MS)) {
    return cache.data;
  }
  try {
    const data = { /* collect your metrics here */ };
    cache = { at: now, data: { available: true, data, updatedAt: new Date().toISOString() } };
    return cache.data;
  } catch (err) {
    return { available: false, error: err.message, data: null };
  }
}

module.exports = { collect };

2. Register Collector in backend/collectors/index.js

  • Import the new collector.
  • Add it to collectAll() mapping.

3. Register Widget in backend/config.js

  • Add to AVAILABLE_WIDGETS array with { id: '<widget-name>', name: '<Readable Name>' }.
  • Add default toggle/display options to DEFAULT_WIDGET_OPTIONS.

4. Add E-Ink Rendering Card in render/dashboard.html

  • Add card rendering logic inside the renderWidget(block, payload) switch.
  • Use high-contrast CSS (pure black #000 text, white #fff background, #333 borders).
  • Ensure typography is crisp and legible on an 800x600 e-ink screen.

5. Register in Layout Editor (src/renderer/src/views/LayoutEditor.tsx)

  • Add widget definition to TOOL_CONFIG_OPTIONS.
  • Add preview card representation.

6. Write Unit Test (test/<widget-name>-collector.test.js)

  • Test standard data collection and fallback error handling.

7. Run Verification

npm test
npm run typecheck
npm run build

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.