4 lines
16 KiB
JSON
4 lines
16 KiB
JSON
{"timestamp":"2025-09-22T15:47:28.723Z","type":"session_meta","payload":{"id":"0199721b-cb00-77f3-b55e-968db7e015fe","timestamp":"2025-09-22T15:47:28.128Z","cwd":"C:\\GitCode\\paiban","originator":"codex_cli_rs","cli_version":"0.39.0","instructions":"## 开发规则\r\n\r\n你是一名经验丰富的[专业领域,例如:软件开发工程师 / 系统设计师 / 代码架构师],专注于构建[核心特长,例如:高性能 / 可维护 / 健壮 / 领域驱动]的解决方案。\r\n\r\n你的任务是:**审查、理解并迭代式地改进/推进一个[项目类型,例如:现有代码库 / 软件项目 / 技术流程]。**\r\n\r\n在整个工作流程中,你必须内化并严格遵循以下核心编程原则,确保你的每次输出和建议都体现这些理念:\r\n\r\n- **简单至上 (KISS):** 追求代码和设计的极致简洁与直观,避免不必要的复杂性。\r\n- **精益求精 (YAGNI):** 仅实现当前明确所需的功能,抵制过度设计和不必要的未来特性预留。\r\n- **坚实基础 (SOLID):**\r\n - **S (单一职责):** 各组件、类、函数只承担一项明确职责。\r\n - **O (开放/封闭):** 功能扩展无需修改现有代码。\r\n - **L (里氏替换):** 子类型可无缝替换其基类型。\r\n - **I (接口隔离):** 接口应专一,避免“胖接口”。\r\n - **D (依赖倒置):** 依赖抽象而非具体实现。\r\n- **杜绝重复 (DRY):** 识别并消除代码或逻辑中的重复模式,提升复用性。\r\n\r\n**请严格遵循以下工作流程和输出要求:**\r\n\r\n1. **深入理解与初步分析(理解阶段):**\r\n\r\n - 详细审阅提供的[资料/代码/项目描述],全面掌握其当前架构、核心组件、业务逻辑及痛点。\r\n - 在理解的基础上,初步识别项目中潜在的**KISS, YAGNI, DRY, SOLID**原则应用点或违背现象。\r\n\r\n2. **明确目标与迭代规划(规划阶段):**\r\n\r\n - 基于用户需求和对现有项目的理解,清晰定义本次迭代的具体任务范围和可衡量的预期成果。\r\n - 在规划解决方案时,优先考虑如何通过应用上述原则,实现更简洁、高效和可扩展的改进,而非盲目增加功能。\r\n\r\n3. **分步实施与具体改进(执行阶段):**\r\n\r\n - 详细说明你的改进方案,并将其拆解为逻辑清晰、可操作的步骤。\r\n - 针对每个步骤,具体阐述你将如何操作,以及这些操作如何体现**KISS, YAGNI, DRY, SOLID**原则。例如:\r\n - “将此模块拆分为更小的服务,以遵循 SRP 和 OCP。”\r\n - “为避免 DRY,将重复的 XXX 逻辑抽象为通用函数。”\r\n - “简化了 Y 功能的用户流,体现 KISS 原则。”\r\n - “移除了 Z 冗余设计,遵循 YAGNI 原则。”\r\n - 重点关注[项目类型,例如:代码质量优化 / 架构重构 / 功能增强 / 用户体验提升 / 性能调优 / 可维护性改善 / Bug 修复]的具体实现细节。\r\n\r\n4. **总结、反思与展望(汇报阶段):**\r\n - 提供一个清晰、结构化且包含**实际代码/设计变动建议(如果适用)**的总结报告。\r\n - 报告中必须包含:\r\n - **本次迭代已完成的核心任务**及其具体成果。\r\n - **本次迭代中,你如何具体应用了** **KISS, YAGNI, DRY, SOLID** **原则**,并简要说明其带来的好处(例如,代码量减少、可读性提高、扩展性增强)。\r\n - **遇到的挑战**以及如何克服。\r\n - **下一步的明确计划和建议。**\r\n\r\n---\r\n\r\n### 编码输出/语言偏好###\r\n## Communication & Language\r\n- Default language: Simplified Chinese for issues, PRs, and assistant replies, unless a thread explicitly requests English.\r\n- Keep code identifiers, CLI commands, logs, and error messages in their original language; add concise Chinese explanations when helpful.\r\n- To switch languages, state it clearly in the conversation or PR description.\r\n\r\n## File Encoding\r\nWhen modifying or adding any code files, the following coding requirements must be adhered to:\r\n- Encoding should be unified to UTF-8 (without BOM). It is strictly prohibited to use other local encodings such as GBK/ANSI, and it is strictly prohibited to submit content containing unreadable characters.\r\n- When modifying or adding files, be sure to save them in UTF-8 format; if you find any files that are not in UTF-8 format before submitting, please convert them to UTF-8 before submitting.\n\n--- project-doc ---\n\n# Repository Guidelines\r\n\r\n## Project Structure & Module Organization\r\nSource lives under the solution `NPP.SmartSchedue.sln`. `NPP.SmartSchedue.Host` hosts the ASP.NET Core app, with environment settings in `appsettings*.json`, seed scripts in `ConfigCenter` and `InitData`, and static assets in `wwwroot`. Domain services sit in `NPP.SmartSchedue.Api`, organized into `Core` (attributes, constants), `Services` (business logic), and `Repositories` (data access). Shared contracts, DTOs, and interfaces reside in `NPP.SmartSchedue.Api.Contracts`; keep cross-project types there. Tests are in `NPP.SmartSchedue.Tests`, with reusable fixtures in `BaseTest` and service-focused integration suites under `Services`.\r\n\r\n## Build, Test, and Development Commands\r\n- `dotnet restore NPP.SmartSchedue.sln` restores all project dependencies.\r\n- `dotnet build NPP.SmartSchedue.sln -c Release` validates compilation; use `-c Debug` during local iteration.\r\n- `dotnet run --project NPP.SmartSchedue.Host` boots the API with the default profile; add `--launch-profile Development` when you need local CAP setups.\r\n- `dotnet test NPP.SmartSchedue.Tests/NPP.SmartSchedue.Tests.csproj --logger \"trx;LogFileName=test-results.trx\"` exercises the xUnit suites and saves artifacts for PR review.\r\n\r\n## Coding Style & Naming Conventions\r\nTarget .NET 9 defaults: four-space indentation, braces on new lines, and explicit namespaces. Use `PascalCase` for classes, public members, and DTOs, `camelCase` for locals and private fields, and prefix interfaces with `I` as seen in `Api.Contracts`. Suffix asynchronous methods with `Async`, and keep request/response models in the Contracts project. Run `dotnet format` before committing to enforce spacing and using-order consistency.\r\n\r\n## Testing Guidelines\r\nWrite xUnit tests alongside existing patterns such as `EquipmentMaintenanceIntegrationTest`. Name new files `{Feature}Test.cs` or `{Feature}IntegrationTest.cs`, group helper logic in `BaseTest`, and rely on `Microsoft.AspNetCore.Mvc.Testing` for host bootstrapping. Aim to cover new service paths and repository edge cases; add mocks via Moq where external systems (CAP, RabbitMQ, MySQL) would otherwise be required.\r\n\r\n## Commit & Pull Request Guidelines\r\nPrefer descriptive commits (`feat(scheduling): add notification workflow`) instead of numeric placeholders seen in recent history. Bundle related changes, include migration or config adjustments in the same commit, and reference tracking IDs where relevant. Pull requests should outline the change, list manual or automated test evidence, mention configuration impacts (CAP, FreeSql, message queues), and supply screenshots for any UI updates under `wwwroot`.\r\n\r\n## Configuration & Environment Notes\r\nKeep secrets out of `appsettings.json`; use user secrets or environment variables for connection strings and CAP brokers. Document any required RabbitMQ or MySQL endpoints in the PR. When adding assets or scripts, mirror the structure under `ConfigCenter`, `InitData`, and `wwwroot` so the publish targets continue copying them correctly.\r\n","git":{"commit_hash":"2b3f9acdce96bfa8be7e2cdb15dd399be53e969d","branch":"master","repository_url":"https://git.comzg.com/WuXi/paiban.git"}}}
|
||
{"timestamp":"2025-09-22T15:47:29.909Z","type":"response_item","payload":{"type":"message","role":"user","content":[{"type":"input_text","text":"<user_instructions>\n\n## 开发规则\r\n\r\n你是一名经验丰富的[专业领域,例如:软件开发工程师 / 系统设计师 / 代码架构师],专注于构建[核心特长,例如:高性能 / 可维护 / 健壮 / 领域驱动]的解决方案。\r\n\r\n你的任务是:**审查、理解并迭代式地改进/推进一个[项目类型,例如:现有代码库 / 软件项目 / 技术流程]。**\r\n\r\n在整个工作流程中,你必须内化并严格遵循以下核心编程原则,确保你的每次输出和建议都体现这些理念:\r\n\r\n- **简单至上 (KISS):** 追求代码和设计的极致简洁与直观,避免不必要的复杂性。\r\n- **精益求精 (YAGNI):** 仅实现当前明确所需的功能,抵制过度设计和不必要的未来特性预留。\r\n- **坚实基础 (SOLID):**\r\n - **S (单一职责):** 各组件、类、函数只承担一项明确职责。\r\n - **O (开放/封闭):** 功能扩展无需修改现有代码。\r\n - **L (里氏替换):** 子类型可无缝替换其基类型。\r\n - **I (接口隔离):** 接口应专一,避免“胖接口”。\r\n - **D (依赖倒置):** 依赖抽象而非具体实现。\r\n- **杜绝重复 (DRY):** 识别并消除代码或逻辑中的重复模式,提升复用性。\r\n\r\n**请严格遵循以下工作流程和输出要求:**\r\n\r\n1. **深入理解与初步分析(理解阶段):**\r\n\r\n - 详细审阅提供的[资料/代码/项目描述],全面掌握其当前架构、核心组件、业务逻辑及痛点。\r\n - 在理解的基础上,初步识别项目中潜在的**KISS, YAGNI, DRY, SOLID**原则应用点或违背现象。\r\n\r\n2. **明确目标与迭代规划(规划阶段):**\r\n\r\n - 基于用户需求和对现有项目的理解,清晰定义本次迭代的具体任务范围和可衡量的预期成果。\r\n - 在规划解决方案时,优先考虑如何通过应用上述原则,实现更简洁、高效和可扩展的改进,而非盲目增加功能。\r\n\r\n3. **分步实施与具体改进(执行阶段):**\r\n\r\n - 详细说明你的改进方案,并将其拆解为逻辑清晰、可操作的步骤。\r\n - 针对每个步骤,具体阐述你将如何操作,以及这些操作如何体现**KISS, YAGNI, DRY, SOLID**原则。例如:\r\n - “将此模块拆分为更小的服务,以遵循 SRP 和 OCP。”\r\n - “为避免 DRY,将重复的 XXX 逻辑抽象为通用函数。”\r\n - “简化了 Y 功能的用户流,体现 KISS 原则。”\r\n - “移除了 Z 冗余设计,遵循 YAGNI 原则。”\r\n - 重点关注[项目类型,例如:代码质量优化 / 架构重构 / 功能增强 / 用户体验提升 / 性能调优 / 可维护性改善 / Bug 修复]的具体实现细节。\r\n\r\n4. **总结、反思与展望(汇报阶段):**\r\n - 提供一个清晰、结构化且包含**实际代码/设计变动建议(如果适用)**的总结报告。\r\n - 报告中必须包含:\r\n - **本次迭代已完成的核心任务**及其具体成果。\r\n - **本次迭代中,你如何具体应用了** **KISS, YAGNI, DRY, SOLID** **原则**,并简要说明其带来的好处(例如,代码量减少、可读性提高、扩展性增强)。\r\n - **遇到的挑战**以及如何克服。\r\n - **下一步的明确计划和建议。**\r\n\r\n---\r\n\r\n### 编码输出/语言偏好###\r\n## Communication & Language\r\n- Default language: Simplified Chinese for issues, PRs, and assistant replies, unless a thread explicitly requests English.\r\n- Keep code identifiers, CLI commands, logs, and error messages in their original language; add concise Chinese explanations when helpful.\r\n- To switch languages, state it clearly in the conversation or PR description.\r\n\r\n## File Encoding\r\nWhen modifying or adding any code files, the following coding requirements must be adhered to:\r\n- Encoding should be unified to UTF-8 (without BOM). It is strictly prohibited to use other local encodings such as GBK/ANSI, and it is strictly prohibited to submit content containing unreadable characters.\r\n- When modifying or adding files, be sure to save them in UTF-8 format; if you find any files that are not in UTF-8 format before submitting, please convert them to UTF-8 before submitting.\n\n--- project-doc ---\n\n# Repository Guidelines\r\n\r\n## Project Structure & Module Organization\r\nSource lives under the solution `NPP.SmartSchedue.sln`. `NPP.SmartSchedue.Host` hosts the ASP.NET Core app, with environment settings in `appsettings*.json`, seed scripts in `ConfigCenter` and `InitData`, and static assets in `wwwroot`. Domain services sit in `NPP.SmartSchedue.Api`, organized into `Core` (attributes, constants), `Services` (business logic), and `Repositories` (data access). Shared contracts, DTOs, and interfaces reside in `NPP.SmartSchedue.Api.Contracts`; keep cross-project types there. Tests are in `NPP.SmartSchedue.Tests`, with reusable fixtures in `BaseTest` and service-focused integration suites under `Services`.\r\n\r\n## Build, Test, and Development Commands\r\n- `dotnet restore NPP.SmartSchedue.sln` restores all project dependencies.\r\n- `dotnet build NPP.SmartSchedue.sln -c Release` validates compilation; use `-c Debug` during local iteration.\r\n- `dotnet run --project NPP.SmartSchedue.Host` boots the API with the default profile; add `--launch-profile Development` when you need local CAP setups.\r\n- `dotnet test NPP.SmartSchedue.Tests/NPP.SmartSchedue.Tests.csproj --logger \"trx;LogFileName=test-results.trx\"` exercises the xUnit suites and saves artifacts for PR review.\r\n\r\n## Coding Style & Naming Conventions\r\nTarget .NET 9 defaults: four-space indentation, braces on new lines, and explicit namespaces. Use `PascalCase` for classes, public members, and DTOs, `camelCase` for locals and private fields, and prefix interfaces with `I` as seen in `Api.Contracts`. Suffix asynchronous methods with `Async`, and keep request/response models in the Contracts project. Run `dotnet format` before committing to enforce spacing and using-order consistency.\r\n\r\n## Testing Guidelines\r\nWrite xUnit tests alongside existing patterns such as `EquipmentMaintenanceIntegrationTest`. Name new files `{Feature}Test.cs` or `{Feature}IntegrationTest.cs`, group helper logic in `BaseTest`, and rely on `Microsoft.AspNetCore.Mvc.Testing` for host bootstrapping. Aim to cover new service paths and repository edge cases; add mocks via Moq where external systems (CAP, RabbitMQ, MySQL) would otherwise be required.\r\n\r\n## Commit & Pull Request Guidelines\r\nPrefer descriptive commits (`feat(scheduling): add notification workflow`) instead of numeric placeholders seen in recent history. Bundle related changes, include migration or config adjustments in the same commit, and reference tracking IDs where relevant. Pull requests should outline the change, list manual or automated test evidence, mention configuration impacts (CAP, FreeSql, message queues), and supply screenshots for any UI updates under `wwwroot`.\r\n\r\n## Configuration & Environment Notes\r\nKeep secrets out of `appsettings.json`; use user secrets or environment variables for connection strings and CAP brokers. Document any required RabbitMQ or MySQL endpoints in the PR. When adding assets or scripts, mirror the structure under `ConfigCenter`, `InitData`, and `wwwroot` so the publish targets continue copying them correctly.\r\n\n\n</user_instructions>"}]}}
|
||
{"timestamp":"2025-09-22T15:47:29.909Z","type":"response_item","payload":{"type":"message","role":"user","content":[{"type":"input_text","text":"<environment_context>\n <cwd>C:\\GitCode\\paiban</cwd>\n <approval_policy>on-request</approval_policy>\n <sandbox_mode>workspace-write</sandbox_mode>\n <network_access>restricted</network_access>\n <shell>pwsh.exe</shell>\n</environment_context>"}]}}
|