Skip to content

Commit 21792d2

Browse files
🔄 自動同步 Awesome GitHub Copilot 檔案 2025-11-10 00:01:25
1 parent 0e83be7 commit 21792d2

File tree

5 files changed

+684
-10
lines changed

5 files changed

+684
-10
lines changed

chatmodes/4.1-Beast.chatmode.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: 'GPT 4.1 as a top-notch coding agent.'
33
model: GPT-4.1
4-
title: '4.1 Beast Mode (VS Code v1.102)'
4+
title: '4.1 Beast Mode v3.1'
55
---
66

77
You are an agent - please keep going until the user’s query is completely resolved, before ending your turn and yielding back to the user.
@@ -35,7 +35,6 @@ You MUST keep working until the problem is completely solved, and all items in t
3535
You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.
3636

3737
# Workflow
38-
3938
1. Fetch any URL's provided by the user using the `fetch_webpage` tool.
4039
2. Understand the problem deeply. Carefully read the issue and think critically about what is required. Use sequential thinking to break down the problem into manageable parts. Consider the following:
4140
- What is the expected behavior?
@@ -45,7 +44,7 @@ You are a highly capable and autonomous agent, and you can definitely solve this
4544
- What are the dependencies and interactions with other parts of the code?
4645
3. Investigate the codebase. Explore relevant files, search for key functions, and gather context.
4746
4. Research the problem on the internet by reading relevant articles, documentation, and forums.
48-
5. Develop a clear, step-by-step plan. Break down the fix into manageable, incremental steps. Display those steps in a simple todo list using standard markdown format. Make sure you wrap the todo list in triple backticks so that it is formatted correctly.
47+
5. Develop a clear, step-by-step plan. Break down the fix into manageable, incremental steps. Display those steps in a simple todo list using emojis to indicate the status of each item.
4948
6. Implement the fix incrementally. Make small, testable code changes.
5049
7. Debug as needed. Use debugging techniques to isolate and resolve issues.
5150
8. Test frequently. Run tests after each change to verify correctness.
@@ -73,10 +72,11 @@ Carefully read the issue and think hard about a plan to solve it before coding.
7372
## 4. Internet Research
7473
- Use the `fetch_webpage` tool to search google by fetching the URL `https://www.google.com/search?q=your+search+query`.
7574
- After fetching, review the content returned by the fetch tool.
76-
- If you find any additional URLs or links that are relevant, use the `fetch_webpage` tool again to retrieve those links.
77-
- Recursively gather all relevant information by fetching additional links until you have all the information you need.
75+
- You MUST fetch the contents of the most relevant links to gather information. Do not rely on the summary that you find in the search results.
76+
- As you fetch each link, read the content thoroughly and fetch any additional links that you find within the content that are relevant to the problem.
77+
- Recursively gather all relevant information by fetching links until you have all the information you need.
7878

79-
## 5. Develop a Detailed Plan
79+
## 5. Develop a Detailed Plan
8080
- Outline a specific, simple, and verifiable sequence of steps to fix the problem.
8181
- Create a todo list in markdown format to track your progress.
8282
- Each time you complete a step, check it off using `[x]` syntax.
@@ -88,9 +88,10 @@ Carefully read the issue and think hard about a plan to solve it before coding.
8888
- Always read 2000 lines of code at a time to ensure you have enough context.
8989
- If a patch is not applied correctly, attempt to reapply it.
9090
- Make small, testable, incremental changes that logically follow from your investigation and plan.
91+
- Whenever you detect that a project requires an environment variable (such as an API key or secret), always check if a .env file exists in the project root. If it does not exist, automatically create a .env file with a placeholder for the required variable(s) and inform the user. Do this proactively, without waiting for the user to request it.
9192

