Skip to content

feat(agent): AgentProfile + ProfileRegistry — closes #1 - #5

Merged
EngineerProjects merged 2 commits into
devfrom
feat/agent-definition
Jun 4, 2026
Merged

EngineerProjects merged 2 commits into
devfrom
feat/agent-definition

Conversation

@EngineerProjects

Copy link
Copy Markdown
Collaborator

Summary

  • AgentProfile struct — persistent team-member persona (ID, Name, Role, SystemPrompt, Model, Skills, Metadata)
  • ProfileRegistry — SQLite-backed CRUD (Register, Get, List, FindByRole, Delete)
  • Seed() inserts 3 built-in profiles on first use without overwriting user edits: orchestrator, researcher, coder
  • DB migration 20260604_005_agent_profiles creates the agent_profiles table via GORM AutoMigrate
  • Clean separation: GAgentProfile lives in the db package (no circular import)

Test plan

  • TestProfileRegistry_Seed — 3 built-ins exist after seeding
  • TestProfileRegistry_Seed_Idempotent — calling Seed twice produces no duplicates
  • TestProfileRegistry_Register_And_Get — round-trip preserves all fields
  • TestProfileRegistry_Register_EmptyID — returns error
  • TestProfileRegistry_Register_Upsert — second Register updates the record
  • TestProfileRegistry_Get_NotFound — returns db.ErrProfileNotFound
  • TestProfileRegistry_FindByRole — case-insensitive role match
  • TestProfileRegistry_Delete — removes record, subsequent Get returns not-found
  • TestProfileRegistry_Delete_NoOp — deleting absent ID does not error
  • TestProfileRegistry_List — returns all profiles sorted by ID

All 10 tests pass. Full go build ./... clean.

Closes #1

🤖 Generated with Claude Code

EngineerProjects and others added 2 commits June 4, 2026 13:14
- AgentProfile struct: ID, Name, Role, SystemPrompt, Model, Skills, Metadata
- ProfileRegistry: SQLite-backed CRUD via db.DB (Register, Get, List, FindByRole, Delete)
- Seed() inserts 3 built-in profiles (orchestrator, researcher, coder) without overwriting user edits
- DB migration 20260604_005_agent_profiles adds the agent_profiles table
- 10 unit tests covering CRUD, upsert, seed idempotency, role filtering, not-found errors

Closes #1

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- ID is now a random UUID (globally unique — multiple agents can share the same role)
- Nickname replaces Name: injected into the system prompt ("You are Maria, a researcher.")
- TeamID field groups agents into named teams for future dispatch filtering
- SystemPromptTemplate supports {{.Nickname}} substitution; SystemPrompt() builds the full prompt
- Built-in profiles: Nexus (manager), Aria (researcher), Kai (engineer) with fixed UUIDs
- FindByTeam() added to registry and DB layer
- 15 unit tests covering UUID uniqueness, nickname injection, multi-role scenarios, team isolation

Closes #1

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@EngineerProjects
EngineerProjects merged commit f59153b into dev Jun 4, 2026
@EngineerProjects
EngineerProjects deleted the feat/agent-definition branch June 4, 2026 12:18
EngineerProjects added a commit that referenced this pull request Jun 4, 2026
feat(agent): AgentProfile + ProfileRegistry — closes #1
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