Production patterns for building reliable agentic engineering pipelines — pre-hook interceptors, composable skills, and closed-loop evaluation loops.
This is a simplified reference implementation of patterns used in a production agentic SDLC automation platform deployed at Salesforce, powering AgentForce and Agent Voice features within Field Service Lightning.
The platform is built around three composable primitives:
Intercept agent execution before a phase runs. Hooks can inspect, enrich, or halt the context. Multiple hooks chain in registration order — fail-fast.
Request → [IPRiskGuard] → [ContextEnricher] → [RateLimiter] → Skills
Built-in hooks:
- IPRiskGuard — blocks execution if payload contains sensitive IP patterns
- ContextEnricher — injects runtime metadata before execution
- RateLimiter — token-bucket rate limiter per task
Discrete, stateless units of agent capability. Skills are registered and chained — all state lives in AgentContext.
[CodeSynthesisSkill] → [TestRunnerSkill] → [EvaluationLoop]
In production, each skill wraps a Claude API call with a specialized system prompt. The skill interface keeps agent logic modular, testable, and independently deployable.
The core of what makes the system self-healing. Evaluates output quality and decides:
- Pass → continue to next phase
- Remediate → retry with feedback (up to
max_retries) - Fail → halt pipeline with structured error
Output → Evaluator → Pass? → Continue
→ Fail? → Remediate → Retry
→ Max retries → Halt
In production, the pipeline automates the complete software development lifecycle as a closed feedback loop:
requirements ingestion
↓
architecture generation
↓
code synthesis ← Claude API
↓
automated test execution
↓
performance telemetry collection
↓
root cause analysis
↓
autonomous remediation ← or executive summary rollup
↓
iteration / done
# No dependencies — runs on Python 3.10+
python agentic_pipeline.pyExpected output:
INFO [task-001] CodeSynthesisSkill: code generated
INFO [task-001] TestRunnerSkill: tests complete
INFO [task-001] Evaluation attempt 1: score=0.91 passed=True
==================================================
Task: task-001
Halted: False
Errors: none
Evaluation: {'score': 0.91, 'attempts': 1}
==================================================
class DocumentationSkill(Skill):
def execute(self, ctx: AgentContext) -> AgentContext:
code = ctx.payload.get("generated_code", "")
# In production: call Claude API to generate docstrings
ctx.payload["documentation"] = f"# Auto-generated docs for:\n{code[:100]}"
return ctxclass AuditLogger(PreHookInterceptor):
def intercept(self, ctx: AgentContext) -> None:
logger.info(f"AUDIT: task={ctx.task_id} phase={ctx.phase.value}")
# Write to your audit trail / SIEMpipeline = (
AgentPipeline()
.register_hook(IPRiskGuard())
.register_hook(AuditLogger())
.register_skill(CodeSynthesisSkill())
.register_skill(DocumentationSkill())
.register_skill(TestRunnerSkill())
.set_evaluation_loop(
EvaluationLoop(
evaluator=my_evaluator,
max_retries=3,
pass_threshold=0.9,
)
)
)
result = pipeline.run(AgentContext(
task_id="task-002",
phase=AgentPhase.CODE,
payload={"design_spec": "Implement exponential backoff"},
))- Fail fast —
haltedpropagates immediately, no partial execution - Observable — every step logs with
task_idfor distributed tracing - Composable — hooks and skills are registered, not hardcoded
- Stateless skills — all state in
AgentContext, skills are pure functions - Self-healing — evaluation loop + remediation closes the feedback cycle
This reference implementation simplifies a production system that:
- Manages multi-agent orchestration across 6+ specialized agents
- Integrates with Claude APIs for LLM-powered code synthesis, evaluation, and remediation
- Deploys across Salesforce Field Service Lightning's AgentForce and Agent Voice features
- Runs as a closed feedback loop replacing manual engineering intervention across planning, development, and QA cycles
Vinoth Suryanarayanan Principal Engineer, Salesforce | PhD, Computer Science, University of Birmingham Google Scholar