/jtac

Development L3 Production low usage

/jtac

Overview

/jtac is a production command in the Development category of the Prismatic Platform that implements a Joint Terminal Attack Controller (JTAC) paradigm for precision code operations. Drawing from military tactical doctrine where a JTAC coordinates air-to-ground precision strikes, this command orchestrates targeted, surgical code modifications across the platform's 99 umbrella applications with minimal collateral impact and maximum effectiveness.

The JTAC approach is particularly valuable in a large-scale Elixir umbrella project where a single change can cascade through dozens of dependent applications. Traditional development workflows often result in broad, imprecise modifications that introduce unexpected regressions. The /jtac command addresses this by providing precise targeting capabilities -- identifying the exact modules, functions, and lines that need modification, analyzing the blast radius of proposed changes, and coordinating the execution to minimize disruption.

This command operates under the L3 authority level -- higher than standard development commands -- reflecting the elevated precision and impact of JTAC operations. It is executed by the elixir-core-specialist agent, the platform's most experienced Elixir developer agent with deep knowledge of OTP patterns, supervision trees, and cross-application dependencies. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard.

The command implements four operational phases: reconnaissance (target identification and analysis), planning (change strategy and blast radius assessment), execution (precise code modification), and verification (post-modification testing and validation). Each phase produces structured output that feeds into the next, creating an auditable chain of evidence for every code change.

Architecture

The JTAC system coordinates multiple subsystems to achieve precision code modification.

+---------------------+     +-------------------+     +-------------------+
| Reconnaissance      | --> | Planning Engine   | --> | Execution Engine  |
| (Target Analysis)   |     | (Strategy + Blast)|     | (Precision Apply) |
+---------------------+     +-------------------+     +-------------------+
  |                                |                          |
  v                                v                          v
+---------------------+     +-------------------+     +-------------------+
| Dependency Mapper   |     | Risk Assessor     |     | Verification      |
| (Cross-App Graph)   |     | (Impact Analysis) |     | (Test + Validate) |
+---------------------+     +-------------------+     +-------------------+
         |                                                    |
         v                                                    v
+---------------------+                              +-------------------+
| Target Designator   |                              | After-Action Report|
| (Precise Location)  |                              | (Evidence Chain)  |
+---------------------+                              +-------------------+

The Reconnaissance subsystem analyzes the codebase to identify targets matching the specified criteria. The Dependency Mapper builds a cross-application dependency graph to understand how targets relate to the broader system. The Target Designator produces precise file, module, and function-level target specifications. The Planning Engine develops a modification strategy, while the Risk Assessor computes blast radius and risk scores. The Execution Engine applies changes with surgical precision, and the Verification subsystem validates that the changes achieve the intended effect without introducing regressions.

Usage

Reconnaissance Operations

# Identify targets matching a pattern
/jtac recon --pattern "Process.sleep" --scope apps/

# Analyze a specific module as a potential target
/jtac recon --module PrismaticWeb.LiveDashboard --depth 3

# Map dependencies of a target function
/jtac recon --function "PrismaticStorage.ETS.get/2" --callers

# Scan for specific anti-pattern targets
/jtac recon --anti-pattern "length() > 0" --scope all

Planning Operations

# Plan a targeted modification with blast radius analysis
/jtac plan --target "apps/prismatic_web/lib/live/dashboard.ex:42" --change "replace"

# Plan a cross-application refactoring
/jtac plan --target-pattern "unsafe_map_access" --strategy incremental

# Preview blast radius of a proposed change
/jtac plan --target MyModule.function/2 --blast-radius

# Generate risk assessment for a planned operation
/jtac plan --target "lib/prismatic/api.ex" --risk-assess

Execution Operations

# Execute a planned JTAC operation
/jtac execute --plan jtac-plan-001

# Execute with dry-run (preview changes only)
/jtac execute --plan jtac-plan-001 --dry-run

# Execute with automatic rollback on test failure
/jtac execute --plan jtac-plan-001 --auto-rollback

# Execute and immediately verify
/jtac execute --plan jtac-plan-001 --verify

Verification Operations

# Verify a completed JTAC operation
/jtac verify --operation jtac-op-001

# Run targeted tests for affected modules
/jtac verify --operation jtac-op-001 --test-scope affected

# Generate after-action report
/jtac verify --operation jtac-op-001 --report

Options & Parameters

