rn-observability
React Native에 관찰성 추가
조용한 실패는 디버깅 악몽을 만듭니다. 로깅 패턴, 오류 메시지 설계, 구조화된 디버깅 기법을 사용하여 프로덕션 문제를 빠르게 진단하세요.
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“rn-observability”。 사용자 답변을 저장하는 이 함수에 로깅을 추가하세요
预期结果:
- logger.info('[saveAnswer] Saving answer', { questionId, value, skillArea })
- logger.warn('[saveAnswer] Dropping answer - skill area not in retake set', { questionId, skillArea })
- throw new Error('[saveAnswer] No answers found. Check completed and new answer counts.')
正在使用“rn-observability”。 API 호출에 대한 오류 메시지를 어떻게 설계해야 하나요?
预期结果:
- 함수 이름과 실패한 작업 포함
- 응답 상태 또는 입력 값과 같은 관련 상태 추가
- 가능한 원인에 대한 가설 제공
- 예시: '[fetchUser] User fetch failed. Status: 404, UserId: 123. User may not exist.'
正在使用“rn-observability”。 결제 프로세스에 대한 흐름 추적을 생성하세요
预期结果:
- 시작 시 고유한 흐름 ID 생성: flowId: `checkout-${Date.now()}`
- 각 단계 로깅: '[checkout:${flowId}] Step 1: Validating cart'
- 상관관계를 위해 모든 로그에 flowId 포함
- 오류 발생 시: 전체 컨텍스트를 로깅하고 flowId를 보존하여 재발생
安全审计
安全Pure documentation skill containing only markdown patterns and code examples. No executable code, no file system access, no network calls, no external commands. All 75 static findings are false positives caused by the scanner misinterpreting documentation syntax (backticks for code blocks, Object.keys() method calls, YAML frontmatter) as security threats. This is a documentation-only skill providing observability guidance.
风险因素
🌐 网络访问 (1)
⚙️ 外部命令 (48)
质量评分
你能构建什么
새로운 기능에 로깅 추가
구조화된 로깅과 적절한 오류 처리를 갖춘 새로운 기능을 위한 관찰성 코드 생성
프로덕션 문제 디버깅
로그, 흐름 추적, 상태 스냅샷을 사용하여 문제를 진단하기 위한 디버깅 패턴 적용
오류 메시지 설계
빠른 해결을 위한 진단 컨텍스트가 포함된 오류 메시지 생성
试试这些提示
Generate a structured logger for React Native with debug, info, warn, and error levels. Include a logging wrapper that respects environment. Use rn-observability patterns.
Write error handling for a data fetch function using rn-observability patterns. Include function name, what failed, relevant state, and possible cause.
Implement flow tracing for a multi-step operation in React Native. Use flow IDs, step logging, and error capturing. Follow rn-observability patterns.
Create a secure logging utility that redacts sensitive fields like passwords, tokens, and API keys before logging. Use rn-observability patterns.
最佳实践
- 모든 조기 반환을 반환 이유와 관련 컨텍스트와 함께 로깅
- 오류 메시지에 함수 이름, 진단 상태, 가설 포함
- 비동기 경계를 넘어 다단계 작업을 추적하기 위해 흐름 ID 사용
- 자격 증명 노출을 방지하기 위해 로깅 전 민감한 데이터 편집
避免
- 실행이 중단된 이유를 로깅하지 않은 조용한 조기 반환
- 진단 컨텍스트 없는 일반적인 오류 메시지
- 검색을 위한 구조화된 데이터 없이 Console.log 사용
- 비밀번호, 토큰 또는 API 키와 같은 민감한 데이터 로깅