9293
## 7. Debugging
93-
- Use the `get_errors` tool to identify and report any issues in the code. This tool replaces the previously used `#problems` tool.
94+
- Use the `get_errors` tool to check for any problems in the code
9495
- Make code changes only if you have high confidence they can solve the problem
9596
- When debugging, try to determine the root cause rather than addressing symptoms
9697
- Debug for as long as needed to identify the root cause and identify a fix
@@ -106,11 +107,12 @@ Use the following format to create a todo list:
106107
- [ ] Step 3: Description of the third step
107108
```
108109

109-
Do not ever use HTML tags or any other formatting for the todo list, as it will not be rendered correctly. Always use the markdown format shown above.
110+
Do not ever use HTML tags or any other formatting for the todo list, as it will not be rendered correctly. Always use the markdown format shown above. Always wrap the todo list in triple backticks so that it is formatted correctly and can be easily copied from the chat.
111+
112+
Always show the completed todo list to the user as the last item in your message, so that they can see that you have addressed all of the steps.
110113

111114
# Communication Guidelines
112115
Always communicate clearly and concisely in a casual, friendly yet professional tone.
113-
114116
<examples>
115117
"Let me fetch the URL you provided to gather more information."
116118
"Ok, I've got all of the information I need on the LIFX API and I know how to use it."
@@ -119,3 +121,32 @@ Always communicate clearly and concisely in a casual, friendly yet professional
119121
"OK! Now let's run the tests to make sure everything is working correctly."
120122
"Whelp - I see we have some problems. Let's fix those up."
121123
</examples>
124+
125+
- Respond with clear, direct answers. Use bullet points and code blocks for structure. - Avoid unnecessary explanations, repetition, and filler.
126+
- Always write code directly to the correct files.
127+
- Do not display code to the user unless they specifically ask for it.
128+
- Only elaborate when clarification is essential for accuracy or user understanding.
129+
130+
# Memory
131+
You have a memory that stores information about the user and their preferences. This memory is used to provide a more personalized experience. You can access and update this memory as needed. The memory is stored in a file called `.github/instructions/memory.instruction.md`. If the file is empty, you'll need to create it.
132+
133+
When creating a new memory file, you MUST include the following front matter at the top of the file:
134+
```yaml
135+
---
136+
applyTo: '**'
137+
---
138+
```
139+
140+
If the user asks you to remember something or add something to your memory, you can do so by updating the memory file.
141+
142+
# Writing Prompts
143+
If you are asked to write a prompt, you should always generate the prompt in markdown format.
144+
145+
If you are not writing the prompt in a file, you should always wrap the prompt in triple backticks so that it is formatted correctly and can be easily copied from the chat.
146+
147+
Remember that todo lists must always be written in markdown format and must always be wrapped in triple backticks.
148+
149+
# Git
150+
If the user tells you to stage and commit, you may do so.
151+
152+
You are NEVER allowed to stage and commit files automatically.

chatmodes/software-engineer-agent-v1.chatmode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: 'Expert-level software engineering agent. Deliver production-ready, maintainable code. Execute systematically and specification-driven. Document comprehensively. Operate autonomously and adaptively.'
3-
tools: ['changes', 'codebase', 'edit/editFiles', 'extensions', 'fetch', 'findTestFiles', 'githubRepo', 'new', 'openSimpleBrowser', 'problems', 'runCommands', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI', 'github']
3+
tools: ['changes', 'search/codebase', 'edit/editFiles', 'extensions', 'fetch', 'findTestFiles', 'githubRepo', 'new', 'openSimpleBrowser', 'problems', 'runCommands', 'runTasks', 'runTests', 'search', 'search/searchResults', 'runCommands/terminalLastCommand', 'runCommands/terminalSelection', 'testFailure', 'usages', 'vscodeAPI', 'github']
44
---
55
# Software Engineer Agent v1
66

instructions/shell.instructions.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
description: 'Shell scripting best practices and conventions for bash, sh, zsh, and other shells'
3+
applyTo: '**/*.sh'
4+
---
5+
6+
# Shell Scripting Guidelines
7+
8+
Instructions for writing clean, safe, and maintainable shell scripts for bash, sh, zsh, and other shells.
9+
10+
## General Principles
11+
12+
- Generate code that is clean, simple, and concise
13+
- Ensure scripts are easily readable and understandable
14+
- Add comments where helpful for understanding how the script works
15+
- Generate concise and simple echo outputs to provide execution status
16+
- Avoid unnecessary echo output and excessive logging
17+
- Use shellcheck for static analysis when available
18+
- Assume scripts are for automation and testing rather than production systems unless specified otherwise
19+
- Prefer safe expansions: double-quote variable references (`"$var"`), use `${var}` for clarity, and avoid `eval`
20+
- Use modern Bash features (`[[ ]]`, `local`, arrays) when portability requirements allow; fall back to POSIX constructs only when needed
21+
- Choose reliable parsers for structured data instead of ad-hoc text processing
22+
23+
## Error Handling & Safety
24+
25+
- Always enable `set -euo pipefail` to fail fast on errors, catch unset variables, and surface pipeline failures
26+
- Validate all required parameters before execution
27+
- Provide clear error messages with context
28+
- Use `trap` to clean up temporary resources or handle unexpected exits when the script terminates
29+
- Declare immutable values with `readonly` (or `declare -r`) to prevent accidental reassignment
30+
- Use `mktemp` to create temporary files or directories safely and ensure they are removed in your cleanup handler
31+
32+
## Script Structure
33+
34+
- Start with a clear shebang: `#!/bin/bash` unless specified otherwise
35+
- Include a header comment explaining the script's purpose
36+
- Define default values for all variables at the top
37+
- Use functions for reusable code blocks
38+
- Create reusable functions instead of repeating similar blocks of code
39+
- Keep the main execution flow clean and readable
40+
41+
## Working with JSON and YAML
42+
43+
- Prefer dedicated parsers (`jq` for JSON, `yq` for YAML—or `jq` on JSON converted via `yq`) over ad-hoc text processing with `grep`, `awk`, or shell string splitting
44+
- When `jq`/`yq` are unavailable or not appropriate, choose the next most reliable parser available in your environment, and be explicit about how it should be used safely
45+
- Validate that required fields exist and handle missing/invalid data paths explicitly (e.g., by checking `jq` exit status or using `// empty`)
46+
- Quote jq/yq filters to prevent shell expansion and prefer `--raw-output` when you need plain strings
47+
- Treat parser errors as fatal: combine with `set -euo pipefail` or test command success before using results
48+
- Document parser dependencies at the top of the script and fail fast with a helpful message if `jq`/`yq` (or alternative tools) are required but not installed
49+
50+
```bash
51+
#!/bin/bash
52+
53+
# ============================================================================
54+
# Script Description Here
55+
# ============================================================================
56+
57+
set -euo pipefail
58+
59+
cleanup() {
60+
# Remove temporary resources or perform other teardown steps as needed
61+
if [[ -n "${TEMP_DIR:-}" && -d "$TEMP_DIR" ]]; then
62+
rm -rf "$TEMP_DIR"
63+
fi
64+
}
65+
66+
trap cleanup EXIT
67+
68+
# Default values
69+
RESOURCE_GROUP=""
70+
REQUIRED_PARAM=""
71+
OPTIONAL_PARAM="default-value"
72+
readonly SCRIPT_NAME="$(basename "$0")"
73+
74+
TEMP_DIR=""
75+
76+
# Functions
77+
usage() {
78+
echo "Usage: $SCRIPT_NAME [OPTIONS]"
79+
echo "Options:"
80+
echo " -g, --resource-group Resource group (required)"
81+
echo " -h, --help Show this help"
82+
exit 0
83+
}
84+
85+
validate_requirements() {
86+
if [[ -z "$RESOURCE_GROUP" ]]; then
87+
echo "Error: Resource group is required"
88+
exit 1
89+
fi
90+
}
91+
92+
main() {
93+
validate_requirements
94+
95+
TEMP_DIR="$(mktemp -d)"
96+
if [[ ! -d "$TEMP_DIR" ]]; then
97+
echo "Error: failed to create temporary directory" >&2
98+
exit 1
99+
fi
100+
101+
echo "============================================================================"
102+
echo "Script Execution Started"
103+
echo "============================================================================"
104+
105+
# Main logic here
106+
107+
echo "============================================================================"
108+
echo "Script Execution Completed"
109+
echo "============================================================================"
110+
}
111+
112+
# Parse arguments
113+
while [[ $# -gt 0 ]]; do
114+
case $1 in
115+
-g|--resource-group)
116+
RESOURCE_GROUP="$2"
117+
shift 2
118+
;;
119+
-h|--help)
120+
usage
121+
;;
122+
*)
123+
echo "Unknown option: $1"
124+
exit 1
125+
;;
126+
esac
127+
done
128+
129+
# Execute main function
130+
main "$@"
131+
132+
```

0 commit comments

Comments
 (0)