---
name: factor-08-concurrency
description: "Trigger: factor 08, concurrency, twelve-factor concurrency. Guide explicit process-model design and audits."
license: Apache-2.0
metadata:
  author: gentleman-programming
  version: "1.0"
  kind: factor-node
  decision_tree: references/decision-tree.md
---

## Activation Contract

Load this skill when working on Factor VIII: Concurrency in greenfield design or existing-project audit mode.

## Hard Rules

- Teach first: the app is divided into named process types, and each type scales horizontally by changing its process count.
- Follow `twelve-factor-methodology` before acting.
- Use `references/decision-tree.md`; do not branch from prose only.
- Collect only metadata: process type names, descriptor paths, command names without secret args, queue/topic names, scale key names, object names, and presence flags.
- Never read, copy, log, or surface raw env values, credentials, private autoscaler targets, queue payloads, logs, or secret-bearing file contents.
- Do not flag an explicitly declared singleton process when its count and constraint are documented.

## Decision Gates

| Situation | Action |
|---|---|
| `greenfield` mode | Return required process-model decisions and omit findings. |
| `audit` mode | Collect safe metadata only, evaluate the tree, then return finding or gaps. |
| Mode or app boundary unclear | Ask one clarification and stop. |
| Hidden work, singleton, or shutdown risk appears | Record cross-factor revalidation. |

## Execution Steps

1. Emit the Factor VIII concept summary from `references/factor-notes.md`.
2. Read `references/decision-tree.md` and confirm mode, app boundary, process-type model, scale unit, background work, worker queue, scheduler singleton, platform scale controls, stateless compatibility, port-bound service scaling, admin separation, secret safety, and evidence sufficiency.
3. In audit mode, collect only sources allowed by `references/evidence.md`.
4. Return the output contract and cross-factor revalidation targets.

## Output Contract

Return `mode`; for audit return `finding`, `evidence`, `remediation_hint`, `revalidate_factors`, and `questions` only for gaps. For greenfield return `design_decisions`, `revalidate_factors`, and omit `finding` and `remediation_hint`.

## References

- `references/factor-notes.md` — Factor VIII doctrine and allowed interpretations.
- `references/evidence.md` — safe evidence sources, denied patterns, and gaps.
- `references/decision-tree.md` — deterministic branching logic.
