✅ fresh
last synced 2026-06-17T22:39:35.514075+00:00 · coverage 100% (
agent-prime)Validation by Beadloom
doc_sync— same source assync-check.
Agent Prime
Cross-IDE context injection via a three-layer architecture.
Layers
AGENTS.md (static) —
.beadloom/AGENTS.mdwith MCP tool list, architecture rules, conventions. Regenerated bygenerate_agents_md(), preserves content below## Custommarker.IDE adapters (pointers) —
.cursorrules,.windsurfrules,.clinerulesfiles that instruct agents to read AGENTS.md. Created bysetup_rules_auto()on bootstrap.beadloom prime(dynamic) — CLI command and MCP tool that queries the DB for current project state: architecture summary, stale docs, lint violations, domain list.
API
prime_context(project_root, *, fmt="markdown")
Returns compact project context. Static layer (config, rules, AGENTS.md) always available. Dynamic layer (DB queries) degrades gracefully without DB.
fmt="markdown"— human-readable output (~1000-1500 tokens)fmt="json"— structured dict for programmatic use
setup_rules_auto(project_root)
Auto-detects IDEs by marker files and creates adapter files. Returns list of created file paths.
generate_agents_md(project_root)
Generates .beadloom/AGENTS.md with v2 template. Injects rules from rules.yml. Preserves user content below ## Custom.
setup_mcp_auto(project_root)
Auto-detects editor (claude-code, cursor, windsurf) by marker files and creates MCP config. Returns editor name on success, or None if config already exists.
Data Types
ScanResult (TypedDict)
Result of scan_project() — discovered project structure.
class ScanResult(TypedDict):
manifests: list[str] # Found manifest files (pyproject.toml, package.json, etc.)
source_dirs: list[str] # Discovered source directories
file_count: int # Total code file count
languages: list[str] # Detected file extensionsClusterEntry (TypedDict)
A two-level directory cluster produced by _cluster_with_children().
class ClusterEntry(TypedDict):
files: list[str] # All code files in the cluster
children: dict[str, list[str]] # Child dir name → code files
source_dir: str # Owning top-level source directoryCLI
beadloom prime [--json] [--update] [--project PATH]beadloom setup-rules [--tool cursor|windsurf|cline] [--project PATH]beadloom setup-mcp [--tool claude-code|cursor|windsurf] [--remove] [--project PATH]
MCP
primetool (no parameters) — returns JSON context for agent sessions
Source
src/beadloom/onboarding/scanner/— cohesion-split package;prime.py(prime_context()),agents_md.py(setup_rules_auto(),generate_agents_md(),setup_mcp_auto()),types.py(ScanResult,ClusterEntry), plusbootstrap.py/init_flow.py/project_scan.py/summary.py/entry_points.py/import_scan.py/readme.py/doc_classify.py/rules_gen.py/claude_md.py/constants.py; the package__init__.pyre-exports the full public surfacesrc/beadloom/services/commands/query.py—primeCLI commandsrc/beadloom/services/commands/setup.py—setup-rulesandsetup-mcpCLI commandssrc/beadloom/services/mcp_server.py—primeMCP tool