pupt 2.2.1 → 2.3.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 (124) hide show
  1. package/dist/cli.js +94 -58
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/add.d.ts +4 -1
  4. package/dist/commands/add.d.ts.map +1 -1
  5. package/dist/commands/add.js +60 -11
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/cache.d.ts +9 -0
  8. package/dist/commands/cache.d.ts.map +1 -0
  9. package/dist/commands/cache.js +31 -0
  10. package/dist/commands/cache.js.map +1 -0
  11. package/dist/commands/config.d.ts +1 -2
  12. package/dist/commands/config.d.ts.map +1 -1
  13. package/dist/commands/config.js +30 -57
  14. package/dist/commands/config.js.map +1 -1
  15. package/dist/commands/edit.d.ts.map +1 -1
  16. package/dist/commands/edit.js +5 -2
  17. package/dist/commands/edit.js.map +1 -1
  18. package/dist/commands/init-refactored.d.ts.map +1 -1
  19. package/dist/commands/init-refactored.js +0 -3
  20. package/dist/commands/init-refactored.js.map +1 -1
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +59 -68
  23. package/dist/commands/init.js.map +1 -1
  24. package/dist/commands/install.d.ts +9 -9
  25. package/dist/commands/install.d.ts.map +1 -1
  26. package/dist/commands/install.js +76 -178
  27. package/dist/commands/install.js.map +1 -1
  28. package/dist/commands/review.d.ts.map +1 -1
  29. package/dist/commands/review.js +3 -1
  30. package/dist/commands/review.js.map +1 -1
  31. package/dist/commands/run.d.ts +2 -0
  32. package/dist/commands/run.d.ts.map +1 -1
  33. package/dist/commands/run.js +13 -9
  34. package/dist/commands/run.js.map +1 -1
  35. package/dist/commands/uninstall.d.ts +2 -0
  36. package/dist/commands/uninstall.d.ts.map +1 -0
  37. package/dist/commands/uninstall.js +45 -0
  38. package/dist/commands/uninstall.js.map +1 -0
  39. package/dist/commands/update.d.ts +2 -0
  40. package/dist/commands/update.d.ts.map +1 -0
  41. package/dist/commands/update.js +113 -0
  42. package/dist/commands/update.js.map +1 -0
  43. package/dist/config/config-manager.d.ts +3 -10
  44. package/dist/config/config-manager.d.ts.map +1 -1
  45. package/dist/config/config-manager.js +23 -140
  46. package/dist/config/config-manager.js.map +1 -1
  47. package/dist/config/global-paths.d.ts +5 -0
  48. package/dist/config/global-paths.d.ts.map +1 -0
  49. package/dist/config/global-paths.js +16 -0
  50. package/dist/config/global-paths.js.map +1 -0
  51. package/dist/config/migration.d.ts.map +1 -1
  52. package/dist/config/migration.js +69 -1
  53. package/dist/config/migration.js.map +1 -1
  54. package/dist/schemas/config-schema.d.ts +863 -196
  55. package/dist/schemas/config-schema.d.ts.map +1 -1
  56. package/dist/schemas/config-schema.js +51 -27
  57. package/dist/schemas/config-schema.js.map +1 -1
  58. package/dist/services/input-collector.d.ts.map +1 -1
  59. package/dist/services/input-collector.js +7 -1
  60. package/dist/services/input-collector.js.map +1 -1
  61. package/dist/services/module-cache.d.ts +42 -0
  62. package/dist/services/module-cache.d.ts.map +1 -0
  63. package/dist/services/module-cache.js +205 -0
  64. package/dist/services/module-cache.js.map +1 -0
  65. package/dist/services/module-entry-builder.d.ts +20 -0
  66. package/dist/services/module-entry-builder.d.ts.map +1 -0
  67. package/dist/services/module-entry-builder.js +67 -0
  68. package/dist/services/module-entry-builder.js.map +1 -0
  69. package/dist/services/output-capture-service.d.ts.map +1 -1
  70. package/dist/services/output-capture-service.js +2 -1
  71. package/dist/services/output-capture-service.js.map +1 -1
  72. package/dist/services/package-manager.d.ts +18 -0
  73. package/dist/services/package-manager.d.ts.map +1 -0
  74. package/dist/services/package-manager.js +141 -0
  75. package/dist/services/package-manager.js.map +1 -0
  76. package/dist/services/prompt-resolver.d.ts +2 -2
  77. package/dist/services/prompt-resolver.d.ts.map +1 -1
  78. package/dist/services/prompt-resolver.js +9 -10
  79. package/dist/services/prompt-resolver.js.map +1 -1
  80. package/dist/services/pupt-prompt-source.d.ts +16 -0
  81. package/dist/services/pupt-prompt-source.d.ts.map +1 -0
  82. package/dist/services/pupt-prompt-source.js +73 -0
  83. package/dist/services/pupt-prompt-source.js.map +1 -0
  84. package/dist/services/pupt-service.d.ts +11 -25
  85. package/dist/services/pupt-service.d.ts.map +1 -1
  86. package/dist/services/pupt-service.js +31 -179
  87. package/dist/services/pupt-service.js.map +1 -1
  88. package/dist/services/review-data-builder.d.ts +4 -1
  89. package/dist/services/review-data-builder.d.ts.map +1 -1
  90. package/dist/services/review-data-builder.js +4 -2
  91. package/dist/services/review-data-builder.js.map +1 -1
  92. package/dist/types/config.d.ts +35 -19
  93. package/dist/types/config.d.ts.map +1 -1
  94. package/dist/types/config.js +3 -4
  95. package/dist/types/config.js.map +1 -1
  96. package/dist/utils/prompt-dir-resolver.d.ts +5 -0
  97. package/dist/utils/prompt-dir-resolver.d.ts.map +1 -0
  98. package/dist/utils/prompt-dir-resolver.js +24 -0
  99. package/dist/utils/prompt-dir-resolver.js.map +1 -0
  100. package/package.json +3 -2
  101. package/dist/utils/path-utils.d.ts +0 -42
  102. package/dist/utils/path-utils.d.ts.map +0 -1
  103. package/dist/utils/path-utils.js +0 -139
  104. package/dist/utils/path-utils.js.map +0 -1
  105. package/dist/utils/prompt-format.d.ts +0 -27
  106. package/dist/utils/prompt-format.d.ts.map +0 -1
  107. package/dist/utils/prompt-format.js +0 -28
  108. package/dist/utils/prompt-format.js.map +0 -1
  109. package/prompts/ad-hoc-long.prompt +0 -60
  110. package/prompts/ad-hoc.prompt +0 -29
  111. package/prompts/code-review.prompt +0 -99
  112. package/prompts/debugging-error-message.prompt +0 -81
  113. package/prompts/fix-github-actions.prompt +0 -62
  114. package/prompts/fix-test-errors.prompt +0 -73
  115. package/prompts/git-commit-comment.prompt +0 -61
  116. package/prompts/implementation-phase.prompt +0 -53
  117. package/prompts/implementation-plan.prompt +0 -101
  118. package/prompts/new-feature.prompt +0 -89
  119. package/prompts/new-project.prompt +0 -9
  120. package/prompts/one-shot-change.prompt +0 -79
  121. package/prompts/pupt-prompt-improvement.prompt +0 -270
  122. package/prompts/simple-test.prompt +0 -8
  123. package/prompts/update-design.prompt +0 -71
  124. package/prompts/update-documentation.prompt +0 -6
