> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Job Generator

> Generate a @Job class

Generates a `@Job` class extending `JobContext` with stub input/output schemas.

## Usage

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
nx g @frontmcp/nx:job analyze-text --project text-processing
```

## Options

| Option      | Type     | Default | Description                                 |
| ----------- | -------- | ------- | ------------------------------------------- |
| `name`      | `string` | —       | **Required.** The name of the job           |
| `project`   | `string` | —       | **Required.** The project to add the job to |
| `directory` | `string` | —       | Subdirectory within `src/jobs/`             |

## Generated File

```
src/jobs/analyze-text.job.ts
```

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import { Job, JobContext } from '@frontmcp/sdk';
import { z } from 'zod';

@Job({
  name: 'analyze-text',
  description: 'TODO: describe what this job does',
  inputSchema: {
    value: z.string().describe('TODO: replace with actual input'),
  },
  outputSchema: {
    result: z.string().describe('TODO: replace with actual output'),
  },
})
export default class AnalyzeTextJob extends JobContext {
  async execute(input: { value: string }) {
    // Full SDK access: this.scope.tools, this.scope.agents, etc.
    return { result: `Processed: ${input.value}` };
  }
}
```

## Example

```bash theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
# Add to a specific subdirectory
nx g @frontmcp/nx:job send-notification --project crm --directory notifications
# Creates: src/jobs/notifications/send-notification.job.ts
```

After generating, update the app to register the job:

```ts theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
import AnalyzeTextJob from './jobs/analyze-text.job';

@App({
  id: 'text-processing',
  jobs: [AnalyzeTextJob],
})
class TextProcessingApp {}
```
