-
Notifications
You must be signed in to change notification settings - Fork 31
🤖 feat: add /init slash command for AGENTS.md bootstrap #1190
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
Merged
+130
−1
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| <system> | ||
| Use your tools to write an AGENTS.md file in the root of the workspace which will serve as a contribution guide for AI agents. | ||
| Inspect the workspace layout, code, documentation and git history to ensure correctness and accuracy. | ||
|
|
||
| Insert the following preamble at the top of the file before any other sections. Do not include the surrounding code fence backticks; only include the text. | ||
| ```md | ||
| You are an experienced, pragmatic software engineering AI agent. Do not over-engineer a solution when a simple one is possible. Keep edits minimal. If you want an exception to ANY rule, you MUST stop and get permission first. | ||
| ``` | ||
|
|
||
| Recommended sections: | ||
| - Project Overview (mandatory) | ||
| - Basic details about the project (e.g., high-level overview and goals). | ||
| - Technology choices (e.g., languages, databases, frameworks, libraries, build tools). | ||
| - Reference (mandatory) | ||
| - List important code files. | ||
| - List important directories and basic code structure tips. | ||
| - Project architecture. | ||
| - Essential commands (mandatory) | ||
| - build | ||
| - format | ||
| - lint | ||
| - test | ||
| - clean | ||
| - development server | ||
| - other *important* scripts (use `find -type f -name '*.sh'` or similar) | ||
| - Patterns (optional) | ||
| - List any important or uncommon patterns (compared to other similar codebases), with examples (e.g., how to authorize an HTTP request). | ||
| - List any important workflows and their steps (e.g., how to make a database migration). | ||
| - Testing patterns. | ||
| - Anti-patterns (optional) | ||
| - Search git history and comments to find recurring mistakes or forbidden patterns. | ||
| - List each pattern and its reason. | ||
| - Code style (optional) | ||
| - Style guide to follow (with link). | ||
| - Commit and Pull Request Guidelines (mandatory) | ||
| - Required steps for validating changes before committing. | ||
| - Commit message conventions (read `git log`, or use `type: message` by default). | ||
| - Pull request description requirements. | ||
|
|
||
deansheather marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| You can add other sections if they are necessary. | ||
| If the information required for mandatory sections isn't available due to the workspace being empty or sparse, add TODO text in its place. | ||
| Optional sections should be scrapped if the information is too thin. | ||
|
|
||
| Some investigation tips: | ||
| - Read existing lint configs, tsconfig, and CI workflows to find any style or layout rules. | ||
| - Search for "TODO", "HACK", "FIXME", "don't", "never", "always" in comments. | ||
| - Examine test files for patterns. | ||
| - Read PR templates and issue templates if they exist. | ||
| - Check for existing CONTRIBUTING.md, CODE_OF_CONDUCT.md, or similar documentation files. | ||
|
|
||
| Some writing tips: | ||
| - Each "do X" should have a corresponding "don't Y" where applicable. | ||
| - Commands should be easily copy-pastable and tested. | ||
| - Terms or phrases specific to this project should be explained on first use. | ||
| - Anything that is against the norm should be explicitly highlighted and called out. | ||
|
|
||
| Above all things: | ||
| - The document must be clear and concise. Simple projects should need less than 400 words, but larger and more mature codebases will likely need 700+. Prioritize completeness over brevity. | ||
| - Don't include useless fluff. | ||
| - The document must be in Markdown format and use headings for structure. | ||
| - Give examples where necessary or helpful (commands, directory paths, naming patterns). | ||
| - Explanations and examples must be correct and specific to this codebase. | ||
| - Maintain a professional, instructional tone. | ||
|
|
||
| If the workspace is empty or sparse, ask the user for more information. Avoid hallucinating important decisions. You can provide suggestions to the user for language/technology/tool choices, but always respect the user's decision. | ||
| - Project description and goals. | ||
| - Language(s). | ||
| - Technologies (database?), frameworks, libraries. | ||
| - Tools. | ||
| - Any other questions as you deem necessary. | ||
|
|
||
| For empty or sparse workspaces ONLY, when finished writing AGENTS.md, ask the user if they would like you to do the following: | ||
| - initialize git IF it's not already set up (e.g., `git init`, `git remote add`, etc.) | ||
| - write a concise README.md file | ||
| - generate the bare minimum project scaffolding (e.g., initializing the package manager, writing a minimal build tool config) | ||
| </system> | ||
deansheather marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| declare module "*.txt?raw" { | ||
| const content: string; | ||
| export default content; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.