Loading...
Loading...
Compare original and translation side by side
start-shorthandend-shorthandstart-shorthandend-shorthand${language:comment} start-shorthand${language:comment} end-shorthand// start-shorthand
()=> add validation for email field
()=> check if user is authenticated before allowing access
// end-shorthand${language:comment} start-shorthand${language:comment} end-shorthand// start-shorthand
()=> add validation for email field
()=> check if user is authenticated before allowing access
// end-shorthand()=>()=>()=>()=>REMOVE COMMENTNOTEREMOVE COMMENTNOTE// Collaborator provides: "Use our logging utility from utils/logger.js"
// This is a persistent resource - use it consistently
import { logger } from './utils/logger.js';
function processData(data) {
logger.info('Processing data batch', { count: data.length });
// Implementation continues...
}// Collaborator provides: "For this migration, use this data mapping from migration-map.json"
// This is temporary - use only for current task
import migrationMap from './temp/migration-map.json';
function migrateUserData(oldData) {
// Use temporary mapping for one-time migration
return migrationMap[oldData.type] || oldData;
}// Collaborator provides: "Use our logging utility from utils/logger.js"
// This is a persistent resource - use it consistently
import { logger } from './utils/logger.js';
function processData(data) {
logger.info('Processing data batch', { count: data.length });
// Implementation continues...
}// Collaborator provides: "For this migration, use this data mapping from migration-map.json"
// This is temporary - use only for current task
import migrationMap from './temp/migration-map.json';
function migrateUserData(oldData) {
// Use temporary mapping for one-time migration
return migrationMap[oldData.type] || oldData;
}()=> 90% comment, 10% pseudo-code - interpret and implement
ALWAYS remove these lines when editing
start-shorthand Begin shorthand section
end-shorthand End shorthand section
openPrompt ["quasi-coder", "quasi-code", "shorthand"]
language:comment Single or multi-line comment in target language
openMarker "${language:comment} start-shorthand"
closeMarker "${language:comment} end-shorthand"()=> 90%注释、10%伪代码 - 解读并实现
编辑时务必删除这些行
start-shorthand 简写内容开始标记
end-shorthand 简写内容结束标记
openPrompt ["quasi-coder", "quasi-code", "shorthand"]
language:comment 目标语言的单行或多行注释
openMarker "${language:comment} start-shorthand"
closeMarker "${language:comment} end-shorthand"()=>()=>openPrompt = ["quasi-coder", "quasi-code", "shorthand"]
// Triggers that indicate quasi-coder should be used
language:comment = "Single or multi-line comment of programming language"
// Comment syntax appropriate for the file type
openMarker = "${language:comment} start-shorthand"
// Example: // start-shorthand (JavaScript)
// Example: # start-shorthand (Python)
// Example: <!-- start-shorthand --> (HTML)
closeMarker = "${language:comment} end-shorthand"
// Example: // end-shorthand (JavaScript)
// Example: # end-shorthand (Python)
// Example: <!-- end-shorthand --> (HTML)openPrompt = ["quasi-coder", "quasi-code", "shorthand"]
// Triggers that indicate quasi-coder should be used
language:comment = "Single or multi-line comment of programming language"
// Comment syntax appropriate for the file type
openMarker = "${language:comment} start-shorthand"
// Example: // start-shorthand (JavaScript)
// Example: # start-shorthand (Python)
// Example: <!-- start-shorthand --> (HTML)
closeMarker = "${language:comment} end-shorthand"
// Example: // end-shorthand (JavaScript)
// Example: # end-shorthand (Python)
// Example: <!-- end-shorthand --> (HTML)// start-shorthand
()=> create function that validates user input
()=> check email format is correct
()=> make sure password is at least 8 characters
()=> return true if valid, false otherwise
// end-shorthand// start-shorthand
()=> create function that validates user input
()=> check email format is correct
()=> make sure password is at least 8 characters
()=> return true if valid, false otherwise
// end-shorthand/**
* Validates user registration input
* @param {string} email - User email address
* @param {string} password - User password
* @returns {boolean} True if input is valid, false otherwise
*/
function validateUserInput(email, password) {
// Validate email format using standard regex pattern
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
return false;
}
// Validate password meets minimum length requirement
if (!password || password.length < 8) {
return false;
}
return true;
}/**
* Validates user registration input
* @param {string} email - User email address
* @param {string} password - User password
* @returns {boolean} True if input is valid, false otherwise
*/
function validateUserInput(email, password) {
// Validate email format using standard regex pattern
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
return false;
}
// Validate password meets minimum length requirement
if (!password || password.length < 8) {
return false;
}
return true;
}()=>()=>| Issue | Solution |
|---|---|
| Unclear intent from collaborator | Ask specific clarifying questions about the goal and expected behavior |
| Multiple valid approaches | Present options with recommendations, explaining trade-offs of each |
| Collaborator insists on suboptimal approach | Implement their approach but respectfully explain trade-offs and alternatives |
| Missing context or dependencies | Read related files, check package.json, review existing patterns in the codebase |
| Conflicting requirements | Clarify priorities with the collaborator before implementing |
| Shorthand requests non-code actions | Execute the requested action (run commands, create files, fetch data) and remove shorthand |
| Terminology doesn't match available tools | Research correct terminology and use appropriate libraries/methods |
| No markers but clear shorthand intent | Process as shorthand even without formal markers if intent is clear |
| 问题 | 解决方案 |
|---|---|
| 合作者意图不明确 | 询问关于目标与预期行为的具体澄清问题 |
| 存在多种有效实现方式 | 提供选项并给出建议,解释每种方案的权衡 |
| 合作者坚持次优方案 | 按其要求实现,但礼貌地解释权衡与替代方案 |
| 缺少上下文或依赖 | 阅读相关文件、检查package.json、参考代码库中的现有模式 |
| 需求冲突 | 实现前与合作者明确优先级 |
| 简写要求非代码操作 | 执行请求的操作(运行命令、创建文件、获取数据)并删除简写内容 |
| 术语与可用工具不匹配 | 研究正确术语并使用合适的库/方法 |
| 无标记但简写意图明确 | 若意图清晰,即使无正式标记也按简写处理 |
()=>()=>undefinedundefined
**Expert Translation** (Python doesn't have forEach, use appropriate Python pattern):
```python
**专业转换**(Python没有forEach,使用合适的Python模式):
```pythonundefinedundefined// start-shorthand
()=> fetch current weather from API
()=> save response to weather.json file
// end-shorthand// start-shorthand
()=> fetch current weather from API
()=> save response to weather.json file
// end-shorthand// start-shorthand
()=> check if user is logged in
()=> if not, redirect to login page
()=> if yes, load user dashboard with their data
()=> show error if data fetch fails
// end-shorthand// start-shorthand
()=> check if user is logged in
()=> if not, redirect to login page
()=> if yes, load user dashboard with their data
()=> show error if data fetch fails
// end-shorthand()=>()=>