一键导入
otel-tracing
Software factory OpenTelemetry tracing — use when emitting traces for factory work. Covers root trace, phase sub-traces, and bi-directional linking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Software factory OpenTelemetry tracing — use when emitting traces for factory work. Covers root trace, phase sub-traces, and bi-directional linking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Software factory clarification — use when gathering requirements before planning. Runs structured Q&A to produce a confirmed clarification summary.
Software factory memory protocol — use when reading or writing factory state. Covers JSONL memory operations, well-known keys, and agent startup protocol.
Software factory spec and planning — use when producing a technical spec and phased implementation plan after clarification is confirmed.
Software factory TDD implementation — use when implementing a phase. Enforces red-green discipline and code security standards before committing.
Software factory validation gate — use when checking phase completion. Verifies automated tests pass and coordinates manual validation if required.
Software factory master workflow — use when starting or orchestrating a full factory run, coordinating clarification → spec → TDD implementation → validation phases.
| name | otel-tracing |
| description | Software factory OpenTelemetry tracing — use when emitting traces for factory work. Covers root trace, phase sub-traces, and bi-directional linking. |
| version | 0.1.0 |
Factory work emits OTLP traces to http://localhost:4317 (configurable via OTEL_EXPORTER_OTLP_ENDPOINT).
Set SF_OTEL_ENABLED=0 to disable export without breaking anything (useful in tests).
main_trace_id + main_span_id.factory.phase_started) for forward traceability (root → phase).Every telemetry.py call is a fresh process. Each command creates an instantaneous span, ends it, and exports it before exit (using SimpleSpanProcessor). No state is held in memory between calls. Returned IDs are stored in memory.py for cross-call correlation.
# At task start: emit root span, store IDs
ROOT=$(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry.py" start-root --task "feature-name")
ROOT_TRACE=$(echo "$ROOT" | python3 -c "import sys,json; print(json.load(sys.stdin)['trace_id'])")
ROOT_SPAN=$(echo "$ROOT" | python3 -c "import sys,json; print(json.load(sys.stdin)['span_id'])")
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" write --key main_trace_id --value "\"${ROOT_TRACE}\""
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" write --key main_span_id --value "\"${ROOT_SPAN}\""
# When starting a phase: emit phase span (independent trace, links back to root)
PHASE=$(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry.py" start-phase \
--phase "planning" --root-trace-id "${ROOT_TRACE}" --root-span-id "${ROOT_SPAN}")
PHASE_TRACE=$(echo "$PHASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['trace_id'])")
PHASE_SPAN=$(echo "$PHASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['span_id'])")
# Emit forward link: instantaneous span in root trace recording child trace_id (root → phase)
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry.py" emit-forward-link \
--root-trace-id "${ROOT_TRACE}" --root-span-id "${ROOT_SPAN}" \
--child-trace-id "${PHASE_TRACE}" --child-span-id "${PHASE_SPAN}" --phase "planning"
# Store phase context in memory
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" write --key "phase_trace:planning" --value "\"${PHASE_TRACE}\""
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/memory.py" write --key "phase_span:planning" --value "\"${PHASE_SPAN}\""
# Emit a discrete factory event within a trace
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/telemetry.py" emit-event \
--trace-id "${PHASE_TRACE}" --parent-span-id "${PHASE_SPAN}" \
--name "factory.validation" --attrs '{"result":"pass","tests_run":42}'
| Span | When |
|---|---|
factory.task | Full workflow duration (root trace) |
factory.phase | Each implementation phase (sub-trace) |
factory.validation.automated | After running test suite |
factory.validation.manual | After user manual confirmation |
factory.checkpoint | After git commit checkpoint |