lz-create-agentsmd
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineselz-create-agentsmd
Workflow
lz-create-agentsmdlz-create-agentsmd
工作流
lz-create-agentsmdYou are an expert AI engineering architect. Your task is to generate a comprehensive file in the root of this repository that enforces full-lifecycle engineering guardrails based on Context Engineering research.
AGENTS.mdYou MUST execute this workflow in the following three phases exactly as described.
您是一位资深AI工程架构师。您的任务是在本仓库的根目录生成一份全面的文件,该文件基于上下文工程研究实施全生命周期工程防护规则。
AGENTS.md您必须严格按照以下三个阶段执行此工作流。
Phase 1: Deep Semantic & AST/LSP Scan
阶段1:深度语义与AST/LSP扫描
You must thoroughly analyze the repository to extract business terms and architectural patterns.
- Tech Stack Discovery: Read package manager files (,
package.json,.csproj, etc.) to identify the core languages and test frameworks.pom.xml - Semantic / AST Search: Do not rely on simple regex grep. Use your AST or LSP semantic search tools (if available) to traverse the codebase structure. If not available, do a deep file-read traversal.
- Discover Ubiquitous Language (DDD): Identify the core business entities by looking at the Database Models, Entities, or domain classes.
- Discover Gold Standard Files: Find the 2-3 highest quality files that perfectly demonstrate the repository's desired architecture (e.g. a perfect Controller, a perfect Service class). These will be used for "Progressive Disclosure" to prevent Context Rot in the markdown.
您必须全面分析仓库,提取业务术语和架构模式。
- 技术栈发现:读取包管理器文件(、
package.json、.csproj等),识别核心语言和测试框架。pom.xml - 语义/AST搜索:不要依赖简单的正则表达式搜索。如果可用,请使用AST或LSP语义搜索工具遍历代码库结构。如果不可用,请进行深度文件读取遍历。
- 发现通用语言(DDD):通过查看数据库模型、实体或领域类,识别核心业务实体。
- 发现黄金标准文件:找到2-3个最能体现仓库理想架构的高质量文件(例如,一个完美的Controller、一个完美的Service类)。这些文件将用于“渐进式披露”,以防止markdown中的上下文偏差。
Phase 2: User Interview (Chained ask_question
)
ask_question阶段2:用户访谈(链式ask_question
)
ask_questionYou MUST NOT generate the file yet. You must present your findings and interview the user using your tool.
Iteratively ask the user:
ask_question- "I have detected the following core Domain entities: . Do you want to enforce these as the strict Ubiquitous Language so future agents don't hallucinate variable names?" (Allow them to add/remove terms).
[List] - "I found and
[File 1]as excellent representations of your architecture. Should I set these as the 'Gold Standard' reference files, or do you have better examples?"[File 2] - "What is the exact CLI command required to run the automated tests with coverage for this project?"
- "Are there any strict negative constraints or security policies you want enforced? (e.g. 'Never use raw SQL', 'Always use AWS Secrets Manager')."
- "What are your Git and Workflow conventions? (e.g., branch naming like , rules against force pushing, commit formats)."
feature/JIRA-123
您不得立即生成文件。您必须展示您的发现,并使用工具对用户进行访谈。
迭代向用户询问:
ask_question- “我已检测到以下核心领域实体:。您是否要将这些作为严格的通用语言强制执行,以避免未来的Agent出现变量名称幻觉?”(允许用户添加/删除术语)。
[列表] - “我发现和
[文件1]是您架构的优秀代表。我是否应将这些设置为‘黄金标准’参考文件,还是您有更好的示例?”[文件2] - “运行此项目的自动化测试并生成覆盖率报告的确切CLI命令是什么?”
- “您是否有任何需要强制执行的严格负面约束或安全策略?(例如:‘禁止使用原生SQL’、‘必须使用AWS Secrets Manager’)。”
- “您的Git和工作流约定是什么?(例如,分支命名如、禁止强制推送的规则、提交格式)。”
feature/JIRA-123
Phase 3: Template Generation
阶段3:模板生成
Once you have the user's explicit answers from Phase 2:
- Read the file located in your skill directory to understand the exact structure required.
TEMPLATE_AGENTS.md - Inject the user's validated answers (DDD terms, Gold Standard file links, Test commands, Security rules) into the template structure.
- Write the final to the root of the user's repository.
AGENTS.md - Print a success message confirming the full-lifecycle engineering guardrails have been applied.
一旦您获得阶段2中用户的明确答复:
- 读取您技能目录中的文件,了解所需的确切结构。
TEMPLATE_AGENTS.md - 将用户验证后的答复(DDD术语、黄金标准文件链接、测试命令、安全规则)注入模板结构。
- 将最终的写入用户仓库的根目录。
AGENTS.md - 打印成功消息,确认已应用全生命周期工程防护规则。