openxiangda 1.0.266 → 1.0.267

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.
package/README.md CHANGED
@@ -4,14 +4,19 @@
4
4
 
5
5
  OpenXiangda is a lightweight CLI and skill package for private low-code platforms.
6
6
 
7
- ## Two runtime generations
8
-
9
- OpenXiangda now has two deliberately separate development tracks:
10
-
11
- - `openxiangda` 1.x maintains existing resource-based applications and its legacy Delivery V2 protocol. Stable applications keep this runtime and are not migrated by a platform upgrade.
12
- - `v2/` contains the new platform-2.0 application toolchain: `create-openxiangda`, `@openxiangda/cli`, `@openxiangda/mcp`, standard React/NestJS packages, typed configuration, domain skills, and application-level deployment.
13
-
14
- For a new 2.0 application, start with [`v2/docs/getting-started.md`](v2/docs/getting-started.md). A 2.0 workspace has `openxiangda.config.ts`, `apps/web`, and `apps/server`; it must not use the 1.x resource/SDD publishing commands.
7
+ ## Repository boundary
8
+
9
+ This repository contains only the stable OpenXiangda 1.x maintenance toolchain.
10
+ It maintains existing resource-based applications and its legacy Delivery V2
11
+ protocol. Stable applications keep this runtime and are not migrated by a
12
+ platform upgrade.
13
+
14
+ OpenXiangda 2.0 is developed and released from the independent
15
+ `tools/openxiangda-v2` repository pinned by the platform orchestration
16
+ repository. A new 2.0 workspace must use that repository's current public
17
+ packages, unified AI skill, templates, and documentation. It must not use the
18
+ 1.x resource/SDD publishing commands or any historical embedded copy of the
19
+ 2.0 toolchain.
15
20
 
16
21
  Normal OpenXiangda app development uses platform-user login tokens through `/openxiangda-api/v1`; it does not use AK/SK. External backend and third-party integrations use the separate `openxiangda-open-api` skill, `/dingtalk-api/v1.0`, and a platform-managed AK/SK credential.
17
22
 
package/lib/skills.js CHANGED
@@ -82,62 +82,17 @@ const SKILL_SPECS = [
82
82
  sourceRelativePath: 'openxiangda-skills/skills/openxiangda-open-api',
83
83
  type: 'subskill',
84
84
  },
