Agent skill

Configure Nightwatch

by trypostit in trypostit/trypost

Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies.

MITAuto-check passedBackend & APIs

Install Configure Nightwatch

skills CLI
$ npx skills add trypostit/trypost --skill configure-nightwatch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install trypostit/trypost configure-nightwatch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/trypostit/trypost.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/configure-nightwatch .claude/skills/configure-nightwatch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
configure-nightwatch
GitHub stars
678
Token cost
~2.7k tokens
SKILL.md length
439 words
Files
2
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies.

  • Works in 3 steps: Sampling - Controls which entry points… → Filtering - Excludes specific events… → Redaction - Modifies captured data to…
  • Setting up Nightwatch
  • SKILL.md covers Documentation Reference, Data Collection Flow, Sampling Configuration and Filtering Configuration, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Configure Nightwatch is an agent skill from trypostit/trypost. Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).

It sits in Backend & APIs, covering Backend development. It works with Laravel, Vue.js, PHP and LinkedIn. The repository describes itself as: Open-source Social Media Scheduling. The licence is MIT.

When your agent uses it

  • Setting up Nightwatch
  • Managing data volume
  • Protecting sensitive data (PII)
  • Optimizing event collection for production workloads

Example prompts

  • “Use the configure-nightwatch skill to configure Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies”
  • “/configure-nightwatch”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Sampling - Controls which entry points are captured (requests, commands, scheduled tasks)
  2. Filtering - Excludes specific events after sampling (queries, cache, mail, etc.)
  3. Redaction - Modifies captured data to remove/obfuscate sensitive information

What it can do on your machine

Read from SKILL.md and the folder at commit a878ee4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are php and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • nightwatch.laravel.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Configure Nightwatch loads about 2.7k tokens when it runs. Until then it costs about 67 tokens; SKILL.md has 439 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from trypostit/trypost at commit a878ee4, republished under its MIT licence (© trypostit). 439 words, ~2,671 tokens.

Download SKILL.mdSave it as .claude/skills/configure-nightwatch/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
configure-nightwatch
description
Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.
license
MIT
metadata.author
laravel

Nightwatch Configuration Guide

This skill helps configure Laravel Nightwatch data collection to balance observability, performance, and privacy. Covers sampling strategies, filtering rules, and redaction methods across all event types.

Documentation Reference

The Nightwatch Documentation is the definitive and up-to-date source of information for all Nightwatch configuration options. This skill provides practical guidance and common patterns, but always consult the official documentation as the primary source of truth for specific details, environment variables, and API behavior. The documentation includes comprehensive coverage of:

  • Filtering and Configuration - Core concepts for sampling, filtering, and redaction
  • Individual event type pages with specific configuration options:
    • Requests - Request sampling, header handling, payload capture
    • Commands - Command sampling and redaction
    • Queries - Query filtering and redaction
    • Cache - Cache event filtering by key or pattern
    • Jobs - Job filtering and sampling decoupling
    • Mail - Mail event filtering
    • Notifications - Notification filtering by channel
    • Exceptions - Exception sampling and throttling
    • Outgoing Requests - HTTP request filtering
  • reference.md - Quick lookup table by event type, production presets, and verification checklist

Data Collection Flow

Nightwatch processes events through three stages:

  1. Sampling - Controls which entry points are captured (requests, commands, scheduled tasks)
  2. Filtering - Excludes specific events after sampling (queries, cache, mail, etc.)
  3. Redaction - Modifies captured data to remove/obfuscate sensitive information
Request/Command/Scheduled Task
       |
       v
   [Sampling?] ----NO----> Drop entire trace
       | YES
       v
   Events generated
       |
       v
   [Filtering?] ----YES---> Drop specific event
       | NO
       v
   [Redaction] ----------> Store modified data

Sampling Configuration

Sampling determines which entry points (requests, commands, scheduled tasks) trigger full trace collection. When an entry point is sampled, all related events are captured.

Global Sample Rates

Configure via environment variables:

bash

# Default: 100% sampling (all requests/commands captured)

