1 agents

shell-setup-specialist

shell-setup-specialist

Overview

The Shell Setup Specialist is an L3 agent operating in the developer-productivity domain of the Prismatic Platform. This agent is responsible for configuring, optimizing, and maintaining shell environments, dotfile configurations, and developer tooling setups that maximize productivity across the platform's development team. From Zsh configuration and Git hooks to Elixir/OTP development environment optimization, the Shell Setup Specialist ensures every developer has a consistent, high-performance workspace that enforces the platform's quality standards from the moment they open a terminal.

Shell environment consistency is a foundational requirement for a platform of this scale. With 90 umbrella applications, thousands of Mix tasks, and strict pre-commit quality gates, an improperly configured development environment can lead to silent quality degradation, inconsistent test results, or bypassed enforcement mechanisms. The Shell Setup Specialist eliminates this risk by providing deterministic, reproducible shell configurations.

This agent is part of the platform's 434-strong autonomous agent ecosystem, contributing to the self-evolving, deterministic intelligence infrastructure under the AIAD standard.

Core Responsibilities

ResponsibilityDescriptionScope
Shell ConfigurationZsh/Bash profiles, aliases, functions, completionsAll developers
Git Hook ManagementPre-commit, commit-msg, pre-push hook installationRepository-wide
Environment VariablesDevelopment, staging, production env managementPer-environment
Tool Version Managementasdf/mise version pinning for Elixir, Erlang, Node.jsProject-level
Path ConfigurationBinary paths, library paths, compilation flagsSystem-level
Editor IntegrationLSP configuration, formatter settings, linter configsPer-editor
Alias LibraryPlatform-specific command shortcuts and workflowsProductivity

Shell Configuration Architecture

The Shell Setup Specialist maintains a layered configuration architecture where each layer builds on the previous one without creating conflicts.

# Layer 1: System defaults (managed by OS)
/etc/zshrc

# Layer 2: Platform base configuration
~/.prismatic/shell/base.zsh

# Layer 3: Tool-specific configurations
~/.prismatic/shell/elixir.zsh
~/.prismatic/shell/git.zsh
~/.prismatic/shell/docker.zsh

# Layer 4: Project-specific overrides
./scripts/shell-env.sh
./.envrc  # direnv integration

# Layer 5: Personal customizations (never overwritten)
~/.prismatic/shell/personal.zsh

Essential Aliases and Functions

# Prismatic Platform development aliases
alias px="cd ~/dev/prismatic-platform"
alias pxtest="mix test --warnings-as-errors"
alias pxcredo="mix credo --strict"
alias pxdeps="mix deps.get && mix deps.compile"
alias pxbuild="mix compile --warnings-as-errors --force"
alias pxquality="mix quality.gates"
alias pxgt="./scripts/git-trees.sh"

# Quick navigation
alias pxweb="cd apps/prismatic_web"
alias pxapi="cd apps/prismatic_api"
alias pxagents="cd apps/prismatic_agents"

# Git workflow
alias gst="git status"
alias gco="git checkout"
alias gcm="git commit -m"
alias gpl="git pull --rebase"

# Quality gates shortcut
pxcheck() {
  echo "Running quality gates..."
  mix compile --warnings-as-errors --force && \
  mix credo --strict && \
  mix test --warnings-as-errors && \
  echo "All gates passed."
}

Git Hook Configuration

The Shell Setup Specialist manages the platform's Git hook infrastructure, which enforces quality standards at every commit point.

HookPurposeEnforcement Level
pre-commitQuality validation, format check, secret scanBlocking
commit-msgConventional commit format validationBlocking
pre-pushFull test suite, Dialyzer, CredoBlocking
post-checkoutDependency refresh, compilation checkAdvisory
post-mergeDependency update detectionAdvisory
defmodule PrismaticAgents.ShellSetupSpecialist do
  @moduledoc """
  L3 Shell Setup Specialist agent.
  Manages developer environment configuration and productivity tooling.
  """

  use GenServer
  require Logger

  @config_check_interval_ms :timer.hours(1)

  defstruct [
    :last_config_check,
    :detected_issues,
    :environment_profile,
    status: :monitoring
  ]

  @spec start_link(keyword()) :: GenServer.on_start()
  def start_link(opts \\ []) do
    GenServer.start_link(__MODULE__, opts, name: __MODULE__)
  end

  @impl true
  def init(_opts) do
    schedule_config_check()
    {:ok, %__MODULE__{environment_profile: detect_environment()}}
  end

  @impl true
  def handle_info(:check_config, state) do
    issues = validate_developer_environment(state.environment_profile)

    :telemetry.execute(
      [:prismatic, :agents, :shell_setup, :config_check],
      %{issue_count: length(issues)},
      %{profile: state.environment_profile}
    )

    schedule_config_check()
    {:noreply, %{state | detected_issues: issues, last_config_check: DateTime.utc_now()}}
  end

  defp detect_environment do
    %{
      shell: System.get_env("SHELL"),
      elixir_version: System.version(),
      otp_release: :erlang.system_info(:otp_release) |> List.to_string(),
      mix_env: Mix.env(),
      git_hooks_installed: File.exists?(".githooks/pre-commit")
    }
  end
