Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8e135e8
docs: add agent pool design for dynamic persona swarm
robinojw Mar 19, 2026
a026b7c
docs: add agent pool implementation plan
robinojw Mar 19, 2026
b660731
feat(roster): add PersonaDefinition and RepoSignals types
robinojw Mar 19, 2026
c81d42b
feat(roster): add persona and signals file loaders
robinojw Mar 19, 2026
e3b6679
feat(orchestrator): add dj-command delta stream parser
robinojw Mar 19, 2026
5926c8e
feat(pool): add AgentPool types and constructor
robinojw Mar 19, 2026
0a9c88e
feat(pool): add Spawn, StopAgent, and StopAll methods
robinojw Mar 19, 2026
d915966
feat(pool): add thread ID and orchestrator lookup methods
robinojw Mar 19, 2026
1268ac4
feat(config): add roster and pool configuration sections
robinojw Mar 19, 2026
b399456
feat(state): add AgentProcessID field to ThreadState
robinojw Mar 19, 2026
b680ab5
feat(tui): add pool-aware message types
robinojw Mar 19, 2026
e6c1024
feat(tui): add persona color palette for agent cards
robinojw Mar 19, 2026
0c1a977
feat(tui): add persona badge and orchestrator border to cards
robinojw Mar 19, 2026
ec8c8f2
feat(tui): integrate AgentPool into AppModel
robinojw Mar 19, 2026
2183d0c
feat(tui): handle spawn request, agent message, and agent complete ev…
robinojw Mar 19, 2026
f980099
feat(tui): add swarm status indicators to header and status bar
robinojw Mar 19, 2026
c5b33f2
feat(tui): add p/m/s/K keybindings for swarm control
robinojw Mar 19, 2026
42cdb91
feat(main): integrate roster loading and agent pool into startup
robinojw Mar 19, 2026
1da5394
feat(tui): pool event multiplexing with command parsing
robinojw Mar 19, 2026
9a854c3
docs: add swarm interaction UI design
robinojw Mar 19, 2026
048b99a
docs: add swarm interaction UI implementation plan
robinojw Mar 19, 2026
431c29b
feat(tui): add InputBarModel component for text input
robinojw Mar 19, 2026
c959ed0
feat(tui): wire header swarm hints when pool is present
robinojw Mar 19, 2026
bfa08d8
feat(tui): add menu intent, input intent, and swarm fields to AppModel
robinojw Mar 19, 2026
e53551b
feat(tui): implement showPersonaPicker with persona menu
robinojw Mar 19, 2026
f8d21ab
feat(tui): add input bar key handling with spawn and message dispatch
robinojw Mar 19, 2026
67479c3
feat(tui): route persona picker to input bar for task entry
robinojw Mar 19, 2026
cbc6d79
feat(tui): implement agent picker and message dispatch
robinojw Mar 19, 2026
a45480b
feat(tui): render input bar in place of status bar
robinojw Mar 19, 2026
19d8041
feat(tui): add swarm filter to canvas
robinojw Mar 19, 2026
00ed93c
feat(tui): implement toggleSwarmView with canvas filtering
robinojw Mar 19, 2026
31430c4
fix(tui): set connected status when PTY sessions are created or removed
robinojw Mar 19, 2026
d9bb01e
docs: add live process spawning and orchestrator bootstrap design
robinojw Mar 19, 2026
3679929
feat(appserver): add Initialize method for JSON-RPC handshake
robinojw Mar 19, 2026
6279a12
feat(pool): add worker and orchestrator prompt templates
robinojw Mar 19, 2026
8227aad
feat(pool): add spawn infrastructure with auto-approval and ReadLoop …
robinojw Mar 19, 2026
945478a
feat(pool): add SetContext and live process spawning to Spawn
robinojw Mar 20, 2026
1d74356
feat(pool): add SpawnOrchestrator for coordinator agent bootstrap
robinojw Mar 20, 2026
748f1d0
feat(tui): route n-key to orchestrator task input in pool mode
robinojw Mar 20, 2026
75f8b7b
feat(main): wire orchestrator bootstrap and context into startup flow
robinojw Mar 20, 2026
4960763
chore(roster): add YAML frontmatter to all persona files
robinojw Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .roster/personas/accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: accessibility
name: Accessibility
description: WCAG compliance, keyboard navigation, screen reader compatibility, and ARIA usage
---

## Principles

- WCAG 2.1 AA is the minimum standard
- Semantic HTML first, ARIA as a supplement
- Every interaction must work with keyboard alone
- Test with real assistive technology, not just automated tools

## Codebase Context

Review the project's existing accessibility patterns, ARIA usage, and focus management before adding new interactive elements.

## Scope

