redbox-controllers
ReDBox controllers live in `@researchdatabox/redbox-core` and are surfaced to Sails.js through generated shims.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ReDBox controllers live in `@researchdatabox/redbox-core` and are surfaced to Sails.js through generated shims.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ReDBox uses embedded Angular applications within EJS views instead of a single SPA. Each feature is often its own Angular project.
Angular services in ReDBox typically extend `HttpClientService` to handle base URLs, configuration, and CSRF protection.
Create detailed feature designs, implementation plans, and task lists for ReDBox/Redbox features that use Waterline models, services, webservice (REST) controllers, ajax controllers, embedded Angular apps, views, and navigation config. Use when asked to design/plan a feature or produce a task list for this stack, especially when explicit sections, non-SPA Angular patterns, and interleaved tests are required.
Review completed ReDBox feature implementations against a growing ruleset and emit structured issues for agent remediation.
Build or update ReDBox form field components end-to-end across Angular form rendering and sails-ng-common config typing/visitor infrastructure. Use when creating a new form component class/model, adding component config properties, wiring component dictionaries, handling config migration/template extraction, or adding form-component tests.
ReDBox uses a JSON-based DSL for configuring record forms, workflows, and record types.
| name | Redbox Controllers |
| description | ReDBox controllers live in `@researchdatabox/redbox-core` and are surfaced to Sails.js through generated shims. |
ReDBox controllers live in @researchdatabox/redbox-core and are surfaced to Sails.js through generated shims.
packages/redbox-core/src/controllers/packages/redbox-core/src/controllers/webservice/Controllers.Core.Controller.init() for sails-dependent setup (avoid using sails in constructors)._exportedMethods to define which methods are exposed.async index(req, res).this.sendResp(data, req, res) instead of direct res.json() or res.send(). This ensures consistent response formatting.(object as any), as any, or other deliberate any casts to bypass TypeScript compilation errors. Fix the types, declare appropriate interfaces, or request assistance from the team.Use the redbox-dev-tools CLI generator generate controller:
name: Controller name (e.g., MyRecord) as an argument.--actions <list>: Comma-separated actions (e.g., index,get,save).--webservice: If it's a webservice controller.--routes <routes>: Action-to-route mappings: action:verb:path[:role1:role2],... (e.g., list:get:/api/items:Admin:Researcher).--auth <roles>: Default roles for auth rules (can be overridden per-route).Use redbox-dev-tools generate method to add actions to an existing controller:
--file <path>: Path to the controller file.--method <name>: Method name.--route <route>: Route path (e.g., /api/new-path).--http <verb>: HTTP verb (GET, POST, etc.).--auth <roles>: Auth roles.When adding a controller, you must update packages/redbox-core/src/controllers/index.ts:
ControllerExports (or WebserviceControllerExports) with a lazy getter.ControllerNames (or WebserviceControllerNames) array.Routes are defined in packages/redbox-core/src/config/routes.config.ts.
Pattern: 'get /api/my-path': { controller: 'MyController', action: 'index' }
Auth rules are defined in packages/redbox-core/src/config/auth.config.ts.
Pattern: { path: '/api/my-path', role: 'admin', can_read: true }