end

Environment Variable Management

The Shell Setup Specialist enforces strict separation between development, staging, and production environment variables. Secrets are never stored in dotfiles and are instead managed through the platform's secrets management infrastructure.

Variable CategoryStorageAccess Method
Development.envrc (direnv)Automatic per-directory
StagingFly.io secretsflyctl secrets
ProductionFly.io secrets + vaultRuntime injection
Build-timeconfig/ Elixir configsCompile-time
Testconfig/test.exsMix environment

Tool Version Pinning

Consistent tool versions across all developers prevent the "works on my machine" class of defects.

ToolVersion ManagerPinned VersionConfiguration
Elixirasdf/mise1.19.x.tool-versions
Erlang/OTPasdf/mise27.x.tool-versions
Node.jsasdf/mise20.x LTS.tool-versions
PostgreSQLSystem16.xdocker-compose.yml
ZolaDirect install0.22.1Manual

IEx and Development REPL Configuration

A significant portion of Elixir development occurs within the Interactive Elixir shell (IEx). The Shell Setup Specialist configures IEx with platform-specific helpers, custom inspectors, and convenience functions that accelerate common development tasks.

# .iex.exs (managed by Shell Setup Specialist)
import_if_available(Ecto.Query)

# Platform module shortcuts
alias PrismaticWeb.Router.Helpers, as: Routes
alias Prismatic.Repo

# Custom helpers for development
defmodule H do
  @moduledoc false

  def agents do
    PrismaticAgents.Registry.list_agents()
    |> Enum.map(& &1.name)
    |> Enum.sort()
  end

  def quality do
    Mix.Tasks.Quality.Gates.run([])
  end

  def routes do
    PrismaticWeb.Router.__routes__()
    |> Enum.map(fn r -> {r.verb, r.path, r.plug} end)
  end

  def app_count do
    Path.wildcard("apps/*/mix.exs") |> length()
  end
end

# ANSI colors for better visibility
IEx.configure(
  colors: [
    eval_result: [:cyan, :bright],
    eval_error: [:red, :bright],
    eval_info: [:yellow]
  ],
  inspect: [
    limit: 50,
    pretty: true,
    width: 100
  ]
)

IO.puts("\n  Prismatic Platform IEx - #{length(Application.started_applications())} apps loaded")
IO.puts("  Type H.agents/0, H.quality/0, H.routes/0 for helpers\n")

Diagnostic and Troubleshooting Tools

The Shell Setup Specialist provides a suite of diagnostic tools that developers can use to quickly identify and resolve common development environment issues.

ToolPurposeInvocationOutput
px-doctorFull environment health checkpx-doctorPass/fail report
px-deps-checkDependency version verificationpx-deps-checkVersion comparison
px-hooks-verifyGit hook integrity checkpx-hooks-verifyHook status report
px-compile-statsCompilation time breakdownpx-compile-statsPer-app timing
px-env-diffCompare env against referencepx-env-diffDivergence report
px-beam-infoBEAM/OTP system informationpx-beam-infoSystem summary

Productivity Metrics

The Shell Setup Specialist tracks developer productivity metrics to validate that environment configurations are achieving their intended efficiency gains. These metrics are collected through telemetry events emitted by the diagnostic tools and compiled into weekly reports for the development team.

MetricBaselineOptimizedImprovement
Cold compilation180s90s50% faster
Incremental compilation15s5s67% faster
Test suite (full)120s80s33% faster
Git hook execution45s20s56% faster
Environment setup (new dev)4 hours30 min87% faster
IEx boot time12s6s50% faster
Dependency resolution30s15s50% faster

Integration Points

Developer Onboarding Automation

One of the Shell Setup Specialist's highest-impact contributions is automating the developer onboarding process. New team members can go from a bare machine to a fully functional development environment in under 30 minutes by running the platform's bootstrap script, which the Shell Setup Specialist maintains and validates.

Onboarding StepManual TimeAutomated TimeAutomation Method
Install asdf/mise15 minutes2 minutesBootstrap script
Install Elixir/Erlang30 minutes5 minutes.tool-versions + asdf
Clone and setup repo20 minutes3 minutesscripts/setup-dev.sh
Install dependencies15 minutes5 minutesmix deps.get && mix deps.compile
Configure Git hooks20 minutes1 minutescripts/install-hooks.sh
Configure shell60 minutes2 minutesscripts/setup-shell.sh
Verify environment30 minutes5 minutespx-doctor diagnostic tool
First compilation10 minutes7 minutesmix compile --warnings-as-errors
Total4+ hours~30 minutes87% time reduction

AIAD Specification Compliance

AIAD ComponentStatus
Agent specification fileCompliant
Behavioral rules10 rules defined
Telemetry integrationFull coverage
NM/ND doctrine enforcementActive
SEADF integrationRegistered

Agents in the developer-productivity domain work together to ensure maximum development efficiency.

Authority Level

L3 - Strategic Command - Multi-domain coordination with authority to enforce environment standards across all development workstations.


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL