Skip to content

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

feat(cos): add simplify and review loop task config options, remove context field (#86)

[._.]/ Adam Eivyeb9822973d70
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index 32b3415728..9915522014 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -1,16 +1,18 @@
import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
-import { Plus, Image, X, ChevronDown, ChevronRight, Sparkles, Loader2, Paperclip, FileText, Zap, Bookmark, Ticket, GitBranch } from 'lucide-react';
+import { Plus, Image, X, ChevronDown, ChevronRight, Sparkles, Loader2, Paperclip, FileText, Zap, Bookmark, Ticket, GitBranch, Wand2, RefreshCw } from 'lucide-react';
import toast from 'react-hot-toast';
import * as api from '../../services/api';
import { processScreenshotUploads, processAttachmentUploads } from '../../utils/fileUpload';
import { formatBytes } from '../../utils/formatters';
export default function TaskAddForm({ providers, apps, onTaskAdded, compact = false, defaultApp = '' }) {
- const [newTask, setNewTask] = useState({ description: '', context: '', model: '', provider: '', app: defaultApp });
+ const [newTask, setNewTask] = useState({ description: '', model: '', provider: '', app: defaultApp });
const [addToTop, setAddToTop] = useState(false);
const [enhancePrompt, setEnhancePrompt] = useState(false);
const [isEnhancing, setIsEnhancing] = useState(false);
const [useWorktree, setUseWorktree] = useState(false);
+ const [simplify, setSimplify] = useState(true);
+ const [reviewLoop, setReviewLoop] = useState(false);
const [createJiraTicket, setCreateJiraTicket] = useState(false);
const [screenshots, setScreenshots] = useState([]);
const [attachments, setAttachments] = useState([]);
@@ -58,7 +60,6 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
const applyTemplate = useCallback(async (template) => {
setNewTask({
description: template.description,
- context: template.context || '',
model: template.model || '',
provider: template.provider || '',
app: template.app || ''
@@ -88,7 +89,6 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
const result = await api.createCosTaskTemplate({
name: templateNameInput.trim(),
description: newTask.description,
- context: newTask.context,
provider: newTask.provider,
model: newTask.model,
app: newTask.app
@@ -160,8 +160,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
if (enhancePrompt) {
setIsEnhancing(true);
const enhanceResult = await api.enhanceCosTaskPrompt({
- description: newTask.description,
- context: newTask.context
+ description: newTask.description
}).catch(err => {
toast('Enhancement failed, using original description', { icon: '\u26a0\ufe0f' });
console.warn('Task enhancement failed:', err.message);
@@ -180,12 +179,13 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
const result = await api.addCosTask({
description: finalDescription,
- context: newTask.context,
model: newTask.model || undefined,
provider: newTask.provider || undefined,
app: newTask.app || undefined,
createJiraTicket: createJiraTicket || undefined,
useWorktree: useWorktree || undefined,
+ simplify: simplify || undefined,
+ reviewLoop: reviewLoop || undefined,
screenshots: screenshots.length > 0 ? screenshots.map(s => s.path) : undefined,
attachments: attachments.length > 0 ? attachments.map(a => ({
filename: a.filename,
@@ -204,13 +204,15 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
if (!result) return;
toast.success('Task added');
- setNewTask({ description: '', context: '', model: '', provider: '', app: defaultApp });
+ setNewTask({ description: '', model: '', provider: '', app: defaultApp });
setScreenshots([]);
setAttachments([]);
setAddToTop(false);
setEnhancePrompt(false);
setCreateJiraTicket(false);
setUseWorktree(false);
+ setSimplify(true);
+ setReviewLoop(false);
setExpanded(false);
setIsSubmitting(false);
onTaskAdded?.();
@@ -356,17 +358,6 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
</span>
</label>
</div>
- <div>
- <label htmlFor="task-context" className="sr-only">Context</label>
- <input
- id="task-context"
- type="text"
- placeholder="Context (optional)"
- value={newTask.context}
- onChange={e => setNewTask(t => ({ ...t, context: e.target.value }))}
- className="w-full px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm"
- />
- </div>
<div className="flex gap-3 items-center">
{!compact && (
<div className="flex-1">
@@ -396,6 +387,30 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
Branch + PR
</span>
</label>
+ <label className="flex items-center gap-2 cursor-pointer select-none whitespace-nowrap">
+ <input
+ type="checkbox"
+ checked={simplify}
+ onChange={(e) => setSimplify(e.target.checked)}
+ className="w-4 h-4 rounded border-port-border bg-port-bg text-port-accent focus:ring-port-accent focus:ring-offset-0"
+ />
+ <span className="flex items-center gap-1.5 text-sm text-gray-400">
+ <Wand2 size={14} className="text-purple-400" />
+ Simplify
+ </span>
+ </label>
+ <label className="flex items-center gap-2 cursor-pointer select-none whitespace-nowrap">
+ <input
+ type="checkbox"
+ checked={reviewLoop}
+ onChange={(e) => setReviewLoop(e.target.checked)}
+ className="w-4 h-4 rounded border-port-border bg-port-bg text-port-accent focus:ring-port-accent focus:ring-offset-0"
+ />
+ <span className="flex items-center gap-1.5 text-sm text-gray-400">
+ <RefreshCw size={14} className="text-amber-400" />
+ Review Loop
+ </span>
+ </label>
{appHasJira && (
<label className="flex items-center gap-2 cursor-pointer select-none whitespace-nowrap">
<input
diff --git a/server/routes/cos.js b/server/routes/cos.js
index c333b4a622..4830341213 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -174,13 +174,13 @@ router.post('/tasks/enhance', asyncHandler(async (req, res) => {
// POST /api/cos/tasks - Add a new task
router.post('/tasks', asyncHandler(async (req, res) => {
- const { description, priority, context, model, provider, app, type = 'user', approvalRequired, screenshots, attachments, position = 'bottom', createJiraTicket, jiraTicketId, jiraTicketUrl, useWorktree } = req.body;
+ const { description, priority, context, model, provider, app, type = 'user', approvalRequired, screenshots, attachments, position = 'bottom', createJiraTicket, jiraTicketId, jiraTicketUrl, useWorktree, simplify, reviewLoop } = req.body;
if (!description) {
throw new ServerError('Description is required', { status: 400, code: 'VALIDATION_ERROR' });
}
- const taskData = { description, priority, context, model, provider, app, approvalRequired, screenshots, attachments, position, createJiraTicket, jiraTicketId, jiraTicketUrl, useWorktree };
+ const taskData = { description, priority, context, model, provider, app, approvalRequired, screenshots, attachments, position, createJiraTicket, jiraTicketId, jiraTicketUrl, useWorktree, simplify, reviewLoop };
const result = await cos.addTask(taskData, type);
if (result?.duplicate) {
diff --git a/server/services/cos.js b/server/services/cos.js
index dbd065a45e..4bac7cad0d 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -3115,6 +3115,8 @@ export async function addTask(taskData, taskType = 'user') {
if (taskData.app) metadata.app = taskData.app;
if (taskData.createJiraTicket) metadata.createJiraTicket = true;
if (taskData.useWorktree) metadata.useWorktree = true;
+ if (taskData.simplify) metadata.simplify = true;
+ if (taskData.reviewLoop) metadata.reviewLoop = true;
if (taskData.jiraTicketId) metadata.jiraTicketId = taskData.jiraTicketId;
if (taskData.jiraTicketUrl) metadata.jiraTicketUrl = taskData.jiraTicketUrl;
if (taskData.screenshots?.length > 0) metadata.screenshots = taskData.screenshots;
diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.js
index c321cf67e1..a9226fe6a6 100644
--- a/server/services/subAgentSpawner.js
+++ b/server/services/subAgentSpawner.js
@@ -2588,6 +2588,18 @@ You are working in an **isolated git worktree** to avoid conflicts with other ag
${worktreeInfo.baseBranch ? `- **Based on**: \`${worktreeInfo.baseBranch}\` (latest from origin)` : ''}
**Important**: Commit your changes to this branch. Your commits will be automatically merged back to the main development branch when your task completes. Do NOT manually switch branches or modify the worktree configuration.
+` : '';
+
+ // Build simplify section if enabled
+ const simplifySection = task.metadata?.simplify ? `
+## Simplify Step
+After completing your work and before committing, run \`/simplify\` to review the changed code for reuse, quality, and efficiency. Fix any issues found before committing.
+` : '';
+
+ // Build review loop section if enabled
+ const reviewLoopSection = task.metadata?.reviewLoop ? `
+## Review Loop
+After opening the PR, run \`/do:rpr\` to resolve PR review feedback and complete the merge validation. Continue running the review loop until all checks pass and the PR is approved.
` : '';
// Build JIRA context section if applicable
@@ -2638,6 +2650,8 @@ ${task.metadata.jiraBranch ? 'Commit your changes to this branch. Do NOT switch
digitalTwinSection,
worktreeSection,
jiraSection,
+ simplifySection,
+ reviewLoopSection,
compactionSection,
skillSection,
planningContextSection,
@@ -2668,6 +2682,8 @@ ${task.metadata?.app ? `- **Target App**: ${task.metadata.app}\n- **Target App D
${Array.isArray(task.metadata?.screenshots) && task.metadata.screenshots.length > 0 ? `- **Screenshots**: ${task.metadata.screenshots.join(', ')}` : ''}
${worktreeSection}
${jiraSection}
+${simplifySection}
+${reviewLoopSection}
${compactionSection}
${skillSection ? `## Task-Type Skill Guidelines\n\n${skillSection}\n` : ''}${planningContextSection}
## Instructions