NIGHTWATCH_REQUEST_SAMPLE_RATE=0.1      # Recommended: 10% of requests

NIGHTWATCH_COMMAND_SAMPLE_RATE=1.0      # Capture all commands

NIGHTWATCH_EXCEPTION_SAMPLE_RATE=1.0    # Always capture exceptions

Recommendation: Start with 0.1 (10%) for requests in production, adjust based on volume and needs.

Route-Based Sampling

Apply different rates to specific routes using the Sample middleware:

php
use Illuminate\Support\Facades\Route;
use Laravel\Nightwatch\Http\Middleware\Sample;

// Sample admin routes at 100%
Route::middleware(Sample::rate(1.0))->prefix('admin')->group(function () {
    // All admin routes sampled fully
});

// Sample API routes at 5%
Route::middleware(Sample::rate(0.05))->prefix('api')->group(function () {
    // API routes sampled sparingly
});

// Always sample critical endpoints
Route::post('/checkout', [CheckoutController::class, 'process'])
    ->middleware(Sample::always());

// Never sample health checks
Route::get('/health', [HealthController::class, 'check'])
    ->middleware(Sample::never());
Show full SKILL.md (177 more words)Show less
Unmatched Route Sampling

Handle 404/bot traffic with reduced sampling:

php
Route::fallback(fn () => abort(404))
    ->middleware(Sample::rate(0.01));  // 1% sampling for unmatched routes
Dynamic Sampling

Sample based on runtime conditions (user role, request attributes):

php
use Closure;
use Illuminate\Http\Request;
use Laravel\Nightwatch\Facades\Nightwatch;

class SampleAdminRequests
{
    public function handle(Request $request, Closure $next)
    {
        if ($request->user()?->isAdmin()) {
            Nightwatch::sample();  // Always sample admin requests
        }
        return $next($request);
    }
}
Command Sampling

Exclude specific commands from sampling:

php
use Illuminate\Console\Events\CommandStarting;
use Illuminate\Support\Facades\Event;
use Laravel\Nightwatch\Facades\Nightwatch;

public function boot(): void
{
    Event::listen(function (CommandStarting $event) {
        if (in_array($event->command, ['schedule:finish', 'horizon:snapshot'])) {
            Nightwatch::dontSample();
        }
    });
}
Vendor Commands

Nightwatch automatically ignores framework/internal commands. Opt-in to capture them:

php
Nightwatch::captureDefaultVendorCommands();

Filtering Configuration

Filtering excludes specific events from collection after sampling. Use filtering to reduce noise and quota usage.

Database Queries

Filter all queries (disable query collection):

bash
NIGHTWATCH_IGNORE_QUERIES=true

Filter specific queries by SQL pattern:

php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Query;

public function boot(): void
{
    // Filter job table queries (PostgreSQL)
    Nightwatch::rejectQueries(function (Query $query) {
        return str_contains($query->sql, 'into "jobs"');
    });

    // Filter cache table queries (MySQL)
    Nightwatch::rejectQueries(function (Query $query) {
        return str_contains($query->sql, 'from `cache`')
            || str_contains($query->sql, 'into `cache`');
    });
}
Cache Events

Filter all cache events:

bash
NIGHTWATCH_IGNORE_CACHE_EVENTS=true

Filter by cache key patterns:

php
Nightwatch::rejectCacheKeys([
    'my-app:users',                    // Exact match
    '/^my-app:posts:/',                // Regex: starts with my-app:posts:
    '/^[a-zA-Z0-9]{40}$/',             // Regex: session IDs
]);

Filter with callback:

php
use Laravel\Nightwatch\Records\CacheEvent;

Nightwatch::rejectCacheEvents(function (CacheEvent $cacheEvent) {
    return str_starts_with($cacheEvent->key, 'temp:');
});
Mail Events

Filter all mail:

bash
NIGHTWATCH_IGNORE_MAIL=true

Filter specific mail:

php
use Laravel\Nightwatch\Records\Mail;

