temporal-rules

Project rules for Temporal, a system that runs long-running workflows and coordinates their individual activities. The rules describe a NestJS monorepo, meaning one repository containing multiple applications and shared packages.

In plain words
What is it for?
They are for defining Temporal workflows, implementing activities, configuring workers, and organizing shared workflow utilities in the specified application structure.
Why use it?
They give developers consistent locations, versions, worker setup, task queues, and workflow patterns for this project.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/proyecto26/projectx/temporal-rules
Clone the repo
git clone --depth 1 https://github.com/proyecto26/projectx

Made for: Cursor.

Per session 2,467 This file is loaded in full into every session.
When invoked 2,467 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02467 $0.02467
Opus 5 $0.01234 $0.01234
Sonnet 5 $0.00493 $0.00493
Haiku 4.5 $0.00247 $0.00247

Measured 2d ago against content hash 5f13fec75f0f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

temporal-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/backend/temporal-rules.mdc · 362 lines

How it starts

The opening of the file, as written. The whole thing — 362 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Temporal Workflow Rules

Project Context

  • This project uses Temporal.io for workflow orchestration
  • Temporal Server version: 1.29.2
  • Temporal Admin Tools: 1.29.1-tctl-1.18.4-cli-1.5.0
  • Temporal UI: 2.44.1
  • All services connect to Temporal for long-running business processes

Workflow Architecture

Workflow Locations

  • Workflow definitions: apps/*/src/workflows/
  • Activity implementations: apps/*/src/activities/
  • Shared workflow utilities: packages/workflows/src/lib/
  • Temporal configuration: apps/*/src/config/temporal.config.ts

Worker Configuration

  • Each NestJS app runs its own Temporal worker
  • Workers are initialized in the main application bootstrap
  • Task queue is configured per service via environment variables
  • Workers bundle workflows using Webpack

Workflow Patterns

Workflow Definition

import { proxyActivities } from '@temporalio/workflow';
import type { ActivitiesService } from '../main';
const activities = proxyActivities<ActivitiesService>({
  startToCloseTimeout: '1 minute',
});
export async function myWorkflow(input: WorkflowInput): Promise<WorkflowOutput> {
  // Workflow logic here
  const result = await activities.myActivity(input);
  return result;
}

Activity Definition

@Injectable()
export class ActivitiesService {
  constructor(
    private readonly prisma: PrismaService,
    private readonly emailService: EmailService,
  ) {}
  async myActivity(input: ActivityInput): Promise<ActivityOutput> {
    // Activity logic with side effects
    return result;
  }
}

Critical Rules

Workflow Code Constraints

  • NO direct database calls in workflows
  • NO HTTP requests in workflows
  • NO file I/O in workflows
  • NO random number generation in workflows
  • NO Date.now() or new Date() in workflows
  • YES to deterministic logic only
  • YES to calling activities for side effects

Use Activities For

  • Database operations (Prisma queries)
  • HTTP/API calls
  • Email sending
  • File operations
  • Any non-deterministic operations
  • External service integrations

Read the full file on GitHub · 362 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 362 lines · 2,467 tokens per session scan A 5f13fec75f0f

Subscribe to this mod's changes

temporal-rules is a cursor rule published in the GitHub repository proyecto26/projectx (83 stars, last pushed 4mo ago), licensed MIT. It adds 2,467 tokens to every session, about $0.0123 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.