Skip to main content

Authoring with AI

This is the heart of Forge: you describe what you want in plain English, and your AI agent uses Forge's tools to look up your schema, generate the right files, and validate them. You never invoke Forge's tools by name — the agent does that for you.

How it works

In GitHub Copilot, open Copilot Chat and select Agent mode. In Claude Code or Codex, just start a session in your project. Forge's tools are available automatically. Describe the task and let the agent work: it fetches the schema, generates the file, and validates it.

Behind the scenes, before writing anything, the agent reads your project — the relevant Type's attributes and lifecycle, the correct interface contract for the program kind, proven coding patterns, and similar existing programs to follow your conventions. That grounding is what keeps generated code correct and idiomatic instead of hallucinated.

Review before you ship

Forge keeps the agent honest about Protrak contracts and your schema, but it can't catch a misunderstood requirement. Always review generated code and JSON before committing or deploying.

What Forge can build

You can ask for…Forge handles
C# programs — triggers (PreCreate, PostCreate, …), schedulers, reports, and morePicks the correct interface contract, namespace, and service-injection pattern; runs static validation before you build
Design Studio layouts — Forms, Type Widgets, Layout TemplatesGenerates the JSON artifacts and assembles them into a page layout
Schema elements — Types, Attributes, Lifecycles, Relation TypesWrites the JSON into the right folder; can scaffold a whole new entity in one pass
Query DefinitionsWrites the query for use with IQueryBuilderService
Rules — attribute filter groupsGenerates a validated Rule and can attach it where it's used
Custom-code Widgets — ReactGenerates the widget metadata plus the component code
Notification templates — HTML + JSONGenerates the paired template files
Answers about your projectLists and explains your Types, Attributes, Programs, layouts, and queries; finds similar existing programs to reuse as examples
A health check on the whole workspaceAudits every schema element for unused attributes, missing lifecycles, duplicate names, and circular promote paths — see Checking your workspace

Attribute types supported: Text, Numeric, Date, DateTime, Currency, Picklist, RichText, Expression, Boolean, Attachment, User, Reference.

Design Studio, not classic layouts

Forge authors the Design Studio layout family — Forms, Type Widgets, and Layout Templates. Classic layouts (Home/Create/View/Edit/Report/Dashboard) are being retired and Forge does not author them; use Design Studio for new layout work.

Example prompts

Write a program

"Write a PreCreate program for the Equipment type that checks Status is not empty."

"Create a Scheduler that queries all pending Work Orders and notifies the assigned user."

Design a layout

"Generate a Create form for the Equipment type."

"Create a Dashboard type widget for WorkOrder showing Status, Title, and AssignedTo."

"Build a complete layout template for Project, including the Create form and a Dashboard widget."

Scaffold a new entity

"Scaffold a Diary entity with an Active/Inactive lifecycle, attributes for entry date and farmer reference, and a FarmerToDiary relation."

"Add a Numeric attribute called Capacity to the workspace."

Create a rule

"Create a rule that flags High Priority Projects past their due date."

Create a query definition

"Create a query definition for active Projects."

"Write a program that uses IQueryBuilderService to find all open Work Orders — create the query if it doesn't exist."

Ask about your project

"What entity types do we have?" · "What attributes does WorkOrder have?"

"Show me all PostCreate programs for Project." · "List all forms and widgets for the Diary type."

"Find programs similar to sending an email notification."

Check the workspace (see Checking your workspace)

"Analyze this workspace for schema quality issues."

"Which attributes here aren't used by any type?"

Scaffolding a whole entity

You don't have to build an entity piece by piece. Ask for a complete entity and Forge orchestrates the lifecycle, relation types, attributes, and the Type in one pass — reusing anything that already exists so it's safe to re-run:

"Scaffold a Diary entity with an Active/Inactive lifecycle, attributes for entry date and farmer reference, and a FarmerToDiary relation."

Existing files are reused — the agent only writes what's missing — so re-running a scaffold to add one more attribute won't clobber your other edits.

Checking your workspace

A customization grows by accretion: attributes staged for a Type that never shipped, a lifecycle renamed but still referenced, two elements that differ only in casing. Forge can sweep the whole project for those in one pass — just ask:

"Analyze this workspace for schema quality issues."

"Which attributes here aren't used by any type?"

"Check whether any type points at a lifecycle that doesn't exist."

The audit is read-only — it reports, it never edits or "fixes". You decide what to act on. You can also narrow it ("just check for duplicate names") and the agent runs that single check.

What it checks

CheckSeverityWhat it finds
Missing lifecyclesErrorA Type naming a Lifecycle with no file in Lifecycles/ — this breaks on import
Duplicate namesErrorTwo elements of the same kind whose names collide, exactly or only by case
Circular promotesWarningA Lifecycle whose promote actions form a loop across two or more states
Orphaned programsWarningA Program whose JSON companion names a target Type that doesn't exist
Unused attributesInfoAttributes no Type and no Relation Type references

The severities are deliberate, and worth reading before you treat the report as a to-do list:

  • A circular promote is not automatically a bug. Reversible workflows (In Stock → Allocated → In Stock) are normal and common — the finding asks you to confirm the round trip is intended, not to remove it. Actions that promote a state to itself are the command-button pattern (Send Notification, Generate Report) and are ignored entirely.
  • An unused attribute is information, not a defect. Attributes are often authored ahead of the Types that will use them, or kept deliberately for a future phase.
  • Orphaned programs is quiet on most projects. It can only report when a program's JSON companion declares a target Type; most workspaces leave that field out, so the check finds nothing rather than guessing.

Sample output

Run against a real customization project (112 Types), the agent reports:

Ran 5 checks in 3871 ms — 139 findings (0 errors, 32 warnings, 107 info).

Every finding names the file it points at, so you can open it directly:

{
"check_id": "circular_promotes",
"severity": "warning",
"element": "Lifecycles/Asset.json",
"message": "Lifecycle 'Asset' has a circular promote path: In Stock → Allocated → In Stock. Confirm this round trip is intended."
}
{
"check_id": "unused_attributes",
"severity": "info",
"element": "Attributes/ActualEndDate.json",
"message": "Attribute 'ActualEndDate' is not referenced by any type or relation type."
}

Findings come back in a stable order, so two runs over an unchanged workspace produce identical reports — you can re-run after a cleanup and diff the result to confirm what you actually closed out.

Good moments to run it

Before a schema Export to Server, before opening a pull request on a customization repo, and when you inherit a project you didn't write.

Guided prompts (optional)

Forge ships named prompts you can invoke explicitly when you want a step-by-step flow: write-protrak-program, design-protrak-layout, scaffold-protrak-entity, design-protrak-rule, and write-protrak-widget.

"Use the scaffold-protrak-entity prompt for the Diary type."

Safe by design

  • Preview before write. Generators can show you exactly what they'll write (the proposed file content and a diff against any existing file) before touching disk.
  • Paired files stay consistent. Programs (.cs + .json), widgets (.js + .json), and notification templates (.html + .json) are written together — a generation never leaves you with half a pair.
  • Validation before build. Program generation is followed by static checks (correct interface, valid service usage, namespace) — and a real dotnet build if the .NET SDK is available.

See Troubleshooting & Limitations for what Forge can and can't do.