You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agent OS has a powerful profile inheritance system, but it's currently limited to local profiles in ~/agent-os/profiles/. As the community grows, there's an opportunity to enable profile sharing - allowing developers to reference and inherit from profiles hosted in GitHub repositories.
This would enable:
Community-driven profiles for popular tech stacks (Rails, Django, Laravel, etc.)
Organization-wide standards shared across teams via private repos
Profile ecosystems where specialized profiles build on community bases
Version pinning to ensure reproducible installations
resolve_profile(source):
ifsource starts with "github:":
parse -> user, repo, path, ref
cache_path = fetch_or_use_cache(user, repo, ref)
return cache_path + path
elseifsource starts with "local:" OR is simple name:
return~/agent-os/profiles/{name}
Inheritance Chain Resolution
The existing get_profile_file() function already walks inheritance chains. This extends it:
get_profile_file(profile_source, file_path):
current = profile_source
visited = []
while true:
if current in visited:
error "Circular inheritance"
visited.append(current)
base_path = resolve_profile(current)
if file exists at base_path/file_path:
return it
config = read base_path/profile-config.yml
if config has "inherits_from":
if file_path matches exclusion patterns:
return not found
current = config.inherits_from
continue
else:
return not found
Use GitHub's raw content API (no authentication needed for public repos):
# Fetch a single file
https://raw.githubusercontent.com/user/repo/ref/profiles/name/profile-config.yml
# For entire profile, recursively fetch directory structure:# 1. Use GitHub API to list directory contents (requires traversal)# 2. Download each file to cache
Version References
Support multiple ref types:
# Branch (tracks latest)source: github:user/repo/profiles/rails@main# Tag (pinned version)source: github:user/repo/profiles/rails@v1.2.0# Commit SHA (exact snapshot)source: github:user/repo/profiles/rails@a1b2c3d# Default (no ref = main branch)source: github:user/repo/profiles/rails
Update Strategy
Initial fetch: During project-install.sh, download and cache
Metadata tracking in ~/.agent-os/cache/github/user/repo/.metadata:
ref: v1.2.0last_fetch: 2025-10-17 14:30:00etag: "abc123..."# GitHub's ETag for conditional requestsresolved_sha: a1b2c3d # what the ref resolved to
Prompted: During project-update.sh, check if cache is stale (>7 days) and prompt
Force: project-update.sh --update-github-profiles
Private Repositories (Future)
For v1, support public repos only. Future enhancement:
# Store token in ~/.agent-os/github-tokenecho"ghp_yourtoken">~/.agent-os/github-token
chmod 600 ~/.agent-os/github-token
# Installation scripts check for token when fetching
New Scripts and Functions
New File: scripts/github-functions.sh
Core functions for GitHub integration:
# Parse github:user/repo/path@ref formatparse_github_source() {
local source=$1# Returns: user, repo, path, ref
}
# Fetch profile from GitHub to cachefetch_github_profile() {
local user=$1local repo=$2local path=$3local ref=${4:-main}# Downloads to ~/.agent-os/cache/github/user/repo/# Updates .metadata file
}
# Get local path to cached profileget_cached_profile_path() {
local user=$1local repo=$2echo"$HOME/.agent-os/cache/github/$user/$repo"
}
# Check if cached profile needs updateis_cache_stale() {
local cache_path=$1local max_age_days=${2:-7}# Reads .metadata, checks last_fetch
}
# Update cached profile from GitHubupdate_github_profile() {
local source=$1# Re-fetches, uses ETag for conditional request
}
New Script: scripts/update-github-profiles.sh
#!/bin/bash# Update cached GitHub profiles# Usage:# update-github-profiles.sh # update all cached profiles# update-github-profiles.sh user/repo/path # update specific profile
Modified: scripts/common-functions.sh
Extend existing functions to handle GitHub sources:
# Modified to call resolve_profile() firstget_profile_file() {
local profile_source=$1local file_path=$2local base_dir=$3# NEW: Resolve GitHub or local sourcelocal resolved_path=$(resolve_profile_source "$profile_source""$base_dir")# EXISTING: Walk inheritance chain# ... rest of function unchanged
}
# NEW: Resolve source to filesystem pathresolve_profile_source() {
local source=$1local base_dir=$2if [[ "$source"== github:* ]];then
parse_github_source "$source"
ensure_cached "$user""$repo""$path""$ref"
get_cached_profile_path "$user""$repo"else# Local profileecho"$base_dir/profiles/$source"fi
}
Modified: scripts/project-install.sh
# In load_configuration(), after reading config:if [[ "$EFFECTIVE_PROFILE"== github:* ]];then
print_status "Fetching GitHub profile..."
fetch_github_profile "$EFFECTIVE_PROFILE"fi# Rest of installation proceeds normally
Modified: scripts/project-update.sh
# In perform_update(), before updating files:if [[ "$PROJECT_PROFILE"== github:* ]];thenif is_cache_stale "$(get_cached_profile_path ...)";then
print_warning "GitHub profile cache is stale"read -p "Update from GitHub? (y/n): " -n 1 -r
if [[ $REPLY=~ ^[Yy]$ ]];then
update_github_profile "$PROJECT_PROFILE"fififi
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Agent OS has a powerful profile inheritance system, but it's currently limited to local profiles in
~/agent-os/profiles/. As the community grows, there's an opportunity to enable profile sharing - allowing developers to reference and inherit from profiles hosted in GitHub repositories.This would enable:
Proposed Syntax
In
agent-os/config.ymlIn
profile-config.yml(for inheritance)Backward Compatibility
How It Works (High Level)
project-install.shdetects GitHub profile references~/.agent-os/cache/github/user/repo/Updates are hybrid: cached locally but manually updated via
update-github-profiles.shor prompted duringproject-update.sh.Relationship to Discussion #200 (Project Mixins)
This proposal is complementary to the Project Mixins discussion:
--profile github:user/base --mixins github:otheruser/auth-mixinImplementation Details
Cache Structure
Profiles are cached at
~/.agent-os/cache/github/:Profile Resolution Algorithm
Inheritance Chain Resolution
The existing
get_profile_file()function already walks inheritance chains. This extends it:Example chain:
GitHub Integration Details
Fetching Profiles
Use GitHub's raw content API (no authentication needed for public repos):
Version References
Support multiple ref types:
Update Strategy
Initial fetch: During
project-install.sh, download and cacheMetadata tracking in
~/.agent-os/cache/github/user/repo/.metadata:Update paths:
~/agent-os/scripts/update-github-profiles.sh [profile-source]project-update.sh, check if cache is stale (>7 days) and promptproject-update.sh --update-github-profilesPrivate Repositories (Future)
For v1, support public repos only. Future enhancement:
New Scripts and Functions
New File:
scripts/github-functions.shCore functions for GitHub integration:
New Script:
scripts/update-github-profiles.shModified:
scripts/common-functions.shExtend existing functions to handle GitHub sources:
Modified:
scripts/project-install.shModified:
scripts/project-update.shExample Use Cases
Use Case 1: Community Rails Profile
Someone creates a comprehensive Rails profile:
Users install it:
Use Case 2: Organization Standards
A company maintains private profile:
Teams use:
~/agent-os/scripts/project-install.sh \ --profile github:acmecorp/engineering-standards/agent-os/rails-api@mainUse Case 3: Versioned Upgrades
Pin to specific version initially:
Later, upgrade explicitly:
Run
project-update.sh --re-installto apply new profile version.Use Case 4: Forking and Customizing
Your fork can still inherit from the original:
Migration Path
For Existing Installations
No breaking changes - all existing profiles continue working:
Gradual Adoption
Security Considerations
Trust Model
Users explicitly specify sources: No automatic discovery prevents supply chain attacks
Version pinning: Commit SHAs provide immutability
Validation
Before using cached profile:
profile-config.ymlexists and is valid YAMLPrivate Repos (Future)
If implementing private repo support:
~/.agent-os/github-tokenwith 600 permissionsQuestions for the Community
github:user/monorepo/packages/agent-os-profiles/rails?github:user/repodefaulting toprofiles/default?Next Steps
If there's interest in this feature:
Feedback welcome! This is a draft proposal to start the conversation.
Beta Was this translation helpful? Give feedback.
All reactions