Nightwatch::rejectMail(function (Mail $mail) {
    return str_contains($mail->subject, 'Newsletter');
});
Notification Events

Filter all notifications:

bash
NIGHTWATCH_IGNORE_NOTIFICATIONS=true

Filter by channel:

php
use Laravel\Nightwatch\Records\Notification;

Nightwatch::rejectNotifications(function (Notification $notification) {
    return $notification->channel === 'database';
});
Outgoing HTTP Requests

Filter all outgoing requests:

bash
NIGHTWATCH_IGNORE_OUTGOING_REQUESTS=true

Filter by URL:

php
use Laravel\Nightwatch\Records\OutgoingRequest;

Nightwatch::rejectOutgoingRequests(function (OutgoingRequest $request) {
    return str_contains($request->url, 'analytics.example.com');
});
Queued Jobs

Filter specific jobs:

php
use Laravel\Nightwatch\Records\QueuedJob;

Nightwatch::rejectQueuedJobs(function (QueuedJob $job) {
    return $job->name === 'App\Jobs\LowPriorityJob';
});
Decoupling Job Sampling

Sample jobs independently from parent contexts:

php
use Illuminate\Support\Facades\Queue;

public function boot(): void
{
    Queue::before(fn () => Nightwatch::sample(rate: 0.5));
}

Redaction Configuration

Redaction modifies captured data to remove or obfuscate sensitive information. Unlike filtering, redaction keeps the event but sanitizes its content.

Request Redaction

Redact sensitive headers (automatically redacts: Authorization, Cookie, X-XSRF-TOKEN):

bash

# Customize redacted headers

NIGHTWATCH_REDACT_HEADERS=Authorization,Cookie,Proxy-Authorization,X-API-Key

Redact request payloads (disabled by default):

bash

# Enable payload capture

NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=true

# Customize redacted fields

NIGHTWATCH_REDACT_PAYLOAD_FIELDS=password,password_confirmation,ssn,credit_card

Programmatic redaction:

php
use Laravel\Nightwatch\Facades\Nightwatch;
use Laravel\Nightwatch\Records\Request;

Nightwatch::redactRequests(function (Request $request) {
    $request->url = str_replace('secret', '***', $request->url);
    $request->ip = preg_replace('/\d+$/', '***', $request->ip);
});
Query Redaction
php
use Laravel\Nightwatch\Records\Query;

Nightwatch::redactQueries(function (Query $query) {
    $query->sql = str_replace('secret_token', '***', $query->sql);
});
Cache Redaction
php
use Laravel\Nightwatch\Records\CacheEvent;

Nightwatch::redactCacheEvents(function (CacheEvent $cacheEvent) {
    $cacheEvent->key = str_replace('user:', 'user:***:', $cacheEvent->key);
});
Command Redaction
php
use Laravel\Nightwatch\Records\Command;

Nightwatch::redactCommands(function (Command $command) {
    $command->command = preg_replace('/--password=\S+/', '--password=***', $command->command);
});
Exception Redaction
php
use Laravel\Nightwatch\Records\Exception;

Nightwatch::redactExceptions(function (Exception $exception) {
    $exception->message = str_replace('secret', '***', $exception->message);
});
Mail Redaction
php
use Laravel\Nightwatch\Records\Mail;

Nightwatch::redactMail(function (Mail $mail) {
    $mail->subject = str_replace('Invoice #', 'Invoice ***', $mail->subject);
});
Outgoing Request Redaction
php
use Laravel\Nightwatch\Records\OutgoingRequest;

Nightwatch::redactOutgoingRequests(function (OutgoingRequest $outgoingRequest) {
    $outgoingRequest->url = preg_replace('/api_key=\w+/', 'api_key=***', $outgoingRequest->url);
});

© trypostit, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/configure-nightwatch of trypostit/trypost.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit a878ee4

Compare with similar skills

Configure Nightwatch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Configure Nightwatch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Configure Nightwatch this skilltrypostit/trypost678—~2.7kAutomated safety check: PassMIT
Livewire Developmentcoollabsio/coolify63k—~964Automated safety check: PassMIT
Livewire Developmentyungifez/skuul4091 repos~1.9kAutomated safety check: PassMIT
Spa Auth Developmentgdarko/laravel-vue-starter145—~668Automated safety check: NotesMIT
Spatie Guidelinesfreekmurze/dotfiles1k—~2.7kAutomated safety check: PassMIT
Laravelericrisco/rsc-harness167—~3.5kAutomated safety check: NotesMIT

Similar skills

  • Livewire Development

    coollabsio/coolify

    A skill your agent uses for any task or question involving Livewire.

    63k GitHub stars~964 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Livewire Development

    yungifez/skuul

    A skill your agent uses for any task or question involving Livewire.

    409 GitHub starsUsed in 1 repo~1.9k tokens
    Backend & APIsAuto-check passed
  • Spa Auth Development

    gdarko/laravel-vue-starter

    Activate when working on SPA authentication flow, Sanctum cookie-based auth, Vue Router guards, auth store, login/register/password reset pages, or CORS/session configuration.

    145 GitHub stars~668 tokensUpdated 6 mo ago
    Backend & APIsAuto-check: notes
  • Spatie Guidelines

    freekmurze/dotfiles

    Spatie's PHP, Laravel, JavaScript and Vue coding guidelines and conventions.

    1k GitHub stars~2.7k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Laravel

    ericrisco/rsc-harness

    A skill your agent uses when building or extending a Laravel 11/12 app — Eloquent models, migrations and relationships, routing with controllers and Form Requests, queues and background jobs…

    167 GitHub stars~3.5k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed

More from trypostit/trypost

  • AI SDK Development

    trypostit/trypost

    TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK.

    678 GitHub starsUsed in 2 repos~3.5k tokens
    Auto-check passed
  • Passport Development

    trypostit/trypost

    Develops OAuth2 API authentication with Laravel Passport. An agent skill from trypostit/trypost.

    678 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Categories

Questions about Configure Nightwatch

What does Configure Nightwatch do?

Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Configure Nightwatch is an agent skill from trypostit/trypost. Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies.

When should I use Configure Nightwatch?

Configure Nightwatch fits situations like: setting up Nightwatch; managing data volume; protecting sensitive data (PII); optimizing event collection for production workloads.

How do I install Configure Nightwatch in Claude Code?

Run `npx skills add trypostit/trypost --skill configure-nightwatch -a claude-code`. Or copy the skill folder (.agents/skills/configure-nightwatch in trypostit/trypost) into .claude/skills/configure-nightwatch in your project. Claude Code loads it when a task matches its description.

How do I install Configure Nightwatch in Codex?

Run `npx skills add trypostit/trypost --skill configure-nightwatch -a codex`. Or copy the skill folder (.agents/skills/configure-nightwatch in trypostit/trypost) into .agents/skills/configure-nightwatch in your project. Codex loads it when a task matches its description.

Can I use Configure Nightwatch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add trypostit/trypost --skill configure-nightwatch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/configure-nightwatch, .gemini/skills/configure-nightwatch, .github/skills/configure-nightwatch and .opencode/skills/configure-nightwatch in your project.

What does Configure Nightwatch need to run?

SKILL.md names no scripts, command-line tools or credentials: Configure Nightwatch is instructions for the agent only.

Does Configure Nightwatch access the network?

SKILL.md names 1 domain. As links in the text: nightwatch.laravel.com. This is read from the text; nothing was executed.

Is Configure Nightwatch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Configure Nightwatch use?

Configure Nightwatch is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Configure Nightwatch use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Configure Nightwatch?

Skills that share tags, products or a category with Configure Nightwatch: Livewire Development (coollabsio/coolify, 63k stars), Livewire Development (yungifez/skuul, 409 stars), Spa Auth Development (gdarko/laravel-vue-starter, 145 stars) and Spatie Guidelines (freekmurze/dotfiles, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Configure Nightwatch?

trypostit (a GitHub organization) maintains it in trypostit/trypost, which has 678 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 8, 2026.

Source: trypostit/trypost on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.