85
- {
86
- name: 'openxiangda-v2',
87
- displayName: 'OpenXiangda 2.0',
88
- shortDescription: '标准 React/NestJS 应用与应用级交付入口。',
89
- sourceRelativePath: 'v2/skills/openxiangda-v2',
90
- type: 'subskill',
91
- },
92
- {
93
- name: 'openxiangda-v2-architecture',
94
- displayName: 'OpenXiangda 2.0 Architecture',
95
- shortDescription: '设计 2.0 应用边界与类型化平台契约。',
96
- sourceRelativePath: 'v2/skills/openxiangda-v2-architecture',
97
- type: 'subskill',
98
- },
99
- {
100
- name: 'openxiangda-v2-frontend',
101
- displayName: 'OpenXiangda 2.0 Frontend',
102
- shortDescription: '开发 React、Ant Design 与标准后台页面。',
103
- sourceRelativePath: 'v2/skills/openxiangda-v2-frontend',
104
- type: 'subskill',
105
- },
106
- {
107
- name: 'openxiangda-v2-backend',
108
- displayName: 'OpenXiangda 2.0 Backend',
109
- shortDescription: '开发平台托管的标准 NestJS 应用后端。',
110
- sourceRelativePath: 'v2/skills/openxiangda-v2-backend',
111
- type: 'subskill',
112
- },
113
- {
114
- name: 'openxiangda-v2-data-authz',
115
- displayName: 'OpenXiangda 2.0 Data and AuthZ',
116
- shortDescription: '设计 Data API、RBAC 与上下文数据权限。',
117
- sourceRelativePath: 'v2/skills/openxiangda-v2-data-authz',
118
- type: 'subskill',
119
- },
120
- {
121
- name: 'openxiangda-v2-workflow-events',
122
- displayName: 'OpenXiangda 2.0 Workflow and Events',
123
- shortDescription: '开发 Workflow Kernel v2 与持久事件消费者。',
124
- sourceRelativePath: 'v2/skills/openxiangda-v2-workflow-events',
125
- type: 'subskill',
126
- },
127
- {
128
- name: 'openxiangda-v2-delivery',
129
- displayName: 'OpenXiangda 2.0 Delivery',
130
- shortDescription: '构建、部署、观察、晋级和回滚完整应用。',
131
- sourceRelativePath: 'v2/skills/openxiangda-v2-delivery',
132
- type: 'subskill',
133
- },
134
- {
135
- name: 'openxiangda-v1-maintenance',
136
- displayName: 'OpenXiangda 1.x Maintenance',
137
- shortDescription: '不迁移地安全维护稳定 1.x 应用。',
138
- sourceRelativePath: 'v2/skills/openxiangda-v1-maintenance',
139
- type: 'subskill',
140
- },
85
+ ];
86
+
87
+ const RETIRED_SKILL_SPECS = [
88
+ { name: 'openxiangda-v2', sourceRelativePath: 'v2/skills/openxiangda-v2' },
89
+ { name: 'openxiangda-v2-architecture', sourceRelativePath: 'v2/skills/openxiangda-v2-architecture' },
90
+ { name: 'openxiangda-v2-frontend', sourceRelativePath: 'v2/skills/openxiangda-v2-frontend' },
91
+ { name: 'openxiangda-v2-backend', sourceRelativePath: 'v2/skills/openxiangda-v2-backend' },
92
+ { name: 'openxiangda-v2-data-authz', sourceRelativePath: 'v2/skills/openxiangda-v2-data-authz' },
93
+ { name: 'openxiangda-v2-workflow-events', sourceRelativePath: 'v2/skills/openxiangda-v2-workflow-events' },
94
+ { name: 'openxiangda-v2-delivery', sourceRelativePath: 'v2/skills/openxiangda-v2-delivery' },
95
+ { name: 'openxiangda-v1-maintenance', sourceRelativePath: 'v2/skills/openxiangda-v1-maintenance' },
141
96
  ];
142
97
 
143
98
  function getDefaultCodexSkillsDir(env = process.env) {
@@ -242,6 +197,36 @@ function getSkillStatus(spec, skillsDir) {
242
197
  };
243
198
  }
244
199
 
