@stackonward/cli 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/index.js +8 -8
  2. package/dist/index.js.map +1 -1
  3. package/dist/resources/components/nuxt/site-source/app/assets/css/site-shell.css +14 -2
  4. package/dist/resources/components/nuxt/site-source/app/components/content/CallToAction.vue +3 -1
  5. package/dist/resources/components/nuxt/site-source/app/components/content/Faq.vue +2 -2
  6. package/dist/resources/components/nuxt/site-source/app/components/content/Reviews.vue +2 -2
  7. package/dist/resources/components/nuxt/site-source/app/components/steps/Showcase.vue +2 -2
  8. package/dist/resources/components/nuxt/site-source/app/composables/useWebPush.ts +4 -0
  9. package/dist/resources/components/nuxt/site-source/app/plugins/web-push.ts +52 -0
  10. package/dist/resources/components/nuxt/site-source/app/theme/button.ts +18 -22
  11. package/dist/resources/components/nuxt/site-source/app/theme/index.ts +24 -0
  12. package/dist/resources/components/nuxt/site-source/app/theme/input.ts +32 -17
  13. package/dist/resources/components/nuxt/site-source/app/theme/modal.ts +1 -1
  14. package/dist/resources/components/nuxt/site-source/app/theme/select.ts +62 -18
  15. package/dist/resources/components/nuxt/site-source/app/theme/textarea.ts +73 -1
  16. package/dist/resources/components/nuxt/site-source/app/web-push/worker.ts +8 -0
  17. package/dist/resources/components/registry.json +11 -1
  18. package/dist/resources/registry.json +15 -3
  19. package/dist/resources/templates/base/{.claude → .codex}/docs/architecture-template.md +1 -1
  20. package/dist/resources/templates/base/{.claude → .codex}/docs/architecture.md +1 -1
  21. package/dist/resources/templates/base/{.claude → .codex}/docs/index.md +3 -3
  22. package/dist/resources/templates/base/{.claude → .codex}/docs/verification.md +1 -1
  23. package/dist/resources/templates/base/AGENTS.md +24 -24
  24. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/api-design.md +1 -1
  25. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/architecture-template.md +1 -1
  26. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/check-list.md +3 -3
  27. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/database.md +1 -1
  28. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/error-handling.md +1 -1
  29. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/index.md +1 -1
  30. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/logging.md +1 -1
  31. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/mediagen-provider-onboarding-sop.md +2 -2
  32. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/mediagen-provider-quick-reference.md +1 -1
  33. package/dist/resources/templates/go-backend/{.claude → .codex}/docs/module-standards.md +1 -1
  34. package/dist/resources/templates/go-backend/.dockerignore +1 -2
  35. package/dist/resources/templates/go-backend/AGENTS.md +19 -19
  36. package/dist/resources/templates/go-backend/README.md +5 -1
  37. package/dist/resources/templates/go-backend/deployments/onex/product-onboarding.example.json +201 -0
  38. package/dist/resources/templates/go-backend/docs/onex-notifications.md +85 -0
  39. package/dist/resources/templates/go-backend/docs/openapi-provenance.json +1 -1
  40. package/dist/resources/templates/go-backend/docs/runtime-provenance.json +23 -2
  41. package/dist/resources/templates/go-backend/docs/source-provenance.json +124 -6
  42. package/dist/resources/templates/go-backend/docs/standards-provenance.json +30 -30
  43. package/dist/resources/templates/go-backend/internal/common/middleware/cors.go +1 -0
  44. package/dist/resources/templates/go-backend/internal/common/middleware/middleware_test.go +1 -0
  45. package/dist/resources/templates/go-backend/internal/core/httpclient/safe_post.go +28 -0
  46. package/dist/resources/templates/go-backend/internal/core/httpclient/safe_post_test.go +56 -0
  47. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/client.go +453 -0
  48. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/client_test.go +772 -0
  49. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/codec.go +33 -0
  50. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/error.go +146 -0
  51. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/error_notification_test.go +29 -0
  52. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/notification/client.go +132 -0
  53. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/notification/client_test.go +222 -0
  54. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/notification/contracts.go +219 -0
  55. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/resilience.go +23 -0
  56. package/dist/resources/templates/go-backend/internal/integrations/onex/v1/transport_policy.go +96 -0
  57. package/dist/resources/templates/go-backend/internal/products/README.md +1 -1
  58. package/dist/resources/templates/go-backend/internal/sharedevents/README.md +1 -1
  59. package/dist/resources/templates/go-backend/scripts/check-openapi-clean-deletion.sh +3 -3
  60. package/dist/resources/templates/mcp-server/.prettierignore +1 -0
  61. package/dist/resources/templates/nuxt/{.claude → .codex}/docs/stack.md +17 -1
  62. package/dist/resources/templates/nuxt/.dockerignore +1 -1
  63. package/dist/resources/templates/nuxt/.env.example +6 -0
  64. package/dist/resources/templates/nuxt/.prettierignore +2 -1
  65. package/dist/resources/templates/nuxt/DESIGN.md +55 -10
  66. package/dist/resources/templates/nuxt/README.md +8 -0
  67. package/dist/resources/templates/nuxt/nuxt.config.ts +13 -1
  68. package/dist/resources/templates/nuxt/package.json +4 -2
  69. package/package.json +1 -1
  70. package/dist/resources/templates/base/CLAUDE.md +0 -437
  71. package/dist/resources/templates/go-backend/CLAUDE.md +0 -1139
  72. /package/dist/resources/templates/base/{.claude → .codex}/docs/security-lifecycle.md +0 -0
  73. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/e2e-standards.md +0 -0
  74. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/event-runtime-boundary.md +0 -0
  75. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/identifier-contract.md +0 -0
  76. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/openapi-contract.md +0 -0
  77. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/payment-gateway-onboarding.md +0 -0
  78. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/platform-boundary.md +0 -0
  79. /package/dist/resources/templates/go-backend/{.claude → .codex}/docs/quality-gates.md +0 -0
  80. /package/dist/resources/templates/mcp-server/{.claude → .codex}/docs/stack.md +0 -0
