Extracts actionable information from GitHub issues for code exploration.
Parse issue title and body to identify:
Include this file when analyzing issues:
Use lib/issue-parser to extract keywords from the issue
Lines starting with error indicators:
Error:Exception:Failed:UncaughtTypeError:ReferenceError:Example:
Error: Authentication token expired
TypeError: Cannot read property 'user' of undefined
Extract: ["Authentication token expired", "Cannot read property 'user' of undefined"]
Text within triple backticks:
```javascript
function login() {
throw new Error("Timeout");
}
```
Extract: ["function login", "throw new Error", "Timeout"]
Patterns indicating files:
/ and ends with extension: src/auth/login.tsat Object.<anonymous> (/path/file.js:123:45)./components/Button.tsxRegex: ([./\w-]+\/[\w.-]+\.(ts|js|py|go|rs|java|rb|php))
Example:
The error occurs in src/auth/middleware.ts line 45
Extract: ["src/auth/middleware.ts"]
CamelCase or PascalCase identifiers:
AuthenticationErrorhandleLoginUserServiceRegex: \b[A-Z][a-zA-Z0-9]*\b|\b[a-z]+[A-Z][a-zA-Z0-9]*\b
Example:
The UserAuthenticator class throws an InvalidTokenError
Extract: ["UserAuthenticator", "InvalidTokenError"]
Multi-line stack traces with file:line:column format:
at login (/src/auth.ts:123:10)
at middleware (/src/server.ts:45:20)
at process (/node_modules/express/lib/router.js:284:15)
Extract:
["src/auth.ts", "src/server.ts"]["login", "middleware"]["123", "45"]URLs and API endpoints:
https://api.example.com/v1/authPOST /api/usersGET /healthRegex: (https?://[^\s]+)|((GET|POST|PUT|DELETE|PATCH)\s+/[\w/]+)
interface ParsedIssue {
errors: string[];
files: string[];
functions: string[];
stackTraces: StackTrace[];
keywords: string[];
}
interface StackTrace {
file: string;
line: number;
function: string;
}
function parseIssue(title: string, body: string): ParsedIssue {
// Combine title and body
const text = `${title}\n${body}`;
// Extract patterns
return {
errors: extractErrors(text),
files: extractFiles(text),
functions: extractFunctions(text),
stackTraces: extractStackTraces(text),
keywords: extractKeywords(text)
};
}
When using this parser, format extracted information as:
**Extracted Information:**
**Error Messages:**
- Authentication token expired
- Cannot read property 'user' of undefined
**Files Referenced:**
- src/auth/middleware.ts (line 45)
- src/server.ts
**Functions/Classes:**
- AuthenticationError
- handleLogin
- UserService
**Keywords:**
- authentication, token, timeout, session
1. Fetch issue: \`gh issue view <number> --json title,body\`
2. Parse with this library: extract errors, files, functions
3. Pass to code-explorer: use extracted keywords for search
4. Generate plan: reference found locations
Empty issue body:
No technical details:
Foreign language:
Very long issues:
Not included (intentionally):
Keep it simple: extract technical keywords for code search.