claude-gh-ticket-gen 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +406 -0
  3. package/bin/claude-ticket-gen.js +6 -0
  4. package/dist/cli/commands/config.d.ts +8 -0
  5. package/dist/cli/commands/config.d.ts.map +1 -0
  6. package/dist/cli/commands/config.js +84 -0
  7. package/dist/cli/commands/config.js.map +1 -0
  8. package/dist/cli/commands/generate.d.ts +9 -0
  9. package/dist/cli/commands/generate.d.ts.map +1 -0
  10. package/dist/cli/commands/generate.js +243 -0
  11. package/dist/cli/commands/generate.js.map +1 -0
  12. package/dist/cli/commands/init.d.ts +8 -0
  13. package/dist/cli/commands/init.d.ts.map +1 -0
  14. package/dist/cli/commands/init.js +160 -0
  15. package/dist/cli/commands/init.js.map +1 -0
  16. package/dist/cli/index.d.ts +6 -0
  17. package/dist/cli/index.d.ts.map +1 -0
  18. package/dist/cli/index.js +54 -0
  19. package/dist/cli/index.js.map +1 -0
  20. package/dist/cli/ui.d.ts +38 -0
  21. package/dist/cli/ui.d.ts.map +1 -0
  22. package/dist/cli/ui.js +148 -0
  23. package/dist/cli/ui.js.map +1 -0
  24. package/dist/core/config-manager.d.ts +48 -0
  25. package/dist/core/config-manager.d.ts.map +1 -0
  26. package/dist/core/config-manager.js +165 -0
  27. package/dist/core/config-manager.js.map +1 -0
  28. package/dist/core/duplicate-detector.d.ts +13 -0
  29. package/dist/core/duplicate-detector.d.ts.map +1 -0
  30. package/dist/core/duplicate-detector.js +123 -0
  31. package/dist/core/duplicate-detector.js.map +1 -0
  32. package/dist/core/github.d.ts +46 -0
  33. package/dist/core/github.d.ts.map +1 -0
  34. package/dist/core/github.js +187 -0
  35. package/dist/core/github.js.map +1 -0
  36. package/dist/core/parser.d.ts +17 -0
  37. package/dist/core/parser.d.ts.map +1 -0
  38. package/dist/core/parser.js +177 -0
  39. package/dist/core/parser.js.map +1 -0
  40. package/dist/core/types.d.ts +89 -0
  41. package/dist/core/types.d.ts.map +1 -0
  42. package/dist/core/types.js +28 -0
  43. package/dist/core/types.js.map +1 -0
  44. package/dist/templates/issue-template.d.ts +17 -0
  45. package/dist/templates/issue-template.d.ts.map +1 -0
  46. package/dist/templates/issue-template.js +87 -0
  47. package/dist/templates/issue-template.js.map +1 -0
  48. package/dist/templates/parsing-prompt.d.ts +5 -0
  49. package/dist/templates/parsing-prompt.d.ts.map +1 -0
  50. package/dist/templates/parsing-prompt.js +70 -0
  51. package/dist/templates/parsing-prompt.js.map +1 -0
  52. package/dist/utils/logger.d.ts +69 -0
  53. package/dist/utils/logger.d.ts.map +1 -0
  54. package/dist/utils/logger.js +136 -0
  55. package/dist/utils/logger.js.map +1 -0
  56. package/dist/utils/validators.d.ts +45 -0
  57. package/dist/utils/validators.d.ts.map +1 -0
  58. package/dist/utils/validators.js +80 -0
  59. package/dist/utils/validators.js.map +1 -0
  60. package/examples/ROADMAP.example.md +84 -0
  61. package/examples/config.example.json +22 -0
  62. package/package.json +54 -0
