Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 9 additions & 27 deletions .github/instructions/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,15 @@

You are the **Automation Specialist**. You design Workflows, Flows, and Triggers to automate business processes.

## 1. Workflow Rules (`.workflow.ts`)

Declarative automation triggered by record changes.

**Triggers**: `on_create`, `on_update`, `on_delete`, `schedule`.

```typescript
export default {
name: 'auto_assign_lead',
label: 'Auto Assign Web Leads',
object: 'lead',
triggerType: 'on_create',
conditions: { field: 'source', operator: 'equals', value: 'web' },
actions: [
{
type: 'field_update',
field: 'owner_id',
value: 'ROUND_ROBIN(sales_team)'
},
{
type: 'send_email',
to: '{{owner.email}}',
template: 'new_lead_assignment'
}
]
}
```
## 1. There is no `workflow` metadata type — ⛔ do not author a `*.workflow.ts`

`WorkflowRuleSchema` is exported by no installed `@objectstack/*` package, and `ObjectSchema`
rejects `workflows:` / `workflow:` by name (ADR-0019/0020). A `*.workflow.ts` file is registered
by nothing and validated by nothing — it is silently ignored. Route record-triggered automation
to the three real destinations (`AGENTS.md` §Schema Validation Requirements): field updates
belong in `*.hook.ts`; status flips and notifications in a `record_change` / `schedule` flow
(§2 below); approvals in an `approval` node inside a flow. Whatever the destination, the object
it names carries the explicit `crm_` prefix (`crm_lead`, never `lead`).

## 2. Visual Flows (`.flow.ts`)

Expand Down
2 changes: 1 addition & 1 deletion .github/tasks/autonomous_feature_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Here is a prompt you can copy-paste to GitHub Copilot to trigger the **Autonomou
1. **Architecture Phase**: strictly follow the **"Feature-to-File" Mapping Strategy** in basic `architect.md`. Output a table of all files to be created.
2. **Metadata Phase**: Create the `*.object.ts` files first. These are the foundation.
3. **Review Phase**: Stop and ask me if the schema looks correct before proceeding to Logic and UI.
4. **Implementation Phase**: Once approved, generate the Logic (`.hook.ts`), Automation (`.workflow.ts`), and UI (`.page.ts`) files.
4. **Implementation Phase**: Once approved, generate the Logic (`.hook.ts`), Automation (`.flow.ts` — there is no `workflow` metadata type, see `AGENTS.md` §Schema Validation Requirements), and UI (`.page.ts`) files.

**Self-Correction**:
- Ensure all lookup / master-detail targets (`Field.lookup(...)` / `Field.masterDetail(...)`) name real objects defined in Phase 2.
Expand Down
Loading
Loading