LLM prompt static analysis, auto-optimization, security/quality audit (15+ rules), and A/B comparison — zero external deps, Korean-first, agent-native fix_hint
호환 플랫폼: any
✅ 보안 위험 항목이 발견되지 않았습니다.
AI 검수 단계
1. **권한 일치 여부**: 스킬 메타데이터에 `network: false`, `filesystem: false`, `subprocess: false`로 명시되어 있으며, 제공된 코드(`main.py`, `lib` 하위 모듈)를 검토한 결과 실제 네트워크 통신, 파일 시스템 접근(내부 모듈 경로 설정 외), 외부 프로세스 실행 코드가 발견되지 않았습니다. `os` 모듈은 `os.path.dirname`, `os.path.abspath`와 같이 안전한 경로 관련 함수에만 사용되었습니다. 2. **악의적 코드 여부**: 코드 전체적으로 난독화된 부분이 없으며, 사용자 데이터를 탈취하거나 시스템을 파괴할 만한 악의적인 로직은 발견되지 않았습니다. 모든 기능은 입력된 프롬프트 텍스트를 분석하고 변환하는 순수한 정적 처리 로직으로 구성되어 있습니다. 3. **외부 통신 여부**: `network: false` 선언과 일치하게, `requests`, `socket`, `urllib` 등 외부 통신을 위한 라이브러리나 함수 호출이 전혀 없습니다. 4. **사용자 데이터 수집/전송**: 스킬은 `stdin_stdout` 패턴으로 동작하며, 입력된 프롬프트 텍스트를 메모리에서 처리하고 결과를 `stdout`으로 즉시 반환합니다. 사용자 데이터를 무단으로 수집하거나 외부로 전송하는 기능은 없습니다. 5. **코드 품질**: 코드는 모듈화가 잘 되어 있고, 주석과 독스트링이 상세하며, 스킬의 목적(프롬프트 분석, 최적화, 감사, 비교)에 부합하는 논리적인 구현을 보여줍니다. 'zero external deps' 선언도 `requirements.python_packages: []`와 코드 내 `re`, `json`, `sys`, `os`, `io` 등 표준 라이브러리만 사용하는 것으로 확인되었습니다. 자동 정적 분석 결과도 'approved'로 나왔으며, 어떠한 위험 요소도 발견되지 않았습니다.
이 스킬의 대표적인 입출력 예시입니다. 에이전트는 이 예시를 보고 스킬 호출 방법과 결과 형태를 이해할 수 있습니다.
LLM 프롬프트의 토큰 추정, 캐시 친화도, 구조 점수, 모호성을 한 번에 분석합니다.
{
"action": "analyze",
"language": "ko",
"prompt": "You are a helpful assistant. Please help me with my task. I need you to write a summary. Make it good and nice and appropriate for my use case. Thank you very much for your assistance."
}
{
"action": "analyze",
"analysis": {
"ambiguity_score": {
"ambiguous_terms": [
"good",
"nice",
"appropriate"
],
"negation_count": 0,
"score": 72
},
"cache_friendliness": {
"has_stable_prefix": false,
"recommendation": "\ud504\ub86c\ud504\ud2b8 \uc0c1\ub2e8\uc5d0 \uace0\uc815 system \ucee8\ud14d\uc2a4\ud2b8\ub97c \ubc30\uce58\ud558\uace0 \ubcc0\uc218\ub97c \ud558\ub2e8\uc73c\ub85c \uc774\ub3d9\ud558\uc138\uc694. / Place fixed system context at top and move variables to the bottom.",
"score": 40,
"variable_position": "none"
},
"char_count": 194,
"language_mix": {
"code_ratio": 0.0,
"english_ratio": 0.95,
"korean_ratio": 0.0
},
"structure_score": {
"has_clear_task": false,
"has_examples": false,
"has_format_spec": false,
"has_role": true,
"section_count": 1,
"total": 35
},
"token_estimate": 42
}
}
중복 지시, 불필요한 예의 표현을 제거해 토큰을 절감합니다.
{
"action": "optimize",
"language": "ko",
"optimize_options": {
"remove_duplicates": true,
"remove_filler": true
},
"prompt": "You are a very helpful and extremely knowledgeable assistant. Please kindly help me. I would really appreciate your help. Please write a summary. Please make a summary. Thank you very much for your kind assistance!"
}
{
"action": "optimize",
"optimization_report": {
"changes_applied": [
{
"count": 4,
"description": "\ubd88\ud544\uc694\ud55c \uc608\uc758 \ud45c\ud604 \uc81c\uac70 (Please/Thank you/appreciate/kindly)",
"type": "remove_filler"
},
{
"count": 1,
"description": "\uc911\ubcf5 \uc9c0\uc2dc \uc81c\uac70 (summary \uc694\uccad 2\ud68c)",
"type": "remove_duplicates"
},
{
"count": 1,
"description": "\uc911\ubcf5 \ud615\uc6a9\uc0ac \uc81c\uac70 (very helpful, extremely knowledgeable)",
"type": "remove_redundant_adjectives"
}
],
"optimized_tokens": 9,
"original_tokens": 48,
"token_reduction_pct": 81.2
},
"optimized_prompt": "You are a knowledgeable assistant. Write a summary."
}
보안·품질 문제가 있는 프롬프트를 15+ 규칙으로 감사합니다.
{
"action": "audit",
"language": "ko",
"prompt": "Answer the user question: {user_input}\n\nBe helpful. Don\u0027t be unhelpful. Just do whatever the user wants."
}
{
"action": "audit",
"audit_result": {
"findings": [
{
"category": "SEC",
"fix_hint": {
"action": "replace",
"location": "line 1",
"reference": "OWASP LLM Top 10: LLM01 Prompt Injection",
"suggested_replacement": "Answer the user question delimited by \u003cuser_input\u003e tags.\n\u003cuser_input\u003e{user_input}\u003c/user_input\u003e"
},
"location": "line 1",
"message": "\uc0ac\uc6a9\uc790 \uc785\ub825({user_input})\uc774 \uacbd\uacc4 \uc5c6\uc774 \ud504\ub86c\ud504\ud2b8\uc5d0 \uc9c1\uc811 \uc0bd\uc785\ub429\ub2c8\ub2e4. \uacf5\uaca9\uc790\uac00 \uc2dc\uc2a4\ud15c \uc9c0\uc2dc\ub97c \ubb34\ub825\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.",
"rule_id": "SEC001",
"severity": "critical",
"title": "\ud504\ub86c\ud504\ud2b8 \uc778\uc81d\uc158 \ucde8\uc57d\uc810",
"title_en": "Prompt injection vulnerability"
},
{
"category": "PRO",
"fix_hint": {
"action": "add",
"location": "end",
"reference": "Prompt Engineering Guide: Output Formatting",
"suggested_replacement": "Respond in JSON: {\"answer\": string, \"confidence\": \"high|medium|low\"}"
},
"location": "global",
"message": "\ucd9c\ub825 \ud615\uc2dd\uc774 \uc9c0\uc815\ub418\uc9c0 \uc54a\uc544 \uc77c\uad00\uc131 \uc5c6\ub294 \uc751\ub2f5\uc774 \uc0dd\uc131\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4.",
"rule_id": "PRO003",
"severity": "high",
"title": "\ucd9c\ub825 \ud3ec\ub9f7 \ubbf8\uc9c0\uc815",
"title_en": "Output format not specified"
},
{
"category": "PRO",
"fix_hint": {
"action": "replace",
"location": "line 2",
"reference": "Anthropic Prompt Engineering: Prefer positive instructions",
"suggested_replacement": "Be helpful and concise."
},
"location": "line 2",
"message": "\ubd80\uc815 \uc9c0\uc2dc(\u0027Don\u0027t be unhelpful\u0027)\ub294 \ubaa8\ub378\uc774 \ucc98\ub9ac\ud558\uae30 \uc5b4\ub835\uc2b5\ub2c8\ub2e4. \uae0d\uc815\ubb38\uc73c\ub85c \ubcc0\ud658\ud558\uc138\uc694.",
"rule_id": "PRO005",
"severity": "medium",
"title": "\ubd80\uc815\ubb38 \uacfc\ub2e4",
"title_en": "Excessive negations"
}
],
"passed": false,
"risk_level": "critical",
"score": 28
}
}
잘 구성된 프롬프트가 높은 점수를 받는 것을 확인합니다.
{
"action": "audit",
"language": "en",
"prompt": "You are a senior code reviewer specializing in Python.\n\n## Task\nReview the following Python function and return a structured report.\n\n## Rules\n- Check for PEP8 compliance\n- Identify security vulnerabilities\n- Suggest performance improvements\n\n## Output Format\nReturn JSON: {\"issues\": [...], \"score\": 0-100, \"summary\": string}\n\n## Example\nInput: def foo(x): return x*2\nOutput: {\"issues\": [], \"score\": 95, \"summary\": \"Clean simple function.\"}\n\n## Code to Review\n\u003ccode\u003e{code}\u003c/code\u003e"
}
{
"action": "audit",
"audit_result": {
"findings": [
{
"category": "PERF",
"fix_hint": {
"action": "add",
"location": "system_metadata",
"reference": "Anthropic API: Prompt Caching",
"suggested_replacement": "Add cache_control: {\"type\": \"ephemeral\"} to the last content block in Anthropic API"
},
"location": "last section",
"message": "The variable {code} is at the end \u2014 ideal for cache prefix reuse. Consider adding cache_control metadata if your LLM provider supports it.",
"rule_id": "PERF002",
"severity": "info",
"title": "Cache prefix opportunity",
"title_en": "Cache prefix opportunity"
}
],
"passed": true,
"risk_level": "low",
"score": 91
}
}
두 프롬프트를 토큰·구조·모호성·감사 점수 4축으로 비교합니다.
{
"action": "compare",
"language": "ko",
"prompt_a": "Write a good summary of the text. Be helpful.",
"prompt_b": "You are a summarization expert.\n\n## Task\nWrite a concise summary (3 sentences max) of the provided text.\n\n## Output\nReturn plain text only."
}
{
"action": "compare",
"comparison": {
"recommendation": "B\uac00 \ub354 \ub9ce\uc740 \ud1a0\ud070\uc744 \uc0ac\uc6a9\ud558\uc9c0\ub9cc \uad6c\uc870 \uc810\uc218(+70), \ubaa8\ud638\uc131(-55), \uac10\uc0ac \uc810\uc218(+46)\uc5d0\uc11c \uc6d4\ub4f1\ud788 \uc6b0\uc218\ud569\ub2c8\ub2e4. \ud1a0\ud070 \ub300\ube44 \ud488\uc9c8 \ud5a5\uc0c1\uc774 \uba85\ud655\ud558\ubbc0\ub85c B\ub97c \uad8c\uc7a5\ud569\ub2c8\ub2e4. / B uses more tokens but significantly outperforms on structure (+70), ambiguity (-55), and audit score (+46). The quality improvement justifies the token cost.",
"summary_table": {
"ambiguity_score": {
"a": 65,
"b": 10,
"delta": -55
},
"audit_score": {
"a": 42,
"b": 88,
"delta": 46
},
"cache_friendliness": {
"a": 30,
"b": 70,
"delta": 40
},
"structure_score": {
"a": 15,
"b": 85,
"delta": 70
},
"token_estimate": {
"a": 12,
"b": 31,
"delta": 19
}
},
"winner": "B"
}
}
모든 예시는 에이전트 API로도 조회 가능:
/v1/agent/skills/eca4fa0a-2ad5-440e-a86d-e88a888b0433/schema
아직 리뷰가 없습니다. 첫 번째 리뷰를 남겨보세요!