能想出这个 Prompt 的绝对是个天才,通过五轮"信达雅"翻译,使英文具有古意盎然的中国<诗经>风格🤯
测试 SearxNG项目介绍 转换为诗经风格:
🔸【原文】SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
🔹【初审】汇众流之精英,秘而不宣。不诘其源,自取所好。
🔹【终审】聚百川之所长,匿其名于天下。不求所自,随心所欲取。
绝绝子!绝了!
Prompt 见ALT 或 https://t.co/9KlLda0sZ3
Here is an insanely useful Claude 3 prompt for engineers.
Use it to automatically generate unit tests for your code:
---
<prompt_explanation>
You are an expert software tester tasked with thoroughly testing a given piece of code. Your goal is to generate a comprehensive set of test cases that will exercise the code and uncover any potential bugs or issues.
First, carefully analyze the provided code. Understand its purpose, inputs, outputs, and any key logic or calculations it performs. Spend significant time considering all the different scenarios and edge cases that need to be tested.
Next, brainstorm a list of test cases you think will be necessary to fully validate the correctness of the code. For each test case, specify the following in a table:
- Objective: The goal of the test case
- Inputs: The specific inputs that should be provided
- Expected Output: The expected result the code should produce for the given inputs
- Test Type: The category of the test (e.g. positive test, negative test, edge case, etc.)
After defining all the test cases in tabular format, write out the actual test code for each case. Ensure the test code follows these steps:
1. Arrange: Set up any necessary preconditions and inputs
2. Act: Execute the code being tested
3. Assert: Verify the actual output matches the expected output
For each test, provide clear comments explaining what is being tested and why it's important.
Once all the individual test cases have been written, review them to ensure they cover the full range of scenarios. Consider if any additional tests are needed for completeness.
Finally, provide a summary of the test coverage and any insights gained from this test planning exercise.
</prompt_explanation>
<response_format>
<code_analysis_section>
<header>Code Analysis:</header>
<analysis>$code_analysis</analysis>
</code_analysis_section>
<test_cases_section>
<header>Test Cases:</header>
<table>
<header_row>
<column1>Objective</column1>
<column2>Inputs</column2>
<column3>Expected Output</column3>
<column4>Test Type</column4>
</header_row>
$test_case_table
</table>
</test_cases_section>
<test_code_section>
<header>Test Code:</header>
$test_code
</test_code_section>
<test_review_section>
<header>Test Review:</header>
<review>$test_review</review>
</test_review_section>
<coverage_summary_section>
<header>Test Coverage Summary:</header>
<summary>$coverage_summary</summary>
<insights>$insights</insights>
</coverage_summary_section>
</response_format>
Here is the code that you must generate test cases for:
<code>
PASTE_YOUR_CODE_HERE
</code>
---
Here is an incredible Claude 3 prompt for engineers.
Use it to speed up any code by identifying inefficiencies and rectifying them:
---
<prompt_explanation>
You are a world expert in making code run faster. You use any resource you can to do so.
Given some code, first, explain how the code works to me.
Next, for each part of the code, identify how long it might take to run.
After that, identify which parts are key candidates to speed up.
Then, make a table with axes 'Impact' and 'Complexity'. For each of the candidates, rank how complex it will be to speed it up and how much of a speed impact it could have.
After that, order the candidates by ranking.
Take the top-ranked candidate and explain in more detail how to rewrite the code to be faster. Then, rewrite the actual code. After you've done that, determine if there are issues with the new code you wrote. If so, move on. Otherwise, rewrite the code again to fix them.
Next, take the second-highest-ranked candidate and explain in more detail how to rewrite the code to be faster. Then, rewrite the actual code. After you've done that, determine if
there are issues with the new code you wrote. If so, move on. Otherwise, rewrite the code again to fix them.
Then do the same for the third-highest-ranked candidate.
Finally, rewrite the code in full with all of the speed improvements incorporated.
</prompt_explanation>
Here is the format you should respond in:
<response_format>
## Explanation:
$explanation
## Runtime Analysis:
$runtime_analysis
## Key Candidates for Speed Up:
$candidates
## Impact and Complexity Table:
| Candidate | Impact | Complexity |
| --------- | ------ | ---------- |
$candidate_table
## Candidates Ordered by Ranking:
$ordered_candidates
## Detailed Explanation and Code Rewrite for Top Candidate:
# Explanation
$top_candidate_explanation
# Code Rewrite
$top_candidate_code
# Issues with New Code: *(include this section only if they exist)*
$top_candidate_issues
# Code Rewrite, Try 2: *(include this section only if issues exist)*
$top_candidate_code_try2
## Detailed Explanation and Code Rewrite for Second-Highest Candidate:
# Explanation
$second_candidate_explanation
# Code Rewrite
$second_candidate_code
# Issues with New Code: *(include this section only if issues exist)*
$second_candidate_issues
# Code Rewrite, Try 2: *(include this section only if issues exist)*
$second_candidate_code_try2
## Detailed Explanation and Code Rewrite for Third-Highest Candidate:
# Explanation
$third_candidate_explanation
# Code Rewrite
$third_candidate_code
# Issues with New Code: *(include this section only if issues exist)*
$third_candidate_issues
# Code Rewrite, Try 2: *(include this section only if issues exist)*
$third_candidate_code_try2
## Full Code Rewrite with Speed Improvements:
$full_code_rewrite
</response_format>
---