소스 정보
- 저장소
- ravi-hq/cli
- 최근 소스 활동
- 2026년 3월 6일 20:18
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ravi-hq/cli --skill gen-test명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Use when releasing a new Ravi CLI version — version bump, tagging, and verification
SKILL.md 표시 중
| name | gen-test |
| description | Use when generating a Go test file for a module following Ravi CLI test conventions |
Generate a Go test file for a specified module, following all Ravi CLI test conventions.
The user should specify which module to generate tests for (e.g., "gen-test internal/api/secrets.go" or "gen-test pkg/cli/passwords.go").
<module>_test.go in the same package directory_test suffix — tests are white-box)[]struct{ name string; ... } with t.Run(tt.name, ...)t.Helper() as the first linewithTempHome(t) for any test that touches config.LoadAuth(), config.SaveAuth(), or os.UserHomeDir()httptest.NewServer() + newTestClient(server.URL) or clientFromAuth(server.URL, auth)testKeyPair(t) (PIN "123456", zero salt) for deterministic keypairt.Fatalf for setup failures, t.Errorf for assertion failuresdefer cleanup() or defer server.Close() immediately after creationinternal/api/ packagewithTempHome(t) // Temp HOME dir, returns (tmpDir, cleanup)
withAPIBaseURL(t, url) // Temp API URL override, returns cleanup
setupTestAuth(t, auth) // Save auth config to temp home
newTestClient(serverURL) // Client with test-token, no disk config
clientFromAuth(serverURL, auth) // Client with specific auth config
internal/crypto/ packagetestKeyPair(t) // Deterministic keypair (PIN "123456", zero salt)
testEncrypt(t, plaintext, kp) // Encrypt with SealAnonymous
pkg/cli/ packagewithTempHome(t) // Same pattern as api package (redefined)
*_test.go files in the same directory to match local patternswithTempHome, etc.)withTempHome(t) + defer cleanup() for config-dependent testshttptest.NewServer mocks for API client testspackage api
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestMyFunction(t *testing.T) {
tests := []struct {
name string
input string
want string
wantErr bool
}{
{"valid input", "hello", "HELLO", false},
{"empty string", "", "", false},
{"special chars", "e2e::data", "E2E::DATA", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := MyFunction(tt.input)
if (err != nil) != tt.wantErr {
t.Fatalf("MyFunction(%q) error = %v, wantErr %v", tt.input, err, tt.wantErr)
}
if got != tt.want {
t.Errorf("MyFunction(%q) = %q, want %q", tt.input, got, tt.want)
}
})
}
}
func TestMyAPIMethod(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte())
}))
server.Close()
client := newTestClient(server.URL)
}