glean-local-dev-loop
Configure Glean local development with mock search responses, test datasources, and connector development workflow. Trigger: "glean dev setup", "glean local development", "glean connector development".
What this skill does
# Glean Local Dev Loop
## Overview
Local development workflow for Glean enterprise search API integration. Provides a fast feedback loop with mock search results, connector testing, and document indexing simulation so you can build custom datasource connectors and search UIs without needing a live Glean deployment. Toggle between mock mode for rapid connector iteration and sandbox mode for validating against your Glean instance.
## Environment Setup
```bash
cp .env.example .env
# Set your credentials:
# GLEAN_API_KEY=glean_xxxxxxxxxxxx
# GLEAN_INSTANCE=https://your-company.glean.com
# MOCK_MODE=true
npm install express axios dotenv tsx typescript @types/node
npm install -D vitest supertest @types/express
```
## Dev Server
```typescript
// src/dev/server.ts
import express from "express";
import { createProxyMiddleware } from "http-proxy-middleware";
const app = express();
app.use(express.json());
const MOCK = process.env.MOCK_MODE === "true";
if (!MOCK) {
app.use("/api", createProxyMiddleware({
target: process.env.GLEAN_INSTANCE,
changeOrigin: true,
headers: { Authorization: `Bearer ${process.env.GLEAN_API_KEY}` },
}));
} else {
const { mountMockRoutes } = require("./mocks");
mountMockRoutes(app);
}
app.listen(3003, () => console.log(`Glean dev server on :3003 [mock=${MOCK}]`));
```
## Mock Mode
```typescript
// src/dev/mocks.ts — realistic enterprise search responses
export function mountMockRoutes(app: any) {
app.post("/api/search", (req: any, res: any) => res.json({
results: [
{ title: "Q4 Engineering Roadmap", url: "https://wiki.co/roadmap", score: 0.97, datasource: "confluence",
snippets: [{ snippet: "The <b>roadmap</b> includes migration to..." }] },
{ title: "Onboarding Guide", url: "https://wiki.co/onboard", score: 0.88, datasource: "notion",
snippets: [{ snippet: "New hire <b>onboarding</b> steps..." }] },
],
totalCount: 2,
}));
app.post("/api/index/documents", (req: any, res: any) => res.json({
status: "OK", documentsIndexed: req.body.documents?.length || 0,
}));
app.get("/api/datasources", (_req: any, res: any) => res.json([
{ name: "confluence", displayName: "Confluence", docCount: 1250 },
{ name: "notion", displayName: "Notion", docCount: 430 },
]));
}
```
## Testing Workflow
```bash
npm run dev:mock & # Start mock server in background
npm run test # Unit tests with vitest
npm run test -- --watch # Watch mode for rapid iteration
MOCK_MODE=false npm run test:integration # Integration test against real Glean instance
```
## Debug Tips
- Use `curl -X POST http://localhost:3003/api/search -d '{"query":"test"}'` to verify mock search
- Glean connectors must return documents with `id`, `title`, `body.textContent`, and `datasource` fields
- Check connector transform output shape before pushing to the indexing API
- Enable verbose logging on the Glean SDK client to trace API call timing
- Verify OAuth scopes if search returns empty results against a live instance
## Error Handling
| Issue | Cause | Fix |
|-------|-------|-----|
| `401 Unauthorized` | Invalid API key or expired token | Regenerate at Glean admin console |
| `403 Forbidden` | Key lacks indexing scope | Request Indexing API permissions from admin |
| `400 Bad Request` | Malformed document payload | Validate required fields: id, title, body |
| `429 Rate Limited` | Too many indexing requests | Batch documents (max 100 per request) |
| `ECONNREFUSED :3003` | Dev server not running | Run `npm run dev:mock` first |
## Resources
- [Glean Indexing API](https://developers.glean.com/api-info/indexing/getting-started/overview)
- Glean Search API
## Next Steps
See `glean-debug-bundle`.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.