lsp-concurrency-audit
정보
이 스킬은 코드를 분석하여 여러 동시성 컨텍스트(고루틴, 스레드 등)에서 접근되는 필드를 식별하고 적절한 동기화가 누락된 부분을 표시함으로써 동시성 안전성 감사를 수행합니다. 필드 수준의 안전성 보고서를 생성하며, 언어에 구애받지 않고 네 가지 동시성 패밀리에서 작동합니다. 코드베이스에서 잠재적인 데이터 레이스와 동기화 문제를 탐지해야 할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add blackwell-systems/agent-lsp -a claude-code/plugin add https://github.com/blackwell-systems/agent-lspgit clone https://github.com/blackwell-systems/agent-lsp.git ~/.claude/skills/lsp-concurrency-auditClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Requires the agent-lsp MCP server.
lsp-concurrency-audit
Given a type or file, map all fields, identify which are accessed from multiple concurrent contexts, and flag fields that lack synchronization. Produces a field-level concurrency safety report.
When to Use
- Before refactoring a type that is accessed from goroutines/threads
- Auditing a codebase for data race candidates
- Reviewing a PR that adds concurrent access to an existing type
- Understanding which fields in a type need mutex protection
Input
/lsp-concurrency-audit <file-path> [--type <TypeName>]
If --type is provided, audit only that type. Otherwise, audit all types in
the file that have concurrent callers.
Step 1: Discover types and fields
Call list_symbols on the target file to enumerate all types (structs, classes):
mcp__lsp__list_symbols({ "file_path": "<target>" })
For each type (kind=23 struct, kind=5 class), collect:
- Type name
- All fields (children with kind=8 field or kind=7 variable)
- Whether any field's name or detail contains sync primitives ("Mutex", "RWMutex", "Lock", "Semaphore", "atomic", "Atomic", "sync.", "pthread_mutex", "std::mutex")
If --type was specified, filter to that type only.
Step 2: Blast radius and sync-guarded status
Call blast_radius on the file:
mcp__lsp__blast_radius({
"changed_files": ["<target>"],
"scope": "all"
})
From the result, for each method on each target type:
- Record
sync_guarded: true/falsefrom the response - Record
non_test_callerscount (blast radius) - Record
test_callerscount
Step 3: Trace concurrent boundaries
For each method on each target type, call find_callers with
cross_concurrent: true:
mcp__lsp__find_callers({
"file_path": "<target>",
"line": <method_line>,
"column": <method_column>,
"direction": "incoming",
"cross_concurrent": true
})
Record for each method:
concurrent_callers: list of callers that cross concurrent boundariespattern: the concurrent entry pattern detected (e.g., "go func(", "Thread.start(")
Step 4: Classify fields
For each field in each type, determine its safety status:
SAFE: The type is sync-guarded (has a mutex/lock field) AND all methods that access this field acquire the lock before access. Confidence: verified if the type has a sync primitive; suspected if relying on external locking.
UNSAFE (data race candidate): The field is accessed by methods that have
concurrent_callers AND the type has no sync primitive. This is a potential
data race.
WRITE-CONCURRENT: The field is written by a method that has concurrent callers. Higher severity than read-only concurrent access.
READ-ONLY: The field is only read (not written) from concurrent contexts. Lower severity; often safe but worth flagging for review.
Severity assignment:
error: UNSAFE + WRITE-CONCURRENT (probable data race)warning: UNSAFE + READ-ONLY (potential race under high concurrency)info: SAFE (sync-guarded, for documentation)
Step 5: Output
## Concurrency Audit: <TypeName>
**File:** <file_path>
**Fields:** N total, M sync-guarded
**Concurrent methods:** K (methods called from goroutines/threads/tasks)
### Field Safety Report
| Field | Type | Sync | Concurrent Writers | Concurrent Readers | Status |
|-------|------|------|-------------------|-------------------|--------|
| mu | sync.RWMutex | (is sync) | - | - | SYNC PRIMITIVE |
| sender | NotificationSender | guarded | 2 (SetSender, Send) | 3 | SAFE |
| subscribers | []Subscriber | none | 1 (Subscribe) | 2 | UNSAFE (write-concurrent) |
### Concurrent Call Sites
For each UNSAFE field, list the concurrent callers:
- `subscribers` written by `Subscribe` called from:
- `setupNotificationHub` via `go func()` at notifications.go:45
- `handleNewSession` via `go func()` at server.go:312
### Recommendations
- Add `sync.RWMutex` to protect `subscribers` field
- Or: use channel-based access pattern instead of direct field mutation
Caveats
-
Heuristic detection. Concurrent boundary detection relies on source pattern matching, not runtime analysis. False negatives are possible when concurrent entry is indirect (e.g., passed as a callback to a framework).
-
Lock discipline not verified. The audit checks whether a sync primitive exists on the type, not whether every method actually acquires it before field access. A type with a mutex but inconsistent locking will show as SAFE when it may not be.
-
External synchronization invisible. If synchronization is provided by an external lock (e.g., the caller holds a lock before calling the method), the audit will flag the field as UNSAFE. Add a comment or annotation to suppress.
-
Read vs write detection is heuristic. Determining whether a method reads or writes a field requires source code analysis. The skill reads the method body and looks for assignment patterns (
field =,field.Store(),append(field,). False positives are possible for complex access patterns.
GitHub 저장소
연관 스킬
railway-docs
문서이 스킬은 Railway의 기능, 작동 방식 또는 특정 문서 URL에 대한 질문에 답하기 위해 최신 Railway 문서를 가져옵니다. 개발자들이 Railway의 공식 소스로부터 정확하고 최신 정보를 직접 받을 수 있도록 보장합니다. 사용자가 Railway의 작동 방식을 묻거나 Railway 문서를 참조할 때 사용하세요.
n8n-code-python
문서이 Claude Skill은 n8n의 Code 노드에서 Python 코드를 작성할 때 전문적인 지침을 제공하며, 특히 Python 표준 라이브러리 사용과 n8n의 특수 구문인 `_input`, `_json`, `_node` 작업에 중점을 둡니다. 이는 개발자가 n8n 내에서 Python의 제한 사항을 이해하도록 돕고, 대부분의 워크플로에는 JavaScript 사용을 권장하면서도 특정 데이터 변환 요구사항에 대한 Python 솔루션을 제안합니다.
archon
문서Archon 스킬은 REST API를 통해 RAG 기반 시맨틱 검색과 프로젝트 관리를 제공합니다. 이 스킬을 사용하여 문서 검색, 계층적 프로젝트/태스크 관리, 문서 업로드 기능을 갖춘 지식 검색을 수행할 수 있습니다. 외부 문서를 검색할 때는 다른 소스를 사용하기 전에 항상 Archon을 최우선으로 활용하세요.
n8n-code-javascript
문서이 Claude Skill은 n8n의 Code 노드에서 JavaScript 코드 작성에 대한 전문적인 지침을 제공합니다. `$input`/`$json` 변수, HTTP 헬퍼, DateTime 처리와 같은 필수적인 n8n 특정 구문을 다루며 일반적인 오류를 해결합니다. Code 노드에서 사용자 정의 JavaScript 처리가 필요한 n8n 워크플로우를 개발할 때 활용하세요.
