feat: add three-tier agent lifecycle (draft, private, shared)#409
feat: add three-tier agent lifecycle (draft, private, shared)#409marcusquinn merged 3 commits intomainfrom
Conversation
Add support for user-created agents with three tiers: - Draft (draft/): R&D and orchestration-created agents for review - Custom (custom/): User's permanent private agents - Shared (.agents/): Open-source agents submitted via PR Key changes: - build-agent.md: Agent Lifecycle Tiers section with placement prompt, draft conventions, promotion workflow, and guidance for orchestration agents to create reusable draft agents - setup.sh: Preserve custom/ and draft/ during deployment (both clean mode and rsync exclusion) - AGENTS.md: Agent tiers reference and updated working dirs - headless-dispatch.md: Cross-reference to draft agents for parallel worker context reuse - ai-orchestration/overview.md: Cross-reference to draft agents
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a robust agent lifecycle management system, categorizing agents into Draft, Custom, and Shared tiers. This system aims to improve the organization and reusability of agents, particularly by allowing orchestration processes to generate temporary 'Draft' agents for parallel tasks. Crucially, the deployment script has been updated to safeguard user-created agents in Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis PR introduces explicit Agent Lifecycle Tiers (Draft, Custom, Shared), reorganizes the local agent workspace under ~/.aidevops/agents/, adds guidance for creating/promotion of draft agents, expands build-agent documentation, and updates deploy logic to preserve user Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Orchestration as Orchestration Agent
participant Draft as Draft Agent\n(~/.aidevops/agents/draft/)
participant Review as Review Process
participant Repo as Custom/Shared Repo
participant Deploy as Deployment
User->>Orchestration: Request reusable agent or pattern
Orchestration->>Draft: Create draft agent (frontmatter + files)
Note over Draft: Stored under agents/draft/\nnot necessarily git-tracked
Draft->>Review: Mark for promotion / TODOs for review
Review->>Review: Evaluate promotion criteria
alt Promote
Review->>Repo: Move to custom/ or shared repo (git-tracked)
Repo->>Deploy: Included in deployment sync
else Discard
Review->>Draft: Remove or archive draft
end
Deploy->>User: Agent available in runtime/workflow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 7 00:44:07 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request introduces a three-tier agent lifecycle (Draft, Custom, Shared), which is a great enhancement for organizing agents. The documentation updates are clear and comprehensive. The changes to setup.sh to preserve user directories during clean deployments are well-implemented. However, I found a potential data loss bug in the fallback logic for systems without rsync, where user data could be deleted. I've provided a suggestion to fix this.
setup.sh
Outdated
| # Fallback: copy then remove excluded dirs | ||
| cp -R "$source_dir"/* "$target_dir/" | ||
| rm -rf "$target_dir/loop-state" 2>/dev/null || true |
There was a problem hiding this comment.
The fallback logic for when rsync is not available is potentially destructive. The cp command is followed by rm -rf "$target_dir/loop-state", which could delete the user's directory. This logic is also inconsistent with the rsync command which now correctly excludes custom/ and draft/ directories in addition to loop-state/.
A more robust and safer approach is to use tar to copy files while excluding the user-specific directories. This correctly mimics the rsync behavior and avoids the risk of data loss.
| # Fallback: copy then remove excluded dirs | |
| cp -R "$source_dir"/* "$target_dir/" | |
| rm -rf "$target_dir/loop-state" 2>/dev/null || true | |
| # Fallback: copy files, excluding user-specific directories. This uses tar to | |
| # robustly copy files while respecting exclusions, preventing data loss. | |
| (cd "$source_dir" && tar c --exclude='loop-state' --exclude='custom' --exclude='draft' .) | (cd "$target_dir" && tar xf -) |
Address Gemini review: cp -R fallback didn't exclude custom/ and draft/ directories. Replace with tar pipe that correctly excludes loop-state/, custom/, and draft/ on both BSD and GNU tar.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@setup.sh`:
- Around line 2096-2116: The clean block for CLEAN_MODE risks deleting user data
if mktemp or the cp operations fail; change the tmp_preserve declaration to use
the local var="..." pattern (local tmp_preserve="$(mktemp -d)") and check its
return/emptiness, verify each cp -R succeeds (capture and test their exit codes)
before running rm -rf "${target_dir:?}"/*, and if any preservation step fails
call print_info or an error logger and abort the clean (skip the destructive
rm); also ensure you remove the tmp_preserve only after successful restore or on
explicit failure handling.
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 7 00:48:15 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Address CodeRabbit review: abort clean if temp dir creation or directory preservation fails, preventing data loss of user's custom/ and draft/ agents. Use local var=$() pattern.
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 7 00:52:10 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
- Remove dataforseo and outscraper from MCP table (replaced by curl subagents) - Update MCP count badge from 19 to 17 - Update script count to 172, subagent count to 765+ - Fix inconsistent script count (was 167 in one place, 146 in another) - Update supported AI assistants to reflect OpenCode-only support (PR #412) - Add three-tier agent lifecycle section (draft/custom/shared from PR #409) - Move outscraper to curl subagents section
* docs: update README with recent feature changes - Remove dataforseo and outscraper from MCP table (replaced by curl subagents) - Update MCP count badge from 19 to 17 - Update script count to 172, subagent count to 765+ - Fix inconsistent script count (was 167 in one place, 146 in another) - Update supported AI assistants to reflect OpenCode-only support (PR #412) - Add three-tier agent lifecycle section (draft/custom/shared from PR #409) - Move outscraper to curl subagents section * fix: align MCP table count with badge (19 available, add shadcn)



Summary
setup.shpreservescustom/anddraft/directories during deployment (both clean mode and rsync)Changes
build-agent.md- Agent Lifecycle Tiers sectionstatus: draft, creation date)setup.sh- Preserve user directoriescustom/anddraft/before wipe, restores aftercustom/anddraft/from overwrite (alongside existingloop-state/exclusion)AGENTS.md- User-facing referencescustom/anddraft/headless-dispatch.md+ai-orchestration/overview.mdTesting
local var, proper quoting, array iteration)Summary by CodeRabbit
New Features
Documentation
Chores