@@ -113,7 +113,7 @@ application already contains these modules.
113
113
 
114
114
  ### 4.2 Package Split Decision
115
115
 
116
- {Answer the package split rules from CLAUDE.md: Which owner has two real consumers? Which types remain feature-private? Does a shared contract avoid framework or provider leakage?}
116
+ {Answer the package split rules from AGENTS.md: Which owner has two real consumers? Which types remain feature-private? Does a shared contract avoid framework or provider leakage?}
117
117
 
118
118
  ---
119
119
 
@@ -124,7 +124,7 @@ Brand tokens, logos, locale and navigation belong to application composition. Ge
124
124
 
125
125
  Projects must run outside the source checkout. **FORBIDDEN**: developer absolute paths, dependency escapes, symlinks to external rules and commands requiring unshipped helpers.
126
126
 
127
- Template changes affect new projects. Existing applications receive reviewed source changes; regeneration never overwrites business code or credentials. CLAUDE and AGENTS remain synchronized complete files.
127
+ Template changes affect new projects. Existing applications receive reviewed source changes; regeneration never overwrites business code or credentials. AGENTS remains the complete rule authority.
128
128
 
129
129
  ## 10. Architecture and Delivery
130
130
 
@@ -1,6 +1,6 @@
1
1
  # Application Standards Index
2
2
 
3
- Read [CLAUDE.md](../../CLAUDE.md) completely, then select the task boundary:
3
+ Read [AGENTS.md](../../AGENTS.md) completely, then select the task boundary:
4
4
 
5
5
  | Task | Standard |
6
6
  | ---------------------------------- | ----------------------------------------------- |
@@ -15,7 +15,7 @@ This directory contains current engineering rules. Product designs and implement
15
15
 
16
16
  ## Required Reading Sequence
17
17
 
18
- 1. Read root `CLAUDE.md` or its identical full `AGENTS.md` body for the five execution phases and shared forbidden patterns.
18
+ 1. Read root `AGENTS.md` for the five execution phases and shared forbidden patterns.
19
19
  2. Read `stack.md` for the actual generated framework, environment consumers, commands and source owners.
20
20
  3. Read `architecture.md` before changing ownership, public types, dependencies or shared abstractions.
21
21
  4. Read `security-lifecycle.md` before changing external inputs, identity, credentials, requests, retries, cancellation or disposal.
@@ -39,4 +39,4 @@ Only the selected `stack.md` is installed. Base standards never overwrite it wit
39
39
 
40
40
  **MUST** update the owning rule when a real contract changes; do not append a correction beside stale instructions. Keep useful examples, forbidden patterns and checklist coverage. Do not shorten a complete standard into an index-only entry.
41
41
 
42
- CLAUDE and AGENTS are standalone full files and must remain equal. Relative links must resolve inside the generated project; external source-checkout paths and external symlinks are forbidden. Record source comparison and implementation evidence in ordinary project documentation, not these binding rules.
42
+ <rule_authority>MUST keep one complete regular `AGENTS.md` per owner. NEVER maintain a second editable rule entrypoint for the same owner.</rule_authority> Relative links must resolve inside the generated project; external source-checkout paths and external symlinks are forbidden. Record source comparison and implementation evidence in ordinary project documentation, not these binding rules.
@@ -79,7 +79,7 @@ Tests of services with fake dependencies do not prove actual provider permission
79
79
 
80
80
  ## 8. Distribution and Generated Projects
81
81
 
82
- For template changes, generate an application outside the source workspace using the packed CLI. Verify substituted variables, complete CLAUDE/AGENTS bodies, `.claude/docs`, relative links, package resolution and executable commands.
82
+ For template changes, generate an application outside the source workspace using the packed CLI. Verify substituted variables, the complete AGENTS body, `.codex/docs`, relative links, package resolution and executable commands.
83
83
 