200
+ function getRetiredSkillStatus(spec, skillsDir) {
201
+ const targetDir = path.join(skillsDir, spec.name);
202
+ if (!fs.existsSync(targetDir)) {
203
+ return {
204
+ name: spec.name,
205
+ status: 'absent',
206
+ targetDir,
207
+ sourceRelativePath: spec.sourceRelativePath,
208
+ };
209
+ }
210
+
211
+ const manifest = readManifest(targetDir);
212
+ const isManagedRetiredSkill =
213
+ manifest?.manager === MANAGER &&
214
+ manifest.sourceRelativePath === spec.sourceRelativePath;
215
+ return {
216
+ name: spec.name,
217
+ status: isManagedRetiredSkill ? 'retired-managed' : 'preserved-external',
218
+ targetDir,
219
+ sourceRelativePath: spec.sourceRelativePath,
220
+ };
221
+ }
222
+
223
+ function removeRetiredManagedSkill(spec, skillsDir) {
224
+ const status = getRetiredSkillStatus(spec, skillsDir);
225
+ if (status.status === 'retired-managed') {
226
+ fs.rmSync(status.targetDir, { recursive: true, force: true });
227
+ }
228
+ }
229
+
245
230
  function getSkillStatusReport(options = {}) {
246
231
  const agent = validateAgent(options.agent);
247
232
  const env = options.env || process.env;
@@ -252,10 +237,12 @@ function getSkillStatusReport(options = {}) {
252
237
  const results = [];
253
238
  for (const skillsDir of skillsDirs) {
254
239
  const skills = SKILL_SPECS.map(spec => getSkillStatus(spec, skillsDir));
240
+ const retiredSkills = RETIRED_SKILL_SPECS.map(spec => getRetiredSkillStatus(spec, skillsDir));
255
241
  results.push({
256
242
  agent,
257
243
  skillsDir,
258
244
  skills,
245
+ retiredSkills,
259
246
  });
260
247
  }
261
248
 
@@ -283,6 +270,7 @@ function installSkills(options = {}) {
283
270
  const results = [];
284
271
  for (const skillsDir of skillsDirs) {
285
272
  const before = SKILL_SPECS.map(spec => getSkillStatus(spec, skillsDir));
273
+ const retiredBefore = RETIRED_SKILL_SPECS.map(spec => getRetiredSkillStatus(spec, skillsDir));
286
274
  const conflicts = before.filter(item => item.status === 'foreign');
287
275
 
288
276
  if (conflicts.length > 0 && !force && !dryRun) {
@@ -298,17 +286,29 @@ function installSkills(options = {}) {
298
286
  targetDir: item.targetDir,
299
287
  sourceRelativePath: item.sourceRelativePath,
300
288
  }));
289
+ const retiredOperations = retiredBefore.map(item => ({
290
+ name: item.name,
291
+ operation: item.status === 'retired-managed' ? 'remove-retired-managed' : 'preserve',
292
+ targetDir: item.targetDir,
293
+ sourceRelativePath: item.sourceRelativePath,
294
+ }));
301
295
 
302
296
  if (!dryRun) {
303
297
  fs.mkdirSync(skillsDir, { recursive: true });
304
298
  for (const spec of SKILL_SPECS) {
305
299
  installOneSkill(spec, skillsDir);
306
300
  }
301
+ for (const spec of RETIRED_SKILL_SPECS) {
302
+ removeRetiredManagedSkill(spec, skillsDir);
303
+ }
307
304
  }
308
305
 
309
306
  const after = dryRun
310
307
  ? before
311
308
  : SKILL_SPECS.map(spec => getSkillStatus(spec, skillsDir));
309
+ const retiredAfter = dryRun
310
+ ? retiredBefore
311
+ : RETIRED_SKILL_SPECS.map(spec => getRetiredSkillStatus(spec, skillsDir));
312
312
 
313
313
  results.push({
314
314
  agent,
@@ -317,7 +317,9 @@ function installSkills(options = {}) {
317
317
  dryRun,
318
318
  force,
319
319
  operations,
320
+ retiredOperations,
320
321
  skills: after,
322
+ retiredSkills: retiredAfter,
321
323
  });
322
324
  }
323
325
 
@@ -446,6 +448,7 @@ function buildWarnings(legacySkills) {
446
448
 
447
449
  module.exports = {
448
450
  INSTALL_MANIFEST,
451
+ RETIRED_SKILL_SPECS,
449
452
  SKILL_SPECS,
450
453
  getSkillStatusReport,
451
454
  installSkills,
@@ -13,7 +13,7 @@ This file is a router and safety card. Read only the one or two subskills select
13
13
 
14
14
  ## Select the runtime generation first
15
15
 
16
- If the workspace contains `openxiangda.config.ts`, `apps/web`, and `apps/server`, it is a platform-2.0 application. Stop this 1.x resource flow and use `$openxiangda-v2` plus its architecture, frontend, backend, data-authz, workflow-events, and delivery skills. The 2.0 CLI operates on one immutable application package and does not use SDD or per-resource publishing.
16
+ If the workspace contains `openxiangda.config.ts`, `apps/web`, and `apps/server`, it is a platform-2.0 application. Stop this 1.x resource flow and use the independently released `$openxiangda-v2` unified skill. The 2.0 CLI operates on one immutable application package and does not use SDD or per-resource publishing.
17
17
 
18
18
  If the workspace contains `app-workspace.config.ts`, forms/pages/resource manifests, or an existing 1.x state directory, continue with this router. Never migrate a stable 1.x application merely because platform 2.0 is available.
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.266",
3
+ "version": "1.0.267",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -55,7 +55,6 @@
55
55
  "bin/",
56
56
  "lib/",
57
57
  "openxiangda-skills/",
58
- "v2/skills/",
59
58
  "policy/",
60
59
  "templates/",
61
60
  "packages/sdk/bin/",
package/v2/README.md DELETED
@@ -1,35 +0,0 @@
1
- # OpenXiangda 2.0 toolchain
2
-
3
- This directory is the isolated OpenXiangda 2.0 package workspace. It does not
4
- import or dispatch the 1.x CLI implementation in `lib/cli.js`.
5
-
6
- Current packages:
7
-
8
- - `@openxiangda/contracts`: versioned wire contracts and JSON Schemas.
9
- - `@openxiangda/compiler`: deterministic configuration, generated contracts and AppPackage sealing.
10
- - `@openxiangda/devkit-core`: framework-neutral workspace, package and control-plane use cases.
11
- - `@openxiangda/nest`: trusted Principal/RoleSession Guard, Data API client,
12
- signed CloudEvents receiver and standard backend health endpoints.
13
- - `@openxiangda/admin`: React + Ant Design application shell, capability-aware
14
- data pages and protocol-driven Workflow v2/1.x compatibility pages.
15
- - `@openxiangda/testing`: permission fixtures, allow/deny matrix assertions and
16
- local event record/replay/simulation.
17
- - `create-openxiangda`: distributable standard application workspace creator.
18
- - `@openxiangda/cli`: thin Oclif application-level CLI.
19
- - `@openxiangda/mcp`: structured AI resources and tools over the same services.
20
- - `@openxiangda/skill-kit`: validation, packaging and installation for the 2.0 domain skills.
21
-
22
- `templates/application` is the build-verified React 19 + NestJS 11 golden
23
- workspace. None of these packages imports or dispatches the 1.x CLI, so this
24
- toolchain can evolve without increasing the stable 1.x launcher surface.
25
-
26
- ```bash
27
- pnpm install
28
- pnpm check
29
- pnpm test
30
- pnpm template:build
31
- pnpm skills:check
32
- pnpm docs:build
33
- ```
34
-
35
- The fixed Changesets group publishes the packages as one compatible version train. See `docs/getting-started.md` for application usage and `docs/migration.md` for the strict 1.x coexistence boundary.
@@ -1,45 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "skills": [
4
- {
5
- "name": "openxiangda-v1-maintenance",
6
- "description": "Maintain an existing stable OpenXiangda 1.x application without migrating it. Use for scoped fixes to legacy pages, forms, resources, App Function code, automation, workflow, or 1.x release records.",
7
- "sha256": "7f554b8092397a0994f6aba70be38d2ec7eaf7524a075d68fb99ecbc95303525"
8
- },
9
- {
10
- "name": "openxiangda-v2",
11
- "description": "Build, inspect, validate, and deliver a complete OpenXiangda 2.0 application workspace. Use when a task spans the React frontend, NestJS backend, Data API, authorization, workflow, events, or whole-application delivery.",
12
- "sha256": "5645e5cb1c18731d5b5fb21c9ad0e59b9760600794705bb4adcad1d0e316010b"
13
- },
14
- {
15
- "name": "openxiangda-v2-architecture",
16
- "description": "Design OpenXiangda 2.0 application boundaries and typed contracts. Use when creating an app, decomposing frontend and backend responsibilities, or changing Data, AuthZ, workflow, event, or deployment declarations.",
17
- "sha256": "02768b17e048c623a13b9a99e5cedc72c9081eaa71b346c3d9db3ca66c95bf5e"
18
- },
19
- {
20
- "name": "openxiangda-v2-backend",
21
- "description": "Build the standard OpenXiangda 2.0 NestJS application backend. Use when implementing App APIs, Data API transactions, identity-aware business services, event consumers, health checks, or external integration endpoints.",
22
- "sha256": "04c3de82f4406eaeb378910fbd53e2721c13e1cb9afbeb39f1c63f352522dd39"
23
- },
24
- {
25
- "name": "openxiangda-v2-data-authz",
26
- "description": "Design OpenXiangda 2.0 Data API and contextual authorization contracts. Use for RBAC, active-role behavior, department or record attributes, application-admin bypass, field policies, and restricted transactions.",
27
- "sha256": "595fe9b8edc1e9b33720de21ed8758d4c266143c84fcb9eccc25a6adb5cce061"
28
- },
29
- {
30
- "name": "openxiangda-v2-delivery",
31
- "description": "Validate, build, deploy, observe, promote, retry, and roll back an OpenXiangda 2.0 application. Use when preparing an immutable AppPackage or changing a platform-managed environment.",
32
- "sha256": "0ee0ffef78ebe37f60319bbf5684522ce61f8d6d084c360f46dc7bb2a31d1906"
33
- },
34
- {
35
- "name": "openxiangda-v2-frontend",
36
- "description": "Build OpenXiangda 2.0 React and Ant Design admin experiences. Use when implementing menus, routes, CRUD pages, role switching, workflow task pages, or application-defined action components.",
37
- "sha256": "26add1dadeaf9a0a25d41163fb65cb70c1c5c7d882d57922193c3bd11d9d3e05"
38
- },
39
- {
40
- "name": "openxiangda-v2-workflow-events",
41
- "description": "Implement OpenXiangda Workflow Kernel v2 and durable application events. Use for approval definitions, assignee providers, task actions, delegation, add-sign, previews, data-change events, workflow events, or timers.",
42
- "sha256": "e32a5dc84e21d32a00fbfff62a349d848b04d44a569eb4f89b390901f54bb19e"
43
- }
44
- ]
45
- }
@@ -1,21 +0,0 @@
1
- ---
2
- name: openxiangda-v1-maintenance
3
- description: Maintain an existing stable OpenXiangda 1.x application without migrating it. Use for scoped fixes to legacy pages, forms, resources, App Function code, automation, workflow, or 1.x release records.
4
- ---
5
-
6
- # OpenXiangda 1.x Maintenance
7
-
8
- Preserve the installed 1.x runtime and its existing SDD, resource, function, automation, and workflow release process. Do not reinterpret the workspace as a 2.0 application package.
9
-
10
- ## Maintenance Workflow
11
-
12
- 1. Inspect the existing workspace and platform state with the installed 1.x OpenXiangda skills.
13
- 2. Run `openxiangda sdd context --json` and create or select the required SDD change.
14
- 3. Change only the named legacy resource. Keep existing identifiers and dependency order.
15
- 4. Validate 1.x JS_CODE, App Function, page, form, automation, or workflow artifacts with their dedicated 1.x skill.
16
- 5. Run `openxiangda sdd verify <change> --changed` and use the established 1.x publish gate.
17
- 6. Verify the live application without migrating its runtime, data model, or deployment topology.
18
-
19
- Do not use 2.0 build, deploy, promote, or rollback commands for a 1.x workspace. Migration is a separate, explicitly approved project.
20
-
21
- Read [1.x Migration Boundary](../../docs/migration.md) before proposing any coexistence or migration work.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 1.x Maintenance"
3
- short_description: "Maintain stable OpenXiangda 1.x applications safely"
4
- default_prompt: "Use $openxiangda-v1-maintenance to make a scoped maintenance change to this 1.x application."
@@ -1,38 +0,0 @@
1
- ---
2
- name: openxiangda-v2
3
- description: Build, inspect, validate, and deliver a complete OpenXiangda 2.0 application workspace. Use when a task spans the React frontend, NestJS backend, Data API, authorization, workflow, events, or whole-application delivery.
4
- ---
5
-
6
- # OpenXiangda 2.0
7
-
8
- Treat the repository as one typed application product. Work through package contracts and deterministic commands; do not mutate platform resources one at a time.
9
-
10
- ## Start Here
11
-
12
- 1. Run `openxiangda app info` and inspect the returned workspace and platform contract versions.
13
- 2. Read `openxiangda.config.ts`, then identify which domain skill applies:
14
- - architecture: `$openxiangda-v2-architecture`
15
- - frontend: `$openxiangda-v2-frontend`
16
- - backend: `$openxiangda-v2-backend`
17
- - data and authorization: `$openxiangda-v2-data-authz`
18
- - workflow and events: `$openxiangda-v2-workflow-events`
19
- - delivery: `$openxiangda-v2-delivery`
20
- 3. Keep generated contracts current with `openxiangda generate`.
21
- 4. Before delivery, run `openxiangda check` and `openxiangda test`.
22
-
23
- For a new repository, link it to the target platform and let an authorized platform administrator run `openxiangda app provision` once. The command is idempotent and must not be used to migrate an existing 1.x identity.
24
-
25
- ## Boundaries
26
-
27
- - Put browser code in `apps/web`, server code in `apps/server`, shared domain types in `packages/domain`, and generated declarations in `packages/contracts`.
28
- - Persist business records only through Data API or an App API implemented by the application backend.
29
- - Treat the active role and context attributes as explicit request state.
30
- - Use durable event consumers for side effects and idempotency keys for retries.
31
- - Build one immutable application package; the platform owns deployment execution, health gates, promotion, and rollback.
32
- - For a stable 1.x workspace, stop and use `$openxiangda-v1-maintenance`.
33
-
34
- ## Delivery Gate
35
-
36
- Use `openxiangda build --backend-image <immutable-image>` only after checks pass. Use `openxiangda deploy`, `openxiangda status`, and `openxiangda logs` only when the user has authorized the environment change.
37
-
38
- Read [Getting Started](../../docs/getting-started.md) for the complete development loop.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0"
3
- short_description: "Build and deliver typed OpenXiangda 2.0 applications"
4
- default_prompt: "Use $openxiangda-v2 to build and validate this OpenXiangda 2.0 application."
@@ -1,29 +0,0 @@
1
- ---
2
- name: openxiangda-v2-architecture
3
- description: Design OpenXiangda 2.0 application boundaries and typed contracts. Use when creating an app, decomposing frontend and backend responsibilities, or changing Data, AuthZ, workflow, event, or deployment declarations.
4
- ---
5
-
6
- # OpenXiangda 2.0 Architecture
7
-
8
- Design one independently versioned application with a standard React frontend and NestJS backend.
9
-
10
- ## Design Sequence
11
-
12
- 1. Inspect the workspace with `openxiangda app info`.
13
- 2. Define business aggregates and invariants in `packages/domain`.
14
- 3. Declare Data API resources, capabilities, policies, workflow definitions, event subscriptions, and timers in `openxiangda.config.ts`.
15
- 4. Keep synchronous user interactions in App APIs; move retryable side effects to event consumers.
16
- 5. Use a workflow provider when assignee resolution or a workflow action depends on application data.
17
- 6. Generate types with `openxiangda generate`, then run `openxiangda check`.
18
-
19
- ## Required Decisions
20
-
21
- - Name every resource, capability, event type, workflow, and provider with a stable application-scoped code.
22
- - Separate business data from workflow runtime state.
23
- - Define the authorization context needed for each operation, including active role and data attributes.
24
- - Define idempotency and concurrency behavior before implementing writes.
25
- - Define health, readiness, and rollback expectations as part of the application contract.
26
-
27
- Do not design environment-specific code paths. Environment values and secrets are injected by the platform at deployment time.
28
-
29
- Read [Concepts](../../docs/concepts.md) before introducing a new platform-facing contract.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Architecture"
3
- short_description: "Design typed OpenXiangda 2.0 application boundaries"
4
- default_prompt: "Use $openxiangda-v2-architecture to design this OpenXiangda 2.0 application."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-backend
3
- description: Build the standard OpenXiangda 2.0 NestJS application backend. Use when implementing App APIs, Data API transactions, identity-aware business services, event consumers, health checks, or external integration endpoints.
4
- ---
5
-
6
- # OpenXiangda 2.0 Backend
7
-
8
- Build a normal NestJS service in `apps/server`. The platform deploys one container per application and injects identity, platform endpoints, environment configuration, and secrets.
9
-
10
- ## Request Path
11
-
12
- 1. Use the platform guard to verify the user token and construct typed request context.
13
- 2. Authorize the capability and contextual data policy before accessing records.
14
- 3. Keep invariants in domain services, not controllers.
15
- 4. Use Data API for persistence and its restricted transaction endpoint for atomic batches.
16
- 5. Require revision or idempotency keys for retryable writes.
17
- 6. Return stable application contracts and structured errors.
18
-
19
- ## Runtime Path
20
-
21
- - Expose liveness and readiness endpoints.
22
- - Consume platform events with signature verification and durable idempotency.
23
- - Keep outbound integrations behind adapters with timeouts and correlation IDs.
24
- - Read secrets only from injected environment references; never place them in source or application packages.
25
-
26
- Use `openxiangda dev` for local orchestration. Run `openxiangda check`, `openxiangda test`, and `openxiangda build --backend-image <immutable-image>` before deployment.
27
-
28
- Read [Backend](../../docs/backend.md) for the standard module layout.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Backend"
3
- short_description: "Build standard NestJS application backend services"
4
- default_prompt: "Use $openxiangda-v2-backend to implement this OpenXiangda 2.0 backend."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-data-authz
3
- description: Design OpenXiangda 2.0 Data API and contextual authorization contracts. Use for RBAC, active-role behavior, department or record attributes, application-admin bypass, field policies, and restricted transactions.
4
- ---
5
-
6
- # OpenXiangda 2.0 Data and AuthZ
7
-
8
- Model permissions as capability checks plus contextual data predicates. A role grants capabilities; policies decide which records and fields are available in the current role context.
9
-
10
- ## Authorization Model
11
-
12
- 1. Declare application roles and stable capability codes.
13
- 2. Treat the selected active role as part of each request. Do not silently union all user roles.
14
- 3. Resolve subject attributes such as departments and managed colleges from trusted platform or application providers.
15
- 4. Resolve resource attributes such as instrument manager and college from the target record.
16
- 5. Express allow rules as explicit subject, action, resource, and environment predicates.
17
- 6. Grant application administrators the declared application-admin bypass and audit every bypassed write.
18
-
19
- ## Data Rules
20
-
21
- - Declare resources and fields in `openxiangda.config.ts`; generate types with `openxiangda generate`.
22
- - Prefer server-enforced filters and field policies over client filtering.
23
- - Use revision checks for updates and restricted transaction batches for related writes.
24
- - Keep policy tests for multiple roles, role switching, cross-department denial, and administrator access.
25
-
26
- Run `openxiangda check` and `openxiangda test` after every policy or schema change.
27
-
28
- Read [Data and Authorization](../../docs/data-authz.md) for policy examples.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Data and AuthZ"
3
- short_description: "Model Data API contracts and contextual authorization"
4
- default_prompt: "Use $openxiangda-v2-data-authz to design this application's data authorization."
@@ -1,30 +0,0 @@
1
- ---
2
- name: openxiangda-v2-delivery
3
- description: Validate, build, deploy, observe, promote, retry, and roll back an OpenXiangda 2.0 application. Use when preparing an immutable AppPackage or changing a platform-managed environment.
4
- ---
5
-
6
- # OpenXiangda 2.0 Delivery
7
-
8
- Deliver the whole application as one immutable version. The client submits intent; the platform owns durable execution and environment state.
9
-
10
- ## Preflight
11
-
12
- 1. Run `openxiangda doctor` and confirm client/platform contract compatibility.
13
- 2. For a first deployment only, confirm an authorized platform administrator has run `openxiangda app provision`.
14
- 3. Run `openxiangda generate --check`, `openxiangda check`, and `openxiangda test`.
15
- 4. Build and push the backend image; use an immutable digest reference.
16
- 5. Run `openxiangda build --backend-image <immutable-image>` and retain the returned package digest.
17
-
18
- ## Deployment
19
-
20
- - Inspect the plan before changing an environment.
21
- - Use `openxiangda deploy` only with explicit user authorization.
22
- - Follow the durable run with `openxiangda status` and `openxiangda logs`.
23
- - Use `openxiangda retry` only for retryable failed runs.
24
- - Use `openxiangda cancel <deploymentId>` to stop an obsolete or blocked run before submitting a replacement package.
25
- - Use `openxiangda promote` to move the exact same application version between environments.
26
- - Use `openxiangda rollback` to create a new run that activates a known historical version.
27
-
28
- Do not rebuild during promotion or rollback. Do not expose injected secrets in logs, manifests returned to clients, or package metadata.
29
-
30
- Read [Delivery](../../docs/delivery.md) for gates and failure handling.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Delivery"
3
- short_description: "Build deploy observe promote and rollback whole apps"
4
- default_prompt: "Use $openxiangda-v2-delivery to validate and deploy this OpenXiangda 2.0 application."
@@ -1,21 +0,0 @@
1
- ---
2
- name: openxiangda-v2-frontend
3
- description: Build OpenXiangda 2.0 React and Ant Design admin experiences. Use when implementing menus, routes, CRUD pages, role switching, workflow task pages, or application-defined action components.
4
- ---
5
-
6
- # OpenXiangda 2.0 Frontend
7
-
8
- Build inside `apps/web` with `@openxiangda/admin`. Preserve the standard shell, role session, route guards, error handling, and typed clients.
9
-
10
- ## Implementation Rules
11
-
12
- 1. Register menus and routes through the application contribution API.
13
- 2. Gate navigation and actions with generated capability names; the server remains authoritative.
14
- 3. Use the active-role session supplied by the platform. Switching roles must refresh permissions and scoped data.
15
- 4. Use the standard CRUD and workflow modules first; add application components only for real domain interactions.
16
- 5. Render workflow actions and field policies from the backend protocol. Do not duplicate workflow transition rules in the browser.
17
- 6. Keep data calls in typed client modules rather than components.
18
-
19
- Run `openxiangda generate`, `openxiangda check`, and `openxiangda test` after changing contracts or pages. Use accessible Ant Design patterns and run the repository's Ant Design lint when available.
20
-
21
- Read [Frontend](../../docs/frontend.md) for route, menu, role, and workflow page examples.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Frontend"
3
- short_description: "Build standard React and Ant Design application pages"
4
- default_prompt: "Use $openxiangda-v2-frontend to implement this OpenXiangda 2.0 frontend."
@@ -1,28 +0,0 @@
1
- ---
2
- name: openxiangda-v2-workflow-events
3
- description: Implement OpenXiangda Workflow Kernel v2 and durable application events. Use for approval definitions, assignee providers, task actions, delegation, add-sign, previews, data-change events, workflow events, or timers.
4
- ---
5
-
6
- # OpenXiangda 2.0 Workflow and Events
7
-
8
- The workflow kernel owns definitions, instances, tasks, transitions, delegation, add-sign, audit, and field policies. The application owns business records and application-specific logic.
9
-
10
- ## Workflow
11
-
12
- 1. Declare approval and conditional nodes in `openxiangda.config.ts`.
13
- 2. Use provider contracts for application-data-dependent assignee resolution and custom action decisions.
14
- 3. Keep submit preview and actual start on the same definition version and subject context.
15
- 4. Return allowed actions, field policies, presentation hints, and concurrency tokens from the backend.
16
- 5. Persist business changes through Data API or App API, then correlate them to the workflow action.
17
- 6. Test approve, reject, transfer, return, delegation, add-sign, duplicate requests, and stale revisions.
18
-
19
- ## Events
20
-
21
- - Subscribe to typed data and workflow events; implement idempotent consumers.
22
- - Use timers as durable event producers.
23
- - Verify signatures, propagate correlation IDs, and fail retryably for transient dependencies.
24
- - Never assume event ordering unless the contract explicitly provides a partition key.
25
-
26
- Use `openxiangda generate`, `openxiangda check`, and `openxiangda test` to keep providers and event payloads aligned.
27
-
28
- Read [Workflow and Events](../../docs/workflow-events.md) for protocol details.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "OpenXiangda 2.0 Workflow and Events"
3
- short_description: "Implement workflow providers and durable event consumers"
4
- default_prompt: "Use $openxiangda-v2-workflow-events to implement this workflow and event behavior."