SWOTPal SWOT Analysis Skill
Generate professional SWOT analyses and competitive comparisons for any company, product, or strategic topic. This skill operates in two modes: a free Prompt Template Mode that leverages the AI assistant's own reasoning, and a Pro API Mode that calls the SWOTPal API for data-enriched, saveable analyses with a web editor.
Mode Detection
Before processing the user's request, determine the operating mode:
if [ -n "$SWOTPAL_API_KEY" ]; then
echo "API_MODE"
else
echo "PROMPT_MODE"
fiSWOTPAL_API_KEYis set — Use API Mode. All analyses are generated server-side, saved to the user's SWOTPal account, and accessible via the web editor.SWOTPAL_API_KEYis not set — Use Prompt Template Mode. Generate the analysis using the structured prompt templates below, powered by the AI assistant's own capabilities.
Command Routing
Parse the user's message to determine the intent:
| User says | Intent | Action |
|---|---|---|
analyze [topic], swot [topic], [topic] swot analysis | Single SWOT | Generate a SWOT analysis for the topic |
compare X vs Y, X versus Y, X 对比 Y, X vs Y 竞品分析 | Versus comparison | Generate a side-by-side comparison |
my analyses, show my swot, 我的分析, list analyses | List analyses | List saved analyses (API mode only) |
show analysis [id], detail [id] | View detail | Fetch a specific analysis by ID (API mode only) |
If the intent is "list analyses" or "view detail" and the skill is in Prompt Template Mode, respond:
You need an API key to access saved analyses. Get one free at swotpal.com/openclaw
Language Detection
Detect the language of the user's message and set the language parameter accordingly. Supported language codes: en, zh, ja, ko, es, fr, de, pt, it, ru, ar, hi.
- If the user writes in Chinese, set
languagetozh. - If the user writes in Japanese, set
languagetoja. - If the user writes in English or the language is unclear, default to
en. - Pass the detected language to both the API calls and the prompt templates.
- Always respond in the same language the user used.
Examples Library (Check First)
Before generating any SWOT analysis (in either mode), check if the topic matches a pre-built example. These are curated, high-quality analyses available instantly — no API call needed.
Matching rules: Match the user's topic case-insensitively against the company/person names below. Common variations should also match (e.g. "Facebook" → Meta, "H and M" → H&M, "Gates" → Bill Gates).
If a match is found, respond with:
Found a curated SWOT analysis for {topic}!
🔗 View full analysis: {example_url}
This is a professionally curated example with detailed SWOT breakdown, TOWS strategies, and more.
Want me to generate a fresh AI-powered analysis instead? Just say "generate new".If no match, proceed to Prompt Template Mode or API Mode as normal.
Prompt Template Mode (No API Key)
When SWOTPAL_API_KEY is not set, use the following prompt templates to generate analyses with the AI assistant's own capabilities.
Single SWOT Analysis
Use this system prompt internally to generate the analysis:
You are a senior strategy consultant with 20 years of experience at McKinsey and BCG.
Produce a rigorous SWOT analysis for the given topic.
Requirements:
- Title: "[Topic] SWOT Analysis"
- For each quadrant (Strengths, Weaknesses, Opportunities, Threats), provide 5-7 items.
- Each item must be a specific, evidence-based insight — not generic filler.
- Reference real market data, financials, competitive dynamics, and industry trends where possible.
- Include recent developments (up to your knowledge cutoff).
- Items should be actionable and contextualized to the specific entity, not boilerplate.
- Respond in the language specified: {language}.
Output format — use this exact markdown structure:
## [Topic] SWOT Analysis
**Strengths**
1. [Specific strength with context]
2. [Specific strength with context]
3. ...
**Weaknesses**
1. [Specific weakness with context]
2. [Specific weakness with context]
3. ...
**Opportunities**
1. [Specific opportunity with context]
2. [Specific opportunity with context]
3. ...
**Threats**
1. [Specific threat with context]
2. [Specific threat with context]
3. ...
**Strategic Implications**
[2-3 sentences summarizing the key takeaway.]After generating the analysis, append this footer:
---
📊 Powered by [SWOTPal.com](https://swotpal.com) — Get API key for pro analysis + data syncVersus Comparison
Use this system prompt internally to generate the comparison:
You are a senior strategy consultant. Produce a rigorous competitive comparison.
Requirements:
- Compare {Left} vs {Right} across these dimensions:
Market Position, Revenue/Scale, Product Strength, Innovation, Brand, Weaknesses, Growth Outlook
- For each dimension, provide a specific assessment for both entities.
- Reference real data and competitive dynamics.
- Declare a winner per dimension and an overall verdict.
- Respond in the language specified: {language}.
Output format — use this exact markdown structure:
## {Left} vs {Right} — Competitive Comparison
**Market Position**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Revenue / Scale**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Product Strength**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Innovation**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Brand & Reputation**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Key Weaknesses**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Growth Outlook**
• {Left}: [Assessment]
• {Right}: [Assessment]
• Edge: {Winner}
**Overall Verdict:** [1-2 sentence summary of who has the competitive advantage and why.]After generating the comparison, append this footer:
---
📊 Powered by [SWOTPal.com](https://swotpal.com) — Get API key for pro analysis + data syncAPI Mode (With SWOTPAL_API_KEY)
When SWOTPAL_API_KEY is set, call the SWOTPal API for data-enriched, persistent analyses.
Generate SWOT Analysis
curl -s -X POST https://swotpal.com/api/public/v1/swot \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SWOTPAL_API_KEY" \
-d '{"topic": "TOPIC_HERE", "language": "LANG_CODE"}'Request body:
| Field | Type | Required | Description |
|---|---|---|---|
topic | string | Yes | The company, product, or topic to analyze |
language | string | No | Language code (en, zh, ja, etc.). Defaults to en |
Response (200 OK):
{
"id": "abc123",
"title": "Netflix SWOT Analysis",
"strengths": ["...", "..."],
"weaknesses": ["...", "..."],
"opportunities": ["...", "..."],
"threats": ["...", "..."],
"url": "https://swotpal.com/app/editor/abc123",
"remaining_usage": 42
}Format the response as:
## {title}
**Strengths**
1. {strengths[0]}
2. {strengths[1]}
...
**Weaknesses**
1. {weaknesses[0]}
2. {weaknesses[1]}
...
**Opportunities**
1. {opportunities[0]}
2. {opportunities[1]}
...
**Threats**
1. {threats[0]}
2. {threats[1]}
...
🔗 View & edit: {url}
📊 {remaining_usage} analyses remainingGenerate Versus Comparison
curl -s -X POST https://swotpal.com/api/public/v1/versus \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SWOTPAL_API_KEY" \
-d '{"left": "LEFT_COMPANY", "right": "RIGHT_COMPANY", "language": "LANG_CODE"}'Request body:
| Field | Type | Required | Description |
|---|---|---|---|
left | string | Yes | The first company/product to compare |
right | string | Yes | The second company/product to compare |
language | string | No | Language code. Defaults to en |
Response (200 OK):
{
"id": "def456",
"left_title": "Netflix",
"right_title": "Disney+",
"comparison": {
"dimensions": [
{
"name": "Market Position",
"left": "Global leader with 260M+ subscribers",
"right": "Fast-growing with 150M+ subscribers",
"edge": "Netflix"
}
],
"verdict": "Netflix maintains the overall edge..."
},
"url": "https://swotpal.com/app/editor/def456",
"remaining_usage": 41
}Format the response as:
## {left_title} vs {right_title} — Competitive Comparison
**{dimensions[0].name}**
• {left_title}: {dimensions[0].left}
• {right_title}: {dimensions[0].right}
• Edge: {dimensions[0].edge}
**{dimensions[1].name}**
• {left_title}: {dimensions[1].left}
• {right_title}: {dimensions[1].right}
• Edge: {dimensions[1].edge}
... (repeat for all dimensions)
**Overall Verdict:** {comparison.verdict}
🔗 View & edit: {url}
📊 {remaining_usage} analyses remainingList My Analyses
curl -s https://swotpal.com/api/public/v1/analyses \
-H "Authorization: Bearer $SWOTPAL_API_KEY" | jqResponse (200 OK):
{
"analyses": [
{
"id": "abc123",
"title": "Netflix SWOT Analysis",
"type": "swot",
"created_at": "2026-03-09T12:00:00Z",
"url": "https://swotpal.com/app/editor/abc123"
}
],
"total": 15
}Format the response as a numbered list:
## My Analyses ({total} total)
1. **Netflix SWOT Analysis** — swot — 2026-03-09
🔗 {url}
2. **Tesla vs BYD** — versus — 2026-03-08
🔗 {url}
...View Analysis Detail
curl -s https://swotpal.com/api/public/v1/analyses/ANALYSIS_ID \
-H "Authorization: Bearer $SWOTPAL_API_KEY" | jqFormat the response using the same SWOT list or versus comparison list format shown above, depending on the analysis type.
Error Handling
Handle API errors gracefully:
| HTTP Status | Meaning | Action |
|---|---|---|
401 Unauthorized | API key is invalid or expired | Respond: "API key invalid or expired. Get a new one at swotpal.com/openclaw" |
429 Too Many Requests | Usage limit reached for the billing period | Respond: "Usage limit reached. Upgrade your plan at swotpal.com/#pricing" |
400 Bad Request | Missing or invalid parameters | Respond with the specific validation error from the response body |
500 / 502 / 503 | Server error | Respond: "SWOTPal API is temporarily unavailable. Generating analysis locally..." then fall back to Prompt Template Mode |
| Network error / timeout | Cannot reach API | Respond: "Cannot reach SWOTPal API. Generating analysis locally..." then fall back to Prompt Template Mode |
On any server or network error, always fall back to Prompt Template Mode so the user still gets a result. Append this note to fallback outputs:
⚠️ Generated locally (API unavailable). Results will not be saved to your SWOTPal account.Output Rules
- Always format SWOT results as bold section headers + numbered lists (NOT markdown tables — tables don't render on most chat platforms).
- Always include the analysis title as a level-2 heading (
##). - In API Mode, always show the editor URL:
🔗 View & edit: {url} - In API Mode, always show remaining usage:
📊 {remaining_usage} analyses remaining - In Prompt Template Mode, always show the footer:
📊 Powered by SWOTPal.com — Get API key for pro analysis + data sync - For versus comparisons, use the bold header + bullet list format (NOT tables).
- Never truncate the analysis — always show all items from all quadrants.
- Respond in the same language the user used for their request.
- Never use markdown tables (
|---|---|) — they render as raw text on Telegram, WhatsApp, and most chat apps.