aibast-agents-library
CLAUDE.md8 starsChanged 3 months agoMITView on GitHub
AIBAST Agents Library is the stable Microsoft downstream for the RAPP (Rapid Agent Prototype Pattern) stack. It combines the local Brainstem server, an industry agent-template catalog, the RAPP production guide, Azure deployment assets, and a Power Platform solution. Philosophy: "engine, not experience" — this is infrastructure, not a consumer product. See CONSTITUTION.md for scope rules and governance. The durable beta product direction is documented in beta/GOLDEN_PATH.md: - RAPP accelerates learning AI and teaching AI immediately after learning it. - The…
- Pipes a download into a shell
- Reads credentials
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Treat this as a product-lifetime invariant.
- Distinctive: line 81
No linter, formatter, or type checker is configured.
- Very specific: line 95
Single-file server: All logic lives in brainstem.py (~3,300 lines) — auth, routing, streaming, diagnostics, LLM calls, and agent …
- Very specific: line 117
Add the release to docs/RELEASES.md and keep adding its post-release issues.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
AIBAST Agents Library is the stable Microsoft downstream for the RAPP (Rapid Agent Prototype Pattern) stack. It combines the local Brainstem server, an industry agent-template catalog, the RAPP production guide, Azure deployment assets, and a Power Platform solution.
Philosophy: "engine, not experience" — this is infrastructure, not a consumer product. See CONSTITUTION.md for scope rules and governance.
Product Golden Path
The durable beta product direction is documented in
beta/GOLDEN_PATH.md:
- RAPP accelerates learning AI and teaching AI immediately after learning it.
- The resulting skill is a portable single-file agent/RAPP capability that can follow the user for life.
- Chat is the control surface.
- GitHub Copilot Brain Surgeon teaches by doing and visibly drives the beta.
- An external AI can take over the visible Brainstem or Surgeon chat to keep a user unstuck, then hand control back.
- The beta combines global and routed agents in isolated hardlinked
AGENTS_PATHworkers around an unchanged Grail kernel. - Screenshots, recordings, source Explorer, tool logs, and real
/chattests make the learning observable. - Proven RAPP/1 artifacts promote into Hippocampus and the appropriate Microsoft downstream platform without rewriting the skill or wire.
Treat this as a product-lifetime invariant. Do not replace the visible
teach-by-doing loop with hidden automation, require VS Code for the golden path,
or add beta routing fields/endpoints to brainstem.py.
Repository Layout
rapp_brainstem/— The core brainstem server (seerapp_brainstem/CLAUDE.mdfor deep internals)agents/@aibast-agents-library/— AIBAST-owned industry templates and stacks; never replace this tree from Grailregistry.json,build_registry.py— generated catalog and its AIBAST-owned builderinstall.sh,install.ps1,install.cmd— One-liner installers (Brainstem path). These are sacred — any change must be tested end-to-end on a fresh machine.community_rapp/— Hippocampus (Tier 2) installer scripts. Parallel path, no dependency on brainstem.rapp_ai/— AIBAST-owned Azure Functions implementation and documentationazuredeploy.json,deploy.sh,deploy.ps1— Azure ARM deployment (Tier 2 cloud)MSFTAIBASMultiAgentCopilot_*.zip— Power Platform solution for Copilot Studio (Tier 3)index.html— the landing page is the browsable agent catalog (search, vertical filter, per-agent and per-stack install commands); readsregistry.json.library.htmlis a redirect that preserves deep linksdocs/installer.html— the Brainstem installer page (one-liner, manual steps, the three tiers);why.htmlexplains the positioningmetrics.html,scripts/build_metrics.py,state/metrics*.json— public metrics dashboard and its daily snapshotdocs/rapp-guide.html— Restored 14-step RAPP production methodologydocs/— Quick start, tutorial, production guide, and installer mirrorsskill.md— Moltbook-pattern onboarding skill (YAML frontmatter, autonomous steps, pause points)
Commands
# Start brainstem server (creates venv, installs deps, launches on port 7071)
cd rapp_brainstem && ./start.sh
# Direct run (assumes deps installed)
cd rapp_brainstem && python brainstem.py
# Run all Brainstem tests
cd rapp_brainstem && python -m pytest tests -v
# Run a single test
cd rapp_brainstem && python -m pytest tests/test_local_agents.py::TestLocalStorage::test_write_and_read -v
# Validate and regenerate the AIBAST registry
python build_registry.py
python -m pytest tests -v
# Refresh the public metrics snapshot (state/metrics.json)
python scripts/build_metrics.py # live; GITHUB_TOKEN with admin:read unlocks traffic
python scripts/build_metrics.py --offline # no network, catalog composition only
# Health check (server must be running)
curl -s localhost:7071/health | python3 -m json.tool
# Test installer (bash)
bash tests/test_installer.shNo linter, formatter, or type checker is configured.
Architecture: Three Tiers
| Tier | Name | What | Key Files |
| 1 | Brainstem (local) | Flask server + GitHub Copilot API | rapp_brainstem/brainstem.py |
| 2 | Spinal Cord (Azure) | Azure Functions + Azure OpenAI | azuredeploy.json, deploy.sh |
| 3 | Nervous System (M365) | Copilot Studio + Teams | MSFTAIBASMultiAgentCopilot_*.zip |
Each tier is self-contained. Users advance when they choose to.
Brainstem Server (rapp_brainstem/)
Single-file server: All logic lives in brainstem.py (~3,300 lines) — auth, routing, streaming, diagnostics, LLM calls, and agent orchestration. Keep it that way.
Request flow (POST /chat and POST /chat/stream): Load soul.md -> discover agents from agents/*_agent.py -> call Copilot API with tools -> execute tool calls via agent .perform() -> loop up to 3 rounds -> return JSON or server-sent events.
Agent system: Files matching agents/*_agent.py are auto-discovered (flat directory only, experimental/ excluded). Each extends BasicAgent with metadata (OpenAI function schema) and perform(**kwargs). Agents reload from disk every request — no restart needed.
Auth chain (priority order): GITHUB_TOKEN env var -> .copilot_token file -> gh auth token CLI -> device code OAuth via /login. Copilot API tokens are short-lived with auto-refresh.
Import shims: _register_shims() injects sys.modules so agents written for CommunityRAPP (cloud) work locally — utils.azure_file_storage maps to local_storage.py.
Memory agents: ManageMemory and ContextMemory get special handling — user_guid arg is stripped, and /chat auto-injects <memory> context if ContextMemory is loaded.
Branching and Release Model
main is production. The install one-liners (curl ... install.sh | bash) pull from main. Users get whatever is on main.
Staging is the fork. A maintainer's fork provides the staging ring: its staging branch serves its own Pages site with installers rendered to install the staging kernel, and its main is a fast-forward mirror of production kept by .github/workflows/sync-upstream.yml. Feature work lands in staging by pull request and is gated by preflight, the Pages deploy, and the clean-runner one-liner smoke (ring-smoke.yml). Do not hardcode a personal fork into Microsoft-facing source or documentation.
Promotion path:
- Merge to
stagingon the fork; let the gates run. tools/promotion_check.shmust report GREEN.- One pull request from
<fork-owner>:stagingtomicrosoft:main, opened and merged by a human. - Add the release to
docs/RELEASES.mdand keep adding its post-release issues.
Kernel updates come from the Grail source recorded in rapp/GRAIL-SPECIES.json only, through a kernel-sync pull request that refreshes that contract and rapp/KERNEL-DRIFT.md in the same commit. Never edit rapp_brainstem/ or the installers for a fix that belongs to every Brainstem user; send it to the Grail first.
Do not push directly to either main. Full process: docs/RELEASE-PROCESS.md.
Grail Downstream Boundary
Shared Brainstem releases flow from the pinned Grail source, but this repository is not a mirror. Preserve these AIBAST-owned surfaces during every sync:
agents/@aibast-agents-library/,registry.json, andbuild_registry.pyindex.html,library.html,docs/installer.html,why.html,metrics.html,scripts/build_metrics.py, andstate/(the catalog browse page, the metrics dashboard, and its snapshots)rapp_ai/README.md,index.html,CLAUDE.md,docs/index.html,docs/tutorial.html, anddocs/rapp-guide.html.github/,LICENSE,SECURITY.md,CONTRIBUTING.md,.vscode/, andtools/
Only repository-identity references are rewritten mechanically: Grail product/support identity becomes microsoft/aibast-agents-library, and Brainstem support drafts target that Microsoft repository. The pinned upstream provenance stays truthful. Content repositories such as CommunityRAPP are separate dependencies and must be reviewed rather than globally replaced. Installer mirrors under docs/install.* must remain byte-identical to their root counterparts.
Key Conventions
- Python 3.11 target; venv at
~/.brainstem/venv - No API keys for local dev — GitHub Copilot token exchange handles auth
- Config via
.envinrapp_brainstem/—GITHUB_TOKEN,GITHUB_MODEL(defaultauto),SOUL_PATH,AGENTS_PATH,PORT,BRAINSTEM_LAN_MODE,BRAINSTEM_ALLOWED_HOSTS, andVOICE_ZIP_PASSWORD - Two install paths exist and must never cross-contaminate: brainstem (
install.sh) and hippocampus (community_rapp/install.sh) - The landing page (
index.html) anddocs/are static HTML — no build step
In this repository509 other files it gives its agents.
- rapp_ai/CLAUDE.mdCLAUDE.md
- rapp_brainstem/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- rapp_ai/.github/copilot-instructions.mdCopilot instructions
- community_rappSkill
- generate-demoSkill
- rapp-brainstemSkill
- aibast-easy-mode-brainstemSkill
- aibast-easy-mode-copilotSkill
- aibast-staging-ring-testSkill
- account-intelligence-account-overviewSkill
- account-intelligence-competitive-intelSkill
- account-intelligence-executive-briefingSkill
- account-intelligence-risk-assessmentSkill
- account-intelligence-stakeholder-mapSkill
- account-intelligence-value-messagingSkill
- escalation-routingSkill
- follow-up-planSkill
- handle-inquirySkill
- interaction-summarySkill
- knowledge-searchSkill
- prepare-actionsSkill
- recommend-resolutionSkill
- satisfaction-surveySkill
- benefits-summarySkill
- health-insuranceSkill
- leave-balanceSkill
- parental-leaveSkill
- remindersSkill
- remote-workSkill
- submit-time-offSkill
- time-off-checkSkill
- asset-maintenance-forecast-asset-healthSkill
- asset-maintenance-forecast-budget-projectionSkill
- asset-maintenance-forecast-maintenance-forecastSkill
- asset-maintenance-forecast-work-order-planSkill
- compare-plansSkill
- deadline-remindersSkill
- document-checklistSkill
- election-draftSkill
- enrollment-windowSkill
- life-event-changeSkill
- provider-networkSkill
- approval-routeSkill
- content-scanSkill
- draft-briefSkill
- figure-checkSkill
- gap-reportSkill
- list-templatesSkill
- proactive-applicant-updatesSkill
- new-application-intake-checkSkill
- automated-code-compliance-reviewSkill
- synthetic-permit-fee-estimateSkill
- inspector-board-and-coverageSkill
- intake-triage-and-review-routingSkill
- permit-backlog-and-complaint-riskSkill
- permit-issuance-packageSkill
- permit-status-and-zoning-detailSkill
- permit-review-checklistSkill
- plan-review-routingSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