@@ -0,0 +1,70 @@
1
+ /**
2
+ * AI prompt template for document parsing
3
+ */
4
+ export function getParsingPrompt(documentContent) {
5
+ return `You are a specialized parser that extracts structured task information from planning documents, roadmaps, and project specifications.
6
+
7
+ Your task is to analyze the following document and extract ALL tasks, features, and actionable items, regardless of their format (checkboxes, bullet points, numbered lists, or plain text).
8
+
9
+ Document to analyze:
10
+ ---
11
+ ${documentContent}
12
+ ---
13
+
14
+ Instructions:
15
+ 1. Identify ALL tasks and actionable items in the document
16
+ 2. For each task, determine:
17
+ - Title: A clear, concise title (imperative form, e.g., "Add user authentication")
18
+ - Description: Brief summary (1-2 sentences max, under 150 chars). Include key details only.
19
+ - Priority: P0 (critical), P1 (high), P2 (medium), P3 (low)
20
+ * Look for keywords like "critical", "urgent", "important", "nice-to-have", "optional"
21
+ * Consider placement and context (early sections often higher priority)
22
+ * Default to P2 if unclear
23
+ - Type: feature, bug, tech-debt, or documentation
24
+ - Phase/Section: Which section or phase of the document it belongs to
25
+ - Status: Is it marked as completed? (✓, [x], "done", "completed")
26
+ - Optional: Is it marked as optional or nice-to-have?
27
+ - Labels: Relevant tags (extract from context, e.g., "backend", "frontend", "api")
28
+ - Subtasks: List of strings, keep brief (3-5 items max)
29
+ - Metadata: milestone, target date, dependencies (if mentioned)
30
+
31
+ 3. Be intelligent about extraction:
32
+ - Don't require specific markdown formats
33
+ - Understand various checkbox syntaxes: [ ], [x], ☐, ✓, etc.
34
+ - Recognize tasks in plain prose ("We need to...", "Should implement...")
35
+ - Infer context from headings and sections
36
+ - Combine split information (title in heading, details in paragraph)
37
+
38
+ 4. Return ONLY a valid JSON array with this exact structure:
39
+
40
+ [
41
+ {
42
+ "title": "string",
43
+ "description": "string",
44
+ "phase": "string or null",
45
+ "priority": "P0" | "P1" | "P2" | "P3",
46
+ "labels": ["string"],
47
+ "isCompleted": boolean,
48
+ "isOptional": boolean,
49
+ "type": "feature" | "bug" | "tech-debt" | "documentation",
50
+ "subTasks": ["string"] or null,
51
+ "metadata": {
52
+ "milestone": "string or null",
53
+ "target": "string or null",
54
+ "dependencies": ["string"] or null
55
+ }
56
+ }
57
+ ]
58
+
59
+ Important:
60
+ - Return ONLY the JSON array, no explanations or markdown formatting
61
+ - Ensure all JSON is valid and properly escaped (escape quotes, newlines, etc.)
62
+ - Use \\n for newlines within strings, not actual line breaks
63
+ - Escape all double quotes within string values as \\"
64
+ - Keep descriptions BRIEF (under 150 chars) - details will be in the full issue
65
+ - Keep subtask lists short (3-5 items max)
66
+ - If no tasks found, return an empty array: []
67
+ - Be thorough but concise - extract every actionable item with minimal text
68
+ - For large documents, prioritize completeness over verbosity`;
69
+ }
70
+ //# sourceMappingURL=parsing-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsing-prompt.js","sourceRoot":"","sources":["../../src/templates/parsing-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,UAAU,gBAAgB,CAAC,eAAuB;IACtD,OAAO;;;;;;EAMP,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAyD6C,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Console output utilities with formatting
3
+ */
4
+ /**
5
+ * Log levels
6
+ */
7
+ export declare const logger: {
8
+ /**
9
+ * Success message (green)
10
+ */
11
+ success(message: string): void;
12
+ /**
13
+ * Error message (red)
14
+ */
15
+ error(message: string): void;
16
+ /**
17
+ * Warning message (yellow)
18
+ */
19
+ warning(message: string): void;
20
+ /**
21
+ * Info message (blue)
22
+ */
23
+ info(message: string): void;
24
+ /**
25
+ * Plain message
26
+ */
27
+ log(message: string): void;
28
+ /**
29
+ * Dim/secondary text
30
+ */
31
+ dim(message: string): void;
32
+ /**
33
+ * Bold text
34
+ */
35
+ bold(message: string): void;
36
+ /**
37
+ * Formatted header
38
+ */
39
+ header(message: string): void;
40
+ /**
41
+ * Section divider
42
+ */
43
+ divider(): void;
44
+ /**
45
+ * Empty line
46
+ */
47
+ newline(): void;
48
+ };
49
+ /**
50
+ * Format priority with color
51
+ */
52
+ export declare function formatPriority(priority: string): string;
53
+ /**
54
+ * Format task type with color
55
+ */
56
+ export declare function formatType(type: string): string;
57
+ /**
58
+ * Format status with color
59
+ */
60
+ export declare function formatStatus(status: string): string;
61
+ /**
62
+ * Truncate text with ellipsis
63
+ */
64
+ export declare function truncate(text: string, maxLength: number): string;
65
+ /**
66
+ * Format a URL with highlighting
67
+ */
68
+ export declare function formatUrl(url: string): string;
69
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;OAEG;qBACc,MAAM,GAAG,IAAI;IAI9B;;OAEG;mBACY,MAAM,GAAG,IAAI;IAI5B;;OAEG;qBACc,MAAM,GAAG,IAAI;IAI9B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAI3B;;OAEG;iBACU,MAAM,GAAG,IAAI;IAI1B;;OAEG;iBACU,MAAM,GAAG,IAAI;IAI1B;;OAEG;kBACW,MAAM,GAAG,IAAI;IAI3B;;OAEG;oBACa,MAAM,GAAG,IAAI;IAM7B;;OAEG;eACQ,IAAI;IAIf;;OAEG;eACQ,IAAI;CAGhB,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAavD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAa/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWnD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Console output utilities with formatting
3
+ */
4
+ import chalk from 'chalk';
5
+ /**
6
+ * Log levels
7
+ */
8
+ export const logger = {
9
+ /**
10
+ * Success message (green)
11
+ */
12
+ success(message) {
13
+ console.log(chalk.green('✓'), message);
14
+ },
15
+ /**
16
+ * Error message (red)
17
+ */
18
+ error(message) {
19
+ console.error(chalk.red('✗'), message);
20
+ },
21
+ /**
22
+ * Warning message (yellow)
23
+ */
24
+ warning(message) {
25
+ console.warn(chalk.yellow('⚠'), message);
26
+ },
27
+ /**
28
+ * Info message (blue)
29
+ */
30
+ info(message) {
31
+ console.log(chalk.blue('ℹ'), message);
32
+ },
33
+ /**
34
+ * Plain message
35
+ */
36
+ log(message) {
37
+ console.log(message);
38
+ },
39
+ /**
40
+ * Dim/secondary text
41
+ */
42
+ dim(message) {
43
+ console.log(chalk.dim(message));
44
+ },
45
+ /**
46
+ * Bold text
47
+ */
48
+ bold(message) {
49
+ console.log(chalk.bold(message));
50
+ },
51
+ /**
52
+ * Formatted header
53
+ */
54
+ header(message) {
55
+ console.log();
56
+ console.log(chalk.bold.cyan(message));
57
+ console.log(chalk.cyan('─'.repeat(message.length)));
58
+ },
59
+ /**
60
+ * Section divider
61
+ */
62
+ divider() {
63
+ console.log(chalk.dim('─'.repeat(50)));
64
+ },
65
+ /**
66
+ * Empty line
67
+ */
68
+ newline() {
69
+ console.log();
70
+ },
71
+ };
72
+ /**
73
+ * Format priority with color
74
+ */
75
+ export function formatPriority(priority) {
76
+ switch (priority) {
77
+ case 'P0':
78
+ return chalk.red.bold(priority);
79
+ case 'P1':
80
+ return chalk.yellow.bold(priority);
81
+ case 'P2':
82
+ return chalk.blue(priority);
83
+ case 'P3':
84
+ return chalk.gray(priority);
85
+ default:
86
+ return priority;
87
+ }
88
+ }
89
+ /**
90
+ * Format task type with color
91
+ */
92
+ export function formatType(type) {
93
+ switch (type) {
94
+ case 'feature':
95
+ return chalk.cyan(type);
96
+ case 'bug':
97
+ return chalk.red(type);
98
+ case 'tech-debt':
99
+ return chalk.magenta(type);
100
+ case 'documentation':
101
+ return chalk.green(type);
102
+ default:
103
+ return type;
104
+ }
105
+ }
106
+ /**
107
+ * Format status with color
108
+ */
109
+ export function formatStatus(status) {
110
+ switch (status) {
111
+ case 'completed':
112
+ return chalk.green('✓ ' + status);
113
+ case 'in-progress':
114
+ return chalk.yellow('⟳ ' + status);
115
+ case 'todo':
116
+ return chalk.gray('○ ' + status);
117
+ default:
118
+ return status;
119
+ }
120
+ }
121
+ /**
122
+ * Truncate text with ellipsis
123
+ */
124
+ export function truncate(text, maxLength) {
125
+ if (text.length <= maxLength) {
126
+ return text;
127
+ }
128
+ return text.substring(0, maxLength - 3) + '...';
129
+ }
130
+ /**
131
+ * Format a URL with highlighting
132
+ */
133
+ export function formatUrl(url) {
134
+ return chalk.cyan.underline(url);
135
+ }
136
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;;OAEG;IACH,OAAO,CAAC,OAAe;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAe;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAe;QACrB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,OAAe;QACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,OAAe;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAe;QACpB,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,IAAI;YACP,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,KAAK,IAAI;YACP,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,KAAK,IAAI;YACP,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,KAAK,IAAI;YACP,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,KAAK,KAAK;YACR,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,eAAe;YAClB,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;QACpC,KAAK,aAAa;YAChB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;QACnC;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,SAAiB;IACtD,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Input validation utilities
3
+ */
4
+ import { Priority } from '../core/types.js';
5
+ /**
6
+ * Validate Anthropic API key format
7
+ */
8
+ export declare function validateApiKey(key: string): boolean;
9
+ /**
10
+ * Validate GitHub repository format (owner/repo)
11
+ */
12
+ export declare function validateRepoFormat(repo: string): boolean;
13
+ /**
14
+ * Validate file path exists
15
+ */
16
+ export declare function validateFilePath(filePath: string): boolean;
17
+ /**
18
+ * Validate priority level
19
+ */
20
+ export declare function validatePriority(priority: string): priority is Priority;
21
+ /**
22
+ * Validate hex color code
23
+ */
24
+ export declare function validateHexColor(color: string): boolean;
25
+ /**
26
+ * Validate duplicate threshold (0-1)
27
+ */
28
+ export declare function validateThreshold(threshold: number): boolean;
29
+ /**
30
+ * Get validation error message for API key
31
+ */
32
+ export declare function getApiKeyError(): string;
33
+ /**
34
+ * Get validation error message for repo format
35
+ */
36
+ export declare function getRepoFormatError(): string;
37
+ /**
38
+ * Get validation error message for file path
39
+ */
40
+ export declare function getFilePathError(path: string): string;
41
+ /**
42
+ * Get validation error message for priority
43
+ */
44
+ export declare function getPriorityError(): string;
45
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,QAAQ,CAEvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Input validation utilities
3
+ */
4
+ import { existsSync } from 'fs';
5
+ /**
6
+ * Validate Anthropic API key format
7
+ */
8
+ export function validateApiKey(key) {
9
+ if (!key || typeof key !== 'string') {
10
+ return false;
11
+ }
12
+ // Anthropic API keys start with sk-ant-
13
+ return key.startsWith('sk-ant-') && key.length > 20;
14
+ }
15
+ /**
16
+ * Validate GitHub repository format (owner/repo)
17
+ */
18
+ export function validateRepoFormat(repo) {
19
+ if (!repo || typeof repo !== 'string') {
20
+ return false;
21
+ }
22
+ const parts = repo.split('/');
23
+ return parts.length === 2 && parts[0].length > 0 && parts[1].length > 0;
24
+ }
25
+ /**
26
+ * Validate file path exists
27
+ */
28
+ export function validateFilePath(filePath) {
29
+ if (!filePath || typeof filePath !== 'string') {
30
+ return false;
31
+ }
32
+ return existsSync(filePath);
33
+ }
34
+ /**
35
+ * Validate priority level
36
+ */
37
+ export function validatePriority(priority) {
38
+ return ['P0', 'P1', 'P2', 'P3'].includes(priority);
39
+ }
40
+ /**
41
+ * Validate hex color code
42
+ */
43
+ export function validateHexColor(color) {
44
+ if (!color || typeof color !== 'string') {
45
+ return false;
46
+ }
47
+ // Valid hex color: 6 hex digits (without #)
48
+ return /^[0-9A-Fa-f]{6}$/.test(color);
49
+ }
50
+ /**
51
+ * Validate duplicate threshold (0-1)
52
+ */
53
+ export function validateThreshold(threshold) {
54
+ return typeof threshold === 'number' && threshold >= 0 && threshold <= 1;
55
+ }
56
+ /**
57
+ * Get validation error message for API key
58
+ */
59
+ export function getApiKeyError() {
60
+ return 'Invalid API key format. Anthropic API keys should start with "sk-ant-"';
61
+ }
62
+ /**
63
+ * Get validation error message for repo format
64
+ */
65
+ export function getRepoFormatError() {
66
+ return 'Invalid repository format. Expected: "owner/repo" (e.g., "octocat/Hello-World")';
67
+ }
68
+ /**
69
+ * Get validation error message for file path
70
+ */
71
+ export function getFilePathError(path) {
72
+ return `File not found: ${path}`;
73
+ }
74
+ /**
75
+ * Get validation error message for priority
76
+ */
77
+ export function getPriorityError() {
78
+ return 'Invalid priority. Must be one of: P0, P1, P2, P3';
79
+ }
80
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAGhC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wCAAwC;IACxC,OAAO,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,4CAA4C;IAC5C,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,wEAAwE,CAAC;AAClF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,iFAAiF,CAAC;AAC3F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,mBAAmB,IAAI,EAAE,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,kDAAkD,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,84 @@
1
+ # Project Roadmap Example
2
+
3
+ This is an example roadmap document that demonstrates various formats that claude-ticket-gen can parse.
4
+
5
+ ## Phase 1: Foundation (Critical)
6
+
7
+ ### Core Infrastructure
8
+ - [ ] Set up authentication system (P0)
9
+ - Implement JWT tokens
10
+ - Add refresh token rotation
11
+ - Create middleware for protected routes
12
+ - [ ] Design and implement database schema (P0)
13
+ - User tables
14
+ - Relationships and indexes
15
+ - [ ] Configure CI/CD pipeline (P1)
16
+ - GitHub Actions for testing
17
+ - Automated deployments to staging
18
+
19
+ ### API Development
20
+ - [x] Create base API structure (P1) - COMPLETED
21
+ - [ ] Implement user CRUD endpoints (P1)
22
+ - [ ] Add input validation and error handling (P1)
23
+ - [ ] Write API documentation (P2)
24
+
25
+ ## Phase 2: Features
26
+
27
+ ### User Features
28
+ The following features need to be implemented for the user dashboard:
29
+
30
+ 1. User profile management (P1)
31
+ - Allow users to update their profile
32
+ - Add avatar upload functionality
33
+ - Email verification flow
34
+
35
+ 2. Notification system (P2)
36
+ - In-app notifications
37
+ - Email notifications
38
+ - Push notifications (optional)
39
+
40
+ 3. Search functionality (P2)
41
+ - Full-text search
42
+ - Filters and sorting
43
+ - Search history
44
+
45
+ ### Admin Features
46
+ - [ ] Admin dashboard (P1)
47
+ - [ ] User management interface (P1)
48
+ - [ ] Analytics and reporting (P2, optional)
49
+
50
+ ## Phase 3: Polish & Optimization
51
+
52
+ ### Performance
53
+ We need to optimize the application for better performance:
54
+ - Implement caching strategy (P1)
55
+ - Optimize database queries (P1)
56
+ - Add rate limiting (P0 - security critical)
57
+
58
+ ### UX Improvements
59
+ - [ ] Improve error messages (P2)
60
+ - [ ] Add loading states (P2)
61
+ - [ ] Mobile responsive design (P1)
62
+ - [ ] Dark mode support (P3, nice-to-have)
63
+
64
+ ### Documentation
65
+ - [ ] Write user guide (P2)
66
+ - [ ] Create developer documentation (P2)
67
+ - [ ] Add inline code comments (P3)
68
+
69
+ ## Bug Fixes
70
+ - [ ] Fix login redirect issue (P0, bug)
71
+ - [ ] Resolve memory leak in websocket connection (P0, bug)
72
+ - [ ] Fix pagination not working correctly (P1, bug)
73
+
74
+ ## Technical Debt
75
+ - [ ] Refactor authentication module (P2, tech-debt)
76
+ - [ ] Update dependencies (P1, tech-debt)
77
+ - [ ] Remove deprecated API endpoints (P2, tech-debt)
78
+
79
+ ## Future Considerations (Optional)
80
+ These are nice-to-have features for future releases:
81
+ - Integration with third-party services
82
+ - Advanced analytics
83
+ - Custom themes
84
+ - Plugin system
@@ -0,0 +1,22 @@
1
+ {
2
+ "anthropicApiKey": "sk-ant-your-api-key-here",
3
+ "defaultRepo": "owner/repo",
4
+ "defaultDocPath": "ROADMAP.md",
5
+ "preferences": {
6
+ "dryRunByDefault": false,
7
+ "autoCreateLabels": true,
8
+ "checkDuplicates": true,
9
+ "duplicateThreshold": 0.8
10
+ },
11
+ "labelColors": {
12
+ "priority-critical": "B60205",
13
+ "priority-high": "D93F0B",
14
+ "priority-medium": "FBCA04",
15
+ "priority-low": "0E8A16",
16
+ "type-feature": "0075CA",
17
+ "type-bug": "D73A4A",
18
+ "type-tech-debt": "F9D0C4",
19
+ "type-documentation": "0E8A16",
20
+ "optional": "E4E669"
21
+ }
22
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "claude-gh-ticket-gen",
3
+ "version": "1.0.0",
4
+ "description": "AI-powered CLI tool to parse roadmap documents and generate GitHub issues",
5
+ "main": "dist/cli/index.js",
6
+ "bin": {
7
+ "claude-ticket-gen": "bin/claude-ticket-gen.js"
8
+ },
9
+ "type": "module",
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsx src/cli/index.ts",
13
+ "start": "node dist/cli/index.js",
14
+ "test": "echo \"Error: no test specified\" && exit 1",
15
+ "prepublishOnly": "npm run build"
16
+ },
17
+ "keywords": [
18
+ "cli",
19
+ "github",
20
+ "issues",
21
+ "ai",
22
+ "claude",
23
+ "roadmap",
24
+ "planning",
25
+ "automation"
26
+ ],
27
+ "author": "Brett Buskirk",
28
+ "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/brett-buskirk/claude-ticket-gen.git"
32
+ },
33
+ "homepage": "https://github.com/brett-buskirk/claude-ticket-gen#readme",
34
+ "bugs": {
35
+ "url": "https://github.com/brett-buskirk/claude-ticket-gen/issues"
36
+ },
37
+ "dependencies": {
38
+ "@anthropic-ai/sdk": "^0.30.0",
39
+ "commander": "^12.0.0",
40
+ "inquirer": "^9.2.0",
41
+ "chalk": "^5.3.0",
42
+ "ora": "^8.0.0",
43
+ "cli-table3": "^0.6.3"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^20.0.0",
47
+ "@types/inquirer": "^9.0.0",
48
+ "typescript": "^5.3.0",
49
+ "tsx": "^4.7.0"
50
+ },
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ }
54
+ }