OptionTypeDefaultDescription
(subcommand)stringrequiredPhase: recon, plan, execute, verify
--patternstring-Code pattern to search for during reconnaissance
--modulestring-Specific module to analyze
--functionstring-Specific function to analyze (Module.function/arity)
--anti-patternstring-Known anti-pattern to detect
--scopestringallSearch scope: all, specific app name, or directory path
--depthinteger2Dependency analysis depth
--callersbooleanfalseShow callers of the target function
--targetstring-Precise target specification (file:line or Module.function/arity)
--target-patternstring-Pattern-based target specification
--strategystringsurgicalModification strategy: surgical, incremental, sweep
--blast-radiusbooleanfalseCompute and display blast radius analysis
--risk-assessbooleanfalseGenerate risk assessment for planned change
--planstring-Plan identifier for execution
--dry-runbooleanfalsePreview changes without applying
--auto-rollbackbooleantrueAutomatically rollback on test failure
--verifybooleanfalseRun verification immediately after execution
--test-scopestringaffectedTest scope: affected, full, unit, integration
--reportbooleanfalseGenerate after-action report
--formatstringtextOutput format: text, json, markdown
--verbosebooleanfalseShow detailed operational information

Execution Flow

  1. Mission Briefing: The command parses the subcommand and options, establishing the operational parameters. For execute operations, the referenced plan is loaded and validated.

  2. Reconnaissance (for recon subcommand): The codebase is scanned using AST-based analysis for the specified pattern, anti-pattern, or module. Cross-application dependency analysis maps the target's relationships. Results are presented as a target dossier.

  3. Planning (for plan subcommand): The planning engine develops a modification strategy based on the target specification. Blast radius is computed by traversing the dependency graph outward from the target. Risk assessment considers the target's centrality in the dependency graph, test coverage, and historical change frequency.

  4. Execution (for execute subcommand): The plan is applied with precision. Each modification is atomic -- either all changes in the plan succeed or none do. If --auto-rollback is enabled, test failures trigger immediate rollback to the pre-modification state.

  5. Verification (for verify subcommand): The verification engine runs targeted tests for all affected modules, checks compilation with --warnings-as-errors, runs Credo checks on modified files, and validates that quality gates pass. An after-action report documents the operation's outcome.

Integration Points

ComponentIntegration TypeDescription
Prismatic AgentsExecutionExecuted by the elixir-core-specialist agent
Quality GatesVerificationPost-operation quality validation
TelemetryObservabilityOperation metrics and audit trail
AIAD RegistryDiscoveryCommand registered via AIAD standard
GitVersion ControlAtomic commits with rollback support
CredoQualityModified file quality checks
DialyzerType SafetyType checking on modified modules
ExUnitTestingTargeted test execution for affected modules

Best Practices

Always run reconnaissance before planning. Understanding the target's dependency graph and blast radius before planning changes prevents unexpected cascading failures. Even for seemingly simple changes, the dependency analysis often reveals non-obvious impacts.

Use the surgical strategy for isolated fixes and incremental for broader pattern elimination. The sweep strategy is reserved for platform-wide anti-pattern removal and should only be used after thorough reconnaissance across the entire codebase.

Enable auto-rollback for all production-impacting changes. The cost of a rollback is minimal compared to the cost of a regression that reaches production. Manual rollback should only be used when you need to preserve partial progress from a partially successful operation.

Generate after-action reports for significant operations. These reports provide an auditable trail of what was changed, why, and what was verified. They are invaluable for post-incident analysis and knowledge transfer.

Prefer precision over speed. JTAC operations are not about making changes quickly; they are about making changes correctly. Take time in the reconnaissance and planning phases to ensure the execution is clean and complete.

Error Handling

Error ConditionResponseRecovery
Target not foundLists similar targets with edit distanceRefine target specification
Circular dependency detectedShows dependency cycle with pathRestructure to break cycle before proceeding
Blast radius exceeds thresholdWarns and requires explicit confirmationUse --strategy incremental to reduce scope
Test failure during executionAuto-rollback to pre-modification stateInvestigate failure, refine plan, re-execute
Compilation error after modificationAuto-rollback with error detailsFix compilation issues in plan
Plan validation failureShows plan inconsistenciesRegenerate plan with corrected parameters

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. JTAC operations are atomic -- partial execution is never acceptable. All modified code must pass compilation, testing, linting, and quality gates. Rollback is automatic on any failure.
  • NO DOUBTS: Full investigation before action, evidence-based results. The reconnaissance and planning phases ensure complete understanding before execution. Every decision is documented in the after-action report. No change is applied without evidence that it achieves the intended effect.

The JTAC paradigm embodies the NABLA Infinity principle of exploring uncertainty thoroughly (reconnaissance) before committing to decisive action (execution), with the transition governed by confidence thresholds and trinity gate passage.


Connect & Contribute

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