| name | ows-new-service |
| description | Checklist and patterns for building a new OWS service element. Use when asked to create or design a service. |
OWS New Service Skill
Before You Start
- Understand the data model — use
get_model_fields(tenant, asset_uri) to know what fields are available
- Check existing services — use
list_services(tenant, project, module) to find similar services to reference
- Clarify input/output — what does the caller pass in, what should come back?
Service Flow Patterns
Query / List service
Input → [Validate Input] → [Build TQL] → [Query Model] → [Transform Output] → Output
- Use a
QueryModel step with TQL
- Always paginate: accept
start + limit in input, return total + data[]
Create / Update service
Input → [Validate] → [Check Permissions] → [Write Model] → [Trigger Side Effects] → Output
- Use
CreateData or UpdateData steps
- Return the created/updated record ID
Invoke external / orchestration service
Input → [Prepare Request] → [RunScript: build payload] → [InvokeService: target] → [Handle Response] → Output
- Use
RunScript (Rhino2/JS) for payload transformation
- Use
InvokeService step to call other services
RunScript Conventions
var fieldValue = input.get("fieldName");
output.put("result", value);
logger.info("Processing: " + fieldValue);
if (!fieldValue) {
throw new Error("fieldName is required");
}
Checklist
Notes
- Service names use snake_case:
centralize_inquiry_ticket_get_list
- Prefix with module abbreviation for discoverability:
cit_, cm_, inc_
- Keep services single-purpose — one service, one responsibility