Skip to content

feat: add three-tier agent lifecycle (draft, private, shared)#409

Merged
marcusquinn merged 3 commits intomainfrom
feature/agent-lifecycle-tiers
Feb 7, 2026
Merged

feat: add three-tier agent lifecycle (draft, private, shared)#409
marcusquinn merged 3 commits intomainfrom
feature/agent-lifecycle-tiers

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 7, 2026

Summary

  • Adds three-tier agent lifecycle: Draft (R&D/orchestration), Custom (private), Shared (open-source PR)
  • Orchestration agents can now create reusable draft agents for parallel processing context
  • setup.sh preserves custom/ and draft/ directories during deployment (both clean mode and rsync)

Changes

build-agent.md - Agent Lifecycle Tiers section

  • Decision prompt asking users which tier when creating an agent
  • Draft agent conventions (frontmatter with status: draft, creation date)
  • Promotion workflow: draft -> custom or shared, with TODO item logging
  • Guidance for orchestration/Task tool agents to create drafts for reusable parallel context

setup.sh - Preserve user directories

  • Clean mode: backs up custom/ and draft/ before wipe, restores after
  • rsync: excludes custom/ and draft/ from overwrite (alongside existing loop-state/ exclusion)

AGENTS.md - User-facing references

  • Agent tiers table in Agents & Subagents section
  • Updated Working Directories tree to show custom/ and draft/

headless-dispatch.md + ai-orchestration/overview.md

  • Cross-references to draft agents for parallel worker context reuse

Testing

  • ShellCheck: zero new violations (all warnings are pre-existing)
  • markdownlint: zero errors across all modified files
  • setup.sh changes follow existing patterns (local var, proper quoting, array iteration)

Summary by CodeRabbit

  • New Features

    • Introduced Agent Tier system (Draft, Custom, Shared) with distinct storage and persistence behaviors.
    • Reorganized workspace into a new top-level layout for clearer agent/workspace separation.
  • Documentation

    • Added lifecycle and promotion workflows, agent file-structure conventions, caching/prompt patterns, and guidance across orchestration and headless dispatch flows.
    • Expanded deployment and setup guidance and integration recommendations.
  • Chores

    • Deployment now preserves user-managed Draft and Custom agent directories during updates.

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
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 custom/ and draft/ directories, ensuring their persistence across system updates. The changes are thoroughly documented to guide users through the new agent creation and promotion workflows.

Highlights

  • Agent Lifecycle Introduction: Implements a new three-tier agent lifecycle: Draft, Custom, and Shared, providing structured management for agents based on their purpose and visibility.
  • Orchestration Agent Capability: Enables orchestration agents to dynamically create 'Draft' agents, facilitating reusable context for parallel processing and experimental development.
  • Deployment Robustness: Enhances the setup.sh script to intelligently preserve user-defined custom/ and draft/ agent directories during updates, preventing accidental data loss.
  • Comprehensive Documentation: Introduces detailed documentation across multiple markdown files, explaining the new agent tiers, their conventions, promotion workflows, and integration points.
Changelog
  • .agents/AGENTS.md
    • Added a new "Agent tiers" table detailing Draft, Custom, and Shared agents, their locations, and purposes.
    • Updated the "Working Directories" section to reflect the new agents/custom/ and agents/draft/ paths within the ~/.aidevops/ structure.
  • .agents/tools/ai-assistants/headless-dispatch.md
    • Added a new section explaining the use of draft agents for reusable context in parallel worker dispatches.
  • .agents/tools/ai-orchestration/overview.md
    • Included a new paragraph on how orchestration tasks can create and promote draft agents.
  • .agents/tools/build-agent/build-agent.md
    • Introduced a comprehensive "Agent Lifecycle Tiers" section.
    • Detailed the purpose, conventions, and promotion workflow for Draft agents.
    • Provided guidelines for Custom (Private) agents, including use cases and conventions.
    • Outlined the criteria and submission process for Shared agents.
    • Explained how orchestration and task agents should create and manage draft agents, including a bash example.
  • setup.sh
    • Modified the deploy_aidevops_agents function to preserve custom/ and draft/ directories during CLEAN_MODE by backing them up and restoring them.
    • Updated the rsync command to explicitly exclude custom/ and draft/ from being overwritten during deployment.
    • Added fallback logic for cp -R to remove excluded directories if rsync is not available.
Activity
  • No human activity has been recorded on this pull request since its creation.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 3 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Walkthrough

This 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 custom/ and draft/ directories during cleanup.

Changes

Cohort / File(s) Summary
Agent Tiering Documentation
.agents/AGENTS.md, .agents/tools/build-agent/build-agent.md
Adds "Agent Lifecycle Tiers" (Draft, Custom, Shared), directory conventions, promotion workflow, frontmatter and file-structure guidance, and reorganizes working directory layout to a top-level ~/.aidevops/agents/ structure.
Guidance for Headless & Orchestration
.agents/tools/ai-assistants/headless-dispatch.md, .agents/tools/ai-orchestration/overview.md
Adds instructions to create and reuse draft agents from ~/.aidevops/agents/draft/ and references the new lifecycle/promotion guidance.
Build Agent Expansion
.agents/tools/build-agent/build-agent.md
Large content additions: cache-aware prompt patterns, MCP configuration patterns, agent file/frontmatter rules, main/subagent relationships, examples, and Oh-My-OpenCode workflow sequencing.
Deployment Script Update
setup.sh
Updates deploy_aidevops_agents to preserve user custom/ and draft/ by staging/excluding them during clean/deploy (rsync & tar paths updated, added comments).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

✨ Drafts take shape in hidden stalls,
Custom keeps the code that calls,
Shared seeds bloom when reviews are done,
Cleanup spares the work you've won,
Agents march together, one by one.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: add three-tier agent lifecycle (draft, private, shared)' is clear and specific, directly reflecting the main change: introducing a three-tier agent lifecycle system with draft, custom (private), and shared tiers.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/agent-lifecycle-tiers

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 25 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 00:44:02 UTC 2026: Code review monitoring started
Sat Feb 7 00:44:02 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 00:44:02 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 00:44:04 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 00:44:07 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Comment on lines 2126 to 2128
# Fallback: copy then remove excluded dirs
cp -R "$source_dir"/* "$target_dir/"
rm -rf "$target_dir/loop-state" 2>/dev/null || true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
# 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.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 25 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 00:48:10 UTC 2026: Code review monitoring started
Sat Feb 7 00:48:11 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 00:48:11 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 00:48:13 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

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.
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 25 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 7 00:52:04 UTC 2026: Code review monitoring started
Sat Feb 7 00:52:04 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 25
Sat Feb 7 00:52:04 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Feb 7 00:52:06 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 25
  • VULNERABILITIES: 0

Generated on: Sat Feb 7 00:52:10 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

@marcusquinn marcusquinn merged commit 0f08675 into main Feb 7, 2026
11 checks passed
@marcusquinn marcusquinn deleted the feature/agent-lifecycle-tiers branch February 7, 2026 00:53
marcusquinn added a commit that referenced this pull request Feb 7, 2026
- 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
marcusquinn added a commit that referenced this pull request Feb 7, 2026
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant