nop-entropy
AGENTS.md701 starsChanged 11 days agoApache-2.0View on GitHub
nop-entropy 是一个可替代 Spring 的全栈 Java 框架(Nop 平台),采用可逆计算原理。 Tech Stack: Java 21(运行基线;2026-11-21 起全仓 maven.compiler.release=21,例外 nop-rg/nop-find=22 FFM),Maven (wrapper 4.0.0-rc-5), JUnit 5, Nop AutoTest, XLang。 模块分组和依赖关系见 docs-for-ai/01-repo-map/module-groups.md。 执行 docs-for-ai/ 或 ai-dev/ 下的任何 .md 文件描述的工作流前,必须完整读取该文件全文,不得只读一部分就开始执行。文件大小不是跳过阅读的理由。 docs-for-ai/INDEX.md is the authoritative docs navigation baseline. 下表覆盖最常见的 agent 工作流。当 By Task 和 By Code Location 都命中时,合并去重阅读清单。 ⚠️动手前检查 Protected Areas:如果代码位于下表 Protected Area 中,必须先遵守对应规则(plan-first / ask-first),再读技术文档。
- Sends data out
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,117 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
20 rules. About 0 are common, 11 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
If a change appears to require editing one of those files, stop and move one level up: edit the source model, Delta, non-underscore …
- Distinctive: line 93
After completing any significant CODE CHANGE, you MUST:
- Very specific: line 102
Run doc link checker: after modifying any file in docs-for-ai/ or ai-dev/:
- Distinctive: line 106
Must exit with code 0 (0 errors).
- Very specific: line 192
When creating, revising, executing, or auditing a file under ai-dev/plans/, you MUST read …
- Very specific: line 208
Prefer editing the source model/template files instead of generated outputs.
- Very specific: line 210
If docs-for-ai/ is insufficient, prefer LSP / definition lookup on classes and methods referenced from docs-for-ai/04-reference/.
- Very specific: line 211
If normal development reveals that docs-for-ai/ is inaccurate, incomplete, or missing a high-frequency rule, treat that as a docs bug and …
- Very specific: line 226
AOP usage: Do not assume Spring AOP patterns (@Aspect, @Around) work in Nop.
- Distinctive: line 265
Always run build and tests after making CODE changes — via nop-ib(见上), not raw mvn.
- Very specific: line 269
If ./mvnw reports JAVA_HOME not found, auto-discover a local JDK from javac and set JAVA_HOME:
- Distinctive: line 291
Avoid noisy refactors; keep diffs minimal and focused
- Very specific: line 292
Temporary files: Use _tmp/ under the project root (<project-root>/_tmp/) for ALL temporary files, scratch data, and intermediate outputs.
- Distinctive: line 298
IMPORTANT: Commit frequently to avoid losing work.
- Distinctive: line 300
After completing a significant feature or fix, commit immediately
- Very specific: line 301
use the nop-git skill(.agents/skills/nop-git/SKILL.md;原 nop-git-master/worktree/bundle 技能已废弃删除)
- Distinctive: line 302
Never let uncommitted changes accumulate across multiple features
- Distinctive: line 308
After fixing any non-trivial bug, you MUST:
- Distinctive: line 310
Evaluate whether regression tests are needed: If the bug had a non-obvious root cause, could be reintroduced by refactoring, or crossed …
- Distinctive: line 319
Before finishing any task:
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md - Nop Entropy Development Guide
Project Overview
nop-entropy 是一个可替代 Spring 的全栈 Java 框架(Nop 平台),采用可逆计算原理。
Tech Stack: Java 21(运行基线;2026-11-21 起全仓 maven.compiler.release=21,例外 nop-rg/nop-find=22 FFM),Maven (wrapper 4.0.0-rc-5), JUnit 5, Nop AutoTest, XLang。
模块分组和依赖关系见 docs-for-ai/01-repo-map/module-groups.md。
Documentation Routing
Hard Stop: Generated Files
- Do not hand-edit any generated file or generated directory.
- This includes all
_-prefixed files such as_*.xml,_*.java,_*.xmeta,_app.orm.xml,_service.beans.xml, and anything under_gen/. - If a change appears to require editing one of those files, stop and move one level up: edit the source model, Delta, non-underscore retention file, or generator template, then regenerate.
Mandatory Full-Read Before Execution
执行 docs-for-ai/ 或 ai-dev/ 下的任何 .md 文件描述的工作流前,必须完整读取该文件全文,不得只读一部分就开始执行。文件大小不是跳过阅读的理由。
docs-for-ai/INDEX.md is the authoritative docs navigation baseline. 下表覆盖最常见的 agent 工作流。当 By Task 和 By Code Location 都命中时,合并去重阅读清单。
By Task
| Task | Read first | Then read |
| 修改业务逻辑(service、action、biz) | docs-for-ai/02-core-guides/service-layer.md | docs-for-ai/02-core-guides/api-and-graphql.md |
日常编译/测试验证(nop-ib check 快路径,回滚开关见该页) | docs-for-ai/02-core-guides/incremental-build.md | — |
| 新增或修改 ORM 模型 / 数据库表 | docs-for-ai/02-core-guides/model-first-development.md | docs-for-ai/02-core-guides/delta-customization.md |
| 修改 IoC 配置、注入、bean 定义 | docs-for-ai/02-core-guides/ioc-and-config.md | — |
| 修改 GraphQL API、crud 操作 | docs-for-ai/02-core-guides/api-and-graphql.md | docs-for-ai/02-core-guides/service-layer.md |
新增或修改 API 模型(*.api.xml)、理解 API codegen 生成物 | docs-for-ai/02-core-guides/api-model-and-codegen.md | docs-for-ai/02-core-guides/api-and-graphql.md |
| 修改 Delta 定制、覆盖已有模块 | docs-for-ai/02-core-guides/delta-customization.md | docs-for-ai/02-core-guides/model-first-development.md |
| 处理错误码、异常处理 | docs-for-ai/02-core-guides/error-handling.md | — |
修改工作流定义(.xwf)、理解审批流配置 | docs-for-ai/02-core-guides/workflow-configuration.md | docs-for-ai/03-runbooks/build-approval-flow.md |
| 修改平台框架核心(nop-core/nop-xlang/nop-xdef 等) | docs-for-ai/02-core-guides/xlang-and-xpl-basics.md | docs-for-ai/02-core-guides/xdef-and-xdsl.md |
| 编写或修改测试 | docs-for-ai/02-core-guides/testing.md | — |
| 编写或运行平台 E2E 测试(Playwright) | nop-entropy-e2e/README.md | docs-for-ai/02-core-guides/e2e-testing-troubleshooting.md |
| E2E Playwright 测试失败排查 | docs-for-ai/02-core-guides/e2e-testing-troubleshooting.md | docs-for-ai/02-core-guides/debugging-and-diagnostics.md |
| 执行特定类型任务(按 runbook) | docs-for-ai/03-runbooks/README.md | 对应 runbook 文件 |
| 新增模块或修改包结构 | docs-for-ai/01-repo-map/module-groups.md | docs-for-ai/01-repo-map/domain-module-pattern.md |
Draft, execute, or audit a plan under ai-dev/plans/ | ai-dev/plans/00-plan-authoring-and-execution-guide.md | ai-dev/logs/00-log-writing-guide.md |
| Write or update daily dev log | ai-dev/logs/00-log-writing-guide.md | — |
| 记录人工测试发现 / 手工验收结论 | ai-dev/testing/README.md | ai-dev/bugs/00-bug-fix-note-writing-guide.md(根因明确后升级为 bug 笔记) |
| Write a bug fix note | ai-dev/bugs/00-bug-fix-note-writing-guide.md | — |
| Write an analysis | ai-dev/analysis/00-analysis-writing-guide.md | — |
| Write a design doc | ai-dev/design/00-design-writing-guide.md | ai-dev/design/README.md |
| Write or update skills | Check existing skills under ai-dev/skills/ first | — |
| 写跨 2 个以上文档的设计/roadmap/审计回复 | ai-dev/lessons/19-doc-ssot-and-evidence-first.md | docs-for-ai/00-start-here/truth-and-precedence.md |
By Code Location
⚠️动手前检查 Protected Areas:如果代码位于下表 Protected Area 中,必须先遵守对应规则(plan-first / ask-first),再读技术文档。
| When touching this code | Read this |
nop-core/, nop-xlang/ | docs-for-ai/01-repo-map/module-groups.md |
nop-biz/, service/action 层 | docs-for-ai/02-core-guides/service-layer.md |
nop-dao/, ORM/model 层 | docs-for-ai/02-core-guides/model-first-development.md |
nop-graphql/ | docs-for-ai/02-core-guides/api-and-graphql.md |
nop-chaos/ (demo app) | docs-for-ai/01-repo-map/domain-module-pattern.md |
业务模块(nop-auth/, nop-job/, nop-wf/, nop-task/ 等) | docs-for-ai/02-core-guides/service-layer.md + 对应 runbook |
其他 nop-* 模块 | docs-for-ai/01-repo-map/module-groups.md |
nop-entropy-e2e/ (e2e tests) | nop-entropy-e2e/README.md |
ai-dev/ (any subdirectory) | 对应子目录的 00-*-guide.md 或 README.md |
Docs Maintenance
Docs live in docs-for-ai/ and are the primary source of platform usage knowledge. Always consult docs-for-ai/INDEX.md first for navigation. See ai-dev/logs/00-log-writing-guide.md for log writing conventions.
ai-dev/ records the development process of the platform itself; it is not normative documentation for platform users.
docs/ 是历史遗留目录,不再接收新内容:AI 开发文档的唯一归属是 ai-dev/——roadmap 写 ai-dev/backlog/,执行计划写 ai-dev/plans/,设计决策写 ai-dev/design/,日志/审计/复盘按对应子目录。平台使用文档的唯一权威来源是 docs-for-ai/。除维护历史遗留内容外,禁止在 docs/ 下新建任何 AI 开发文档。(Mission Driver 配置面已退役:missions/ 已归档至 ai-dev/archived/missions-2026-11-22/;仓内 tools/mission-driver/ 引擎作为 nop-ai-agent 产品代码保留。)
Documentation Domains
docs-for-ai/ | ai-dev/ | |
| 定位 | 使用 Nop 平台所需的知识 | 开发 Nop 平台本身所需的知识 |
| 内容 | API、约定、开发模式、runbook | 设计决策、执行计划、复杂 bug 分析、经验教训 |
| 读者 | 基于 Nop 构建应用的 AI / 开发者 | 改造 Nop 框架本身的 AI / 开发者 |
| 权威性 | source of truth(规范性文档) | design/ 规范性;logs/、plans/、bugs/ 过程记录 |
| 路由入口 | docs-for-ai/INDEX.md | ai-dev/logs/index.md |
Mandatory Updates
After completing any significant CODE CHANGE, you MUST:
- Update the daily dev log at
ai-dev/logs/{year}/{month}-{day}.md(reverse chronological, seeai-dev/logs/00-log-writing-guide.mdfor format). - Update relevant owner docs under
docs-for-ai/when changing:- Service layer patterns →
docs-for-ai/02-core-guides/service-layer.md - ORM/model patterns →
docs-for-ai/02-core-guides/model-first-development.md - API or GraphQL →
docs-for-ai/02-core-guides/api-and-graphql.md - General conventions → the smallest owning doc under
docs-for-ai/
- Service layer patterns →
- Update
docs-for-ai/INDEX.mdanddocs-for-ai/04-reference/source-anchors.mdif routing or implementation anchors changed. - Run doc link checker after modifying any file in
docs-for-ai/orai-dev/:
Must exit with code 0 (0 errors). Fix any broken links before finishing the task.node ai-dev/tools/check-doc-links.mjs --strict
ai-dev/ Directory Roles
| 目录 | 用途 | 什么时候写 | 写前必读 |
logs/ | 每日开发上下文、决策记录 | 每次 significant code/doc change(一天一个文件,追加在顶部) | ai-dev/logs/00-log-writing-guide.md |
plans/ | 执行计划(含 status、exit criteria) | 方案已确定、进入实施阶段时 | ai-dev/plans/00-plan-authoring-and-execution-guide.md |
design/ | 架构决策 + 使用契约 + 需求规格 | 方案确定后。按子系统组织子目录 | ai-dev/design/00-design-writing-guide.md |
analysis/ | AI 单方面调研、对比、评估 | 对比多个技术方案、评估代码质量时 | ai-dev/analysis/00-analysis-writing-guide.md |
discussions/ | 人与 AI 多轮对话,澄清模糊需求 | 需求不明确时 | ai-dev/discussions/00-discussion-writing-guide.md |
bugs/ | 复杂 bug 的修复记录 | 根因不明显、跨模块的 bug | ai-dev/bugs/00-bug-fix-note-writing-guide.md |
testing/ | 手工测试发现的现象、复现步骤、预期/实际、验收结论(问题发现阶段,可能尚未定位根因) | 人工/探索性测试过程中随时记录 | ai-dev/testing/README.md |
audits/ | 代码和设计审计记录 | 执行代码审计时 | ai-dev/audits/README.md |
lessons/ | 经验教训索引 | 踩坑后总结 | ai-dev/lessons/README.md |
skills/ | 可复用的 AI 审计/review prompt 模板(含 invariant-loop-audit-prompt.md 不变式闭环审计方法论) | 需要标准化审计流程时;同族缺陷反复复发时用 invariant-loop | ai-dev/audits/README.md 中的 prompt 对照表 |
所有 AI 开发计划必须写在 ai-dev/plans/ 下,禁止写入 docs/plans/。
Document Authority (SSOT)
每个事实只有一个 canonical owner。 权威归属矩阵与冲突处理以 docs-for-ai/00-start-here/truth-and-precedence.md 的 Content Ownership Matrix 为准,本节不复制矩阵,只列硬规则:
- Link, don't copy:其他文档只能链接 owner 或写 ≤3 行摘要(摘要后加「以
<owner>为准」),不得复制完整模块表、能力/限制表、配置默认值表、指标名表、状态块。 - 状态只住状态块:roadmap/plan 的
done/planned/todo只允许出现在其## Work Item Status/## 阶段状态块或 plan checklist;其他文档引用时写“当前状态见<roadmap>”,不复制状态。 - Reconcile-on-touch:修改一个事实时,必须同时更新其 canonical owner,并把其他位置的副本改为链接/摘要;同任务内修复,不留给下次审计。
- 派生文档必须可辨:INDEX、模块总表、subsystem README 等导航/派生视图应标注「派生视图,以 X 为准」或可由脚本重建;不得成为第二事实源。
- 新增长文档前先查重:先 grep 现有 owner;若已有 owner,只补链接,不新建平行文档。新增内容若必须暂存,放
ai-dev/analysis/并标Status: open,结论确认后收敛进 owner。 - 规范性 vs 时效性分离:
docs-for-ai/**、ai-dev/design/**、AGENTS.md、各00-*-guide.md、subsystem README/owner doc 属规范性(无时间演化、不写创建/更新日期、不写 Stage/plan/WI/审计轮次、不记录变更历史;只写当前结论与情境化理由,变化时原地更新为最新);analysis/logs/plans/audits/bugs/testing/backlog/discussions 属时效性(必须带日期/时间戳与 Status,可过时,只作证据)。历史由 git 与时效性文档承担。
清理路线图与门禁:ai-dev/backlog/doc-system-ssot-roadmap.md。
Large Design / Review Tasks
跨 2 个以上文档、或需要多轮独立审查的设计/roadmap/审计任务,强制按以下顺序执行(详细教训见 ai-dev/lessons/19-doc-ssot-and-evidence-first.md):
- 先建证据/裁定底账:10–15 条载荷事实 + 已有裁定,每条带
file:line;底账未闭合前不写完整设计。 - 分层交付:先骨架(目录 + 核心决策 + 风险)→ 1 轮独立架构审查 → 再补细节;禁止先写全文再整篇重写。
- 单一事实源:每个 canonical claim(公式/分派/名称/状态)只写一处;每次编辑后对全部相关文档跑 grep 一致性检查。
- 审查预算:最多 2 轮;每轮 reviewer 只返回
[Blocker|Major]+ 证据 + 修复(≤100 行);只剩 Minor 即停并登记 watch-only。 - 子 agent 复用规则:同一问题不得同时开 background 与 foreground reviewer;用 background 必须先确保能回收结果,未回收前不开第二个;禁止 sleep 轮询。
- 编辑纪律:同一文件批量修改;每次 edit/write 前重新 read;跨文件改名用脚本;不反复单点改同一文件。
- 时间盒:文档类任务超过 2–3 小时即冻结剩余项为 follow-up,不靠加轮次收尾。
AI Autonomy Levels
当前项目状态和 autonomy 等级定义在 docs-for-ai/00-start-here/project-context.md。
等级定义
| 等级 | 含义 |
implement | AI 可直接实施,前提是满足 Verification Checklist |
plan-first | AI 可起草/更新计划,但实施需等待 plan audit |
ask-first | AI 必须先询问,才能变更代码或用户可见行为 |
research-only | AI 可 inspect、summarize、propose,但不能修改产品行为 |
blocked | AI 不可继续,直到阻塞解除 |
Protected Areas
以下区域变更需 plan-first 或 ask-first:
| 区域 | Rule | Required Evidence |
ORM 模型结构(model/*.orm.xml) | plan-first | owner doc + test |
跨模块公共 API(nop-*-api) | plan-first | owner doc + migration plan |
权限/认证模型(nop-auth) | ask-first | owner doc + test |
生成管线(_gen/、_*.xml、codegen 模板) | plan-first | 理解生成链路 |
框架核心引擎(nop-core/nop-xlang/nop-xdef 内部) | plan-first | 设计文档 + 回归测试 |
nop-api-core(io.nop.api.core.* 全平台公共 API) | plan-first | owner doc + 回归测试(SPI 变更须列全部实现为回归面) |
AI Must Ask Before
- 变更产品范围且 requirement 或 owner doc 有歧义
- 跳过验证因为命令缺失或失败
- 关闭一个 audit/verification/docs 证据缺失的 plan
- 当
docs-for-ai/与实际代码冲突且解决冲突会改变用户可见行为
Plan Execution
When creating, revising, executing, or auditing a file under ai-dev/plans/, you MUST read ai-dev/plans/00-plan-authoring-and-execution-guide.md first. Then follow these hard rules:
- Read the plan guide first — every time, no exceptions.
- Follow the guide mechanically — it defines what to do before, during, and after execution. Treat its rules as hard constraints, not suggestions.
- Maintain the plan file as a live document — toggle checkboxes immediately after each item, update phase/slice status in real time, never batch updates at the end.
- Closure requires independent audit — use a separate subagent (different task_id) to verify exit criteria against live code. Never self-audit.
- Textual consistency before
completed— Plan Status, Phase Status, Exit Criteria, Closure Gates, and daily log must all agree before you set the plan tocompleted.
These rules exist because agents routinely skip plan maintenance when focused on code changes. The guide's 19 minimum rules are the correction.
Generated Files And Docs
- Files or directories prefixed with
_are typically generated by the codegen/build pipeline and will be overwritten duringmvn install. Do not hand-edit them unless the corresponding generator/template is being changed intentionally. - This prohibition explicitly includes
_*.xmetaand all files under_gen/. - Prefer editing the source model/template files instead of generated outputs. Typical examples: edit
model/*.orm.xml, not generated_app.orm.xml,_gen/*.java, or other_*.xml/_*.javafiles. docs-for-ai/is the only runtime guidance source for normal development AI work. Do not readdocs/ordocs-for-ai-old/during ordinary development tasks.- If
docs-for-ai/is insufficient, prefer LSP / definition lookup on classes and methods referenced fromdocs-for-ai/04-reference/. Only read raw source in exceptional blocker cases or for documentation maintenance, and then updatedocs-for-ai/. - If normal development reveals that
docs-for-ai/is inaccurate, incomplete, or missing a high-frequency rule, treat that as a docs bug and fix the relevant owner doc in the same task whenever feasible.
Nop IoC vs Spring (high-impact differences)
- Field injection visibility: NopIoC does not support injecting into
privatefields.- ✅ Prefer
protectedor package-private fields when using@Inject. - ✅ Prefer setter injection when you want explicit dependencies but don't want constructor-based wiring.
- ❌ Avoid examples like
@Inject private Foo foo;in code and documentation.
- ✅ Prefer
- No annotation-driven bean scanning: Nop IoC discovers beans purely through
beans.xmlfiles under_vfs/— not via Java classpath annotation scanning (@Component,@Service, etc.).@BizModeland@Injectare metadata/field-injection annotations only; they do not auto-register beans. Every bean must have an explicit<bean>definition in abeans.xml. - Value/config injection: inject configuration values with
@InjectValue(avoid Spring-only patterns like@Value). - AOP usage: Do not assume Spring AOP patterns (
@Aspect,@Around) work in Nop. Verify actual implementations exist in codebase before documenting or using them. Nop uses source-code generated AOP, not runtime bytecode manipulation.
Commands
日常编译/测试一律走 nop-ib 服务(默认入口,AI/子代理不得直接跑 mvn 编译测试);mvn 只用于最终打包(install/deploy/发布镜像/CI/全量冷构建)。详见 docs-for-ai/02-core-guides/incremental-build.md。
# 服务(推荐,多 AI/多项目共享,同项目自动串行排队)
~/nop-ib/bin/start.sh # 启动(幂等,端口 8188)
curl -s http://127.0.0.1:8188/v1/health # 健康检查
# 调用首选 ib-run 薄壳(自动从 cwd 推断 projectDir、组装 JSON、透传构建退出码):
~/nop-ib/bin/ib-run check --paths <变更文件> --json
~/nop-ib/bin/ib-run model refresh
# 等价的原始 HTTP 契约(ib-run 不可用时的兜底):
curl -s -X POST http://127.0.0.1:8188/v1/run -d \
'{"projectDir":"<仓库根>","cmd":"check","args":["--paths","<变更文件>","--json"],"wait":true}'
~/nop-ib/bin/stop.sh # 停止
# 禁止 CLI 直用:`nop-tools/nop-ib/bin/ib` 不是调用方入口(仅 `bin/ib serve` 用于启动服务本身)。
# 调用方(AI/脚本)一律走服务 HTTP 接口(优先 ib-run 薄壳)——CLI 路径绕过服务队列与并发治理,
# model refresh 与服务并发时曾出现长时间静默阻塞(2026-11-21 收敛)。
# pom 变更后刷新构建事实(一次性 ~50s):
~/nop-ib/bin/ib-run model refresh
# 最终打包(唯一保留 mvn 的场景)
./mvnw clean install -T 1C使用要点:
- 调用契约:
cmd白名单status|plan|compile|test|check|model|clean;projectDir可为仓库根/子模块目录/symlink(服务自动归一到同一 reactor 队列);回复exit字段即构建结果(0 成功 / 1 失败 / 3 用法错误 / 6 partial / 75 回退 Maven 超时);fallback.reason非 null 表示该轮走了 Maven 回退及其原因。 - 代码生成:模块目录可放
nop-ib.tasks.json声明 codegen 任务(如 nop-wf-meta 的 xgen precompile)——改模板后经服务跑compile --paths <模板>会自动执行生成任务,不再整体回退 Maven;契约见ai-dev/design/nop-incremental-build/08-codegen-task-hooks-design.md。 - 模型过期(改了 pom)时服务会自动回退真 Maven 并给出原因;跑一次
model refresh即恢复快路径。 - 分布重建:
nop-tools/nop-ib/bin/package-ib.sh重新打包到~/nop-ib(改了 nop-ib 本身之后必须重打包再重启服务)。
Always run build and tests after making CODE changes — via nop-ib(见上), not raw mvn.
Java setup (Windows)
If ./mvnw reports JAVA_HOME not found, auto-discover a local JDK from javac and set JAVA_HOME:
$javac = (Get-Command javac -ErrorAction SilentlyContinue).Source
if (-not $javac) { throw "No javac found in PATH. Install JDK 21+ first." }
$jdk = Split-Path (Split-Path $javac -Parent) -Parent
$env:JAVA_HOME = $jdk
if (-not ($env:Path -split ';' | Where-Object { $_ -eq "$jdk\bin" })) {
$env:Path = "$jdk\bin;$env:Path"
}
setx JAVA_HOME "$jdk"Code Conventions
- Naming: PascalCase (classes), camelCase (methods/variables), UPPER_SNAKE_CASE (constants)
- Formatting: 4-space indentation, keep lines ~80–120 chars where reasonable
- Package names: modules use
io.nop.<module-name>(e.g.,io.nop.ai.core,io.nop.stream.core) - Imports: grouped (io.nop.* → jakarta./javax. → third-party → java.*),组间空行分隔;静态导入放最后(与代码库实际惯例一致,见
ai-dev/audits/2026-07-31-0539-arm-MA4.2-nop-ai-style.mdMA4.2-14 裁定) - Error handling: Two-tier strategy (see
docs-for-ai/02-core-guides/error-handling.md): (1) Framework core & public APIs:NopException+ErrorCode+.param(...). (2) Module internals & AI-driven code: module-level exception class (e.g.NopAiException) with English string messages. Never use bareRuntimeException. Error messages must be in English. - Avoid noisy refactors; keep diffs minimal and focused
- Temporary files: Use
_tmp/under the project root (<project-root>/_tmp/) for ALL temporary files, scratch data, and intermediate outputs. NEVER use system-level/tmp/— it is outside the project sandbox and will triggerexternal_directorypermission prompts that block non-interactiveopencode runsessions.
Git Workflow
IMPORTANT: Commit frequently to avoid losing work.
- After completing a significant feature or fix, commit immediately
- use the nop-git skill(
.agents/skills/nop-git/SKILL.md;原 nop-git-master/worktree/bundle 技能已废弃删除) - Never let uncommitted changes accumulate across multiple features
Bug Fix Test Coverage Rule
After fixing any non-trivial bug, you MUST:
- Evaluate whether regression tests are needed. If the bug had a non-obvious root cause, could be reintroduced by refactoring, or crossed module boundaries, add a test.
- Add tests that verify the correct result, not just the absence of an error.
- Prefer adding new regression tests instead of rewriting or weakening existing ones. Preserve prior coverage whenever possible.
- Record complex bugs in
ai-dev/bugs/followingai-dev/bugs/00-bug-fix-note-writing-guide.md.
Verification Checklist
Before finishing any task:
./mvnw test -pl <affected-module> -ampasses (or full./mvnw clean installif touched multiple modules)- Check style: imports grouped (io.nop.* → third-party → java.*)
- Tests: add/extend JUnit 5 tests; use Nop AutoTest where the project already uses it
docs-for-ai/updated (if conventions or APIs changed)ai-dev/logs/updated (for significant changes, seeai-dev/logs/00-log-writing-guide.md)ai-dev/plans/updated (if executing a plan, see Plan Execution rules above)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

