[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M794CM1ASB7GDD2X126XGKT0":3,"skill-same:01M794CM1ASB7GDD2X126XGKT0":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M794CM1ASB7GDD2X126XGKT0","perplexity-local-dev-loop",null,"Configure Perplexity local development with mocking, testing, and hot reload.\nUse when setting up a development environment, configuring test workflows,\nor establishing a fast iteration cycle with Perplexity Sonar API.\nTrigger with phrases like \"perplexity dev setup\", \"perplexity local development\",\n\"perplexity dev environment\", \"develop with perplexity\", \"mock perplexity\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--perplexity-pack--perplexity-local-dev-loop\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: perplexity-local-dev-loop\ndescription: |\n  Configure Perplexity local development with mocking, testing, and hot reload.\n  Use when setting up a development environment, configuring test workflows,\n  or establishing a fast iteration cycle with Perplexity Sonar API.\n  Trigger with phrases like \"perplexity dev setup\", \"perplexity local development\",\n  \"perplexity dev environment\", \"develop with perplexity\", \"mock perplexity\".\nallowed-tools: Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, perplexity, testing, workflow]\n---\n# Perplexity Local Dev Loop\n\n## Overview\nSet up a fast, cost-effective local development workflow for Perplexity Sonar API. Key challenge: every real API call performs a web search and costs money, so mocking and caching are essential for development.\n\n## Prerequisites\n- Completed `perplexity-install-auth` setup\n- Node.js 18+ with npm\u002Fpnpm\n- `vitest` for testing\n\n## Instructions\n\n### Step 1: Project Structure\n```\nmy-perplexity-project\u002F\n├── src\u002F\n│   ├── perplexity\u002F\n│   │   ├── client.ts       # OpenAI client wrapper for Perplexity\n│   │   ├── search.ts       # Search functions with citation handling\n│   │   └── types.ts        # Response type extensions\n│   └── index.ts\n├── tests\u002F\n│   ├── fixtures\u002F           # Saved API responses for mocking\n│   │   └── sonar-response.json\n│   ├── perplexity.test.ts\n│   └── setup.ts\n├── .env.local              # API key (git-ignored)\n├── .env.example            # Template\n└── package.json\n```\n\n### Step 2: Type-Safe Client Wrapper\n```typescript\n\u002F\u002F src\u002Fperplexity\u002Fclient.ts\nimport OpenAI from \"openai\";\n\nexport interface PerplexityResponse extends OpenAI.ChatCompletion {\n  citations?: string[];\n  search_results?: Array\u003C{\n    title: string;\n    url: string;\n    snippet: string;\n  }>;\n  related_questions?: string[];\n}\n\nexport type PerplexityModel = \"sonar\" | \"sonar-pro\" | \"sonar-reasoning-pro\" | \"sonar-deep-research\";\n\nexport function createClient(apiKey?: string): OpenAI {\n  return new OpenAI({\n    apiKey: apiKey || process.env.PERPLEXITY_API_KEY,\n    baseURL: \"https:\u002F\u002Fapi.perplexity.ai\",\n  });\n}\n\nexport async function search(\n  client: OpenAI,\n  query: string,\n  opts: {\n    model?: PerplexityModel;\n    systemPrompt?: string;\n    maxTokens?: number;\n    searchRecencyFilter?: \"hour\" | \"day\" | \"week\" | \"month\";\n    searchDomainFilter?: string[];\n  } = {}\n): Promise\u003CPerplexityResponse> {\n  const response = await client.chat.completions.create({\n    model: opts.model || \"sonar\",\n    messages: [\n      ...(opts.systemPrompt\n        ? [{ role: \"system\" as const, content: opts.systemPrompt }]\n        : []),\n      { role: \"user\" as const, content: query },\n    ],\n    max_tokens: opts.maxTokens,\n    ...(opts.searchRecencyFilter && { search_recency_filter: opts.searchRecencyFilter }),\n    ...(opts.searchDomainFilter && { search_domain_filter: opts.searchDomainFilter }),\n  } as any);\n\n  return response as unknown as PerplexityResponse;\n}\n```\n\n### Step 3: Save Fixtures for Offline Development\n```typescript\n\u002F\u002F scripts\u002Fcapture-fixture.ts\nimport { createClient, search } from \"..\u002Fsrc\u002Fperplexity\u002Fclient\";\nimport { writeFileSync } from \"fs\";\n\nasync function captureFixture() {\n  const client = createClient();\n  const response = await search(client, \"What is TypeScript 5.5?\");\n\n  writeFileSync(\n    \"tests\u002Ffixtures\u002Fsonar-response.json\",\n    JSON.stringify(response, null, 2)\n  );\n  console.log(\"Fixture saved with\", (response.citations || []).length, \"citations\");\n}\n\ncaptureFixture();\n```\n\n### Step 4: Mock Client for Tests\n```typescript\n\u002F\u002F tests\u002Fsetup.ts\nimport { vi } from \"vitest\";\nimport fixture from \".\u002Ffixtures\u002Fsonar-response.json\";\n\nexport function mockPerplexityClient() {\n  return {\n    chat: {\n      completions: {\n        create: vi.fn().mockResolvedValue(fixture),\n      },\n    },\n  };\n}\n```\n\n### Step 5: Write Tests\n```typescript\n\u002F\u002F tests\u002Fperplexity.test.ts\nimport { describe, it, expect } from \"vitest\";\nimport { mockPerplexityClient } from \".\u002Fsetup\";\nimport { search } from \"..\u002Fsrc\u002Fperplexity\u002Fclient\";\n\ndescribe(\"Perplexity Search\", () => {\n  it(\"returns answer with citations\", async () => {\n    const client = mockPerplexityClient() as any;\n    const result = await search(client, \"test query\");\n\n    expect(result.choices[0].message.content).toBeDefined();\n    expect(result.citations).toBeDefined();\n    expect(result.citations!.length).toBeGreaterThan(0);\n  });\n\n  it.skipIf(!process.env.PERPLEXITY_API_KEY)(\n    \"live API returns citations\",\n    async () => {\n      const { createClient, search } = await import(\"..\u002Fsrc\u002Fperplexity\u002Fclient\");\n      const client = createClient();\n      const result = await search(client, \"What is Node.js?\", {\n        model: \"sonar\",\n        maxTokens: 100,\n      });\n      expect(result.citations!.length).toBeGreaterThan(0);\n    }\n  );\n});\n```\n\n### Step 6: Dev Scripts\n```json\n{\n  \"scripts\": {\n    \"dev\": \"tsx watch src\u002Findex.ts\",\n    \"test\": \"vitest\",\n    \"test:watch\": \"vitest --watch\",\n    \"test:live\": \"PERPLEXITY_API_KEY=$PERPLEXITY_API_KEY vitest --run\",\n    \"capture-fixtures\": \"tsx scripts\u002Fcapture-fixture.ts\"\n  }\n}\n```\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Fixture missing | Never captured | Run `npm run capture-fixtures` once |\n| Tests hit real API | Missing mock | Ensure mock client is injected |\n| Stale fixtures | API response format changed | Re-capture fixtures |\n| High dev costs | Making live calls in loop | Use fixtures; reserve live calls for CI |\n\n## Output\n- Type-safe Perplexity client wrapper\n- Fixture-based test suite that runs offline\n- Live integration test gated on API key presence\n- Hot-reload dev server\n\n## Resources\n- [Vitest Documentation](https:\u002F\u002Fvitest.dev\u002F)\n- [Perplexity API Reference](https:\u002F\u002Fdocs.perplexity.ai\u002Fapi-reference\u002Fchat-completions-post)\n\n## Next Steps\nSee `perplexity-sdk-patterns` for production-ready code patterns.\n","# Perplexity Local Dev Loop\n\n## Overview\nSet up a fast, cost-effective local development workflow for Perplexity Sonar API. Key challenge: every real API call performs a web search and costs money, so mocking and caching are essential for development.\n\n## Prerequisites\n- Completed `perplexity-install-auth` setup\n- Node.js 18+ with npm\u002Fpnpm\n- `vitest` for testing\n\n## Instructions\n\n### Step 1: Project Structure\n```\nmy-perplexity-project\u002F\n├── src\u002F\n│   ├── perplexity\u002F\n│   │   ├── client.ts       # OpenAI client wrapper for Perplexity\n│   │   ├── search.ts       # Search functions with citation handling\n│   │   └── types.ts        # Response type extensions\n│   └── index.ts\n├── tests\u002F\n│   ├── fixtures\u002F           # Saved API responses for mocking\n│   │   └── sonar-response.json\n│   ├── perplexity.test.ts\n│   └── setup.ts\n├── .env.local              # API key (git-ignored)\n├── .env.example            # Template\n└── package.json\n```\n\n### Step 2: Type-Safe Client Wrapper\n```typescript\n\u002F\u002F src\u002Fperplexity\u002Fclient.ts\nimport OpenAI from \"openai\";\n\nexport interface PerplexityResponse extends OpenAI.ChatCompletion {\n  citations?: string[];\n  search_results?: Array\u003C{\n    title: string;\n    url: string;\n    snippet: string;\n  }>;\n  related_questions?: string[];\n}\n\nexport type PerplexityModel = \"sonar\" | \"sonar-pro\" | \"sonar-reasoning-pro\" | \"sonar-deep-research\";\n\nexport function createClient(apiKey?: string): OpenAI {\n  return new OpenAI({\n    apiKey: apiKey || process.env.PERPLEXITY_API_KEY,\n    baseURL: \"https:\u002F\u002Fapi.perplexity.ai\",\n  });\n}\n\nexport async function search(\n  client: OpenAI,\n  query: string,\n  opts: {\n    model?: PerplexityModel;\n    systemPrompt?: string;\n    maxTokens?: number;\n    searchRecencyFilter?: \"hour\" | \"day\" | \"week\" | \"month\";\n    searchDomainFilter?: string[];\n  } = {}\n): Promise\u003CPerplexityResponse> {\n  const response = await client.chat.completions.create({\n    model: opts.model || \"sonar\",\n    messages: [\n      ...(opts.systemPrompt\n        ? [{ role: \"system\" as const, content: opts.systemPrompt }]\n        : []),\n      { role: \"user\" as const, content: query },\n    ],\n    max_tokens: opts.maxTokens,\n    ...(opts.searchRecencyFilter && { search_recency_filter: opts.searchRecencyFilter }),\n    ...(opts.searchDomainFilter && { search_domain_filter: opts.searchDomainFilter }),\n  } as any);\n\n  return response as unknown as PerplexityResponse;\n}\n```\n\n### Step 3: Save Fixtures for Offline Development\n```typescript\n\u002F\u002F scripts\u002Fcapture-fixture.ts\nimport { createClient, search } from \"..\u002Fsrc\u002Fperplexity\u002Fclient\";\nimport { writeFileSync } from \"fs\";\n\nasync function captureFixture() {\n  const client = createClient();\n  const response = await search(client, \"What is TypeScript 5.5?\");\n\n  writeFileSync(\n    \"tests\u002Ffixtures\u002Fsonar-response.json\",\n    JSON.stringify(response, null, 2)\n  );\n  console.log(\"Fixture saved with\", (response.citations || []).length, \"citations\");\n}\n\ncaptureFixture();\n```\n\n### Step 4: Mock Client for Tests\n```typescript\n\u002F\u002F tests\u002Fsetup.ts\nimport { vi } from \"vitest\";\nimport fixture from \".\u002Ffixtures\u002Fsonar-response.json\";\n\nexport function mockPerplexityClient() {\n  return {\n    chat: {\n      completions: {\n        create: vi.fn().mockResolvedValue(fixture),\n      },\n    },\n  };\n}\n```\n\n### Step 5: Write Tests\n```typescript\n\u002F\u002F tests\u002Fperplexity.test.ts\nimport { describe, it, expect } from \"vitest\";\nimport { mockPerplexityClient } from \".\u002Fsetup\";\nimport { search } from \"..\u002Fsrc\u002Fperplexity\u002Fclient\";\n\ndescribe(\"Perplexity Search\", () => {\n  it(\"returns answer with citations\", async () => {\n    const client = mockPerplexityClient() as any;\n    const result = await search(client, \"test query\");\n\n    expect(result.choices[0].message.content).toBeDefined();\n    expect(result.citations).toBeDefined();\n    expect(result.citations!.length).toBeGreaterThan(0);\n  });\n\n  it.skipIf(!process.env.PERPLEXITY_API_KEY)(\n    \"live API returns citations\",\n    async () => {\n      const { createClient, search } = await import(\"..\u002Fsrc\u002Fperplexity\u002Fclient\");\n      const client = createClient();\n      const result = await search(client, \"What is Node.js?\", {\n        model: \"sonar\",\n        maxTokens: 100,\n      });\n      expect(result.citations!.length).toBeGreaterThan(0);\n    }\n  );\n});\n```\n\n### Step 6: Dev Scripts\n```json\n{\n  \"scripts\": {\n    \"dev\": \"tsx watch src\u002Findex.ts\",\n    \"test\": \"vitest\",\n    \"test:watch\": \"vitest --watch\",\n    \"test:live\": \"PERPLEXITY_API_KEY=$PERPLEXITY_API_KEY vitest --run\",\n    \"capture-fixtures\": \"tsx scripts\u002Fcapture-fixture.ts\"\n  }\n}\n```\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Fixture missing | Never captured | Run `npm run capture-fixtures` once |\n| Tests hit real API | Missing mock | Ensure mock client is injected |\n| Stale fixtures | API response format changed | Re-capture fixtures |\n| High dev costs | Making live calls in loop | Use fixtures; reserve live calls for CI |\n\n## Output\n- Type-safe Perplexity client wrapper\n- Fixture-based test suite that runs offline\n- Live integration test gated on API key presence\n- Hot-reload dev server\n\n## Resources\n- [Vitest Documentation](https:\u002F\u002Fvitest.dev\u002F)\n- [Perplexity API Reference](https:\u002F\u002Fdocs.perplexity.ai\u002Fapi-reference\u002Fchat-completions-post)\n\n## Next Steps\nSee `perplexity-sdk-patterns` for production-ready code patterns.\n",{"name":5,"tags":24,"author":29,"license":15,"version":30,"description":31,"allowed-tools":32,"compatible-with":33},[25,26,27,28],"saas","perplexity","testing","workflow","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Configure Perplexity local development with mocking, testing, and hot reload.\nUse when setting up a development environment, configuring test workflows,\nor establishing a fast iteration cycle with Perplexity Sonar API.\nTrigger with phrases like \"perplexity dev setup\", \"perplexity local development\",\n\"perplexity dev environment\", \"develop with perplexity\", \"mock perplexity\".\n","Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--perplexity-pack--perplexity-local-dev-loop",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill perplexity-local-dev-loop",{"tool":49,"command":50},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill perplexity-local-dev-loop",{"tool":52,"command":53},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill perplexity-local-dev-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--perplexity-pack--perplexity-local-dev-loop\u002FSKILL.md",true,[],[58,65,72,79,86,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]