Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

dependency-direction-analysis

/dependency-direction-analysis

Uruchamia detektor kierunku zależności w ddtrace i proponuje poprawki architektoniczne dla wykrytych naruszeń.

Repozytorium
dd-trace-py ↗
Licencja
BSD-3-Clause
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

BSD-3-Clause, otwarta.

Co robi i kiedy

Uruchamia detektor kierunku zależności w ddtrace i proponuje poprawki architektoniczne dla wykrytych naruszeń.

Oryginalny opis (EN)

Run the dependency direction detector against ddtrace and propose architectural fixes for any violations found. Use this when adding or refactoring modules under ddtrace/internal, ddtrace/contrib, or any product package, or when the detect_layering_violations CI job reports new violations on a PR.

Jak działa

  1. Resolve the ownership problem
Sekcje z nagłówków SKILL.md, w oryginale · 59 linii, 535 słów
Podgląd SKILL.md
---

name: dependency-direction-analysis
description: >
  Run the dependency direction detector against ddtrace and propose architectural
  fixes for any violations found. Use this when adding or refactoring modules
  under ddtrace/internal, ddtrace/contrib, or any product package, or when the
  detect_layering_violations CI job reports new violations on a PR.
allowed-tools:
  - Bash
  - Read
  - Grep
  - Glob
  - Edit
  - TodoWrite
---

# Dependency direction

`scripts/import-analysis/layers.json` is the authority for zones, foundation modules, and
intentional exceptions. `internal-core`/`contrib` imports into products and imports between
products are restricted; the configured contrib-to-tracing exception is intentional.
Explicitly listed foundation modules are exempt from these dependency-direction rules.

```bash
uv run --script scripts/import-analysis/layers.py analyze --root <candidate-checkout>/ddtrace <candidate.json>
uv run --script scripts/import-analysis/layers.py analyze --root <merge-base-checkout>/ddtrace <base.json>
uv run --script scripts/import-analysis/layers.py compare <base.json> <candidate.json>
```

Run both analyses with the candidate's detector and adjacent `layers.json`, matching CI;
only the source tree passed through `--root` changes. Keep outputs in a temporary location.
The result lists `violations` and `uncovered` top-level modules. Read the detector's current
comparison rules when diagnosing CI; severity scores prioritize investigation, not correctness.

For each violation, `from`/`to` identify the importing/imported modules and `from_zone`/`to_zone`
show their classified owners. `in_tangle` means the target participates in a circular-import
component; it does not by itself prove this particular edge creates the cycle.

`score` combines the rule's weight, how many modules depend on the target, and a cycle bonus.
Within the task's scope, investigate high scores and tangled targets first; read the current
formula in `layers.py`. A lower score does not make a forbidden dependency acceptable.

`uncovered` identifies top-level modules missing a zone or foundation classification. Resolve
that configuration gap explicitly; new uncovered modules fail the comparison independently of
violation scores. The comparison also distinguishes new edges from worsened existing edges.

## Resolve the ownership problem

- Trace the names crossing the boundary. Move misplaced code to its owner, extract a genuinely
  shared contract, or use core events / registration to keep the dependency pointing downward.
- Security products subscribe to contrib events; see `.cursor/rules/isolated-responsibility.mdc`.
- When shared machinery needs product behavior, define a narrow `Protocol` or callback contract
  at the shared boundary and let the product supply its implementation through the existing
  lifecycle. `Product` in `ddtrace/internal/products.py` is an example of a lifecycle contract.
- For types/constants needed by multiple products, extract only the common contract into a
  classified shared module. Keep product implementation imports out of that module, including
  imports through convenience re-exports that would recreate the dependency.
- Move product-specific behavior into its owning product. Move a utility into shared code only
  when it is genuinely product-independent; a helper's current location alone does not decide ownership.
- Do not relocate public product contracts such as `Tracer` or `Span` into shared code just to
  satisfy the detector. They are exported by `ddtrace/trace/__init__.py`; preserve that API and
  product ownership, using a narrower interface or event for other products' needs.
- Classify new top-level modules in `layers.json`: product code belongs in its product zone;
  shared foundation code must be explicitly listed. Product-owned `internal` packages need
  the corresponding zone mapping rather than falling into generic internal-core.
- Do not move code into an unclassified module merely to evade the check. Do not hide violations
  using deferred imports. Use `circular-import-analysis` for cycles.
- Propose a zone exception only for a deliberate, durable dependency, with the architectural
  reason explicit in the PR for human review. Do not decide unilaterally that an exception is
  acceptable merely to make the check pass.

Rerun both analysis and base comparison to confirm that the intended violation is resolved and
no new violations or uncovered modules were introduced.

Wersje

W bazie nie ma innych skilli o nazwie dependency-direction-analysis.

Migawka bazy z 13.11.2026 · wersja paczki 2cd39cb6dc22 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 96circular-import-analysis
    Wykrywa cykliczne importy w bibliotece ddtrace i proponuje poprawki architektury, gdy przy zmianach pojawiają się nowe cykle.
  • 100go-architecture-review
    Recenzuje architekturę projektu Go: struktura pakietów, kierunek zależności, warstwy, podział odpowiedzialności, modelowanie domeny i granice modułów, w tym rozbijanie monolitów.
  • 90thermo-nuclear-architecture-review
    Przeprowadza bardzo surowy przegląd architektury i projektu systemu pod kątem sprzężeń, naruszeń granic, kierunku zależności, warstw i strukturalnego rozkładu.
  • 90uds-architecture
    Pomaga wybrać lub przejrzeć strukturę aplikacji, granice modułów, kierunek zależności, własność logiki i decyzje architektoniczne.
  • 100agent-observability-experiment-bootstrap
    Tworzy szkielet powtarzalnego eksperymentu LLM Observability przez SDK ddtrace w Pythonie lub dd-trace w Node: dataset, evaluator, benchmark, regresja i LLM-as-a-judge.
  • 100architecture
    Mapuje architekturę projektu: zależności między modułami, sprzężenie, graf zależności i granice modułów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.