84
84
  Do not rely on workspace symlinks to satisfy dependencies. Inspect packed files and the consumer artifact. The generated project must not reference developer absolute paths or template placeholders.
85
85
 
@@ -1,6 +1,6 @@
1
1
  # Application Engineering Standard
2
2
 
3
- > **Runtime**: Node.js ESM and TypeScript; complete installed stack in `.claude/docs/stack.md`.
3
+ > **Runtime**: Node.js ESM and TypeScript; complete installed stack in `.codex/docs/stack.md`.
4
4
  > **Owner**: application business rules, routes, branding, configuration and release.
5
5
  > **Dependencies**: versioned public package exports; generated source belongs to this application.
6
6
 
@@ -13,7 +13,7 @@ app/ and server/ # Nuxt presentation and server execution bound
13
13
  src/ # MCP registrations, adapters and process startup
14
14
  package.json # Installed dependencies and executable commands
15
15
  .env.example # Configuration schema without credentials
16
- .claude/docs/ # Complete engineering specifications
16
+ .codex/docs/ # Complete engineering specifications
17
17
  ```
18
18
 
19
19
  ---
@@ -33,29 +33,29 @@ pnpm build
33
33
 
34
34
  ## Coding Rules
35
35
 
36
- The selected stack has complete coding rules in `.claude/docs/stack.md`. Shared AI execution flow is defined in this file. `AGENTS.md` contains the same complete body. Nested rules add owner-specific constraints.
36
+ The selected stack has complete coding rules in `.codex/docs/stack.md`. Shared AI execution flow is defined in this file. <rule_authority>MUST keep one complete regular `AGENTS.md` per owner. NEVER maintain a second editable rule entrypoint for the same owner.</rule_authority> Nested rules add owner-specific constraints.
37
37
 
38
38
  | File | Scope |
39
39
  | --------------------------------------- | ------------------------------------------------------------- |
40
- | `CLAUDE.md` | Shared execution flow and delivery discipline |
41
- | `.claude/docs/index.md` | Reading order and module navigation |
42
- | `.claude/docs/stack.md` | Framework rules, full command and environment tables |
43
- | `.claude/docs/architecture.md` | Ownership, dependency direction, contracts and reuse |
44
- | `.claude/docs/security-lifecycle.md` | Validation, secrets, authorization, cancellation and recovery |
45
- | `.claude/docs/verification.md` | Verification and delivery requirements |
46
- | `.claude/docs/architecture-template.md` | Complete design skeleton |
40
+ | `AGENTS.md` | Shared execution flow and delivery discipline |
41
+ | `.codex/docs/index.md` | Reading order and module navigation |
42
+ | `.codex/docs/stack.md` | Framework rules, full command and environment tables |
43
+ | `.codex/docs/architecture.md` | Ownership, dependency direction, contracts and reuse |
44
+ | `.codex/docs/security-lifecycle.md` | Validation, secrets, authorization, cancellation and recovery |
45
+ | `.codex/docs/verification.md` | Verification and delivery requirements |
46
+ | `.codex/docs/architecture-template.md` | Complete design skeleton |
47
47
 
48
- **Read the selected stack and applicable nested `CLAUDE.md` before writing code.**
48
+ **Read the selected stack and applicable nested `AGENTS.md` before writing code.**
49
49
 
50
50
  ## Visual Design Standards (CRITICAL)
51
51
 
52
- For a stack with a visual interface, **MUST** read the design standard identified by `.claude/docs/stack.md` before choosing icons, colors, sizing or component overrides. Use that stack's installed component system, token owner and asset conventions. Icon artwork, accessible labels and interactive target size are separate responsibilities; local size changes must use the existing component contract.
52
+ For a stack with a visual interface, **MUST** read the design standard identified by `.codex/docs/stack.md` before choosing icons, colors, sizing or component overrides. Use that stack's installed component system, token owner and asset conventions. Icon artwork, accessible labels and interactive target size are separate responsibilities; local size changes must use the existing component contract.
53
53
 
54
54
  **FORBIDDEN**: inventing a second icon library or theme implementation for an existing capability. Non-visual stacks do not acquire UI dependencies or a required design document from this rule.
55
55
 
56
56
  ## Technology Stack and Environment
57
57
 
58
- Read `package.json`, `.env.example`, configuration consumers and `.claude/docs/stack.md` before changing dependencies or environment variables. A sample variable does not prove that runtime code reads it. Nuxt uses `pnpm dev` / `pnpm preview`; MCP uses `pnpm start:stdio` after build. Never put private credentials in Nuxt public configuration or MCP tool output.
58
+ Read `package.json`, `.env.example`, configuration consumers and `.codex/docs/stack.md` before changing dependencies or environment variables. A sample variable does not prove that runtime code reads it. Nuxt uses `pnpm dev` / `pnpm preview`; MCP uses `pnpm start:stdio` after build. Never put private credentials in Nuxt public configuration or MCP tool output.
59
59
 
60
60
  ## Workflow Proportionality (CRITICAL)
61
61
 
@@ -93,7 +93,7 @@ Directories, modules and packages are namespaces. Child files and symbols **MUST
93
93
  # AI Execution Standard
94
94
 
95
95
  > Mandatory workflow for every task, regardless of language or subproject.
96
- > Stack-specific rules are in `.claude/docs/stack.md` and applicable nested rules.
96
+ > Stack-specific rules are in `.codex/docs/stack.md` and applicable nested rules.
97
97
 
98
98
  ---
99
99
 
@@ -104,8 +104,8 @@ Before touching code, fully understand the task and its context.
104
104
  ### 1.1 Read Project Documentation
105
105
 
106
106
  1. Read this file for shared execution rules.
107
- 2. Read the subproject `CLAUDE.md` for stack-specific rules, starting with `.claude/docs/stack.md`.
108
- 3. Read subproject specs, and shared specs under `.claude/docs/` that are relevant to the task.
107
+ 2. Read the subproject `AGENTS.md` for stack-specific rules, starting with `.codex/docs/stack.md`.
108
+ 3. Read subproject specs, and shared specs under `.codex/docs/` that are relevant to the task.
109
109
  4. Read existing architecture documents for affected modules.
110
110
 
111
111
  **Read specs before designing. Do not rely on memory or assumptions about project conventions.**
@@ -365,7 +365,7 @@ Violation of any rule blocks commit. No exceptions.
365
365
  | SH-E3 | Enforcement | Fix applied as patch/workaround without proper design | Make the fix architecturally sound |
366
366
  | SH-E6 | Enum Registry | Cross-language enum metadata duplication, such as backend labels/colors/options plus frontend `constants/*.ts` copies | The owning backend contract is the single source of truth for business enum metadata. Consume its declared API/generated types; pure UI variants stay local. Do not assume a platform enum endpoint exists |
367
367
 
368
- Additional forbidden patterns are defined in each subproject's `CLAUDE.md`. Identifier/reference boundaries are in `.claude/docs/security-lifecycle.md`.
368
+ Additional forbidden patterns are defined in each subproject's `AGENTS.md`. Identifier/reference boundaries are in `.codex/docs/security-lifecycle.md`.
369
369
 
370
370
  ---
371
371
 
@@ -411,11 +411,11 @@ The principle: fail loudly, never silently skip. A production system that return
411
411
 
412
412
  | Doc | Content |
413
413
  | --------------------------------------- | --------------------------------------------------------- |
414
- | `.claude/docs/stack.md` | Framework rules, real directories and executable commands |
415
- | `.claude/docs/architecture.md` | Types, owner boundaries and dependency direction |
416
- | `.claude/docs/security-lifecycle.md` | Trust, identity, secrets, async lifetime and recovery |
417
- | `.claude/docs/verification.md` | Full verification and delivery requirements |
418
- | `.claude/docs/architecture-template.md` | Complete Level A/B/C skeleton |
414
+ | `.codex/docs/stack.md` | Framework rules, real directories and executable commands |
415
+ | `.codex/docs/architecture.md` | Types, owner boundaries and dependency direction |
416
+ | `.codex/docs/security-lifecycle.md` | Trust, identity, secrets, async lifetime and recovery |
417
+ | `.codex/docs/verification.md` | Full verification and delivery requirements |
418
+ | `.codex/docs/architecture-template.md` | Complete Level A/B/C skeleton |
419
419
 
420
420
  ## Project Skill Routing
421
421
 
@@ -423,7 +423,7 @@ Use only skills available in the active environment. Read the selected entry and
423
423
 
424
424
  ## Artifact Hygiene (CRITICAL)
425
425
 
426
- Durable standards belong in `.claude/docs/`; concrete designs and evidence belong in ordinary `docs/designs/`. Binding rules describe implemented structures and stable constraints. FORBIDDEN: conversation transcripts, repair narration, future-state assertions, dead links and invented commands.
426
+ Durable standards belong in `.codex/docs/`; concrete designs and evidence belong in ordinary `docs/designs/`. Binding rules describe implemented structures and stable constraints. FORBIDDEN: conversation transcripts, repair narration, future-state assertions, dead links and invented commands.
427
427
 
428
428
  ## Pre-commit Checklist
429
429
 
@@ -433,5 +433,5 @@ Durable standards belong in `.claude/docs/`; concrete designs and evidence belon
433
433
  - [ ] Relevant success, validation, authorization and recovery behavior is verified.
434
434
  - [ ] Declared stack checks pass; unavailable checks are reported accurately.
435
435
  - [ ] No secrets, dead imports or deferred production code enter the diff.
436
- - [ ] CLAUDE.md and AGENTS.md contain the same complete standards body.
436
+ - [ ] One complete AGENTS.md authority links the applicable .codex/docs standards.
437
437
  - [ ] Normal commits preserve unrelated work and remote history.
@@ -1,6 +1,6 @@
1
1
  # API Design Templates
2
2
 
3
- > Templates only. Rules are in `CLAUDE.md`.
3
+ > Templates only. Rules are in `AGENTS.md`.
4
4
 
5
5
  ## OpenAPI Security Contract
6
6
 
@@ -118,7 +118,7 @@ internal/platform/{module}/
118
118
 
119
119
  ### 4.2 Package Split Decision
120
120
 
121
- {Answer the package split rules from CLAUDE.md: Does application/ need sub-domain splitting? Does domain/ need splitting by aggregate root?}
121
+ {Answer the package split rules from AGENTS.md: Does application/ need sub-domain splitting? Does domain/ need splitting by aggregate root?}
122
122
 
123
123
  ---
124
124
 
@@ -1,6 +1,6 @@
1
1
  # Development Checklist
2
2
 
3
- > Workflow and quality gates. Rules in `CLAUDE.md`.
3
+ > Workflow and quality gates. Rules in `AGENTS.md`.
4
4
 
5
5
  ---
6
6
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  1. Design(架构评审)
10
10
  2. Implementation
11
- 3. Self-review(对照 CLAUDE.md FORBIDDEN 表)
11
+ 3. Self-review(对照 AGENTS.md FORBIDDEN 表)
12
12
  4. Pre-commit validation
13
13
 
14
14
  ---
@@ -110,7 +110,7 @@ Pre-Commit Validation
110
110
  =====================
111
111
  Files changed: [list]
112
112
  Specs checked:
113
- - CLAUDE.md FORBIDDEN table: PASS/FAIL (CRITICAL)
113
+ - AGENTS.md FORBIDDEN table: PASS/FAIL (CRITICAL)
114
114
  - api-design.md: PASS/FAIL
115
115
  - module-standards.md: PASS/FAIL
116
116
  - error-handling.md: PASS/FAIL
@@ -1,6 +1,6 @@
1
1
  # Database Reference
2
2
 
3
- > Templates and examples. Rules in `CLAUDE.md`.
3
+ > Templates and examples. Rules in `AGENTS.md`.
4
4
 
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Error Handling Templates
2
2
 
3
- > Implementation code for errors and middleware. Rules are in `CLAUDE.md`.
3
+ > Implementation code for errors and middleware. Rules are in `AGENTS.md`.
4
4
 
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Specification Index
2
2
 
3
- Read `CLAUDE.md` completely. Files below retain the full OneX specifications and examples. Binding event, E2E and OpenAPI contracts apply according to their declared owner. Platform paths, service names, governance commands and platform tables refer to upstream OneX; generated backend commands are defined by its own `Makefile`.
3
+ Read `AGENTS.md` completely. Files below retain the full OneX specifications and examples. Binding event, E2E and OpenAPI contracts apply according to their declared owner. Platform paths, service names, governance commands and platform tables refer to upstream OneX; generated backend commands are defined by its own `Makefile`.
4
4
 
5
5
  | File | Content | Priority |
6
6
  |------|---------|----------|
@@ -1,6 +1,6 @@
1
1
  # Logging Reference
2
2
 
3
- > Templates and examples. Rules in `CLAUDE.md`.
3
+ > Templates and examples. Rules in `AGENTS.md`.
4
4
 
5
5
  ---
6
6
 
@@ -5,7 +5,7 @@
5
5
  > Scope: `internal/platform/mediagen/infrastructure/providers/*` + admin runtime configuration plane
6
6
  > Audience: 任何需要新增 / 修改 / 排障 mediagen Provider Adapter 或在 admin 上线 Provider 的工程师
7
7
  > 状态:admin-integrated 锁定版(基于提交 `f2338a6d` → `211ed024`)
8
- > 设计权威:本文与 `backend/.claude/docs/identifier-contract.md`、`api-design.md`、`error-handling.md` 共同构成 mediagen 模块的技术契约。
8
+ > 设计权威:本文与 `.codex/docs/identifier-contract.md`、`api-design.md`、`error-handling.md` 共同构成 mediagen 模块的技术契约。
9
9
 
10
10
  本文档目的:让"接入新 Provider"从一个**模糊的探索性任务**收敛为**一组可逐步勾选的工程操作**。每一步都有具体的文件路径、迁移编号、admin UI 入口、复制模板、验收门槛。**严格按照本 SOP 落地的新 Provider,零返工**。
11
11
 
@@ -888,7 +888,7 @@ Service: 构造一个虚拟 SubmitRequest (sample input + draft revision snapsho
888
888
  - `migrations/000473_add_generation_transport_retry_count.up.sql` —— transport_retry_count 列
889
889
  - `migrations/000483_extend_p_mediagen_execution_logs_phase_lane.up.sql` —— execution_log phase + lane_code + 复合索引
890
890
  - `migrations/000484_seed_ai_lane_dry_run_permission.up.sql` —— `ai_lane:rollback` + `ai_lane:dry_run` 权限种子
891
- - 短表速查:`backend/.claude/docs/mediagen-provider-quick-reference.md`
891
+ - 短表速查:`.codex/docs/mediagen-provider-quick-reference.md`
892
892
 
893
893
  ---
894
894
 
@@ -192,4 +192,4 @@ bad config 在 Save / Publish 阶段直接拒收,前端按 `param` 字段路
192
192
 
193
193
  ---
194
194
 
195
- > **完整 SOP**: `backend/.claude/docs/mediagen-provider-onboarding-sop.md`
195
+ > **完整 SOP**: `.codex/docs/mediagen-provider-onboarding-sop.md`
@@ -1,6 +1,6 @@
1
1
  # Module Structure Templates
2
2
 
3
- > Directory structures and decision tree. Rules are in `CLAUDE.md`.
3
+ > Directory structures and decision tree. Rules are in `AGENTS.md`.
4
4
 
5
5
  ## File Creation Decision Tree
6
6
 
@@ -1,6 +1,6 @@
1
1
  .git
2
2
  .github
3
- .claude
3
+ .codex
4
4
  .husky
5
5
  .idea
6
6
  .vscode
@@ -22,7 +22,6 @@ tmp/
22
22
  .DS_Store
23
23
 
24
24
  AGENTS.md
25
- CLAUDE.md
26
25
  README.md
27
26
  deploy.config.json
28
27
  docs/
@@ -153,7 +153,7 @@ ANTHROPIC_API_KEY
153
153
 
154
154
  ## Code Rules Reference
155
155
 
156
- 规范模板在 `backend/.claude/docs/` 目录中。
156
+ 规范模板在 `.codex/docs/` 目录中。
157
157
 
158
158
  ---
159
159
  ---
@@ -172,9 +172,9 @@ Before touching any code, fully understand the task and its context.
172
172
  ### 1.1 Read project documentation
173
173
 
174
174
  1. Read this file (execution flow + coding rules)
175
- 2. Read `backend/.claude/docs/` specifications relevant to the task (api-design, module-standards, database, error-handling, etc.)
175
+ 2. Read `.codex/docs/` specifications relevant to the task (api-design, module-standards, database, error-handling, etc.)
176
176
  3. Read existing architecture docs in `docs/platform/` for affected modules
177
- 4. Read the CLAUDE.md of each affected cmd/ app if applicable
177
+ 4. Read the AGENTS.md of each affected cmd/ app if applicable
178
178
 
179
179
  **Read the specs BEFORE designing. Do not rely on memory or assumptions about project conventions.**
180
180
 
@@ -263,7 +263,7 @@ Verdict: PROCEED / REJECT / REVISE
263
263
 
264
264
  ### 2.4 Determine design document level
265
265
 
266
- Classify the task and produce the corresponding design document. See `.claude/docs/architecture-template.md` for full skeleton.
266
+ Classify the task and produce the corresponding design document. See `.codex/docs/architecture-template.md` for full skeleton.
267
267
 
268
268
  ```
269
269
  New module or major architecture change?
@@ -278,7 +278,7 @@ Otherwise?
278
278
 
279
279
  | Level | What to produce | Destination |
280
280
  |-------|----------------|-------------|
281
- | **A** | Complete architecture document following `.claude/docs/architecture-template.md` | Plan file → archive to `docs/platform/` |
281
+ | **A** | Complete architecture document following `.codex/docs/architecture-template.md` | Plan file → archive to `docs/platform/` |
282
282
  | **B** | Impact scope, industry reference, schema/model/API changes, data flow, implementation waves | Plan file |
283
283
  | **C** | Root cause analysis, fix design, affected files, verification plan | Plan file |
284
284
 
@@ -286,7 +286,7 @@ Otherwise?
286
286
 
287
287
  ### 2.5 Decision Autonomy
288
288
 
289
- **Inherited from `CLAUDE.md` Phase 2.2.** AI MUST make standard technical decisions autonomously when industry consensus exists. NEVER ask the user to choose between options that have a clear industry-standard answer.
289
+ **Inherited from `AGENTS.md` Phase 2.2.** AI MUST make standard technical decisions autonomously when industry consensus exists. NEVER ask the user to choose between options that have a clear industry-standard answer.
290
290
 
291
291
  Go-specific autonomous decisions (NEVER ask):
292
292
 
@@ -299,7 +299,7 @@ Go-specific autonomous decisions (NEVER ask):
299
299
 
300
300
  ### 2.6 Self-Review Gate (MANDATORY)
301
301
 
302
- **Inherited from `CLAUDE.md` Phase 2.6.** After completing ANY design or implementation, MUST self-review BEFORE presenting to user.
302
+ **Inherited from `AGENTS.md` Phase 2.6.** After completing ANY design or implementation, MUST self-review BEFORE presenting to user.
303
303
 
304
304
  Go-specific self-review additions:
305
305
 
@@ -390,7 +390,7 @@ Re-validate against the FORBIDDEN Patterns table below with the actual implement
390
390
 
391
391
  ### 5.5 Automated review loop (Level A/B)
392
392
 
393
- **Inherited from `CLAUDE.md` Phase 5.5.** For Level A/B deliveries, dispatch review agents and iterate until zero findings BEFORE presenting to user.
393
+ **Inherited from `AGENTS.md` Phase 5.5.** For Level A/B deliveries, dispatch review agents and iterate until zero findings BEFORE presenting to user.
394
394
 
395
395
  Go-specific review dimensions:
396
396
 
@@ -551,14 +551,14 @@ Violation of ANY rule blocks commit. No exceptions.
551
551
  | TX2 | Transaction | `middleware.WithTransaction` / `middleware.DBOrTx` | Use `database.TransactionManager.WithTransaction` — single mechanism |
552
552
  | TX3 | Transaction | Multiple transaction context keys | Single `database.ctxTxKey{}` — one mechanism, one key |
553
553
  | N1 | Enum | 管理端展示或选择使用的枚举值、标签、颜色在 registry 外重复维护 | 在 `internal/common/enums/register_xxx.go` 引用 owner 常量注册,并测试实际消费的值集合。私有实现类型和机器协议值不要求注册为管理端选项 |
554
- | N2 | Reference | `ReferenceID` / `reference_id` 字段用 `fmt.Sprintf` / 字符串拼接 ad-hoc 构造 | 在 owner domain 的 `reference.go` 定义 helper `XxxReferenceID(xxxID int64) string`,调用方 MUST 通过 helper 生成。See `backend/.claude/docs/identifier-contract.md` §3.2 |
554
+ | N2 | Reference | `ReferenceID` / `reference_id` 字段用 `fmt.Sprintf` / 字符串拼接 ad-hoc 构造 | 在 owner domain 的 `reference.go` 定义 helper `XxxReferenceID(xxxID int64) string`,调用方 MUST 通过 helper 生成。See `.codex/docs/identifier-contract.md` §3.2 |
555
555
  | N3 | Reference | `ReferenceType` 字段使用字符串字面量(e.g. `"order"` / `"subscription"`) | 在 domain 的 `reference.go` 定义 `ReferenceTypeXxx` 常量,所有写入路径 MUST 引用常量 |
556
556
  | N4 | Validator | 写入 `p_credit_transactions` / `p_member_point_ledger` / `p_quota_transactions` 时绕过模块的 `ValidateTransactionFields` 直接调用 `db.Create` / `db.Save` | MUST 通过 repo 的 `Create` / `BatchCreate` 方法,repo 内部强制调用 `credit.ValidateTransactionFields`(或对应模块 validator)。禁止 Service/Handler 直接操作 `*gorm.DB` 写入凭证类表 |
557
557
  | LC1 | Locale | Domain model, DTO write path, persisted JSON map, or admin API accepts/stores region locale tags such as `zh-CN` / `en-US` as business locale keys | Internal business locale values MUST use OneX short codes validated by `internal/common/locale.IsShortCode`. External headers/imports may call `NormalizeCode` only at boundary adapters before entering domain/service writes |
558
558
  | LC2 | Locale | Duplicated supported-locale lists, locale enum metadata, or fallback locale arrays outside `internal/common/locale` / enum registry helpers | Use `commonlocale.SupportedCodes()`, `commonlocale.DefaultCode`, `commonlocale.AdminDefaultCode`, and shared enum helpers. Migrations may list historical external aliases only to repair old data |
559
559
  | LC3 | Locale | Localized text/channel JSON validation implemented with ad-hoc key checks or `map[string]string` loops that do not call the common locale validator | Route all localized-map write validation through `commonlocale.IsShortCode` or a module helper that delegates to it. Invalid locale keys fail fast with validation errors |
560
560
 
561
- `make lint-enums` / `backend/scripts/check-forbidden-patterns.sh` 运行管理端枚举合同测试及标识符、凭证写入静态检查。详细标识符契约见 `backend/.claude/docs/identifier-contract.md`。
561
+ `make lint-enums` / `backend/scripts/check-forbidden-patterns.sh` 运行管理端枚举合同测试及标识符、凭证写入静态检查。详细标识符契约见 `.codex/docs/identifier-contract.md`。
562
562
 
563
563
  ---
564
564
 
@@ -832,7 +832,7 @@ After write operation completes →
832
832
  - 修改路由、请求、响应、认证或状态码时,同一变更内更新 owner path/component、Arazzo workflow 和生成制品。
833
833
  - registry 中全部 HTTP 服务启动时必须通过 Gin route 与内嵌 internal bundle 的精确集合校验。
834
834
  - partner/public 只能由 internal canonical source 投影生成,禁止直接编辑 `dist/`。
835
- - 详细规则和模板见 `.claude/docs/openapi-contract.md`。
835
+ - 详细规则和模板见 `.codex/docs/openapi-contract.md`。
836
836
 
837
837
  ---
838
838
 
@@ -1064,9 +1064,9 @@ Modular Monolith 架构(Stripe/Shopify 标准)。统一平台 API 服务所
1064
1064
 
1065
1065
  **Outbox Relay**:platform-api 运行统一 Relay,处理所有域的 outbox 事件。admin-api 不调用 `relay.Start()`,admin 写入的 outbox 记录由 platform-api 的 Relay 投递。
1066
1066
 
1067
- **Event runtime boundary**:源聚合投影监听器必须留在拥有该状态机的运行时;`worker` 只消费 durable public events 做下游副作用。`user.deleted` 这类部分公开的事件族必须使用精确白名单,禁止 `user.*` 这类宽泛通配。See `backend/.claude/docs/event-runtime-boundary.md`.
1067
+ **Event runtime boundary**:源聚合投影监听器必须留在拥有该状态机的运行时;`worker` 只消费 durable public events 做下游副作用。`user.deleted` 这类部分公开的事件族必须使用精确白名单,禁止 `user.*` 这类宽泛通配。See `.codex/docs/event-runtime-boundary.md`.
1068
1068
 
1069
- **E2E contract tests**:凡是跨运行时、依赖 relay/worker、会改变最终用户可见真相的工作流,必须同时具备一个全链路 E2E 和一个 `ProvideRelayConfig()` 白名单回归测试。See `backend/.claude/docs/e2e-standards.md`.
1069
+ **E2E contract tests**:凡是跨运行时、依赖 relay/worker、会改变最终用户可见真相的工作流,必须同时具备一个全链路 E2E 和一个 `ProvideRelayConfig()` 白名单回归测试。See `.codex/docs/e2e-standards.md`.
1070
1070
 
1071
1071
  **内部服务间调用**:`/internal/v1/` 路由组,通过 IAM 服务账号凭证认证、已认证主体校验、路由资源策略授权保护。
1072
1072
 
@@ -1109,7 +1109,7 @@ Product-specific tables are owned by external product repositories and must not
1109
1109
  ## Commit Discipline
1110
1110
 
1111
1111
  - ONE module, ONE feature per commit
1112
- - Pre-commit: validate against `backend/.claude/docs/` specs
1112
+ - Pre-commit: validate against `.codex/docs/` specs
1113
1113
  - MUST NOT commit with any CRITICAL/MUST violation
1114
1114
 
1115
1115
  ---
@@ -1129,11 +1129,11 @@ Product-specific tables are owned by external product repositories and must not
1129
1129
 
1130
1130
  | Doc | Content |
1131
1131
  |-----|---------|
1132
- | `.claude/docs/architecture-template.md` | Plan mode mandatory skeleton (Level A/B/C) |
1133
- | `backend/.claude/docs/api-design.md` | Handler/Service/DTO/VO templates, pagination |
1134
- | `backend/.claude/docs/module-standards.md` | Tier decision, directory subdivision, VO naming |
1135
- | `backend/.claude/docs/error-handling.md` | Error types, codes, decision table |
1136
- | `backend/.claude/docs/database.md` | Model template, column types, migrations |
1132
+ | `.codex/docs/architecture-template.md` | Plan mode mandatory skeleton (Level A/B/C) |
1133
+ | `.codex/docs/api-design.md` | Handler/Service/DTO/VO templates, pagination |
1134
+ | `.codex/docs/module-standards.md` | Tier decision, directory subdivision, VO naming |
1135
+ | `.codex/docs/error-handling.md` | Error types, codes, decision table |
1136
+ | `.codex/docs/database.md` | Model template, column types, migrations |
1137
1137
  | Upstream OneX `.claude/docs/decisions.md` | Platform Architecture Decision Records; source revision in `docs/standards-provenance.json` |
1138
1138
  | `internal/platform/trade/order/` | Reference: Full DDD module |
1139
1139
  | `internal/platform/trade/module.go` | Reference: Module self-registration |
@@ -63,4 +63,8 @@ Outbox 保留 `schema_version` 不可变约束,产品生产者负责写入自
63
63
 
64
64
  `/metrics` 用于内部采集,不应通过公网网关发布。当前入口只有基础健康与指标接口;产品登录、业务路由、OneX 服务身份和授权策略必须通过真实契约接入,健康检查成功不代表业务验收完成。
65
65
 
66
- 通用源码来源见 `docs/source-provenance.json`;入口、配置、部署和迁移的来源与调整见 `docs/runtime-provenance.json`。阅读 `CLAUDE.md` 和 `.claude/docs/` 后开发,新增模块复用现有所有者和 ProviderSet。
66
+ 通用源码来源见 `docs/source-provenance.json`;入口、配置、部署和迁移的来源与调整见 `docs/runtime-provenance.json`。阅读 `AGENTS.md` 和 `.codex/docs/` 后开发,新增模块复用现有所有者和 ProviderSet。
67
+
68
+ ## 可选 OneX 通知配置
69
+
70
+ 需要接入 OneX 时,使用 [通知接入说明](docs/onex-notifications.md)和随模板分发的 [原生 profile 示例](deployments/onex/product-onboarding.example.json)。产品填写自身身份、品牌和公开配置,私有连接交给 OneX 现有执行器;示例默认不激活、不发布、不发送。模板已分发通用 `internal/integrations/onex/v1/notification` 协议客户端与测试,由产品显式装配;不会自动生成产品事件、通知 BFF 或客户端接收流程。