agentleFS
UnpackerrUnpackerr/unpackerr/.github/copilot-instructions.md

unpackerr

Copilot instructions1.5k starsChanged 56 days agoMITView on GitHub

Longer runtime/API context: INTERNALS.md. Unpackerr is a single-process daemon. One goroutine in Run() (pkg/unpackerr/start.go) owns the live Config, the queue map, and the folder tracker. HTTP handlers validate input and hand mutations to that goroutine through onMainLoop. Review with that model in mind; the items below have been raised and rejected before. - Live Config fields are read and written only on the main loop. Do not ask for a mutex around u.StartDelay, u.Passwords, u.Sonarr, and similar. If a new…

We split this copilot-instructions.md into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not propose snapshot-and-merge logic whose only purpose is concurrent PUTs.

    line 23
  2. Very specific:

    Do not request url.Parse or a non-empty host.

    line 30
  3. Distinctive:

    Do not force a write failure with a read-only directory.

    line 53
  4. Distinctive:

    Do not request an in-process watcher or listener rebuild.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions 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
copilot-instructions.md

Review guidance for Unpackerr

Longer runtime/API context: INTERNALS.md.

Unpackerr is a single-process daemon. One goroutine in Run() (pkg/unpackerr/start.go) owns the live Config, the queue map, and the folder tracker. HTTP handlers validate input and hand mutations to that goroutine through onMainLoop. Review with that model in mind; the items below have been raised and rejected before.

Concurrency

  • Live Config fields are read and written only on the main loop. Do not ask for a mutex around u.StartDelay, u.Passwords, u.Sonarr, and similar. If a new reader runs on another goroutine, route it through onMainLoop instead. Exception: GET /api/stats / Prometheus Collect read Starr/folder map headers under configMu and the last poll snapshot under History.mu. Poll workers publish Queue and last* after GetQueue returns. Do not hop that path onto onMainLoop.
  • retrieveAppQueues does not need to snapshot the app lists. A config PUT applies on the same goroutine, which is parked in wait.Wait() until every poll returns.
  • syncFileUIPassword is not a lock-order inversion. uiPassword() releases uiPassMu before configMu is taken.
  • Two administrators saving config at the same instant is not a design target. Do not propose snapshot-and-merge logic whose only purpose is concurrent PUTs.
  • History.mu, histMu, configMu, and uiPassMu each guard one thing for HTTP readers. Do not suggest adding a fifth lock; suggest moving the work to the main loop.

Validation and input

  • Starr URLs are checked for an http:// or https:// prefix, matching startup. Do not request url.Parse or a non-empty host.
  • The history JSONL is written by this process, capped at keep_history, and read with bufio.Reader.ReadBytes. It is not untrusted input. Do not request line caps, bounded readers, atomic rename, rollback copies, or .bak handling for it. Starr and Folder rows newer than 72 hours are restored into History.Map after validateApps. Folder items are attached to the watch tracker after PollFolders (which replaces u.folders). Do not skip Folder rows.
  • A local admin POST does not need context-cancellation checks between enqueue and execution on the main loop.
  • New() allocates Config, Webserver, History, and folders. Nil checks on those fields in HTTP handlers are dead code.
  • The tray builds its menus in readyTray before go u.Run(), and a config PUT cannot apply until the loop drains taskChan, so those reads of live Config are ordered before any possible write. They are not a race and do not need a lock.
  • filepath: values are kept as written in fileConfig and expanded on the live copy only (expandFilepaths). PUT may add or change a filepath: string; a missing secret file is 400. Webserver PUT expands filepath: only on ui_password. Do not add expandFilepaths across API keys or TLS paths as a drive-by.

Tests

  • Do not force a write failure with a read-only directory. The container image runs as root, which ignores the permission bits, and Windows ignores them outright. Use blockedPath, which puts the target under a regular file so the write fails with ENOTDIR for every user and platform.

Config PUT

  • Sections that the loop cannot re-apply in place return restartRequired: true and set pendingRestart; the loop re-execs itself once the queue is idle (maybeRestart). Folders and listener/TLS/logger changes fall in this group. Do not request an in-process watcher or listener rebuild.
  • General PUT resets the loop tickers directly; interval changes do not need a restart.

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 4 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 4 mentionsSep 2026: 3 mentionsOct 2026: 34 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Unpackerr/unpackerr repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about Unpackerr/unpackerr

The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 51

Talked about on GitHub and Bluesky (51 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 1

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

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.