@@ -1,139 +0,0 @@
1
- /**
2
- * Utilities for converting paths to portable format for config files.
3
- *
4
- * When saving configs, absolute paths should be converted to portable formats:
5
- * - Paths under project root → ${projectRoot}/...
6
- * - Paths under home directory → ~/...
7
- * - Already relative paths → kept as-is
8
- * - Other absolute paths → kept as-is with warning
9
- */
10
- import path from 'node:path';
11
- import fs from 'node:fs';
12
- import os from 'node:os';
13
- import { findProjectRoot } from './project-root.js';
14
- import { logger } from './logger.js';
15
- /**
16
- * Resolve symlinks in a path, even if the leaf segments don't exist.
17
- * Walks up to the nearest existing ancestor, resolves it, then re-appends
18
- * the non-existent tail. This handles macOS /var -> /private/var symlink
19
- * differences when the target path (e.g. a prompt directory) hasn't been
20
- * created yet.
21
- */
22
- function safeRealpath(p) {
23
- try {
24
- return fs.realpathSync(p);
25
- }
26
- catch {
27
- const parent = path.dirname(p);
28
- if (parent === p) {
29
- // Reached filesystem root — nothing more to resolve
30
- return p;
31
- }
32
- return path.join(safeRealpath(parent), path.basename(p));
33
- }
34
- }
35
- /**
36
- * Contract a single path to a portable format.
37
- *
38
- * Priority:
39
- * 1. Already relative paths → keep as-is
40
- * 2. Paths under project root → ${projectRoot}/...
41
- * 3. Paths under home directory → ~/...
42
- * 4. Other absolute paths → keep as-is (with optional warning)
43
- */
44
- export function contractPath(filepath, options = {}) {
45
- const { configDir = process.cwd(), warnOnAbsolute = true } = options;
46
- // Already relative path - keep as-is
47
- if (!path.isAbsolute(filepath)) {
48
- return { path: filepath, warned: false };
49
- }
50
- // Already uses ${projectRoot} or ~ - keep as-is
51
- if (filepath.includes('${projectRoot}') || filepath.startsWith('~/')) {
52
- return { path: filepath, warned: false };
53
- }
54
- const homeDir = os.homedir();
55
- const projectRoot = findProjectRoot(configDir);
56
- // Resolve symlinks for comparison (handles macOS /var -> /private/var)
57
- const resolvedPath = safeRealpath(filepath);
58
- // Check if path is under project root (prefer this over home)
59
- if (projectRoot) {
60
- const resolvedProjectRoot = safeRealpath(projectRoot);
61
- if (resolvedPath.startsWith(resolvedProjectRoot + path.sep) || resolvedPath === resolvedProjectRoot) {
62
- const relativePath = path.relative(resolvedProjectRoot, resolvedPath);
63
- // Use forward slashes for cross-platform compatibility in config
64
- const portablePath = relativePath.split(path.sep).join('/');
65
- return {
66
- path: portablePath ? `\${projectRoot}/${portablePath}` : '${projectRoot}',
67
- warned: false
68
- };
69
- }
70
- }
71
- // Check if path is under home directory
72
- const resolvedHomeDir = safeRealpath(homeDir);
73
- if (resolvedPath.startsWith(resolvedHomeDir + path.sep) || resolvedPath === resolvedHomeDir) {
74
- const relativePath = path.relative(resolvedHomeDir, resolvedPath);
75
- // Use forward slashes for cross-platform compatibility
76
- const portablePath = relativePath.split(path.sep).join('/');
77
- return {
78
- path: portablePath ? `~/${portablePath}` : '~',
79
- warned: false
80
- };
81
- }
82
- // Absolute path outside project and home - keep as-is but warn
83
- if (warnOnAbsolute) {
84
- logger.warn(`Path "${filepath}" is absolute and outside the project root. ` +
85
- `This path will not be portable across machines. ` +
86
- `Consider using a relative path, ~/..., or \${projectRoot}/...`);
87
- }
88
- return { path: filepath, warned: true };
89
- }
90
- /**
91
- * Check if a path is absolute and could be made portable.
92
- * Used for warning users on config load.
93
- */
94
- export function isNonPortableAbsolutePath(filepath, configDir) {
95
- // Not absolute - it's fine
96
- if (!path.isAbsolute(filepath)) {
97
- return false;
98
- }
99
- // Uses portable variables - it's fine
100
- if (filepath.includes('${projectRoot}') || filepath.startsWith('~/')) {
101
- return false;
102
- }
103
- const homeDir = os.homedir();
104
- const projectRoot = findProjectRoot(configDir || process.cwd());
105
- const resolvedPath = safeRealpath(filepath);
106
- // Check if it could be made portable
107
- if (projectRoot) {
108
- const resolvedProjectRoot = safeRealpath(projectRoot);
109
- if (resolvedPath.startsWith(resolvedProjectRoot + path.sep)) {
110
- return true; // Could use ${projectRoot}
111
- }
112
- }
113
- const resolvedHomeDir = safeRealpath(homeDir);
114
- if (resolvedPath.startsWith(resolvedHomeDir + path.sep)) {
115
- return true; // Could use ~/
116
- }
117
- // Absolute but can't be made portable - still flag it
118
- return true;
119
- }
120
- /**
121
- * Warn about non-portable paths in a config.
122
- * Call this when loading a config to alert users.
123
- */
124
- export function warnAboutNonPortablePaths(paths, configFilePath) {
125
- const configDir = configFilePath ? path.dirname(configFilePath) : process.cwd();
126
- const nonPortable = [];
127
- for (const p of paths) {
128
- if (p && isNonPortableAbsolutePath(p, configDir)) {
129
- nonPortable.push(p);
130
- }
131
- }
132
- if (nonPortable.length > 0) {
133
- logger.warn(`Your config contains absolute paths that may not be portable:\n` +
134
- nonPortable.map(p => ` - ${p}`).join('\n') + '\n' +
135
- `These will be converted to portable format next time the config is saved.\n` +
136
- `To fix manually, use relative paths, ~/..., or \${projectRoot}/...`);
137
- }
138
- }
139
- //# sourceMappingURL=path-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../../src/utils/path-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;YACjB,oDAAoD;YACpD,OAAO,CAAC,CAAC;QACX,CAAC;QACD,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GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CACT,iEAAiE;YACjE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;YAClD,6EAA6E;YAC7E,oEAAoE,CACrE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Prompt format types supported by pupt.
3
- *
4
- * - `jsx`: Build-time JSX, imported as ES modules (.tsx/.jsx files)
5
- * - `jsx-runtime`: Runtime-parsed JSX via createPromptFromSource (.prompt files)
6
- */
7
- export type PromptFormat = 'jsx' | 'jsx-runtime';
8
- /**
9
- * File extensions recognized as pupt-lib JSX prompt formats.
10
- */
11
- export declare const PUPT_LIB_EXTENSIONS: string[];
12
- /**
13
- * All file extensions recognized as prompt files.
14
- */
15
- export declare const ALL_PROMPT_EXTENSIONS: string[];
16
- /**
17
- * Detect the prompt format based on file extension.
18
- *
19
- * @param filePath - Path or filename to check
20
- * @returns The detected prompt format
21
- */
22
- export declare function detectPromptFormat(filePath: string): PromptFormat;
23
- /**
24
- * Check if a file is a pupt-lib prompt format.
25
- */
26
- export declare function isPuptLibFormat(filePath: string): boolean;
27
- //# sourceMappingURL=prompt-format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-format.d.ts","sourceRoot":"","sources":["../../src/utils/prompt-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,aAAa,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAA8B,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,qBAAqB,UAA2B,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAKjE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGzD"}
@@ -1,28 +0,0 @@
1
- /**
2
- * File extensions recognized as pupt-lib JSX prompt formats.
3
- */
4
- export const PUPT_LIB_EXTENSIONS = ['.tsx', '.jsx', '.prompt'];
5
- /**
6
- * All file extensions recognized as prompt files.
7
- */
8
- export const ALL_PROMPT_EXTENSIONS = [...PUPT_LIB_EXTENSIONS];
9
- /**
10
- * Detect the prompt format based on file extension.
11
- *
12
- * @param filePath - Path or filename to check
13
- * @returns The detected prompt format
14
- */
15
- export function detectPromptFormat(filePath) {
16
- if (filePath.endsWith('.tsx') || filePath.endsWith('.jsx')) {
17
- return 'jsx';
18
- }
19
- return 'jsx-runtime';
20
- }
21
- /**
22
- * Check if a file is a pupt-lib prompt format.
23
- */
24
- export function isPuptLibFormat(filePath) {
25
- const format = detectPromptFormat(filePath);
26
- return format === 'jsx' || format === 'jsx-runtime';
27
- }
28
- //# sourceMappingURL=prompt-format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt-format.js","sourceRoot":"","sources":["../../src/utils/prompt-format.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,mBAAmB,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,MAAM,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,aAAa,CAAC;AACtD,CAAC"}
@@ -1,60 +0,0 @@
1
- {/* Converted from ad-hoc-long.md */}
2
- <Prompt name="ad-hoc-long" description="Ad Hoc (Long)" tags={[]}>
3
-
4
- <Role>
5
- You are a versatile expert assistant capable of handling complex, multi-part requests that require detailed analysis, planning, or implementation.
6
- </Role>
7
-
8
- <Task>
9
- Address the comprehensive request below with appropriate depth and thoroughness.
10
- </Task>
11
-
12
- <Constraint>
13
- - Read the entire request before beginning response
14
- - Identify all sub-tasks and requirements
15
- - Create a prioritized task list focusing on the MAIN objective
16
- - For debugging tasks:
17
- - Stay focused on the specific issue reported
18
- - Follow a systematic process without getting sidetracked
19
- - Fix the reported issue FIRST before exploring related problems
20
- - Verify the fix resolves the original issue
21
- - Organize response to address each part clearly
22
- - Use appropriate formatting and structure
23
- - Provide comprehensive solutions
24
- </Constraint>
25
-
26
- <Format>
27
- Organize response based on request type:
28
- - For multi-part questions: Address each part with clear sections
29
- - For analysis tasks: Use structured findings and recommendations
30
- - For implementation tasks: Provide step-by-step approach
31
- - For debugging:
32
- 1. State the specific issue to be fixed
33
- 2. Reproduce the issue exactly as described
34
- 3. Identify root cause through systematic investigation
35
- 4. Apply targeted fix for that specific issue
36
- 5. Verify the original issue is resolved
37
- 6. Only then address related issues if requested
38
-
39
- **Complex Request**:
40
- <Ask.Editor name="prompt" label="Prompt (press enter to open editor):" />
41
- </Format>
42
-
43
- <Section>
44
- N/A (varies by request type)
45
- </Section>
46
-
47
- <Constraint>
48
- - Maintain focus on the specific request
49
- - Balance thoroughness with clarity
50
- - Use examples and code samples where helpful
51
- - Flag any assumptions or uncertainties
52
- </Constraint>
53
-
54
- <SuccessCriteria>
55
- <Criterion>All parts of the request are addressed</Criterion>
56
- <Criterion>Response is well-organized and easy to follow</Criterion>
57
- <Criterion>Solutions are practical and implementable</Criterion>
58
- <Criterion>Any edge cases or considerations are noted</Criterion>
59
- </SuccessCriteria>
60
- </Prompt>
@@ -1,29 +0,0 @@
1
- {/* Converted from ad-hoc.md */}
2
- <Prompt name="ad-hoc" description="Ad Hoc" tags={[]}>
3
- <Role>
4
- You are a versatile AI assistant capable of handling various technical and non-technical tasks. Adapt your expertise based on the specific request.
5
- </Role>
6
-
7
- <Task>
8
- <Ask.Text name="prompt" label="Prompt:" />
9
- </Task>
10
-
11
- <Constraint>
12
- - Provide accurate, helpful, and actionable responses
13
- - Use appropriate formatting (code blocks, lists, tables) based on content type
14
- </Constraint>
15
-
16
- <WhenUncertain action="ask" />
17
-
18
- <Format>
19
- Match the response format to the task type - use structured output for technical tasks, narrative for explanations, and step-by-step instructions for procedures.
20
- </Format>
21
-
22
- <Constraint>
23
- Stay focused on the specific request without adding unnecessary information unless it directly supports the main objective.
24
- </Constraint>
25
-
26
- <SuccessCriteria>
27
- <Criterion>The response directly addresses the user's request with appropriate depth and format for the task at hand.</Criterion>
28
- </SuccessCriteria>
29
- </Prompt>
@@ -1,99 +0,0 @@
1
- {/* Converted from code-review.md */}
2
- <Prompt name="code-review" description="Code Review" tags={[]}>
3
-
4
- <Role preset="engineer" extend expertise="code review, identifying AI-generated code issues, maintainability, correctness">
5
- You are a meticulous code reviewer with expertise in identifying both human and AI-generated code issues, focusing on maintainability, correctness, and common LLM coding mistakes.
6
- </Role>
7
-
8
- <Task>
9
- Perform a comprehensive multi-pass code review identifying issues and improvement opportunities. Write the code review to <Ask.ReviewFile name="outputFile" label="Output file:" />.
10
- </Task>
11
-
12
- <Constraints extend>
13
- - **Pass 1 - Critical Issues**: Security, correctness, data loss risks
14
- - **Pass 2 - Code Quality**:
15
- <Ask.Editor name="codeReviewConcerns" label="Code review concerns (press enter to open editor):" />
16
- - **Pass 3 - LLM-Specific Issues**:
17
- - Hallucinated APIs or methods that don't exist
18
- - Incorrect error handling patterns
19
- - Overly complex solutions to simple problems
20
- - Inconsistent code style within same file
21
- - Copy-paste errors and duplicated logic
22
- - Missing edge case handling
23
-
24
- - Create file inventory first, categorizing files as:
25
- - Production code (src/)
26
- - Test code (test/, *.test.*, *.spec.*)
27
- - Configuration (config files, build scripts)
28
- - Apply different standards based on file type:
29
- - Production code: Strict type safety, no 'any' types
30
- - Test code: 'any' types acceptable for mocks, relaxed standards
31
- - Configuration: Focus on security and correctness
32
- - For each issue found:
33
- - Verify it's a real issue considering the file context
34
- - Assess actual impact on system
35
- - Provide specific fix with code example
36
- - Group similar issues for batch remediation
37
- </Constraints>
38
-
39
- <Format>
40
- ```markdown
41
- # Code Review Report - <DateTime />
42
-
43
- ## Executive Summary
44
- - Files reviewed: X
45
- - Critical issues: X
46
- - High priority issues: X
47
- - Medium priority issues: X
48
- - Low priority issues: X
49
-
50
- ## Critical Issues (Fix Immediately)
51
- ### 1. [Issue Title]
52
- - **Files**: [List affected files]
53
- - **Description**: [What and why it's critical]
54
- - **Example**: `path/to/file.js:123`
55
- ```javascript
56
- // Problem code
57
- ```
58
- - **Fix**:
59
- ```javascript
60
- // Corrected code
61
- ```
62
-
63
- ## High Priority Issues (Fix Soon)
64
- [Same format as critical]
65
-
66
- ## Medium Priority Issues (Technical Debt)
67
- [Same format, grouped by theme]
68
-
69
- ## Low Priority Issues (Nice to Have)
70
- [Brief list with file references]
71
-
72
- ## Positive Findings
73
- - [Good patterns to replicate elsewhere]
74
-
75
- ## Recommendations
76
- 1. [Highest impact improvement]
77
- 2. [Next priority]
78
- ...
79
- ```
80
- </Format>
81
-
82
- <Constraint>
83
- - Don't flag test utilities for production code issues
84
- - Test files have different standards: 'any' types, mocks, and test helpers are acceptable
85
- - Consider project conventions before suggesting changes
86
- - Check if the issue is actually problematic in its context
87
- - Focus on measurable improvements
88
- - Distinguish must-fix from nice-to-have
89
- - CRITICAL: Don't recommend unnecessary libraries - check if existing solutions work first
90
- </Constraint>
91
-
92
- <SuccessCriteria>
93
- <Criterion>All significant issues caught and correctly prioritized</Criterion>
94
- <Criterion>Fixes are specific and implementable</Criterion>
95
- <Criterion>Report enables systematic remediation</Criterion>
96
- <Criterion>No false positives that waste developer time</Criterion>
97
- </SuccessCriteria>
98
-
99
- </Prompt>
@@ -1,81 +0,0 @@
1
- {/* Converted from debugging-error-message.md */}
2
- <Prompt name="debugging-error-message" description="Debugging Error Message" tags={[]}>
3
-
4
- <Role preset="engineer" expertise="error analysis, debugging, root cause identification, systematic problem-solving" />
5
-
6
- <Task>
7
- Diagnose and fix all errors that occur when <Ask.Text name="errorCondition" label="Error condition:" />.
8
- </Task>
9
-
10
- <Constraints extend>
11
- - First, reproduce the error condition exactly as described
12
- - Capture complete error output including stack traces
13
- - For multiple errors, create a prioritized list (fix blocking errors first)
14
- - For each error apply this debugging process:
15
- 1. **Understand**: Read error message and stack trace completely
16
- 2. **Locate**: Find exact file, line, and surrounding context
17
- 3. **Analyze**: Determine what the code is trying to do vs. what's happening
18
- 4. **Trace**: Follow data flow to find where things go wrong
19
- 5. **Fix**: Address root cause, not symptoms
20
- 6. **Verify**: Confirm this specific error is resolved
21
- 7. **Test**: Ensure fix doesn't break other functionality
22
- - After all fixes, reproduce original condition to verify resolution
23
- - Document any assumptions or environmental dependencies
24
- </Constraints>
25
-
26
- <Format>
27
- ```markdown
28
- ## Error Analysis for: {inputs.errorCondition}
29
-
30
- ### Complete Error Output
31
- ```
32
- <Ask.Editor name="errorText" label="Error text (press enter to open editor):" />
33
- ```
34
-
35
- ### Error Inventory
36
- 1. [Error Type]: [File:Line] - [Brief description]
37
- 2. [Continue for all errors...]
38
-
39
- ### Root Cause Analysis
40
-
41
- #### Error 1: [Error type]
42
- - **Symptom**: [What's visibly wrong]
43
- - **Location**: [Specific file:line]
44
- - **Root Cause**: [Why it's happening]
45
- - **Code Context**: [Relevant code snippet]
46
- - **Fix Applied**: [Specific changes made]
47
- - **Verification**: [How confirmed it's fixed]
48
-
49
- ### Final Verification
50
- - Command run: [exact command]
51
- - Result: [success/failure]
52
- - All errors resolved: [yes/no]
53
- ```
54
- </Format>
55
-
56
- <Examples>
57
- <Example>
58
- ```
59
- Error 1: TypeError: Cannot read property 'name' of undefined
60
- Location: src/user.js:42
61
- Root Cause: API returns null for deleted users, code assumes user always exists
62
- Fix: Added null check before accessing user.name
63
- Verification: Error no longer occurs, added test case for null user
64
- ```
65
- </Example>
66
- </Examples>
67
-
68
- <Constraint>
69
- - Fix root causes, not symptoms
70
- - Don't suppress errors with try-catch unless that's the correct solution
71
- - Preserve all intended functionality
72
- - Make focused changes that don't introduce new issues
73
- </Constraint>
74
-
75
- <SuccessCriteria>
76
- <Criterion>Original error condition no longer produces any errors</Criterion>
77
- <Criterion>All fixes address root causes</Criterion>
78
- <Criterion>No new errors introduced</Criterion>
79
- <Criterion>Clear documentation of what was wrong and how it was fixed</Criterion>
80
- </SuccessCriteria>
81
- </Prompt>
@@ -1,62 +0,0 @@
1
- {/* Converted from fix-github-actions.md */}
2
- <Prompt name="fix-github-actions" description="Fix GitHub Actions" tags={[]}>
3
- <Role preset="devops" extend expertise="GitHub Actions, CI/CD pipelines, cross-platform compatibility">
4
- You are a DevOps engineer specializing in GitHub Actions, CI/CD pipelines, and cross-platform compatibility issues.
5
- </Role>
6
-
7
- <Task>
8
- Analyze and fix all failing GitHub Actions workflow jobs, ensuring reliable CI/CD pipeline operation.
9
- </Task>
10
-
11
- <Constraints extend>
12
- - Use `gh run list --limit 1` to find the latest workflow run
13
- - Use `gh run view` with the run ID to see all jobs
14
- - For each failed job, use `gh run view` with the run ID and `--log-failed` to get error details
15
- - Categorize failures: environment, dependencies, tests, build, deployment
16
- - For each error:
17
- 1. Identify if it's environment-specific (OS, versions)
18
- 2. Check if it's a flaky test or real failure
19
- 3. Determine if it's a workflow configuration issue
20
- 4. Test the fix locally when possible
21
- 5. Consider cross-platform compatibility
22
- - Create fixes that work across all environments
23
- - Add appropriate error handling and retries for transient failures
24
- </Constraints>
25
-
26
- <Format>
27
- 1. Workflow run summary (ID, jobs, success/failure status)
28
- 2. Categorized error list with job names
29
- 3. For each error:
30
- - Job name and step that failed
31
- - Error message and likely cause
32
- - Proposed fix with explanation
33
- - Local verification method
34
- 4. Summary of all changes made
35
- </Format>
36
-
37
- <Examples>
38
- <Example>
39
- ```
40
- Job: test-ubuntu / Step: Run tests
41
- Error: Cannot find module 'xyz'
42
- Cause: Package not installed in CI environment
43
- Fix: Add 'xyz' to package.json dependencies
44
- Local verification: npm ci && npm test
45
- ```
46
- </Example>
47
- </Examples>
48
-
49
- <Constraint>
50
- - Fixes must work on all platforms (Ubuntu, macOS, Windows)
51
- - Don't disable failing tests to make CI pass
52
- - Preserve existing CI/CD functionality
53
- - Consider impact on build time and resource usage
54
- </Constraint>
55
-
56
- <SuccessCriteria>
57
- <Criterion>All GitHub Actions jobs pass on next run</Criterion>
58
- <Criterion>No reduction in test coverage or quality checks</Criterion>
59
- <Criterion>Fixes are robust against common CI/CD issues</Criterion>
60
- <Criterion>Clear documentation of what was fixed and why</Criterion>
61
- </SuccessCriteria>
62
- </Prompt>
@@ -1,73 +0,0 @@
1
- {/* Converted from fix-test-errors.md */}
2
- <Prompt name="fix-lint-build-test-errors" description="Fix Lint, Build, Test Errors" tags={[]}>
3
- <Role preset="engineer" extend expertise="debugging, testing, JavaScript/TypeScript, build tools">
4
- You are a debugging expert with deep knowledge of JavaScript/TypeScript, testing frameworks, and build tools.
5
- </Role>
6
-
7
- <Task>
8
- Systematically identify and fix all build, lint, and test errors in the codebase.
9
- </Task>
10
-
11
- <Constraints extend>
12
- - IMPORTANT: Before making ANY changes, understand the CONTEXT of why tests might be failing
13
- - Check recent changes, removed features, or intentional modifications
14
- - Run commands in this exact order: `npm run build`, `npm run lint`, `npm test`
15
- - Capture ALL error output completely (stdout and stderr)
16
- - Categorize errors by type: syntax, type, lint, test assertion, runtime
17
- - For each error:
18
- 1. Identify the specific file and line number
19
- 2. Understand what the code is trying to do
20
- 3. CRITICAL: Determine if the test is failing because:
21
- - The implementation is wrong (fix the implementation)
22
- - The test is outdated (update the test to match new requirements)
23
- - A feature was intentionally removed (remove the corresponding test)
24
- 4. Fix the root cause with minimal code changes
25
- 5. Verify the specific error is resolved
26
- - After fixing all errors, run ALL commands again to verify
27
- - MANDATORY: Show complete test output proving "0 failing" before declaring success
28
- - If new errors appear, repeat the process
29
- - Continue until all commands pass with zero errors
30
- </Constraints>
31
-
32
- <Format>
33
- 1. Context analysis (recent changes, removed features)
34
- 2. Initial error inventory (categorized list)
35
- 3. For each error:
36
- - Error type and location
37
- - Root cause analysis
38
- - Decision: Fix implementation OR Update test OR Remove test
39
- - Fix applied with justification
40
- - Verification result
41
- 4. Final status report with COMPLETE command outputs showing:
42
- - npm run build: "Compiled successfully"
43
- - npm run lint: "0 errors, 0 warnings"
44
- - npm test: Full output with "0 failing"
45
- </Format>
46
-
47
- <Examples>
48
- <Example>
49
- ```
50
- Error 1: TypeError at src/utils/helper.ts:23
51
- Root cause: Function expects string but receives undefined when config.name is not set
52
- Fix: Add default parameter value
53
- Verification: Error resolved, test now passes
54
- ```
55
- </Example>
56
- </Examples>
57
-
58
- <Constraint>
59
- - NEVER skip tests with .skip() or xit()
60
- - NEVER remove failing tests
61
- - NEVER suppress errors with ignore comments
62
- - Fix root causes, not symptoms
63
- - Preserve all existing functionality
64
- </Constraint>
65
-
66
- <SuccessCriteria>
67
- <Criterion>`npm run build` exits with code 0</Criterion>
68
- <Criterion>`npm run lint` reports 0 errors and 0 warnings</Criterion>
69
- <Criterion>`npm test` shows all tests passing (100% pass rate)</Criterion>
70
- <Criterion>No unhandled errors or warnings in output</Criterion>
71
- <Criterion>All original tests still present and passing</Criterion>
72
- </SuccessCriteria>
73
- </Prompt>