Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

debugging-with-opensrc使用 opensrc 进行调试

Agent Skill

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

总安装

685

周安装

28

GitHub Stars

公开资料未说明

下载量

222
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:debugging-with-opensrc(使用 opensrc 进行调试)
来源仓库:https://github.com/blogic-cz/agent-tools
仓库路径:skills/debugging-with-opensrc
安装命令:
npx skills add https://github.com/blogic-cz/agent-tools --skill debugging-with-opensrc
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/blogic-cz/agent-tools --skill debugging-with-opensrc

简介

debugging-with-opensrc 用于查阅实际安装的库源码以解决集成问题,适合在 Codex、Claude、Cursor、Gemini CLI 中调试第三方依赖时使用。

  • 它要求先阅读源码再作假设,避免盲目猜测行为。
  • 使用时同步仓库后可直接查看函数实现或错误堆栈细节。
  • 安装前建议确认磁盘空间占用及网络同步频率限制。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Debugging with OpenSrc

Overview

CRITICAL: Never guess how a library works. Always verify by reading the actual source code.

OpenSrc provides access to the exact version of external libraries installed in this project. Use it BEFORE making assumptions.

When to Use This Skill

  • Something doesn't work as expected
  • Documentation is unclear or missing
  • Need to understand library internals
  • Debugging integration issues
  • Before implementing patterns with external libraries
  • When error messages are cryptic

OpenSrc Commands

# Sync all repos (run after git clone)
bun run opensrc:sync

# Fetch new package
bun run opensrc:use <package>        # npm package
bun run opensrc:use owner/repo       # GitHub repo

Available Repos (opensrc/repos/github.com/)

LibraryPathWhat to look for
EffectEffect-TS/effect/packages/effect/src/Schema, Effect.gen, Layer, Context
TanStack RouterTanStack/router/packages/react-router/src/createFileRoute, loader, useParams
TanStack QueryTanStack/query/packages/react-query/src/useSuspenseQuery, queryOptions
TanStack FormTanStack/form/packages/react-form/src/useForm, validation
TanStack StartTanStack/router/packages/start/src/SSR, server functions
TRPCtrpc/trpc/packages/server/src/procedures, middleware, routers
Drizzle ORMdrizzle-team/drizzle-orm/drizzle-orm/src/pgTable, relations, queries
Better Authbetter-auth/better-auth/packages/better-auth/src/auth config, plugins, sessions
OpenCodesst/opencode/packages/opencode/src/skills, commands, plugins
Pinopinojs/pino/lib/logger, transports
Sentrygetsentry/sentry-javascript/packages/SDK, integrations, tracing

Debugging Workflow

Step 1: Identify the Problem

Error: "X is not a function" or "Cannot read property Y"
→ Find where X/Y is defined in source code

Step 2: Locate Relevant Source

# Use CK semantic search to find in opensrc
mcp_ck_semantic_search(
  query="useSuspenseQuery implementation",
  path="opensrc/repos/github.com/TanStack/"
)

# Or grep for specific function
mcp_grep(
  pattern="export function useSuspenseQuery",
  path="opensrc/repos/github.com/TanStack/"
)

Step 3: Read the Implementation

# Read the actual source file
mcp_read(filePath="opensrc/repos/github.com/TanStack/query/packages/react-query/src/useSuspenseQuery.ts")

Step 4: Understand the Expected Behavior

Look for:

  • Function signatures and return types
  • Default values and optional parameters
  • Error handling and edge cases
  • Internal state management

Common Debugging Scenarios

Scenario: TanStack Form Validation Not Working

BAD: Search web for "TanStack Form validation issue"
GOOD:
1. Read opensrc/repos/github.com/TanStack/form/packages/react-form/src/useForm.ts
2. Find validator interface and expected return type
3. Check how Standard Schema integration works
4. Fix based on actual implementation

Scenario: TRPC Procedure Not Receiving Context

1. Read opensrc/repos/github.com/trpc/trpc/packages/server/src/core/middleware.ts
2. Understand how context flows through middleware chain
3. Check if .use() returns opts.next() correctly

Scenario: Effect Layer Not Providing Service

1. Read opensrc/repos/github.com/Effect-TS/effect/packages/effect/src/Layer.ts
2. Understand Layer.effect vs Layer.succeed
3. Check Context.Tag usage patterns