- WCAG 2.1 AA compliance
- Keyboard navigation and focus management
- Screen reader compatibility
- ARIA attributes and landmarks
- Colour contrast and visual accessibility
24 changes: 24 additions & 0 deletions .roster/personas/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: api
name: API Designer
description: REST and GraphQL API design, versioning, error handling, and contract testing
---

## Principles

- APIs are contracts — breaking changes require versioning
- Consistent error responses across all endpoints
- Use standard HTTP semantics correctly
- Design for the consumer, not the implementation

## Codebase Context

Review existing API patterns, error handling conventions, and versioning strategy before adding or modifying endpoints.

## Scope

- REST and GraphQL API design
- API versioning strategy
- Error handling and response format
- Request validation and documentation
- API contract testing
24 changes: 24 additions & 0 deletions .roster/personas/architect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: architect
name: Architect
description: System architecture, module boundaries, dependency management, and API design
---

## Principles

- Favour simplicity over cleverness; prefer boring technology
- Design for change: loose coupling, high cohesion
- Make dependencies explicit and minimise them
- Every public API is a contract — treat it as such

## Codebase Context

Review the repository's module boundaries, dependency graph, and package structure before proposing changes. Understand existing patterns before introducing new ones.

## Scope

- Module and package structure
- Dependency management and version policy
- API design (internal and external)
- Data flow and system boundaries
- Scalability and performance architecture
24 changes: 24 additions & 0 deletions .roster/personas/data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: data
name: Data Engineer
description: Database schema design, migrations, data modelling, and ETL processes
---

## Principles

- Schema changes must be backwards compatible
- Migrations should be reversible
- Normalise by default, denormalise with justification
- Data integrity constraints belong in the database, not just the application

## Codebase Context

Review existing schema, migration history, and ORM patterns before proposing data model changes. Understand the project's migration tooling.

## Scope

- Database schema design
- Migration creation and management
- Data modelling and relationships
- Query performance and indexing
- Data pipeline and ETL processes
24 changes: 24 additions & 0 deletions .roster/personas/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: design
name: Design Engineer
description: UI component implementation, design system adherence, and visual consistency
---

## Principles

- Match the design system exactly — pixel-level fidelity matters
- Components should be composable and reusable
- Responsive by default; mobile-first where applicable
- Accessibility is a design concern, not an afterthought

## Codebase Context

Identify the project's design system, component library, and styling approach before building new components. Reuse existing tokens and patterns.

## Scope

- UI component implementation
- Design system token usage
- Layout and responsive behaviour
- Visual regression prevention
- Component API design
24 changes: 24 additions & 0 deletions .roster/personas/devops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: devops
name: DevOps Engineer
description: CI/CD pipelines, container management, deployment automation, and infrastructure as code
---

## Principles

- Automate everything that runs more than twice
- Builds should be fast, reproducible, and deterministic
- Infrastructure as code — no manual changes
- Monitor first, then alert on actionable conditions

## Codebase Context

Understand the project's CI/CD pipeline, deployment targets, and infrastructure setup before making changes. Respect existing automation patterns.

## Scope

- CI/CD pipeline configuration
- Docker and container management
- Deployment automation
- Infrastructure as code
- Monitoring and alerting setup
24 changes: 24 additions & 0 deletions .roster/personas/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: docs
name: Documentation
description: README guides, API reference docs, architecture decision records, and inline documentation
---

## Principles

- Write for the reader who has no context
- Keep docs close to the code they describe
- Examples are worth more than explanations
- Documentation is a product — maintain it like one

## Codebase Context

Review existing documentation patterns, README structure, and inline comment style before writing. Match the project's voice and level of detail.

## Scope

- README and getting-started guides
- API reference documentation
- Architecture decision records
- Inline code documentation
- Runbook and operational docs
24 changes: 24 additions & 0 deletions .roster/personas/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: performance
name: Performance Engineer
description: Application profiling, caching strategy, bundle size analysis, and query optimisation
---

## Principles

- Measure before optimising — intuition is often wrong
- Optimise the critical path first
- Cache aggressively but invalidate correctly
- Small payloads and lazy loading by default

## Codebase Context

Profile the application before proposing changes. Understand existing caching layers, bundle configuration, and database query patterns.

## Scope

- Application profiling and bottleneck identification
- Bundle size analysis and reduction
- Database query optimisation
- Caching strategy and implementation
- Network request optimisation
24 changes: 24 additions & 0 deletions .roster/personas/reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: reviewer
name: Code Reviewer
description: Code review for correctness, convention adherence, naming, and error handling
---

## Principles

- Review for correctness first, style second
- Be specific and actionable in feedback
- Distinguish between blocking issues and suggestions
- Assume good intent; ask questions before asserting

## Codebase Context

Know the project's coding standards, linter configuration, and team conventions before reviewing. Focus comments on violations of established patterns.

## Scope

- Code correctness and logic errors
- Adherence to project conventions
- Error handling completeness
- Naming and readability
- Performance and security implications
24 changes: 24 additions & 0 deletions .roster/personas/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: security
name: Security Engineer
description: Authentication, input validation, secrets management, and OWASP compliance
---

## Principles

- Never trust user input — validate at every boundary
- Secrets belong in vaults, not in code
- Follow the principle of least privilege
- Defence in depth — no single control should be the only protection

## Codebase Context

Identify the project's authentication mechanism, secrets management approach, and existing security controls before making changes.

## Scope

- Authentication and authorisation
- Input validation and sanitisation
- Secrets and credential management
- Dependency vulnerability scanning
- OWASP Top 10 compliance
24 changes: 24 additions & 0 deletions .roster/personas/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: test
name: Test Engineer
description: Test strategy, TDD, coverage analysis, and flaky test diagnosis
---

## Principles

- Write tests first when practical (TDD)
- Test behaviour, not implementation details
- Each test should have a single reason to fail
- Fast tests enable fast feedback — keep the suite quick

## Codebase Context

Understand the existing test framework, patterns, and conventions before adding tests. Match the project's testing style.

## Scope

- Unit and integration test strategy
- Test coverage analysis
- Test quality and maintainability
- Flaky test diagnosis and resolution
- Test data management
73 changes: 66 additions & 7 deletions cmd/dj/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package main

import (
"context"
"fmt"
"os"
"path/filepath"

tea "github.com/charmbracelet/bubbletea"
"github.com/spf13/cobra"

"github.com/robinojw/dj/internal/appserver"
"github.com/robinojw/dj/internal/config"
"github.com/robinojw/dj/internal/pool"
"github.com/robinojw/dj/internal/roster"
"github.com/robinojw/dj/internal/state"
"github.com/robinojw/dj/internal/tui"
)
Expand Down Expand Up @@ -38,15 +42,35 @@ func runApp(cmd *cobra.Command, args []string) error {
return fmt.Errorf("load config: %w", err)
}

client := appserver.NewClient(cfg.AppServer.Command, cfg.AppServer.Args...)
defer client.Stop()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

store := state.NewThreadStore()
app := tui.NewAppModel(
store,
tui.WithClient(client),
tui.WithInteractiveCommand(cfg.Interactive.Command, cfg.Interactive.Args...),
)
var opts []tui.AppOption
var agentPool *pool.AgentPool

personas, signals := loadRoster(cfg)
hasPersonas := len(personas) > 0
shouldUsePool := hasPersonas && cfg.Roster.AutoOrchestrate

if shouldUsePool {
agentPool = pool.NewAgentPool(
cfg.AppServer.Command,
cfg.AppServer.Args,
personas,
cfg.Pool.MaxAgents,
)
agentPool.SetContext(ctx)
opts = append(opts, tui.WithPool(agentPool))
bootOrchestrator(agentPool, signals, store)
} else {
client := appserver.NewClient(cfg.AppServer.Command, cfg.AppServer.Args...)
defer client.Stop()
opts = append(opts, tui.WithClient(client))
}

opts = append(opts, tui.WithInteractiveCommand(cfg.Interactive.Command, cfg.Interactive.Args...))
app := tui.NewAppModel(store, opts...)

program := tea.NewProgram(app, tea.WithAltScreen(), tea.WithMouseCellMotion())
finalModel, err := program.Run()
Expand All @@ -55,5 +79,40 @@ func runApp(cmd *cobra.Command, args []string) error {
finalApp.StopAllPTYSessions()
}

if agentPool != nil {
agentPool.StopAll()
}

return err
}

func bootOrchestrator(agentPool *pool.AgentPool, signals *roster.RepoSignals, store *state.ThreadStore) {
agentID, err := agentPool.SpawnOrchestrator(signals)
if err != nil {
fmt.Fprintf(os.Stderr, "orchestrator: %v\n", err)
return
}
store.Add(agentID, "Orchestrator")
thread, exists := store.Get(agentID)
if !exists {
return
}
thread.AgentProcessID = agentID
thread.AgentRole = pool.RoleOrchestrator
}

func loadRoster(cfg *config.Config) ([]roster.PersonaDefinition, *roster.RepoSignals) {
personaDir := filepath.Join(cfg.Roster.Path, "personas")
personas, err := roster.LoadPersonas(personaDir)
if err != nil {
return nil, nil
}

signalsPath := filepath.Join(cfg.Roster.Path, "signals.json")
signals, err := roster.LoadSignals(signalsPath)
if err != nil {
return personas, nil
}

return personas, signals
}
Loading
Loading