Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

instrument-repo仪器回购

Agent Skill

instrument-repo 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

139

周安装

8

GitHub Stars

8

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:instrument-repo(仪器回购)
来源仓库:https://github.com/phrazzld/claude-config
仓库路径:skills/instrument-repo
安装命令:
npx skills add https://github.com/phrazzld/claude-config --skill instrument-repo
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/phrazzld/claude-config --skill instrument-repo

简介

instrument-repo 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中筛选信息的场景。
  • 通过关键词、任务场景或来源线索进行信息检索和筛选。
  • 安装前需确认权限范围、维护状态及是否触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

/instrument-repo

Add production observability to a repository. Detects stack, installs SDKs, writes config, opens PR.

Shared Config

SENTRY_ORG=misty-step
SENTRY_TEAM=misty-step
POSTHOG_PROJECT_ID=293836
POSTHOG_HOST=https://us.i.posthog.com

All repos share ONE PostHog project (segmented by events). Each repo gets its OWN Sentry project.

Detection

Before instrumenting, detect what we're working with:

# Language detection
[ -f package.json ] && echo "typescript"
[ -f go.mod ] && echo "go"
[ -f pyproject.toml ] || [ -f setup.py ] && echo "python"
[ -f Package.swift ] && echo "swift"
[ -f Cargo.toml ] && echo "rust"

# Framework detection (TypeScript)
grep -q '"next"' package.json 2>/dev/null && echo "nextjs"
grep -q '"hono"' package.json 2>/dev/null && echo "hono"
grep -q '"express"' package.json 2>/dev/null && echo "express"
grep -q '"react-native"' package.json 2>/dev/null && echo "react-native"

# LLM usage detection (for Helicone)
grep -rq '@ai-sdk\|openai\|anthropic\|@google/genai' package.json src/ lib/ app/ 2>/dev/null && echo "has-llm"
grep -rq 'openai\|anthropic\|langchain' *.go cmd/ internal/ 2>/dev/null && echo "has-llm"
grep -rq 'openai\|anthropic\|langchain' *.py src/ 2>/dev/null && echo "has-llm"

# Existing instrumentation
grep -q '@sentry' package.json 2>/dev/null && echo "has-sentry"
grep -q 'posthog' package.json 2>/dev/null && echo "has-posthog"
grep -rq 'helicone' src/ lib/ app/ 2>/dev/null && echo "has-helicone"

Per-repo Workflow

1. cd ~/Development/$REPO
2. Detect language, framework, LLM usage, existing instrumentation
3. git fetch origin && git checkout -b infra/observability origin/main (or master)
4. Create Sentry project if needed → mcp__sentry__create_project
5. Install packages (language-specific)
6. Write/update config files from templates
7. Update .env.example
8. Typecheck/build to verify
9. git add <specific files> && git commit
10. git push -u origin infra/observability
11. gh pr create with structured body

What to Add (Decision Matrix)

ConditionSentryPostHogHelicone
Any app/serviceYES
User-facing web appYESYES
Has LLM SDK importsYESmaybeYES
CLI toolYESNOmaybe
GitHub Action / libNONONO

Sentry Sampling Rates

Cost-conscious defaults (5k errors/mo free tier):

tracesSampleRate: 0.1          # 10% of transactions
replaysSessionSampleRate: 0    # Don't record sessions by default
replaysOnErrorSampleRate: 1.0  # Always replay on error

Templates

Next.js → templates/nextjs/

Files to create:

  • sentry.client.config.ts — Client-side Sentry init
  • sentry.server.config.ts — Server-side Sentry init
  • sentry.edge.config.ts — Edge runtime Sentry init (same as server)
  • instrumentation.ts — Next.js instrumentation hook
  • lib/sentry.ts — Shared Sentry config factory with PII scrubbing
  • components/posthog-provider.tsx — PostHog React provider
  • components/posthog-pageview.tsx — Route-aware pageview tracking
  • lib/posthog.ts — PostHog client init + helpers

Install: pnpm add @sentry/nextjs posthog-js posthog-node

Next.js config: wrap with withSentryConfig() in next.config.ts

PostHog /ingest rewrite in next.config.ts:

async rewrites() {
  return [
    { source: "/ingest/static/:path*", destination: "https://us-assets.i.posthog.com/static/:path*" },
    { source: "/ingest/:path*", destination: "https://us.i.posthog.com/:path*" },
    { source: "/ingest/decide", destination: "https://us.i.posthog.com/decide" },
  ];
},

