03 coding

From Pandaala/Edgion · View interactive version

03 coding is an AI agent skill from the GitHub repository Pandaala/Edgion. Coding standards skill for Edgion. Use when reviewing or writing code that touches logging, tracing IDs, log safety, access logs, metrics, structured tracing, time/timestamp/duration formatting, or shared project-wide implementation rules.

How to use this skill

Skill file

Coding Standards

Edgion project-wide coding standards. Covers logging and ID propagation, sensitive-information leakage prevention, control-plane / data-plane log separation, and observability design (Access Log / Metrics / control-plane Tracing).

These standards are mandatory. New code must comply; existing code is brought into alignment incrementally as it is modified.

Core principles

  1. Single-line access log reconstruction — one access log entry contains enough information to locate a problem without flipping through other logs
  2. Record only key checkpoints — record final decisions and exception paths; do not record process steps or intermediate state
  3. Avoid metrics explosion — no new histogram without explicit review, strict label cardinality, unified management
  4. Zero tracing on the data plane — tracing::* macros are forbidden on the data-plane hot path

Information layering

| Layer | Tool | Target audience | Retention |

|------|------|---------|---------|

| Request granularity | access log (JSON) | ops troubleshooting, audit | days~weeks |

| System events | tracing::info/warn/error | developer debugging, alerts | hours~days |

| Performance aggregation | Prometheus metrics | SRE, Grafana | months |

File list

Logging and safety

| File | Topic |

|------|------|

| 00-logging-and-tracing-ids.md | Log ID propagation: rv / sv / key_name triple, ensures control plane → data plane correlation |

| 01-log-safety.md | Log safety: no sensitive info in logs, no config leakage, tracing forbidden on data plane |

Rust coding rules

| File | Topic |

|------|------|

| 02-rust-coding-rules.md | Rust coding rules: short import paths, unwrap ban, judicious Clone, actionable error messages |

| 03-time-conventions.md | Time conventions: duration (GEP-2257), monotonic Instant, RFC3339 Z-seconds timestamps (now_rfc3339), hot-path epoch-millis logs — which surface uses which shape and why |

Observability — [observability/](observability/)

| File | Topic |

|------|------|

| observability/00-access-log.md | Access Log design: field structure, PluginLog format (including push_err error-entry API), common-scenario quick reference |

| observability/01-metrics.md | Metrics rules: how to add, label constraints, Test Metrics, prohibitions |

| observability/02-tracing-and-logging.md | Control-plane logging: structured Tracing, level selection, error context, instrument naming |

Pre-commit self-check list

Log safety

Rust coding

Observability

DSL plugin implementation — [dsl/](dsl/)

See dsl/SKILL.md for the sub-directory index and cross-links to the DSL engine architecture, URI normalization, and the Value-type design memo.

| File | Topic |

|------|------|

| dsl/builtins-path.md | DSL path/URI variable reference: req.path, req.uri, req.query, and the difference between them |

| dsl/builtin-error-semantics.md | DSL builtin error-handling contract: silent-fallback vs RuntimeError::ApiError grouping, lock-in tests, "adding a new builtin" decision flow |

| dsl/http-call.md | http.call() builtin: async outbound HTTP, Value::Map, SSRF guard, config fields, test patterns |

| dsl/redis-builtin.md | redis.* builtins: async LinkSys Redis interaction, named alias lookup, return Map {ok, value, error} |

Relation to other Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.