forcedotcom/sf-skills / plugins/builder/agentforce-adlc/skills/agentforce-architecture-analyze
agentforce-architecture-analyze
VerifiedDeclared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).
scripts/parallel_retrieve.py
View on GitHub"""ThreadPoolExecutor orchestrator for Wave B body fetches.
one failure MUST NOT abort the whole run. Callers merge failed kinds
into `_unresolved[]` with `reason=f'{kind}-fetch-failed:{redact_error(exc)}'`
and emit STATUS=PARTIAL_OK. We return a mixed list of (ok, result_or_exc)
tuples instead of raising on the first failure — which is what
`ThreadPoolExecutor.map` would do (and silently cancel remaining work in
the process).
Exception identity is preserved on the failure path: callers get the exact
exception object back so they can run it through `rest_client.redact_error`
at the point of logging. We intentionally do NOT stringify here — doing so
would lose structured info (urllib.error.HTTPError.code, etc.) and could
leak tokens into intermediate strings before redaction runs.
"""
from __future__ import annotations
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Callable
def fetch_bodies_parallel(
tasks: list[Callable[[], object]],
*,
max_workers: int = 5,
) -> list[tuple[bool, object]]:
"""Run zero-arg callables in parallel; return (ok, result_or_exc) per task.
contract:
* Each `task` is a zero-arg callable (use `functools.partial` to bind
args at the call site).
* On success, `(True, return_value)` is appended.
* On any exception, `(False, exc)` is appended — the EXC object itself,
not a stringification. Callers run it through `rest_client.redact_error`
before logging.
* Results are returned in INPUT ORDER, not completion order. Callers
frequently zip results back to their input tasks to identify which
target failed; completion order would break that contract.
* Empty task list returns `[]` without spinning up a pool.
* `max_workers=1` serializes — tasks run sequentially but the as_completed
path is still used (deterministic ordering preserved via index map).
* This function NEVER raises on a task failure. It may propagate
programmer errors (e.g., a non-callable in `tasks`) at submit time;
that's a bug surface, not a runtime failure mode.
"""
if not tasks:
return []
# Pre-size the results list so we can assign by input index. This keeps
# output ordering deterministic and independent of completion timing,
# which matters for callers that identify failures positionally.
results: list[tuple[bool, object] | None] = [None] * len(tasks)
with ThreadPoolExecutor(max_workers=max_workers) as pool:
future_to_idx = {pool.submit(task): i for i, task in enumerate(tasks)}
for fut in as_completed(future_to_idx):
idx = future_to_idx[fut]
try:
results[idx] = (True, fut.result())
except Exception as exc: # noqa: BLE001 — see contract above
# Preserve exc identity; do NOT stringify here. Callers run
# this through rest_client.redact_error at log time .
# We catch Exception (not BaseException) so KeyboardInterrupt
# / SystemExit still propagate — those signal shutdown, not a
# task failure.
results[idx] = (False, exc)
# All slots filled by construction — futures/indexes are 1:1 with input.
return [r for r in results if r is not None] # type: ignore[return-value]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |