Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\n'/\\\\n}\" # Newlines\n str=\"${str//

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\t'/\\\\t}\" # Tabs\n str=\"${str//

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\r'/\\\\r}\" # Carriage returns\n str=\"${str//

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\f'/\\\\f}\" # Form feed\n str=\"${str//

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\b'/\\\\b}\" # Backspace\n printf '%s' \"$str\"\n}\n\n# -----------------------------------------------------------------------------\n# JSON Construction (graceful degradation: jq -> python3 -> bash)\n# -----------------------------------------------------------------------------\n\nbuild_request_json() {\n local prompt=\"$1\"\n local model=\"$2\"\n\n if command -v jq &>/dev/null; then\n jq -n \\\n --arg model \"$model\" \\\n --arg prompt \"$prompt\" \\\n '{\n model: $model,\n input: [\n {role: \"developer\", content: \"Peer SWE consultant; use web search when helpful.\"},\n {role: \"user\", content: $prompt}\n ],\n tools: [{type: \"web_search\", user_location: {type: \"approximate\"}, search_context_size: \"medium\"}],\n store: false\n }'\n elif command -v python3 &>/dev/null; then\n python3 -c \"\nimport json, sys\nprint(json.dumps({\n 'model': sys.argv[1],\n 'input': [\n {'role': 'developer', 'content': 'Peer SWE consultant; use web search when helpful.'},\n {'role': 'user', 'content': sys.argv[2]}\n ],\n 'tools': [{'type': 'web_search', 'user_location': {'type': 'approximate'}, 'search_context_size': 'medium'}],\n 'store': False\n}))\n\" \"$model\" \"$prompt\"\n else\n # Fallback: bash pure (handles most common cases)\n local escaped_model escaped_prompt\n escaped_model=$(json_escape \"$model\")\n escaped_prompt=$(json_escape \"$prompt\")\n printf '%s' '{\"model\":\"'\"$escaped_model\"'\",\"input\":[{\"role\":\"developer\",\"content\":\"Peer SWE consultant; use web search when helpful.\"},{\"role\":\"user\",\"content\":\"'\"$escaped_prompt\"'\"}],\"tools\":[{\"type\":\"web_search\",\"user_location\":{\"type\":\"approximate\"},\"search_context_size\":\"medium\"}],\"store\":false}'\n fi\n}\n\n# -----------------------------------------------------------------------------\n# API Key Loading\n# -----------------------------------------------------------------------------\n\nload_api_key() {\n local key=\"\"\n\n # Try .env.local first\n if [[ -f \".env.local\" ]]; then\n key=$(grep -E \"^OPENAI_API_KEY=\" .env.local 2>/dev/null | cut -d= -f2- | tr -d \"\\\"'\" || true)\n fi\n\n # Try .env second\n if [[ -z \"$key\" && -f \".env\" ]]; then\n key=$(grep -E \"^OPENAI_API_KEY=\" .env 2>/dev/null | cut -d= -f2- | tr -d \"\\\"'\" || true)\n fi\n\n # Fall back to environment variable\n if [[ -z \"$key\" ]]; then\n key=\"${OPENAI_API_KEY:-}\"\n fi\n\n echo \"$key\"\n}\n\n# -----------------------------------------------------------------------------\n# Utility: trim whitespace (bash native, no xargs)\n# -----------------------------------------------------------------------------\n\ntrim() {\n local str=\"$1\"\n str=\"${str#\"${str%%[![:space:]]*}\"}\" # trim leading\n str=\"${str%\"${str##*[![:space:]]}\"}\" # trim trailing\n printf '%s' \"$str\"\n}\n\n# -----------------------------------------------------------------------------\n# Argument Parsing\n# -----------------------------------------------------------------------------\n\nMESSAGE=\"\"\nFILES=\"\"\n\nwhile [[ $# -gt 0 ]]; do\n case $1 in\n --message)\n [[ -z \"${2:-}\" ]] && { echo \"Error: --message requires a value\" >&2; exit 1; }\n MESSAGE=\"$2\"\n shift 2\n ;;\n --files)\n [[ -z \"${2:-}\" ]] && { echo \"Error: --files requires a value\" >&2; exit 1; }\n FILES=$(trim \"$2\")\n [[ -z \"$FILES\" ]] && { echo \"Error: --files requires a value\" >&2; exit 1; }\n shift 2\n ;;\n *)\n echo \"Unknown option: $1\" >&2\n exit 1\n ;;\n esac\ndone\n\nif [[ -z \"$MESSAGE\" ]]; then\n echo \"Error: --message is required\" >&2\n exit 1\nfi\n\n# -----------------------------------------------------------------------------\n# Build Prompt\n# -----------------------------------------------------------------------------\n\nPROMPT=\"$MESSAGE\"\n\nif [[ -n \"$FILES\" ]]; then\n PROMPT+=

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\n\\n---\\n\\n# Context Files\\n'\n\n IFS=',' read -ra FILE_ARRAY \u003c\u003c\u003c \"$FILES\"\n for file in \"${FILE_ARRAY[@]}\"; do\n file=$(trim \"$file\")\n if [[ -f \"$file\" && -r \"$file\" ]]; then\n content=$(cat \"$file\") || { echo \"Warning: Could not read: $file\" >&2; continue; }\n PROMPT+=

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\n## '\"$file\"

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\n\\n```\\n'\"$content\"

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…

\\n```\\n'\n elif [[ -f \"$file\" ]]; then\n echo \"Warning: File not readable: $file\" >&2\n else\n echo \"Warning: File not found: $file\" >&2\n fi\n done\nfi\n\n# -----------------------------------------------------------------------------\n# Load Configuration\n# -----------------------------------------------------------------------------\n\nAPI_KEY=$(load_api_key)\nif [[ -z \"$API_KEY\" ]]; then\n echo \"Error: OPENAI_API_KEY not found. Checked: .env.local, .env, environment\" >&2\n exit 1\nfi\n\nMODEL=\"${SECOND_OPINION_MODEL:-$DEFAULT_MODEL}\"\nTIMEOUT=\"${SECOND_OPINION_TIMEOUT:-$DEFAULT_TIMEOUT}\"\n\n# Validate timeout is numeric\nif ! [[ \"$TIMEOUT\" =~ ^[0-9]+$ ]]; then\n echo \"Error: SECOND_OPINION_TIMEOUT must be a positive integer (got: $TIMEOUT)\" >&2\n exit 1\nfi\n\n# -----------------------------------------------------------------------------\n# Build Request Body (using jq/python for proper JSON escaping)\n# -----------------------------------------------------------------------------\n\nREQUEST_BODY=$(build_request_json \"$PROMPT\" \"$MODEL\")\n\n# -----------------------------------------------------------------------------\n# Make Request\n# -----------------------------------------------------------------------------\n\nTMPFILE=\"\"\nERRFILE=\"\"\ncleanup() { rm -f \"$TMPFILE\" \"$ERRFILE\"; }\ntrap cleanup EXIT\nTMPFILE=$(mktemp) || { echo \"Error: Failed to create temp file\" >&2; exit 1; }\nERRFILE=$(mktemp) || { echo \"Error: Failed to create temp file\" >&2; exit 1; }\n\nHTTP_CODE=$(curl -s -w \"%{http_code}\" --max-time \"$TIMEOUT\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $API_KEY\" \\\n -d \"$REQUEST_BODY\" \\\n -o \"$TMPFILE\" \\\n \"$API_ENDPOINT\" 2>\"$ERRFILE\")\n\nCURL_EXIT=$?\n\nif [[ $CURL_EXIT -ne 0 ]]; then\n echo \"Error: curl failed with exit code $CURL_EXIT\" >&2\n [[ -s \"$ERRFILE\" ]] && cat \"$ERRFILE\" >&2\n [[ -s \"$TMPFILE\" ]] && cat \"$TMPFILE\" >&2\n exit 1\nfi\n\nRESPONSE=$(cat \"$TMPFILE\") || { echo \"Error: Failed to read response\" >&2; exit 1; }\n\n# Validate HTTP_CODE is numeric before comparison\nif ! [[ \"$HTTP_CODE\" =~ ^[0-9]+$ ]]; then\n echo \"Error: Invalid HTTP response code: $HTTP_CODE\" >&2\n echo \"$RESPONSE\" >&2\n exit 1\nfi\n\nif [[ \"$HTTP_CODE\" -ge 400 ]]; then\n echo \"Error: API returned HTTP $HTTP_CODE\" >&2\n echo \"$RESPONSE\" >&2\n exit 1\nfi\n\n# -----------------------------------------------------------------------------\n# Output Response\n# -----------------------------------------------------------------------------\n\necho \"\"\necho \"=== PEER CONSULTANT RESPONSE ===\"\necho \"\"\necho \"## Response\"\necho \"\"\n\nOUTPUT_TEXT=$(extract_response_text \"$RESPONSE\")\n\nif [[ -z \"$OUTPUT_TEXT\" ]]; then\n echo \"Warning: Empty response from API\" >&2\n echo \"Raw response:\" >&2\n echo \"$RESPONSE\" >&2\n exit 1\nfi\n\necho \"$OUTPUT_TEXT\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":8947,"content_sha256":"1e69ecbfcf7c4d2b6699c8031c22af3e1e6b092b5c3115a9fb05ba8396e2ab7f"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Second Opinion Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Usage","type":"text"}]},{"type":"paragraph","content":[{"text":"Invoke the consultation script using the ","type":"text"},{"text":"base directory shown above","type":"text","marks":[{"type":"strong"}]},{"text":" when this skill loads:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash \u003cbase_directory>/scripts/consult.sh --message \"your question\" --files path1,path2,path3","type":"text"}]},{"type":"paragraph","content":[{"text":"Important","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Replace ","type":"text"},{"text":"\u003cbase_directory>","type":"text","marks":[{"type":"code_inline"}]},{"text":" with the actual \"Base directory for this skill\" path shown above","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The script will look for ","type":"text"},{"text":"OPENAI_API_KEY","type":"text","marks":[{"type":"code_inline"}]},{"text":" in this order: ","type":"text"},{"text":".env.local","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":".env","type":"text","marks":[{"type":"code_inline"}]},{"text":", system environment variable","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT run in background—synchronous execution avoids polling overhead","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Note on GPT-5 models","type":"text","marks":[{"type":"strong"}]},{"text":": GPT-5 was released on August 7, 2025. Available variants: ","type":"text"},{"text":"gpt-5","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"gpt-5-mini","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"gpt-5-nano","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"gpt-5-pro","type":"text","marks":[{"type":"code_inline"}]},{"text":" (thinking model). Default is ","type":"text"},{"text":"gpt-5-pro-2025-10-06","type":"text","marks":[{"type":"code_inline"}]},{"text":". Override via ","type":"text"},{"text":"SECOND_OPINION_MODEL","type":"text","marks":[{"type":"code_inline"}]},{"text":" env var.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Context Responsibility","type":"text"}]},{"type":"paragraph","content":[{"text":"Critical","type":"text","marks":[{"type":"strong"}]},{"text":": You must pass ALL relevant context. The peer consultant has no access to this codebase, conversation history, or project context beyond what you provide.","type":"text"}]},{"type":"paragraph","content":[{"text":"Include:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complete problem description","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Relevant code files (via --files)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Constraints, requirements, decisions made","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Specific questions or areas for review","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Interpretation Authority","type":"text"}]},{"type":"paragraph","content":[{"text":"You retain final judgment","type":"text","marks":[{"type":"strong"}]},{"text":". The peer consultant provides alternative viewpoints, but you must:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Evaluate responses against conversation context","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reject/question suggestions that conflict with established requirements","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Apply your understanding of the full project context","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Make final decisions based on complete information","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"The peer opinion is input, not directive.","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"second-opinion","author":"@skillopedia","source":{"stars":8,"repo_name":"skills","origin_url":"https://github.com/alberduris/skills/blob/HEAD/plugins/second-opinion/skills/second-opinion/SKILL.md","repo_owner":"alberduris","body_sha256":"9c1b3de0330e77198ff8b6fc7df1ca32e33d01bec51624fcd8e31573b38d1e9b","cluster_key":"5ebad308c1dc182a0c45df625d4ab3ed78bf25824e93e7bff4a7d54873d0fc92","clean_bundle":{"format":"clean-skill-bundle-v1","source":"alberduris/skills/plugins/second-opinion/skills/second-opinion/SKILL.md","attachments":[{"id":"733ca078-2dc3-5db6-85c7-215b9fb93ea8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/733ca078-2dc3-5db6-85c7-215b9fb93ea8/attachment.sh","path":"scripts/consult.sh","size":8947,"sha256":"1e69ecbfcf7c4d2b6699c8031c22af3e1e6b092b5c3115a9fb05ba8396e2ab7f","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"3897c22cbcab0ad45ce1c1d1b81b7b8bcdc7de5ffe48bb3b6d29b9ed9bd25573","attachment_count":1,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"plugins/second-opinion/skills/second-opinion/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"ai-agent-development","category_label":"AI"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"ai-agent-development","import_tag":"clean-skills-v1","description":"Consult peer LLM for alternative perspectives when you need second opinion, peer review, or fresh take on technical decisions; useful for validating approaches or exploring alternative solutions","allowed-tools":"Read, Bash"}},"renderedAt":1782981991340}

Second Opinion Skill Use this skill when you need an alternative perspective on technical decisions, architecture choices, or implementation approaches. Usage Invoke the consultation script using the base directory shown above when this skill loads: Important : - Replace with the actual "Base directory for this skill" path shown above - The script will look for in this order: , , system environment variable - Default timeout is 30 minutes; match this in your Bash tool timeout parameter (1800000ms) - Do NOT run in background—synchronous execution avoids polling overhead Note on GPT-5 models :…