-
Notifications
You must be signed in to change notification settings - Fork 2
ralph: #23 — Design Bootstrap Cases for common real tasks — create 5 dynamic case YAMLs #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Bootstrap Case: Fix linting errors in a specific file | ||
| # This case tests an agent's ability to fix code style issues in a single file. | ||
|
|
||
| id: boot-001 | ||
| title: "Fix linting errors in a specific file" | ||
| prompt: | | ||
| Fix all linting errors in the file: ${FILE_PATH} | ||
|
|
||
| The file currently has linting errors. Run the linter on this file | ||
| to see what needs to be fixed, then apply the necessary corrections | ||
| to make the file pass all linting rules. | ||
|
|
||
| Requirements: | ||
| - Fix all linting errors in ${FILE_PATH} | ||
| - Do not modify any other files | ||
| - Preserve the original functionality | ||
| - Run the linter again to verify all errors are fixed | ||
|
|
||
| ${LINTER_COMMAND} | ||
|
|
||
| source: bootstrap | ||
| category: bootstrap | ||
| language: javascript | ||
| difficulty: easy | ||
|
|
||
| tags: | ||
| - bootstrap | ||
| - linting | ||
| - code-quality | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Bootstrap Case: Rename a symbol across the codebase | ||
| # This case tests an agent's ability to find and rename a symbol consistently. | ||
|
|
||
| id: boot-002 | ||
| title: "Rename a symbol across the codebase" | ||
| prompt: | | ||
| Rename the symbol "${OLD_NAME}" to "${NEW_NAME}" throughout the codebase. | ||
|
|
||
| Find all occurrences of ${OLD_NAME} in the codebase and replace them | ||
| with ${NEW_NAME}. Ensure the change is consistent across all files. | ||
|
|
||
| Requirements: | ||
| - Find all references to ${OLD_NAME} | ||
| - Replace each reference with ${NEW_NAME} | ||
| - Verify the change with grep: grep -r "${NEW_NAME}" . | ||
| - Run tests to ensure nothing is broken | ||
| - Do not introduce any new errors | ||
|
|
||
| ${GREP_COMMAND} | ||
|
|
||
| source: bootstrap | ||
| category: bootstrap | ||
| language: javascript | ||
| difficulty: easy | ||
|
|
||
| tags: | ||
| - bootstrap | ||
| - refactoring | ||
| - rename | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||
| # Bootstrap Case: Extract duplicated code into shared function | ||||||||||||
| # This case tests an agent's ability to identify and eliminate code duplication. | ||||||||||||
|
|
||||||||||||
| id: boot-003 | ||||||||||||
| title: "Extract duplicated code into shared function" | ||||||||||||
| prompt: | | ||||||||||||
| Extract the duplicated code pattern into a shared function. | ||||||||||||
|
|
||||||||||||
| The following code pattern appears multiple times in the codebase: | ||||||||||||
| ${DUPLICATE_PATTERN} | ||||||||||||
|
|
||||||||||||
| Create a new function called "${SHARED_FUNCTION_NAME}" that contains | ||||||||||||
| this duplicated logic, then replace all occurrences with a call to | ||||||||||||
| this new function. | ||||||||||||
|
|
||||||||||||
| Requirements: | ||||||||||||
| - Identify all occurrences of the duplicate pattern | ||||||||||||
| - Create a shared function with a clear name | ||||||||||||
| - Replace all duplicates with calls to the shared function | ||||||||||||
| - Verify the pattern is gone with grep | ||||||||||||
| - Run tests to ensure functionality is preserved | ||||||||||||
|
|
||||||||||||
| ${GREP_COMMAND} | ||||||||||||
|
|
||||||||||||
| source: bootstrap | ||||||||||||
| category: bootstrap | ||||||||||||
| language: javascript | ||||||||||||
| difficulty: medium | ||||||||||||
|
|
||||||||||||
| tags: | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All other bootstrap cases define tag items under Suggested fix tags:
+ - bootstrap
+ - refactoring
+ - deduplication📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Bootstrap Case: Add type annotations to a module | ||
| # This case tests an agent's ability to add type safety to code. | ||
|
|
||
| id: boot-004 | ||
| title: "Add type annotations to a module" | ||
| prompt: | | ||
| Add type annotations to the module at ${MODULE_PATH}. | ||
|
|
||
| The module currently lacks type annotations. Add appropriate TypeScript | ||
| types to all functions, variables, and parameters to ensure type safety. | ||
|
|
||
| Requirements: | ||
| - Add type annotations to all functions | ||
| - Add type annotations to all variables | ||
| - Add type annotations to all parameters | ||
| - Run the TypeScript type checker to verify no errors | ||
| - Ensure the module still works correctly | ||
|
|
||
| ${TYPECHECK_COMMAND} | ||
|
|
||
| source: bootstrap | ||
| category: bootstrap | ||
| language: typescript | ||
| difficulty: medium | ||
|
|
||
| tags: | ||
| - bootstrap | ||
| - typescript | ||
| - type-safety | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||
| # Bootstrap Case: Update deprecated API usage | ||||||||||||||||
| # This case tests an agent's ability to identify and fix deprecated patterns. | ||||||||||||||||
|
|
||||||||||||||||
| id: boot-005 | ||||||||||||||||
| title: "Update deprecated API usage" | ||||||||||||||||
| prompt: | | ||||||||||||||||
| Update all deprecated API usage in the codebase. | ||||||||||||||||
|
|
||||||||||||||||
| The following deprecated pattern is currently used: | ||||||||||||||||
| ${DEPRECATED_PATTERN} | ||||||||||||||||
|
|
||||||||||||||||
| Replace all occurrences of this deprecated pattern with the new API: | ||||||||||||||||
| ${NEW_API} | ||||||||||||||||
|
|
||||||||||||||||
| Requirements: | ||||||||||||||||
| - Find all occurrences of the deprecated pattern | ||||||||||||||||
| - Replace each with the new API | ||||||||||||||||
| - Verify the deprecated pattern is gone with grep | ||||||||||||||||
| - Run tests to ensure functionality is preserved | ||||||||||||||||
| - Do not introduce any new errors | ||||||||||||||||
|
|
||||||||||||||||
| ${GREP_COMMAND} | ||||||||||||||||
|
|
||||||||||||||||
| source: bootstrap | ||||||||||||||||
| category: bootstrap | ||||||||||||||||
| language: javascript | ||||||||||||||||
| difficulty: medium | ||||||||||||||||
|
|
||||||||||||||||
| tags: | ||||||||||||||||
| - bootstrap | ||||||||||||||||
|
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tags list is incomplete and file is missing a trailing newline. Only Suggested fix tags:
- bootstrap
+ - deprecated
+ - api-update
+📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded grep command on Line 15 conflicts with
${GREP_COMMAND}placeholder on Line 19.Line 15 hardcodes
grep -r "${NEW_NAME}" .while Line 19 provides a${GREP_COMMAND}placeholder intended for runtime substitution. If the runtime environment uses a different grep invocation (e.g.,rg, different flags, or scoped paths), these two will be inconsistent.Pick one approach — either use
${GREP_COMMAND}consistently or inline the command.Suggested fix — use placeholder consistently
Requirements: - Find all references to ${OLD_NAME} - Replace each reference with ${NEW_NAME} - - Verify the change with grep: grep -r "${NEW_NAME}" . + - Verify the change with the provided grep command - Run tests to ensure nothing is broken - Do not introduce any new errors ${GREP_COMMAND}📝 Committable suggestion
🤖 Prompt for AI Agents