Node.js (Express/Hono) → templates/node/

Files to create:

  • lib/sentry.ts — Sentry init for Node

Install: pnpm add @sentry/node

Express: Sentry.setupExpressErrorHandler(app) after all routes Hono: Import and init at app entry, use onError hook

Go → templates/go/

Files to create:

  • internal/observability/sentry.go — Sentry init + flush helper

Install: go get github.com/getsentry/sentry-go

Python → templates/python/

Files to create:

  • observability.py — Sentry init

Install: pip install sentry-sdk or add to pyproject.toml

Swift → templates/swift/

Files to create:

  • SentrySetup.swift — Sentry init via SPM

SPM dependency: https://github.com/getsentry/sentry-cocoa PostHog SPM: https://github.com/PostHog/posthog-ios

Rust → templates/rust/

Files to create:

  • src/sentry_init.rs — Sentry guard init

Install: Add sentry = "0.35" to Cargo.toml

React Native → templates/react-native/

Install: pnpm add @sentry/react-native posthog-react-native

Helicone → templates/helicone/

Files to create:

  • lib/ai-provider.ts — Helicone-proxied AI SDK provider

Pattern: Change baseURL on AI SDK provider to Helicone gateway, add auth + property headers.

Commit Message

feat: add observability (Sentry [+ PostHog] [+ Helicone])

- Sentry: error tracking with PII-safe defaults
[- PostHog: product analytics with privacy masking]
[- Helicone: LLM cost tracking via gateway proxy]
- Updated .env.example with required variables

PR Body

## Summary
Add production observability to {repo}.

## Changes
- Sentry error tracking (DSN: `{dsn}`)
  - PII scrubbing (emails, IPs, sensitive headers)
  - Environment-aware (production/preview/development)
  - Traces sample rate: 10%
[- PostHog product analytics
  - Pageview tracking via `/ingest` proxy rewrite
  - Privacy: `respect_dnt: true`, manual pageview capture]
[- Helicone LLM cost tracking
  - Proxied through gateway for cost/latency monitoring
  - Tagged with product name and environment]
- Updated `.env.example` with all required variables

## Required Env Vars
| Variable | Where | Value |
|----------|-------|-------|
| `NEXT_PUBLIC_SENTRY_DSN` | Vercel | `{dsn}` |
| `SENTRY_AUTH_TOKEN` | Vercel + GH Actions | org-level token |
[| `NEXT_PUBLIC_POSTHOG_KEY` | Vercel | project API key |]
[| `HELICONE_API_KEY` | Vercel (server) | Helicone API key |]

## Test Plan
- [ ] `pnpm build` passes
- [ ] Deploy to preview → check Sentry for test error
- [ ] Set env vars on Vercel production
[- [ ] Verify PostHog Live Events after deploy]
[- [ ] Verify Helicone dashboard shows tagged requests]

Env Var Reference

VariableScopeNotes
NEXT_PUBLIC_SENTRY_DSNPer-projectUnique per Sentry project
SENTRY_DSNPer-project (server-only)Same DSN, no NEXT_PUBLIC prefix
SENTRY_AUTH_TOKENSharedFor source map uploads
SENTRY_ORGmisty-stepHardcode in config
SENTRY_PROJECTPer-projectMatches Sentry project slug
NEXT_PUBLIC_POSTHOG_KEYSharedPostHog project API key
NEXT_PUBLIC_POSTHOG_HOST/ingestVia rewrite proxy
HELICONE_API_KEYShared (server-only)Never expose client-side

Audit Mode

When --audit flag or repo already has instrumentation:

  1. Check Sentry config against best practices (PII scrubbing, sampling rates, env detection)
  2. Check PostHog config (respect_dnt, manual pageview, proxy rewrite)
  3. Check Helicone config (product tag, environment tag, user-id)
  4. Report findings, fix issues, open PR with fixes

Anti-Patterns

  • tracesSampleRate: 1 — exhausts free tier instantly
  • Missing PII scrubbing — privacy violation
  • sendDefaultPii: true — leaks emails/IPs
  • PostHog without /ingest rewrite — blocked by ad blockers
  • Helicone API key in client-side code — key exposure
  • Hardcoded DSN in code instead of env var — can't change per environment
  • Missing respect_dnt: true on PostHog — privacy violation

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.04%
按下载量换算24

Claude

32.41%
按下载量换算21

Cursor

19.07%
按下载量换算12

Gemini CLI

8.5%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills