Skip to content

Initial example of custom agents#126

Open
reidbaker wants to merge 2 commits intoflutter:mainfrom
reidbaker:r-experiment-with-custom-agents
Open

Initial example of custom agents#126
reidbaker wants to merge 2 commits intoflutter:mainfrom
reidbaker:r-experiment-with-custom-agents

Conversation

@reidbaker
Copy link
Copy Markdown
Contributor

Custom agent that includes the skills and prompts I have been using to develop and a bare-agent that includes nothing both as a control and as an escape hatch of skills are making work harder.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new agent configurations, 'bare-agent' and 'reidbaker-agent', along with a comprehensive 'code-review' skill and a 'grill-me' interview skill. The code review skill includes detailed workflows, criteria, and a Python script for splitting large diffs. Feedback was provided to fix a hardcoded absolute file path in the documentation, improve the robustness of a regex for parsing diff headers, and ensure consistent file encoding when writing split diffs.

After performing subdivided reviews, use the **Synthesis** step to create the final output:
1. **Deduplicate**: Ensure that the same issue found in multiple passes or files is not reported multiple times unless it manifests differently.
2. **Prioritize**: Group comments by severity. Ensure critical and high-severity issues are highlighted at the top.
3. **Cohesiveness**: Ensure the tone and style of all comments are consistent, following the [natural-writing](file:///Users/gspencer/code/cheats/agents/skills/natural-writing/SKILL.md) skill.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link to the natural-writing skill uses a hardcoded absolute path (file:///Users/gspencer/...). This should be replaced with a relative path to ensure the documentation is portable and works for all users across different environments.

Suggested change
3. **Cohesiveness**: Ensure the tone and style of all comments are consistent, following the [natural-writing](file:///Users/gspencer/code/cheats/agents/skills/natural-writing/SKILL.md) skill.
3. **Cohesiveness**: Ensure the tone and style of all comments are consistent, following the [natural-writing](../../natural-writing/SKILL.md) skill.

# Try to find file name
match = re.search(r"^diff --git a/(.*?) b/", file_diff, re.MULTILINE)
if not match:
match = re.search(r"^--- a/(.*?)$", file_diff, re.MULTILINE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The regex r"^--- a/(.*?)$" is too broad and will capture trailing timestamps or tab characters often found in unified diff headers (e.g., --- a/file.txt\t2023-10-27...). This can lead to invalid filenames when creating the split diff files. Using \S+ to capture only the non-whitespace path is more robust.

Suggested change
match = re.search(r"^--- a/(.*?)$", file_diff, re.MULTILINE)
match = re.search(r"^--- a/(\S+)", file_diff, re.MULTILINE)

file_name = safe_name

file_path = os.path.join(output_dir, safe_name)
with open(file_path, "w") as f:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to specify an explicit encoding (e.g., utf-8) when opening files for writing to ensure consistent behavior across different platforms and avoid issues with system-default encodings.

Suggested change
with open(file_path, "w") as f:
with open(file_path, "w", encoding="utf-8") as f:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant