The Coding Agent is an automated system that integrates Jira issues with GitHub Actions and Cursor CLI to automatically implement code changes based on Jira ticket requirements. It can create branches, implement features, deploy to custom environments, create Pull Requests, and iteratively fix issues based on PR feedback.
The files in this repository are placed outside of .git folder for better visibility. At the end of this document there is a decription as to how to place the files in a real project
- Trigger: User add a label
coding_agentin a Jira issue comment - Jira Webhook: Sends
coding_agentevent to GitHub - Event Dispatch Workflow (
coding-agent-event-dispatch.yaml):- Validates Jira issue key format (RND-123 or RES-123)
- Checks if branch
{JIRA_KEY}-Coding-Agentexists - Routes to
initial-commitworkflow if branch doesn't exist
- Initial Commit Workflow (
coding-agent-initial-commit.yaml):- Downloads existing files from Azure Blob Storage (if any)
- Creates new branch:
{JIRA_KEY}-Coding-Agent - Extracts Jira issue information (if no files from blob storage exist)
- Runs Cursor CLI to implement changes
- Formats and commits changes
- Uploads files to Azure Blob Storage
- Deploys to custom Azure Static Web App environment
- Creates Pull Request with deployment URL
- Sends Slack notification
- Trigger: User comments
@coding_agenton a GitHub Pull Request - Comment Dispatch Workflow (
coding-agent-comment-dispatch.yaml):- Validates comment contains
@coding_agent - Verifies PR exists and is open
- Extracts Jira issue key from branch name
- Triggers
fix-prworkflow
- Validates comment contains
- Fix PR Workflow (
coding-agent-fix-pr.yaml):- Downloads existing files from Azure Blob Storage
- Checks out existing branch
- Extracts Jira issue if
.coding_agentfolder missing - Generates branch diff (current vs default branch)
- Fetches PR comments (issue comments and review comments)
- Processes and converts comments to YAML
- Runs Cursor CLI with combined context (Jira issue + PR comments + branch diff)
- Formats and commits fixes
- Uploads files to Azure Blob Storage
- Deploys updated changes
- Updates PR with completion status
- Sends Slack notification
Both workflows can also be triggered manually via workflow_dispatch:
- Navigate to Actions → Select workflow → Run workflow
- Provide
jira_issue_keyandbranch_nameas inputs
- Purpose: Main entry point for Jira-triggered events
- Trigger:
repository_dispatchevent with typecoding_agent - Function:
- Validates Jira issue key format
- Checks if branch exists
- Routes to either
initial-commitorfix-prworkflow based on branch existence
- Key Features:
- Validates issue key format:
RND-123orRES-123(case insensitive) - Concurrency control per Jira issue key
- Validates issue key format:
- Purpose: Entry point for PR comment triggers
- Trigger:
issue_commentevent (when comment contains@coding_agent) - Function:
- Validates comment is on a PR (not an issue)
- Extracts Jira issue key from branch name
- Triggers
fix-prworkflow - Posts confirmation comment on PR
- Key Features:
- Only processes open PRs
- Extracts Jira key from branch name pattern:
{JIRA_KEY}-Coding-Agent
- Purpose: Deploys to custom Azure Static Web App environment
- Function: Creates a deployment slot named after the Jira issue key
- Used by: Both
initial-commitandfix-prworkflows
All coding agent files are stored in Azure Blob Storage instead of being committed to the repository:
- Container:
coding-agent - Path Structure:
{jira_key}/(e.g.,RND_123/issue_info.json) - Files Stored:
issue_info.json- Complete Jira issue dataissue_info.md- Human-readable issue summaryplan.md- Implementation plansummary.md- Implementation summarypr_comments.json- Processed PR commentspr_comments.yaml- PR comments in YAML formathandled_comments.yaml- Tracks processed commentsbranch_diff.txt- Git diffissue_comments.json- Raw PR commentsreview_comments.json- Raw review commentsattachments/- Jira attachments (images, etc.)
Workflow:
- Files are downloaded at the beginning of each workflow job (if they exist)
- All operations work on local
.coding_agentfolder - Files are uploaded to blob storage at the end of each workflow job
- The
.coding_agentfolder is in.gitignoreand not committed
JIRA_API_TOKEN- Description: Jira API token for authentication
- How to get:
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a label (e.g., "Coding Agent")
- Copy the generated token
- Required for: All workflows
- Description: Jira API token for authentication
CURSOR_API_KEY- Description: API key for Cursor CLI
- How to get:
- Sign up/login at https://cursor.com
- Navigate to API settings
- Generate an API key
- Required for: All workflows
-
GITHUB_CODING_AGENT_APP_ID- Description: GitHub App ID
- How to get:
- Create a GitHub App at https://github.com/settings/apps/new
- Set permissions:
- Repository permissions:
- Contents: Read and write
- Pull requests: Read and write
- Issues: Read
- Actions: Read
- Checks: Read and write
- Account permissions:
- None required
- Repository permissions:
- Copy the App ID from the app settings page
- Required for: All workflows
-
GITHUB_CODING_AGENT_KEY- Description: GitHub App private key (PEM format)
- How to get:
- In your GitHub App settings, go to "Private keys"
- Click "Generate a private key"
- Download the
.pemfile - Copy the entire contents (including
-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY-----)
- Required for: All workflows
AZURE_STATIC_WEB_APPS_API_TOKEN- Description: Deployment token for Azure Static Web Apps
- How to get:
- Go to Azure Portal → Your Static Web App
- Navigate to "Manage deployment token"
- Copy the deployment token
- Required for: All workflows
AZURE_STORAGE_ACCOUNT- Description: Azure Storage Account name
- Example:
mystorageaccount - How to get:
- Go to Azure Portal → Storage accounts
- Find or create a storage account
- Copy the storage account name
- Required for: All workflows
- Note: The container
coding-agentmust be created manually or via infrastructure as code
AZURE_CLIENT_ID- Description: Azure AD Application (Service Principal) Client ID
- How to get:
- Go to Azure Portal → Azure Active Directory → App registrations
- Create a new app registration or use existing
- Copy the Application (client) ID
- Create a client secret in "Certificates & secrets"
- Grant the app "Storage Blob Data Contributor" role on the storage account
- Required for: All workflows
These variables should be set in the dev environment (Settings → Environments → dev → Environment variables).
-
JIRA_BASE_URL- Description: Your Jira instance URL
- Example:
https://yourcompany.atlassian.net - How to get: Your Jira instance URL
- Required for: All workflows
-
JIRA_USER_EMAIL- Description: Email address of the Jira user account
- Example:
coding-agent@yourcompany.com
- Example:
- How to get: Create a service account in Jira or use an existing user
- Required for: All workflows
- Description: Email address of the Jira user account
-
AZURE_TENANT_ID- Description: Azure AD Tenant ID
- How to get:
- Go to Azure Portal → Azure Active Directory
- Copy the Tenant ID from "Overview"
- Required for: All workflows
-
AZURE_SUBSCRIPTION_ID- Description: Azure Subscription ID
- How to get:
- Go to Azure Portal → Subscriptions
- Copy the Subscription ID
- Required for: All workflows
CODING_AGENT_SLACK_RND_WEBHOOK- Description: Slack webhook URL for notifications
- How to get:
- Go to Slack → Apps → Incoming Webhooks
- Create a new webhook
- Select the channel for notifications
- Copy the webhook URL
- Required for: Slack notifications (optional but recommended)
The workflows require a GitHub environment named dev to be configured:
- Go to Settings → Environments → New environment
- Create an environment named
dev - Add the required environment variables (see "Required GitHub Variables" above)
- Optionally configure environment protection rules (reviewers, wait timer, etc.)
All workflow jobs that need Azure authentication must have environment: name: dev specified to access the environment-scoped variables.
The workflows require the following permissions (configured in workflow files):
contents: write- To create branches and commit changespull-requests: write- To create and update Pull Requestsissues: read- To read PR commentsactions: write- To trigger other workflowschecks: write- For deployment checksid-token: write- For Azure authentication
These are automatically configured in the workflow files and don't require manual setup.
The Azure Service Principal (identified by AZURE_CLIENT_ID) needs:
-
Storage Blob Data Contributor role on the storage account
- How to set:
- Go to Azure Portal → Storage Account → Access control (IAM)
- Click "Add role assignment"
- Select "Storage Blob Data Contributor"
- Assign to your Service Principal (App Registration)
- How to set:
-
Static Web Apps Contributor role (if deploying)
- How to set:
- Go to Azure Portal → Static Web App → Access control (IAM)
- Click "Add role assignment"
- Select "Static Web Apps Contributor"
- Assign to your Service Principal
- How to set:
To enable Jira-triggered workflows:
-
Create Jira Webhook:
- Go to Jira Settings → System → Webhooks
- Create a new webhook
- URL:
https://api.github.com/repos/{owner}/{repo}/dispatches - Events: Select "Comment created"
- Authentication: Use Basic Auth with a GitHub Personal Access Token
-
Webhook Payload (when
@coding_agentis mentioned):{ "event_type": "coding_agent", "client_payload": { "jira_issue_key": "RND-123" } } -
GitHub Personal Access Token (for webhook):
- Create at https://github.com/settings/tokens
- Scopes needed:
repo(full control of private repositories) - Use this token in Jira webhook Basic Auth
After setup, verify the configuration:
-
Test Initial Commit Flow:
- Tag
@coding_agentin a Jira issue comment - Check GitHub Actions for workflow run
- Verify branch is created and PR is opened
- Tag
-
Test Fix PR Flow:
- Comment
@coding_agenton an existing PR - Check GitHub Actions for workflow run
- Verify changes are committed
- Comment
-
Check Azure Blob Storage:
- Verify files are uploaded to
coding-agentcontainer - Check files are organized by Jira issue key
- Verify files are uploaded to
-
Workflow fails with "No existing files found in blob storage"
- This is normal for first runs
- The workflow will create new files
-
Azure authentication fails
- Verify
AZURE_CLIENT_ID,AZURE_TENANT_ID, andAZURE_SUBSCRIPTION_IDare correct - Ensure Service Principal has required roles
- Ensure the workflow job has
environment: name: devset (required to access environment-scoped variables)
- Verify
-
Blob storage upload/download fails
- Verify
AZURE_STORAGE_ACCOUNTis correct - Ensure container
coding-agentexists - Check Service Principal has "Storage Blob Data Contributor" role
- Verify
-
Cursor CLI fails
- Verify
CURSOR_API_KEYis valid - Check Cursor API quota/limits
- Verify
-
GitHub App authentication fails
- Verify
GITHUB_CODING_AGENT_APP_IDandGITHUB_CODING_AGENT_KEYare correct - Ensure GitHub App has required permissions
- Check the App is installed on the repository
- Verify
.github/
├── workflows/
│ ├── coding-agent-event-dispatch.yaml # Main entry point (Jira → GitHub)
│ ├── coding-agent-comment-dispatch.yaml # PR comment entry point
│ ├── coding-agent-initial-commit.yaml # First-time implementation
│ ├── coding-agent-fix-pr.yaml # Iterative fixes
│ └── deploy-custom-url.yaml # Custom environment deployment
├── scripts/
│ └── jira_issue_extractor/ # Jira issue extraction scripts
README.md # This file
- The
.coding_agentfolder is in.gitignoreand should never be committed - All files are stored in Azure Blob Storage, organized by Jira issue key
- Image URLs in PR descriptions point to Azure Blob Storage, not GitHub
- Each workflow run is isolated - files are downloaded at the start and uploaded at the end
- Concurrency is controlled per Jira issue key to prevent duplicate runs