Scenario: OpenCode Skill Not Loading

1. Read opensrc/repos/github.com/sst/opencode/packages/opencode/src/
2. Find skill loading logic
3. Check frontmatter parsing and description matching
4. Run `opencode debug skill` to verify

Scenario: Better Auth Session Not Persisting

1. Read opensrc/repos/github.com/better-auth/better-auth/packages/better-auth/src/
2. Find session handling logic
3. Check cookie configuration and storage

Key Principle

Source code is the truth.

  • Documentation can be outdated
  • Stack Overflow answers may not apply to your version
  • Blog posts may use different configurations
  • Only the source code shows exactly what happens

Example: Full Debugging Session

Problem: useSuspenseQuery returns undefined even though data is in cache

Step 1: Check TanStack Query source
→ Read opensrc/repos/github.com/TanStack/query/packages/react-query/src/useSuspenseQuery.ts

Step 2: Find the issue
→ Discover that useSuspenseQuery requires queryOptions() wrapper, not raw object

Step 3: Verify in project
→ Check how other components use it successfully

Step 4: Fix
→ Change from trpc.x.useQuery() to useSuspenseQuery(trpc.x.queryOptions())

OpenCode Agent Infrastructure

Testing Skills and CLAUDE.md Changes

After modifying skills or CLAUDE.md, test in a NEW session:

# Test with specific model (use perl timeout for non-interactive)
perl -e 'alarm 120; exec @ARGV' opencode run -m anthropic/claude-sonnet-4-5 --format json "your test prompt" 2>&1

# Examples:
# Test database skill autoloading
perl -e 'alarm 120; exec @ARGV' opencode run -m anthropic/claude-sonnet-4-5 --format json "potrebujem vytvorit novu tabulku v databaze" 2>&1

# Test auth skill
perl -e 'alarm 120; exec @ARGV' opencode run -m anthropic/claude-sonnet-4-5 --format json "ako pridam protected procedure pre admin" 2>&1

OpenCode Debug Commands

# List all available skills (verify skill is registered)
opencode debug skill

# Check OpenCode version
opencode --version

# Run with different models
opencode run -m anthropic/claude-sonnet-4-5 "message"
opencode run -m anthropic/claude-opus-4 "message"

Skill File Structure

.opencode/skill/<skill-name>/
├── SKILL.md              # Main skill file with frontmatter
└── references/           # Optional additional docs
    ├── examples.md
    └── patterns.md

SKILL.md Frontmatter Format

---
name: skill-name
description: "ALWAYS LOAD THIS SKILL when: keyword1, keyword2, keyword3. Contains X, Y, Z."
---
# Skill Title

## Content...

Key insight: The description field determines when the model loads the skill automatically. Use:

  • "ALWAYS LOAD THIS SKILL when:..." for critical skills
  • "LOAD THIS SKILL when:..." for optional skills
  • Include relevant keywords the user might mention

Testing Skill Autoloading

  1. Make changes to skill or CLAUDE.md
  2. Run test in NEW session (skills load at session start)
  3. Check JSON output for "tool":"skill" call
  4. Verify skill content was used in response
# Look for skill loading in output
perl -e 'alarm 120; exec @ARGV' opencode run -m anthropic/claude-sonnet-4-5 --format json "test prompt" 2>&1 | grep -A5 '"tool":"skill"'

OpenCode Source Code Locations

For debugging OpenCode itself:

opensrc/repos/github.com/sst/opencode/packages/opencode/src/
├── skill/          # Skill loading and management
├── command/        # Custom commands
├── plugin/         # Plugin system
├── session/        # Session management
└── provider/       # Model providers

Remember

  1. Read source FIRST - before asking, before web searching
  2. Exact version matters - opensrc has YOUR installed version
  3. Follow the code path - trace from entry point to implementation
  4. Check types - TypeScript types often reveal expected usage
  5. Look at tests - library tests show correct usage patterns
  6. Test in NEW session - skills and CLAUDE.md load at session start

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.02%
按下载量换算82

Claude

30.38%
按下载量换算67

Cursor

19.83%
按下载量换算44

Gemini CLI

10.73%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills