Skill: Investigative Issue Workdown
Description
A robust workflow for handling a batch of related investigative tasks, such as those assigned by a cron job or a project board. This pattern is ideal for tasks that require researching the file system, generating a report or artifact, committing the result to version control, and closing the source issue.
When to use this skill
Trigger this skill when you are assigned 2-5 related tasks in a single prompt, where each task follows a similar "investigate -> document -> commit -> close" lifecycle. It is particularly useful when the investigation involves searching across large or numerous directories.
Workflow Steps
- Initial Planning: List the assigned tasks.
- Sequential Execution: Address each task one by one to ensure reliability and clear separation of work.
- Investigation: Use file system tools like
search_filesto gather the necessary information for the current task. If a required path is inaccessible, note this finding and proceed. - Documentation: Create the required artifact (typically a Markdown report) using
write_fileand populate it with your findings. - Version Control: Use
terminaltogit addandgit committhe newly created file. Use a clear commit message that references the task or issue number. - Task Closure: Use
terminalto interact with the issue tracker CLI (e.g.,gh issue close 1234) to close the completed task. - Iterate: Repeat steps 3-6 for the next task until all are complete.
- Final Summary: Conclude with a summary of the work performed, listing each completed task and the artifact created.
Pitfalls & Best Practices
- Avoid
execute_codefor Batch File Searches: Do not use a singleexecute_codeblock to run multiplesearch_filescalls in a loop, especially on large or complex directory structures. This approach is prone to intermittentJSONDecodeErrorfailures when tool outputs are large or contain unexpected characters, making the script unreliable. - Prefer Sequential Tool Calls: The most robust method for file system investigation is to use direct, sequential
search_filestool calls from the main agent loop for each query. While this may appear less concurrent, it is far more reliable and provides clearer, more debuggable outputs. - Handle Inaccessible Paths Gracefully: If a file path or network mount is unavailable during the investigation, do not halt the entire batch. Document the inaccessibility in your report for that specific task and continue with the remaining tasks.