add-background-job

add-background-job is a skill for Claude Code from fpindej/netrock. It costs 13 tokens per session (846 once invoked), scanned A, original, MIT.

A recipe for adding Hangfire background jobs, which run work outside a user's request, either once or on a schedule. It covers creating the job and registering it with the application's dependency-injection system.

In plain words
What is it for?
Use it for scheduled cleanup, notifications, maintenance, or other one-time and recurring tasks that the application should run in the background.
Why use it?
It removes the need to run slow or recurring work during a web request and provides a standard place for that work to be configured.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it for scheduled cleanup, notifications, maintenance, or other one-time and recurring tasks that the application should run in the background.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fpindej/netrock/add-background-job
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fpindej/netrock --skill add-background-job
Clone the repo
git clone --depth 1 https://github.com/fpindej/netrock

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-background-job

README.md
[![agentmods](https://agentmods.dev/badge/skills/fpindej/netrock/add-background-job/github.svg)](https://agentmods.dev/skills/fpindej/netrock/add-background-job)
Your own site
<a href="https://agentmods.dev/skills/fpindej/netrock/add-background-job"><img src="https://agentmods.dev/badge/skills/fpindej/netrock/add-background-job/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-background-job

Your own site · 80×15
<a href="https://agentmods.dev/skills/fpindej/netrock/add-background-job"><img src="https://agentmods.dev/badge/skills/fpindej/netrock/add-background-job.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 846 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00846
Opus 5 $0.00006 $0.00423
Sonnet 5 $0.00003 $0.00169
Haiku 4.5 $0.00001 $0.00085

Measured 9d ago against content hash ebc70d45fe99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

add-background-job scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/add-background-job/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adds a recurring or one-time Hangfire background job.

Recurring Job

1. Create the job class in src/backend/MyProject.Infrastructure/Features/Jobs/RecurringJobs/{JobName}Job.cs:

using Hangfire;
using Microsoft.Extensions.Logging;

namespace MyProject.Infrastructure.Features.Jobs.RecurringJobs;

/// <summary>
/// Brief description of what this job does and why.
/// </summary>
internal sealed class MyCleanupJob(
    MyProjectDbContext dbContext,
    TimeProvider timeProvider,
    ILogger<MyCleanupJob> logger) : IRecurringJobDefinition
{
    /// <inheritdoc />
    public string JobId => "my-cleanup";

    /// <inheritdoc />
    public string CronExpression => Cron.Daily();

    /// <inheritdoc />
    public async Task ExecuteAsync()
    {
        // Job logic here - each execution gets its own DI scope
        logger.LogInformation("Job completed");
    }
}

Key conventions:

  • Mark internal sealed, use primary constructor
  • Descriptive JobId (kebab-case, e.g. "expired-token-cleanup")
  • Hangfire.Cron helpers: Cron.Hourly(), Cron.Daily(), Cron.Weekly()

2. Register in DI - add two lines to src/backend/MyProject.Infrastructure/Features/Jobs/Extensions/ServiceCollectionExtensions.cs:

services.AddScoped<MyCleanupJob>();
services.AddScoped<IRecurringJobDefinition>(sp => sp.GetRequiredService<MyCleanupJob>());

3. Verify: dotnet build src/backend/MyProject.slnx

UseJobScheduling() discovers all IRecurringJobDefinition implementations automatically. The job appears in admin panel at /admin/jobs. Pause state persists to DB (hangfire.pausedjobs).

Configuration via appsettings.json: "JobScheduling": { "Enabled": true, "WorkerCount": 4 }. Dev dashboard at http://localhost:8080/hangfire.

One-Time Job

For ad-hoc background work (call API, process file, generate report), use IBackgroundJobClient directly.

Note: transactional emails are already queued automatically - ITemplatedEmailSender.SendSafeAsync() routes through BackgroundEmailService -> EmailDeliveryJob (Features/Email/Jobs/) whenever email and job scheduling are both enabled. Do not wrap email sends in another job.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 96 lines · 13 tokens per session scan A ebc70d45fe99

Subscribe to this mod's changes

add-background-job is a skill published in the GitHub repository fpindej/netrock (232 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 846 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.