memento-momentum
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemento Momentum
Memento Momentum
This skill guides agents to prioritize project-specific, established commands and ensures that non-trivial command executions are documented with their Intent in a dedicated directory for auditability.
本技能指导Agent优先使用项目特有的既定命令,并确保非琐碎的命令执行会连同其Intent一起记录在专用目录中,以满足可审计性要求。
Core Mandates
核心规则
1. Prioritize Established Commands
1. 优先使用既定命令
Before executing any command to build, test, lint, or run the project, you SHOULD first research the repository for established task runners or scripts.
- Check for: ,
package.json,Makefile,tasks.json,Justfile, or scripts inTaskfile.yml,scripts/, orbin/.tools/ - Action: If an established command exists (e.g., instead of
npm run test), you SHOULD prefer it.vitest - Nuance: Standard, simple calls to established task runners (e.g., ,
npm run test) are considered safe and do not strictly require the creation of a documented script unless they are being modified or are part of a larger sequence.make build
在执行任何用于构建、测试、代码检查或运行项目的命令之前,你应当首先调研代码仓库中的既定任务运行器或脚本。
- 检查对象:,
package.json,Makefile,tasks.json,Justfile, 或Taskfile.yml,scripts/,bin/目录下的脚本。tools/ - 操作要求:如果存在既定命令(例如使用而非
npm run test),你应当优先选择该命令。vitest - 细节说明:对既定任务运行器的标准、简单调用(如,
npm run test)被视为安全操作,除非需要修改这些命令或它们属于更复杂的执行序列,否则无需严格要求创建记录脚本。make build
2. Document Non-Trivial Command Executions
2. 记录非琐碎的命令执行
To ensure auditability and persistence, AVOID executing bespoke or complex commands directly. Instead, follow this "Document-then-Execute" workflow for non-trivial tasks.
为确保可审计性和持久性,请勿直接执行定制化或复杂的命令。相反,对于非琐碎任务,请遵循以下“先记录后执行”工作流。
Workflow: Document-then-Execute
工作流:先记录后执行
- Preparation: Ensure the directory exists (e.g.,
.cmds-by-agents/).mkdir -p .cmds-by-agents - Creation: Use or an equivalent tool to create a shell script in
write_file..cmds-by-agents/- Naming Convention: .
<purpose>-<YYYYMMDD>-<HHMMSS>.sh - Content:
bash
#!/usr/bin/env bash # Intent: [Short description of why you are running this command] set -x [Full command here]
- Naming Convention:
- Permissions: Make the script executable ().
chmod +x - Execution: Run the generated script directly (e.g., ).
./.cmds-by-agents/script.sh
- 准备工作:确保目录存在(例如执行
.cmds-by-agents/)。mkdir -p .cmds-by-agents - 创建脚本:使用或等效工具在
write_file目录下创建一个Shell脚本。.cmds-by-agents/- 命名规范:。
<purpose>-<YYYYMMDD>-<HHMMSS>.sh - 内容:
bash
#!/usr/bin/env bash # Intent: [Short description of why you are running this command] set -x [Full command here]
- 命名规范:
- 设置权限:将脚本设置为可执行()。
chmod +x - 执行脚本:直接运行生成的脚本(例如)。
./.cmds-by-agents/script.sh
Exceptions
例外情况
- Simple research, navigation, and management commands (e.g., ,
ls,cd,mkdir,grep) are allowed to be run directly.git status - Standard, direct calls to established project scripts (e.g., ) may be run directly if they don't involve complex flags or environment setup.
npm start
- 简单的调研、导航和管理命令(如,
ls,cd,mkdir,grep)可直接运行。git status - 如果标准的、直接调用既定项目脚本的操作(如)不涉及复杂参数或环境配置,也可直接运行。
npm start
3. Security & Secrets
3. 安全与机密信息
- No Secrets: NEVER embed sensitive information (API keys, passwords, tokens) in the command script.
- Execution-Time Secrets: Sensitive environment variables must be provided at execution time, either by assuming they are provided by external tooling or by confirming with the user.
- No Leakage: If secrets are being handled, DO NOT use in the script to avoid leaking values in the output.
set -x
- 禁止嵌入机密:切勿在命令脚本中嵌入敏感信息(如API密钥、密码、令牌)。
- 执行时提供机密:敏感环境变量必须在执行时提供,可通过外部工具自动注入或向用户确认后获取。
- 防止泄露:如果处理机密信息,请勿在脚本中使用,以避免在输出中泄露敏感值。
set -x
Source Control
版本控制
- Do NOT commit the directory unless explicitly instructed. It should be ignored in
.cmds-by-agents/..gitignore
- 除非明确指示,否则请勿提交目录。该目录应在
.cmds-by-agents/中被忽略。.gitignore
Example Workflow
示例工作流
- Research: You find in
"test": "vitest".package.json - Simple Action: You may run directly.
npm run test - Bespoke Action: If you need to run tests with specific filters and a custom reporter:
- Create :
.cmds-by-agents/test-filtered-20260312-143005.shbash#!/usr/bin/env bash # Intent: Run only auth tests with verbose output for debugging set -x npm run test -- --filter="auth" --reporter=verbose chmod +x .cmds-by-agents/test-filtered-20260312-143005.sh./.cmds-by-agents/test-filtered-20260312-143005.sh
- Create
- 调研:你在中发现
package.json。"test": "vitest" - 简单操作:你可以直接运行。
npm run test - 定制化操作:如果你需要运行带有特定过滤器和自定义报告器的测试:
- 创建:
.cmds-by-agents/test-filtered-20260312-143005.shbash#!/usr/bin/env bash # Intent: Run only auth tests with verbose output for debugging set -x npm run test -- --filter="auth" --reporter=verbose chmod +x .cmds-by-agents/test-filtered-20260312-143005.sh./.cmds-by-agents/test-filtered-20260312-143005.sh
- 创建