Skip to content

About

Official pinrail plugins

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Pinrail plugins

Sample plugins for Pinrail, which show what a plugin can do. A plugin defines one kind of review: the payload an agent sends, the decision the person gives back, and the view the person decides in.

The plugins in this repository, each showing a sample review

Pinrail's core plugins, list, feedback, code-review, image and markdown, come with the app and live in its repository, forgeplane/pinrail. This repository holds the sample plugins.

Plugin For
artifact an HTML page an agent designed, commented on element by element
audio audio takes, such as voices reading one script, played and compared with their waveforms and transcripts
calendar times to arrange around what is already booked
canvas a set of designs on a canvas, the steps of a flow or variants of a screen, commented and approved frame by frame
db-schema a database schema or a migration, drawn as a diagram, commented table by table, column by column and relationship by relationship
email emails an agent wants to send, to edit, send, revise or discard
logo candidate logo marks and icons, shown at every size
model-3d candidate 3D models, viewed on a stage, with changes requested on their parts
motion candidate animations, in CSS or Lottie, played frame by frame and side by side
palette colour palettes or design tokens, light and dark, checked for contrast on the parts of a product
trade a trade an agent proposes, on its candlestick chart with the entry, stop and targets to adjust
video a video, such as a promo cut or a screen recording, commented at a moment or over a stretch, on its picture or its sound
visual-diff before and after images of a revision, compared with a wipe, side by side, a fade or a difference highlight

Installing a plugin

Each plugin is released as a zip of its built bundle. Download <name>-<version>.zip from this repository's releases and install it:

pinrail plugins install ~/Downloads/email-1.0.0.zip

To install a plugin from a checkout of this repository, install its folder. A plugin with a build step, whose package.json has a build script, needs npm ci && npm run build in its folder first:

pinrail plugins install ./plugins/email

Layout

Each plugin has a folder in plugins/, and every plugin uses the same layout:

plugins/email/
  manifest.json             # name, version, title and the plugin's declarations
  README.md
  icon.svg                  # the plugin's icon
  screenshot.png            # the image in the README, taken by pnpm screenshot
  view/index.html           # the page the app serves, with the files it loads
  schemas/                  # payload.schema.json and decision.schema.json
  templates/                # decision.md.j2, when the plugin writes its own Markdown
  samples/                  # <name>.json, reviews to try the plugin with; the first is the agents' example
  fixtures/                 # payloads for development and tests, and recorded decisions
  tests/                    # the plugin's Playwright tests under the SDK's harness
  src/                      # only for a plugin with a build: the sources the build turns into view/

The repository's own files sit beside plugins/: scripts/ holds the screenshot and release-notes scripts, and licenses/ the licences of the code the plugins bundle.

When a plugin is installed, only manifest.json, icon.svg, README.md, LICENSE and the folders schemas/, view/, templates/ and samples/ are copied into the app, without hidden files. A plugin's view always runs in a sandbox, and installing a plugin runs nothing. See What runs where.

Development

The repository uses pnpm. The plugin SDK is pinrail-sdk from npm, at the version pnpm-lock.yaml records. Checking a plugin needs the pinrail command, which the Pinrail app installs; CI takes it from the app's latest release.

pnpm install
(cd plugins/artifact && npm ci && npm run build)   # each plugin with a build step
pnpm test                                          # every plugin's tests
pnpm format                                        # format the views, scripts, tests and styles
pinrail plugins check plugins/email                # what the app would say of a plugin
pnpm exec pinrail-sdk dev plugins/email            # its view in a browser, with its fixtures
pnpm screenshot email                              # retake its screenshot.png

pnpm screenshot without a name retakes every plugin's screenshot. Either way, it then rebuilds .github/plugins.png, the grid of every plugin's screenshot at the top of this README. It mounts each view under the SDK's harness with the plugin's own sample, in the light theme, so build a plugin that has a build step first. A screenshot is not part of the plugin when it is installed.

CI checks that the HTML, JavaScript, TypeScript and CSS files are formatted with Prettier. pnpm format formats them. The recorded reviews in each plugin's fixtures/ are left as they are.

Each plugin's tests/ mount its view under the SDK's harness, with the payloads in its fixtures/. A recorded decision, fixtures/<name>.decided.json, holds a review's title, payload and decision, and optionally its origin and agent_note. Beside it, <name>.decided.md holds the Markdown the app renders from it for an agent, and <name>.decided.summary.json the summary the inbox shows. pinrail plugins check compares both with what the app makes of the recorded decision. When a change to a plugin is meant to change them, rewrite the files and review the difference before you commit it:

pinrail plugins check plugins/email --update-fixtures

To take the newest SDK locally, install without the lock file and the installed packages, which resolves the main branch again. With node_modules in place, pnpm keeps the commit it installed before. pnpm update and pnpm add lose the folder that a git dependency names, so do not use them for the SDK:

rm -rf node_modules pnpm-lock.yaml && pnpm install

Releasing

Each plugin has its own CHANGELOG.md, in the Keep a Changelog format. Record a change under Unreleased when you make it. To release a plugin:

  1. Rename Unreleased in its changelog to the new version, such as ## [1.2.0], and set the same version in its manifest.json.
  2. Commit, then tag the commit <name>-v<version>, such as email-v1.1.0, and push the tag.

The tag runs release.yml. It takes the changelog's section for the version as the release notes, builds the plugin when its package.json has a build script, checks that the manifest's version matches the tag, and attaches the bundle, <name>-<version>.zip, to a GitHub release of the same tag. A tag without a changelog section for its version releases nothing.

Writing your own plugin

Plugins live in their own repositories, and this repository holds only the samples. To write your own, start with Writing a plugin and Publishing a plugin.

Licence

Apache 2.0. See LICENSE and NOTICE.

About

Official pinrail plugins

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages