Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
refactor: consolidate redundant autonomous jobs
Adam Eivy11f8d25cdaf2
diff --git a/.changelog/v0.24.x.md b/.changelog/v0.24.x.mdindex 961240094a..dd0f5dd622 100644--- a/.changelog/v0.24.x.md+++ b/.changelog/v0.24.x.md@@ -20,6 +20,10 @@ Bidirectional peer registration — adding a peer on one instance now automatica## Improvements+### Consolidated redundant autonomous jobs+- **JIRA Sprint Manager** — merged "JIRA App Maintenance" and "JIRA Ticket Implementation" into a single phased job that triages sprint tickets first, then implements the top-priority ready ticket+- **Brain Review** — merged "Brain Inbox Processing" and "Brain Project Review" into a single job that processes inbox items and reviews active projects in one pass+### Script jobs for autonomous job system- **Script job type** — autonomous jobs can now be marked as `type: 'script'` to execute directly without spawning an AI agent- **Autobiography prompt converted** — the autobiography story prompt job now runs as a simple cron-like script instead of invoking an LLM, saving resources for jobs that don't need AI processingdiff --git a/data.sample/prompts/skills/jobs/jira-app-maintenance.md b/data.sample/prompts/skills/jobs/jira-app-maintenance.mddeleted file mode 100644index 734e36f2de..0000000000--- a/data.sample/prompts/skills/jobs/jira-app-maintenance.md+++ /dev/null@@ -1,147 +0,0 @@-# JIRA App Maintenance Job--Autonomous job for maintaining JIRA tickets across managed apps with JIRA integration.--## Prompt Template--You are acting as my Chief of Staff, managing JIRA tickets for apps with JIRA integration enabled.--Your goal is to proactively maintain and advance work on JIRA tickets assigned to me across all managed apps. For each ticket, you should evaluate what needs to be done next and take appropriate action.--## Steps--1. **Discover JIRA-enabled apps**- - Call `GET /api/apps` to get all managed apps- - Filter for apps where `jira.enabled === true` and both `jira.instanceId` and `jira.projectKey` are set- - Skip archived apps--2. **Fetch sprint tickets for each app**- - For each JIRA-enabled app, call `GET /api/jira/:instanceId/my-sprint-tickets/:projectKey`- - This returns tickets assigned to me in the current active sprint--3. **Evaluate each ticket and determine next action**-- For each ticket, analyze:-- **Ticket Quality Assessment:**- - Is the summary clear and descriptive?- - Is the description detailed enough to implement?- - Are acceptance criteria defined?- - Are there technical details or context missing?-- **Readiness Assessment:**- - Is this ticket ready to be worked on?- - Are there dependencies or blockers mentioned?- - Does the priority suggest urgency?-- **Action Decision Matrix:**-- | Ticket State | Action to Take |- |--------------|----------------|- | **Poor quality** - Vague summary, missing details, no acceptance criteria | Add JIRA comment requesting clarification. List specific questions about requirements, expected behavior, edge cases, etc. |- | **Well-defined & ready** - Clear requirements, no blockers, medium/high priority | Create a CoS task to implement the ticket. Include ticket key, summary, and link in the task description. |- | **Blocked or needs discussion** - Dependencies mentioned, unclear approach, needs architectural decision | Add JIRA comment noting the blocker and suggesting paths forward or requesting input. |- | **High priority or blocker** - Marked as urgent or blocking other work | Create a CoS task with HIGH priority to address immediately. Consider spawning an agent to start work if well-defined. |- | **Low priority & well-groomed** - Can wait, already has good details | No immediate action needed. Note in your report for future reference. |--4. **Take actions via API**-- **To add a JIRA comment:**- ```- POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments- Body: { "comment": "Your comment text here" }- ```-- **To create a CoS task:**- ```- POST /api/cos/tasks- Body: {- "description": "Implement JIRA-123: Feature name\n\nJIRA: [link]\nDetails: ...",- "priority": "HIGH|MEDIUM|LOW",- "taskType": "internal",- "metadata": {- "jiraTicket": "JIRA-123",- "appId": "app-uuid",- "appName": "App Name"- }- }- ```--5. **Prioritization Guidelines**- - Handle HIGH priority and Blocker tickets first- - Group tickets by app for context- - Focus on tickets that can be moved forward (either by clarifying or implementing)- - Avoid spending time on low-priority tickets that are already well-groomed--6. **Generate Summary Report**- - Total tickets reviewed- - Actions taken per app (comments added, tasks created)- - Tickets requiring urgent attention- - Tickets that need human input- - Tickets ready for implementation--## Expected Outputs--1. **JIRA Comments** - Added to tickets needing clarification or blocked tickets-2. **CoS Tasks** - Created for tickets ready to be implemented-3. **Summary Report** - Saved via CoS reporting system with:- - Breakdown by app- - Actions taken- - Recommendations for next steps--## Success Criteria--- All JIRA-enabled apps are checked-- Every ticket in current sprint is evaluated-- Actionable tickets have CoS tasks created-- Unclear tickets have clarifying comments added-- Report provides clear visibility into ticket status and next steps--## Job Metadata--- **Category**: jira-app-maintenance-- **Interval**: Daily-- **Priority**: MEDIUM-- **Autonomy Level**: manager (can add comments and create tasks autonomously)--## Example Report Structure--```markdown-# JIRA App Maintenance Report - 2026-02-17--## Summary-- Apps reviewed: 3-- Total tickets: 12-- Comments added: 4-- Tasks created: 3-- Urgent items: 2--## App: MyWebApp (PROJ-KEY)-### Tickets Reviewed: 5-- **PROJ-123** (HIGH) - Implement user authentication- - Action: Created CoS task for implementation-- **PROJ-124** (MEDIUM) - Fix login redirect bug- - Action: Added comment requesting reproduction steps-- **PROJ-125** (LOW) - Update documentation- - Action: None - well-defined, low priority--### Urgent Items-- PROJ-123 needs immediate attention (blocker)--## App: APIServer (API-KEY)-### Tickets Reviewed: 7-...--## Recommendations-1. Focus on PROJ-123 (blocker)-2. Follow up on PROJ-124 comment responses-3. Schedule PROJ-125 for next week-```--## Notes--- This job should NOT make code changes directly-- It should NOT commit to repositories-- It focuses on ticket management and task planning-- For implementation work, it creates CoS tasks that spawn separate agents-- Always include JIRA ticket keys and links in created tasks for traceabilitydiff --git a/data.sample/prompts/skills/jobs/jira-sprint-manager.md b/data.sample/prompts/skills/jobs/jira-sprint-manager.mdnew file mode 100644index 0000000000..dc5cbb5b9e--- /dev/null+++ b/data.sample/prompts/skills/jobs/jira-sprint-manager.md@@ -0,0 +1,117 @@+# JIRA Sprint Manager Job++Autonomous job that triages and implements JIRA tickets for apps with JIRA integration enabled. Runs Monday-Friday at 9 AM.++## Prompt Template++You are acting as my Chief of Staff, triaging and implementing JIRA tickets for apps with JIRA integration enabled.++This job runs Monday-Friday. It triages all sprint tickets first, then implements the top-priority ready ticket.++## Steps++### Phase 1 — Triage++1. **Discover JIRA-enabled apps**+ - Call `GET /api/apps` to get all managed apps+ - Filter for apps where `jira.enabled === true` and both `jira.instanceId` and `jira.projectKey` are set+ - Skip archived apps++2. **Fetch sprint tickets for each app**+ - For each JIRA-enabled app, call `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey`+ - This returns tickets assigned to me in the current active sprint++3. **Evaluate each ticket**++ For each ticket, assess quality and readiness:++ | Ticket State | Action to Take |+ |--------------|----------------|+ | **Poor quality** - Vague summary, missing details | Add JIRA comment requesting clarification with specific questions |+ | **Blocked or needs discussion** - Dependencies, unclear approach | Add JIRA comment noting the blocker and suggesting paths forward |+ | **Well-defined & ready** - Clear requirements, no blockers | Mark as implementation candidate |+ | **High priority or blocker** - Marked urgent | Prioritize for implementation |+ | **Low priority & well-groomed** - Can wait | No immediate action needed |++4. **Take triage actions via API**++ **To add a JIRA comment:**+ ```+ POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments+ Body: { "comment": "Your comment text here" }+ ```++### Phase 2 — Implement++5. **Select a ticket to implement**+ - From triage results, select the highest priority ticket in "To Do" or "Ready" status+ - Must have clear requirements (summary + description)+ - Select only ONE ticket per run to maintain focus+ - Skip if no tickets are ready++6. **Create a git worktree for implementation**+ ```bash+ cd /path/to/app/repo+ git fetch origin+ git worktree add -b feature/TICKET-123 ../worktrees/TICKET-123 origin/main+ ```++7. **Implement the ticket** in the worktree directory+ - Read the ticket requirements carefully+ - Follow the project's coding conventions+ - Write tests if the project has a test suite+ - Ensure the code compiles/lints without errors++8. **Commit and push changes**+ ```bash+ git add .+ git commit -m "feat(TICKET-123): <summary from ticket>"+ git push -u origin feature/TICKET-123+ ```++9. **Create a merge/pull request** using `gh pr create` or `glab mr create`++10. **Transition the JIRA ticket to In Review**+ ```+ GET /api/jira/instances/:instanceId/tickets/:ticketKey/transitions+ POST /api/jira/instances/:instanceId/tickets/:ticketKey/transition+ Body: { "transitionId": "<transition-id>" }+ ```++11. **Add PR link to JIRA ticket**+ ```+ POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments+ Body: { "comment": "Implementation complete. PR: <pr-url>\n\nReady for code review." }+ ```++### Phase 3 — Report++12. **Generate summary report** covering:+ - Total tickets reviewed per app+ - Triage actions taken (comments added, blockers noted)+ - Ticket implemented (if any) with PR link+ - Recommendations for next steps++## Expected Outputs++1. **JIRA Comments** - Added to tickets needing clarification or blocked+2. **Code Changes** - Committed to a feature branch (if implementing)+3. **Pull/Merge Request** - Created and linked to ticket (if implementing)+4. **JIRA Ticket Update** - Transitioned to "In Review" with PR link (if implementing)+5. **Summary Report** - Saved via CoS reporting system++## Success Criteria++- All JIRA-enabled apps are checked+- Every ticket in current sprint is evaluated+- Unclear tickets have clarifying comments added+- If a ready ticket exists, it is implemented with PR created+- JIRA ticket transitioned to review status with PR link+- Report provides clear visibility into all actions taken++## Job Metadata++- **Category**: jira-sprint-manager+- **Interval**: Daily at 9:00 AM, Monday-Friday+- **Priority**: HIGH+- **Autonomy Level**: yolo (fully autonomous triage and implementation)diff --git a/data.sample/prompts/skills/jobs/jira-ticket-implementation.md b/data.sample/prompts/skills/jobs/jira-ticket-implementation.mddeleted file mode 100644index 71434c4d43..0000000000--- a/data.sample/prompts/skills/jobs/jira-ticket-implementation.md+++ /dev/null@@ -1,261 +0,0 @@-# JIRA Ticket Implementation Job--Autonomous job for implementing JIRA tickets in JIRA-connected apps using git worktrees.--## Prompt Template--You are acting as my Chief of Staff, implementing JIRA tickets for apps with JIRA integration enabled.--This job runs Monday-Friday at 9 AM and focuses on actually implementing tickets, not just reviewing them. Unlike the JIRA App Maintenance job which triages and comments on tickets, this job picks up ready tickets and implements them.--## Steps--1. **Discover JIRA-enabled apps**- - Call `GET /api/apps` to get all managed apps- - Filter for apps where:- - `jira.enabled === true`- - `jira.instanceId` is set- - `jira.projectKey` is set- - Skip archived apps--2. **Fetch sprint tickets for each app**- - For each JIRA-enabled app, call `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey`- - This returns tickets assigned to me in the current active sprint- - Filter tickets to find implementation candidates--3. **Select a ticket to implement**-- **Selection Criteria:**- - Status is "To Do", "Ready", "Open", or similar pre-work state- - NOT in "In Progress", "In Review", "Done", "Blocked"- - Ticket has clear requirements (summary + description)- - Prefer higher priority tickets first- - Select only ONE ticket per job run to maintain focus-- **Skip tickets that:**- - Are already in progress or review- - Lack clear requirements or acceptance criteria- - Are marked as blocked- - Have open questions in comments--4. **Create a git worktree for implementation**-- Use the PortOS worktree manager API or direct git commands:-- ```bash- cd /path/to/app/repo- git fetch origin- git worktree add -b feature/TICKET-123 ../worktrees/TICKET-123 origin/main- ```-- Or via API:- ```- POST /api/cos/worktrees- Body: {- "agentId": "jira-impl-{timestamp}",- "sourceWorkspace": "/path/to/app/repo",- "taskId": "TICKET-123"- }- ```--5. **Implement the ticket**-- In the worktree directory:- - Read the ticket requirements carefully- - Implement the feature/fix as described- - Follow the project's coding conventions- - Write tests if the project has a test suite- - Ensure the code compiles/lints without errors--6. **Commit and push changes**-- ```bash- git add .- git commit -m "feat(TICKET-123): <summary from ticket>"- git push -u origin feature/TICKET-123- ```--7. **Create a merge/pull request**-- Using GitHub CLI:- ```bash- gh pr create \- --title "TICKET-123: <summary>" \- --body "## Summary- Implements TICKET-123-- ## Changes- - <list of changes>-- ## Testing- - <how to test>-- ## JIRA- [TICKET-123](https://jira.example.com/browse/TICKET-123)" \- --base main- ```-- For GitLab:- ```bash- glab mr create \- --title "TICKET-123: <summary>" \- --description "..." \- --target-branch main- ```--8. **Transition the JIRA ticket to In Review**-- First, get available transitions:- ```- GET /api/jira/instances/:instanceId/tickets/:ticketKey/transitions- ```-- Find the transition ID for "In Review", "Code Review", or "Ready for Review" status.-- Then transition:- ```- POST /api/jira/instances/:instanceId/tickets/:ticketKey/transition- Body: { "transitionId": "<transition-id>" }- ```--9. **Add PR link to JIRA ticket**-- ```- POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments- Body: {- "comment": "Implementation complete. PR: <pr-url>\n\nReady for code review."- }- ```--10. **Clean up worktree (optional)**-- The worktree can be kept for reference or cleaned up:- ```bash- git worktree remove ../worktrees/TICKET-123- ```--11. **Generate summary report**- - Ticket implemented- - PR created (with link)- - Ticket transitioned to status- - Any issues encountered--## Expected Outputs--1. **Code Changes** - Committed to a feature branch-2. **Pull/Merge Request** - Created and linked to ticket-3. **JIRA Ticket Update** - Transitioned to "In Review" with PR link-4. **Summary Report** - Saved via CoS reporting system--## Success Criteria--- One well-defined ticket is selected and implemented per run-- Code is committed to a feature branch (not main/master)-- PR/MR is created with proper description-- JIRA ticket is transitioned to review status-- PR link is added as a JIRA comment-- No broken builds or failing tests introduced--## Job Metadata--- **Category**: jira-ticket-implementation-- **Interval**: Daily-- **Schedule**: Monday-Friday at 9:00 AM (cron: `0 9 * * 1-5`)-- **Priority**: HIGH-- **Autonomy Level**: yolo (fully autonomous implementation)--## Workflow Diagram--```-Start Job- |- v-Get JIRA-enabled apps- |- v-For each app:- |- v-Fetch sprint tickets --> Filter ready tickets --> Select highest priority- |- v-Create git worktree- |- v-Implement ticket- |- v-Commit + Push- |- v-Create PR/MR- |- v-Transition ticket to "In Review"- |- v-Add PR link comment- |- v-Generate report- |- v-End Job-```--## Example Report Structure--```markdown-# JIRA Ticket Implementation Report - 2026-02-24--## Summary-- Apps checked: 2-- Tickets evaluated: 8-- Ticket implemented: 1-- PR created: Yes--## Implementation Details--### App: MyWebApp (PROJ)--**Selected Ticket:** PROJ-456 (HIGH Priority)-- Summary: Add user profile settings page-- Original Status: To Do-- New Status: In Review--**Implementation:**-- Branch: `feature/PROJ-456`-- Commits: 3-- Files changed: 5-- Lines added: 247-- Lines removed: 12--**Pull Request:**-- URL: https://github.com/org/mywebapp/pull/123-- Title: PROJ-456: Add user profile settings page-- Status: Open, awaiting review--**JIRA Updates:**-- Transitioned to: In Review-- Comment added with PR link--### Skipped Tickets-- PROJ-457: Needs clarification (no acceptance criteria)-- PROJ-458: Already in progress-- PROJ-459: Low priority, well-groomed (deferred)--## Next Steps-1. Monitor PR for review feedback-2. Address any review comments in next run-3. Consider PROJ-457 after requirements clarified-```--## Notes--- This job makes actual code changes and creates PRs-- Only one ticket is implemented per run to maintain quality-- The job respects the app's existing git workflow-- Worktrees ensure the main workspace stays clean-- If implementation fails, the ticket is NOT transitioned-- Failed implementations should be reported but not block future runs-- The job runs Monday-Friday to align with typical work schedulesdiff --git a/docs/features/jira-app-maintenance.md b/docs/features/jira-app-maintenance.mddeleted file mode 100644index 1806cca575..0000000000--- a/docs/features/jira-app-maintenance.md+++ /dev/null@@ -1,341 +0,0 @@-# JIRA App Maintenance Job--Autonomous job that monitors and maintains JIRA tickets for apps with JIRA integration enabled.--## Overview--The JIRA App Maintenance job proactively manages JIRA tickets across all managed apps that have JIRA integration configured. It runs on a daily schedule (configurable) and evaluates each ticket assigned to you in the current sprint to determine appropriate actions.--## How It Works--### 1. Discovery Phase-- Scans all registered apps in PortOS-- Identifies apps with JIRA integration enabled (`jira.enabled === true`)-- Collects JIRA instance ID and project key for each app--### 2. Ticket Retrieval-For each JIRA-enabled app:-- Fetches tickets assigned to the current user in active sprint-- Uses the JIRA API endpoint: `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey`--### 3. Evaluation & Action-Each ticket is evaluated against quality and readiness criteria:--#### Ticket Quality Assessment-- **Summary clarity**: Is the title descriptive?-- **Description completeness**: Are requirements detailed?-- **Acceptance criteria**: Are success conditions defined?-- **Technical details**: Is context provided?--#### Action Decision Matrix--| Ticket State | Automated Action |-|--------------|------------------|-| **Poor Quality** | Add JIRA comment requesting clarification with specific questions |-| **Well-Defined & Ready** | Create CoS task to implement the ticket |-| **Blocked** | Add JIRA comment noting blocker and suggesting resolution paths |-| **High Priority/Blocker** | Create HIGH priority CoS task for immediate attention |-| **Low Priority & Well-Groomed** | No action (noted in report for future reference) |--### 4. Actions Taken--**JIRA Comments** - Added to tickets needing:-- Clarification of requirements-- Additional technical details-- Discussion of blockers-- Architectural decisions--**CoS Tasks** - Created for tickets that are:-- Well-defined and ready to implement-- High priority or blocking other work-- Have clear acceptance criteria--**Report Generation** - Comprehensive summary including:-- Total tickets reviewed per app-- Actions taken (comments, tasks created)-- Urgent items requiring attention-- Recommendations for next steps--## Configuration--### Enabling the Job--1. Navigate to Chief of Staff → Jobs tab-2. Find "JIRA App Maintenance" in the list-3. Click the toggle to enable-4. Configure schedule (default: daily)--### Job Settings--| Setting | Default | Description |-|---------|---------|-------------|-| Interval | Daily | How often the job runs |-| Priority | MEDIUM | Task priority for created work items |-| Autonomy Level | manager | Can add comments and create tasks without approval |-| Enabled | false | Must be manually enabled |--### App-Level JIRA Configuration--For each app you want monitored, configure JIRA integration:--1. Go to Apps page-2. Edit the app-3. Enable JIRA integration-4. Select JIRA instance-5. Enter project key (e.g., "PROJ")-6. Save--Example app configuration:-```json-{- "name": "My Web App",- "jira": {- "enabled": true,- "instanceId": "company-jira",- "projectKey": "WEBAPP"- }-}-```--## API Endpoints Used--### Apps API-- `GET /api/apps` - List all registered apps--### JIRA API-- `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey` - Get sprint tickets-- `POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments` - Add comment--### CoS API-- `POST /api/cos/tasks` - Create task--## Example Workflow--### Scenario: Poor Quality Ticket--**Ticket**: PROJ-123 - "Fix login"-- No description-- No acceptance criteria-- No priority--**Action**: Adds JIRA comment-```-Hi! I'm reviewing sprint tickets and need more information about PROJ-123:--1. What specific login issue is occurring? (Error message, behavior, etc.)-2. Which login flow is affected? (username/password, SSO, OAuth, etc.)-3. What is the expected behavior?-4. Are there steps to reproduce?-5. What acceptance criteria should be met for this fix?--Please update the ticket description with these details so I can prioritize implementation.-```--### Scenario: Well-Defined Ticket--**Ticket**: PROJ-124 - "Add password reset flow"-- Detailed requirements in description-- Clear acceptance criteria-- Medium priority--**Action**: Creates CoS task-```markdown-Implement JIRA-124: Add password reset flow--JIRA: https://company.atlassian.net/browse/PROJ-124-Project: My Web App-Priority: MEDIUM--Requirements:-- Add "Forgot Password?" link on login page-- Email reset link (expires in 1 hour)-- Validate token on reset page-- Update password with confirmation--Acceptance Criteria:-- User receives email within 1 minute-- Link expires after 1 hour-- Invalid/expired tokens show error-- Password meets security requirements-- Success redirects to login-```--### Scenario: High Priority Blocker--**Ticket**: PROJ-125 - "Production API failing"-- Clear description-- CRITICAL priority-- Marked as blocker--**Action**: Creates HIGH priority CoS task-```markdown-🚨 URGENT - Implement JIRA-125: Fix production API failure--JIRA: https://company.atlassian.net/browse/PROJ-125-Project: API Server-Priority: HIGH (BLOCKER)--Issue: Payment processing endpoint returning 500 errors-Impact: Blocking customer transactions-Details: [From JIRA description]--This task requires immediate attention - marked as blocker in sprint.-```--## Report Format--The job generates a structured report after each run:--```markdown-# JIRA App Maintenance Report - 2026-02-17--## Summary-- Apps reviewed: 3-- Total tickets: 12-- Comments added: 4-- Tasks created: 3-- Urgent items: 2--## App: MyWebApp (PROJ)-### Tickets Reviewed: 5--**PROJ-123** (HIGH) - Implement user authentication-- Status: To Do-- Action: ✅ Created CoS task for implementation-- Notes: Well-defined, ready to start--**PROJ-124** (MEDIUM) - Fix login redirect bug-- Status: In Progress-- Action: 💬 Added comment requesting reproduction steps-- Notes: Missing technical details--**PROJ-125** (LOW) - Update documentation-- Status: To Do-- Action: None - well-defined, low priority-- Notes: Can be addressed later--### Urgent Items-- PROJ-123 (HIGH) - Ready for immediate implementation--## App: APIServer (API)-### Tickets Reviewed: 7-[...]--## Recommendations-1. Focus on PROJ-123 (high priority, ready to implement)-2. Follow up on PROJ-124 comment responses-3. Schedule PROJ-125 for next sprint planning-```--## Limitations & Best Practices--### What the Job Does NOT Do-- ❌ Does not make code changes directly-- ❌ Does not commit to repositories-- ❌ Does not modify JIRA ticket fields (only adds comments)-- ❌ Does not create JIRA tickets--### What the Job DOES Do-- ✅ Evaluates ticket quality-- ✅ Adds clarifying comments-- ✅ Creates CoS tasks for implementation-- ✅ Prioritizes urgent work-- ✅ Generates actionable reports--### Best Practices--1. **Keep JIRA Integration Updated**- - Ensure project keys are correct- - Verify JIRA instance credentials are valid- - Archive apps you no longer maintain--2. **Review Reports Regularly**- - Check daily reports for urgent items- - Respond to JIRA comments the job adds- - Approve or adjust created CoS tasks--3. **Tune for Your Workflow**- - Adjust job frequency (daily, twice-daily, etc.)- - Set appropriate priority thresholds- - Customize the skill template for your team's conventions--4. **Provide Feedback**- - If the job creates incorrect comments, improve ticket templates- - If tasks are poorly formatted, update the skill template- - Use CoS learning system to improve over time--## Skill Template--The job uses a skill template at:-```-data/prompts/skills/jobs/jira-app-maintenance.md-```--You can customize this template to:-- Change evaluation criteria-- Adjust comment templates-- Modify prioritization logic-- Add team-specific conventions--## Troubleshooting--### Job Runs But No Actions Taken--**Possible causes:**-1. No apps have JIRA integration enabled-2. No tickets assigned to you in current sprint-3. All tickets are low priority and well-defined--**Solution:** Check the job report for details on what was evaluated.--### JIRA API Errors--**Possible causes:**-1. Invalid JIRA credentials-2. Project key doesn't exist-3. User doesn't have permissions--**Solution:**-- Test JIRA connection from JIRA settings page-- Verify project key is correct-- Ensure API token has required permissions--### Created Tasks Are Poorly Formatted--**Possible causes:**-1. JIRA tickets have inconsistent structure-2. Skill template needs tuning--**Solution:**-- Standardize JIRA ticket templates-- Edit `data/prompts/skills/jobs/jira-app-maintenance.md`-- Add examples for your specific project types--### Too Many Comments Being Added--**Possible causes:**-1. Ticket quality in JIRA is generally poor-2. Evaluation criteria too strict--**Solution:**-- Improve ticket creation process-- Add ticket templates in JIRA-- Adjust skill template evaluation logic--## Related Features--- [Chief of Staff](./chief-of-staff.md) - Core autonomous agent system-- [Autonomous Jobs](./autonomous-jobs.md) - Recurring job scheduler-- [Task Management](./task-management.md) - CoS task system-- [JIRA Integration](./jira-integration.md) - JIRA API setup--## Future Enhancements--Potential improvements for future versions:--1. **Smart Ticket Assignment** - Auto-assign tickets based on expertise-2. **Sprint Planning Assistant** - Help estimate and allocate sprint work-3. **Dependency Detection** - Identify blocking relationships between tickets-4. **Auto-Grooming** - Suggest improvements to ticket descriptions-5. **Metrics Dashboard** - Track ticket velocity and quality over time-6. **Multi-Sprint Planning** - Look ahead to backlog for proactive groomingdiff --git a/docs/features/jira-sprint-manager.md b/docs/features/jira-sprint-manager.mdnew file mode 100644index 0000000000..fe35696b78--- /dev/null+++ b/docs/features/jira-sprint-manager.md@@ -0,0 +1,76 @@+# JIRA Sprint Manager Job++Autonomous job that triages and implements JIRA tickets for apps with JIRA integration enabled. Combines triage (reviewing, commenting, prioritizing) with implementation (worktree, PR, JIRA transition) in a single daily run.++## Overview++The JIRA Sprint Manager runs Monday-Friday at 9 AM. It first triages all sprint tickets across JIRA-enabled apps, then implements the highest-priority ready ticket.++## How It Works++### Phase 1 — Triage++1. **Discovery**: Scans all registered apps for JIRA integration (`jira.enabled === true`)+2. **Ticket Retrieval**: Fetches sprint tickets via `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey`+3. **Evaluation**: Each ticket is assessed for quality and readiness:++| Ticket State | Action |+|--------------|--------|+| **Poor Quality** | Add JIRA comment requesting clarification |+| **Blocked** | Add JIRA comment noting blocker and suggesting resolution |+| **Well-Defined & Ready** | Mark as implementation candidate |+| **High Priority/Blocker** | Prioritize for immediate implementation |+| **Low Priority & Well-Groomed** | No action (noted in report) |++### Phase 2 — Implement++4. **Selection**: Picks the highest-priority "To Do"/"Ready" ticket with clear requirements+5. **Worktree**: Creates an isolated git worktree for the implementation+6. **Implementation**: Codes the feature/fix following project conventions+7. **PR Creation**: Commits, pushes, and creates a merge request+8. **JIRA Update**: Transitions ticket to "In Review" and adds PR link as comment++### Phase 3 — Report++9. **Summary**: Generates a report covering triage actions and implementation work++## Configuration++| Setting | Default | Description |+|---------|---------|-------------|+| Interval | Daily at 09:00 | Weekdays only |+| Priority | HIGH | Job priority |+| Autonomy Level | yolo | Fully autonomous |+| Enabled | true | Active by default |++### App-Level JIRA Configuration++For each app to be monitored, enable JIRA integration in the app settings:+```json+{+ "jira": {+ "enabled": true,+ "instanceId": "company-jira",+ "projectKey": "WEBAPP"+ }+}+```++## API Endpoints Used++- `GET /api/apps` — List all registered apps+- `GET /api/jira/instances/:instanceId/my-sprint-tickets/:projectKey` — Get sprint tickets+- `POST /api/jira/instances/:instanceId/tickets/:ticketKey/comments` — Add comment+- `GET /api/jira/instances/:instanceId/tickets/:ticketKey/transitions` — Get transitions+- `POST /api/jira/instances/:instanceId/tickets/:ticketKey/transition` — Transition ticket+- `POST /api/cos/tasks` — Create CoS task++## Skill Template++Customizable at: `data/prompts/skills/jobs/jira-sprint-manager.md`++## Related Features++- [Chief of Staff](./chief-of-staff.md) — Core autonomous agent system+- [Autonomous Jobs](./autonomous-jobs.md) — Recurring job scheduler+- [JIRA Integration](./jira-integration.md) — JIRA API setupdiff --git a/server/services/autonomousJobs.js b/server/services/autonomousJobs.jsindex 3f29aecb17..f70a818108 100644--- a/server/services/autonomousJobs.js+++ b/server/services/autonomousJobs.js@@ -42,12 +42,10 @@ const JOBS_SKILLS_DIR = join(__dirname, '../../data/prompts/skills/jobs')const JOB_SKILL_MAP = {'job-daily-briefing': 'daily-briefing','job-github-repo-maintenance': 'github-repo-maintenance',- 'job-brain-processing': 'brain-processing',- 'job-project-review': 'project-review',+ 'job-brain-review': 'brain-review','job-moltworld-exploration': 'moltworld-exploration',- 'job-jira-app-maintenance': 'jira-app-maintenance',- 'job-autobiography-prompt': 'autobiography-prompt',- 'job-jira-ticket-implementation': 'jira-ticket-implementation'+ 'job-jira-sprint-manager': 'jira-sprint-manager',+ 'job-autobiography-prompt': 'autobiography-prompt'}// Time constants@@ -95,28 +93,40 @@ Save the report via the CoS report system.`,updatedAt: null},{- id: 'job-brain-processing',- name: 'Brain Inbox Processing',- description: 'Review brain inbox items that need attention, process ideas into actionable tasks, and surface patterns.',- category: 'brain-processing',+ id: 'job-brain-review',+ name: 'Brain Review',+ description: 'Process brain inbox items, review active projects for staleness, surface patterns, and create actionable tasks.',+ category: 'brain-review',interval: 'daily',intervalMs: DAY,enabled: false,priority: 'MEDIUM',autonomyLevel: 'manager',- promptTemplate: `[Autonomous Job] Brain Inbox Processing+ promptTemplate: `[Autonomous Job] Brain Review-You are acting as my Chief of Staff, processing my brain inbox.+You are acting as my Chief of Staff, reviewing my brain inbox and active projects.-Tasks to perform:+Phase 1 — Inbox Processing:1. Call GET /api/brain/inbox?status=needs_review to find items needing review2. Call GET /api/brain/summary to understand the current brain state3. For items in needs_review status, analyze the content and suggest classifications4. Look for patterns across recent brain captures — recurring themes, related ideas5. For high-value active ideas (GET /api/brain/ideas?status=active) that could become projects, create CoS tasks to explore them. Skip ideas with status=done — they've already been ingested-6. Generate a brief summary of insights from the brain inbox-Focus on surfacing actionable insights. Don't just classify — think about what these ideas mean and how they connect.`,+Phase 2 — Project Review:+6. Call GET /api/brain/projects?status=active to get active projects (skip done/archived)+7. For each active project:+ - Assess if the next action is still relevant+ - Check if there are related brain captures since last review+ - Suggest updated next actions if stale+8. Identify projects that might be stalled (no activity in 2+ weeks)+9. Look for connections between projects and recent inbox items++Phase 3 — Actions:+10. Create CoS tasks for actionable items from both inbox and projects+11. Generate a summary report covering inbox insights and project health++Focus on surfacing actionable insights and moving projects forward. Don't just classify — think about what these ideas mean and how they connect.`,lastRun: null,runCount: 0,createdAt: null,@@ -150,36 +160,6 @@ Write the briefing in a concise, actionable format. Save it as a CoS report.`,createdAt: null,updatedAt: null},- {- id: 'job-project-review',- name: 'Brain Project Review',- description: 'Review active brain projects, check progress, suggest next actions, and identify stalled projects.',- category: 'project-review',- interval: 'weekly',- intervalMs: WEEK,- enabled: false,- priority: 'LOW',- autonomyLevel: 'assistant',- promptTemplate: `[Autonomous Job] Brain Project Review--You are acting as my Chief of Staff, reviewing active projects from my brain.--Tasks to perform:-1. Call GET /api/brain/projects?status=active to get active projects (skip done/archived)-2. For each active project:- - Assess if the next action is still relevant- - Check if there are related brain captures since last review- - Suggest updated next actions if stale-3. Identify projects that might be stalled (no activity in 2+ weeks)-4. Look for connections between projects that could be leveraged-5. For any actionable suggestions, create CoS tasks--Report a project health summary when done.`,- lastRun: null,- runCount: 0,- createdAt: null,- updatedAt: null- },{id: 'job-moltworld-exploration',name: 'Moltworld Exploration',@@ -210,34 +190,47 @@ After the script finishes, report the exploration summary including SIM earned aupdatedAt: null},{- id: 'job-jira-app-maintenance',- name: 'JIRA App Maintenance',- description: 'Review JIRA tickets assigned to me in current sprint for JIRA-enabled apps, evaluate next steps, and take action (improve tickets, add comments, plan work, or create PRs).',- category: 'jira-app-maintenance',+ id: 'job-jira-sprint-manager',+ name: 'JIRA Sprint Manager',+ description: 'Triage current sprint tickets for JIRA-enabled apps, then implement the highest-priority ready ticket in a worktree with a merge request.',+ category: 'jira-sprint-manager',interval: 'daily',intervalMs: DAY,- enabled: false,- priority: 'MEDIUM',- autonomyLevel: 'manager',- promptTemplate: `[Autonomous Job] JIRA App Maintenance+ scheduledTime: '09:00',+ weekdaysOnly: true,+ enabled: true,+ priority: 'HIGH',+ autonomyLevel: 'yolo',+ promptTemplate: `[Autonomous Job] JIRA Sprint Manager-You are acting as my Chief of Staff, managing JIRA tickets for apps with JIRA integration enabled.+You are acting as my Chief of Staff, triaging and implementing JIRA tickets for apps with JIRA integration enabled.-Tasks to perform:+This job runs Monday-Friday. It triages all sprint tickets first, then implements the top-priority ready ticket.++Phase 1 — Triage:1. Call GET /api/apps to get all managed apps-2. Filter for apps with jira.enabled = true+2. Filter for apps with jira.enabled = true and jira.instanceId + jira.projectKey set3. For each JIRA-enabled app:- Call GET /api/jira/:instanceId/my-sprint-tickets/:projectKey to get tickets assigned to me in current sprint- For each ticket, evaluate what needs to be done next:a) Does the ticket need clarification or better requirements? Add a comment with questions- b) Is the ticket well-defined and ready to work? Create a CoS task to plan or implement it- c) Is the ticket blocked or needs discussion? Add a comment noting blockers- d) Should this be worked on now based on priority? Create an agent task to implement and PR+ b) Is the ticket blocked or needs discussion? Add a comment noting blockers+ c) Is the ticket well-defined and ready to work? Mark it as a candidate for implementation4. Prioritize tickets marked as HIGH or Blocker-5. Create CoS tasks for actionable items-6. Generate a summary report of JIRA maintenance activities-Focus on moving tickets forward. Don't just report - take action by improving ticket quality, creating tasks, or spawning agents to implement solutions.`,+Phase 2 — Implement:+5. From the triage results, select the highest priority ticket in "To Do" or "Ready" status that is well-defined+6. For the selected ticket:+ - Create a git worktree using the worktree manager+ - Implement the ticket requirements+ - Commit changes and push the branch+ - Create a merge request using gh CLI+ - Transition the ticket to "In Review" status+ - Add a comment to JIRA with the MR link+7. If no tickets are ready to implement, skip Phase 2++Phase 3 — Report:+8. Generate a summary report covering triage actions taken and implementation work completed`,lastRun: null,runCount: 0,createdAt: null,@@ -259,45 +252,6 @@ Focus on moving tickets forward. Don't just report - take action by improving ticreatedAt: null,updatedAt: null},- {- id: 'job-jira-ticket-implementation',- name: 'JIRA Ticket Implementation',- description: 'For JIRA-connected apps, pick up the next ready ticket from sprint, implement it in a git worktree, create a merge request, and move the ticket to In Review.',- category: 'jira-ticket-implementation',- interval: 'daily',- intervalMs: DAY,- scheduledTime: '09:00',- weekdaysOnly: true,- enabled: false,- priority: 'HIGH',- autonomyLevel: 'yolo',- promptTemplate: `[Autonomous Job] JIRA Ticket Implementation--You are acting as my Chief of Staff, implementing JIRA tickets for apps with JIRA integration enabled.--This job runs Monday-Friday and focuses on actually implementing tickets, not just reviewing them.--Tasks to perform:-1. Call GET /api/apps to find JIRA-enabled apps-2. For each app with jira.enabled = true and jira.instanceId + jira.projectKey set:- - Call GET /api/jira/:instanceId/my-sprint-tickets/:projectKey- - Filter for tickets in "To Do" or "Ready" status that are well-defined- - Select the highest priority ticket that is ready to implement-3. For the selected ticket:- - Create a git worktree using the worktree manager- - Implement the ticket requirements- - Commit changes and push the branch- - Create a merge request using gh CLI- - Transition the ticket to "In Review" status- - Add a comment to JIRA with the MR link-4. Generate a summary report of work completed--Focus on tickets that are ready to implement. Skip tickets that need clarification.`,- lastRun: null,- runCount: 0,- createdAt: null,- updatedAt: null- }]/**diff --git a/server/services/autonomousJobs.test.js b/server/services/autonomousJobs.test.jsindex 407eb11a7c..54e98aa847 100644--- a/server/services/autonomousJobs.test.js+++ b/server/services/autonomousJobs.test.js@@ -133,7 +133,7 @@ describe('autonomousJobs', () => {// Verify only expected test jobs plus any default jobs are presentconst testJobIds = new Set(['job-test-1', 'job-1', 'job-2'])- const defaultJobPrefixes = ['job-github-', 'job-brain-', 'job-daily-', 'job-project-', 'job-moltworld-', 'job-jira-', 'job-autobiography-']+ const defaultJobPrefixes = ['job-github-', 'job-brain-', 'job-daily-', 'job-moltworld-', 'job-jira-', 'job-autobiography-']const unexpectedJobs = due.filter(j => !testJobIds.has(j.id) && !defaultJobPrefixes.some(p => j.id.startsWith(p)))expect(unexpectedJobs).toHaveLength(0)})@@ -268,7 +268,7 @@ describe('autonomousJobs', () => {expect(jobs.length).toBeGreaterThan(1)expect(jobs.find(j => j.id === 'job-custom-only')).toBeDefined()expect(jobs.find(j => j.id === 'job-github-repo-maintenance')).toBeDefined()- expect(jobs.find(j => j.id === 'job-brain-processing')).toBeDefined()+ expect(jobs.find(j => j.id === 'job-brain-review')).toBeDefined()})})