npx skills add ...
npx skills add keyvaluesoftwaresystems/netra-skills --skill netra-best-practices
Code-first Netra best-practices playbook covering setup, instrumentation, context tracking, custom spans/metrics, integration patterns, evaluation, simulation, and troubleshooting.
npx skills add keyvaluesoftwaresystems/netra-skills --skill netra-best-practices
Use this skill as the end-to-end guide for integrating, operating, and improving AI systems with Netra.
Before doing anything else, determine whether the project is Python or TypeScript/JavaScript. Check the project root in this order:
| Signal file | Language |
|---|---|
pyproject.toml, setup.py, requirements.txt, Pipfile | Python |
package.json, tsconfig.json, bun.lockb | TypeScript / JavaScript |
If both are present (monorepo), ask the user which sub-project they are working on. If neither is found, ask the user.
From this point forward, use ONLY the references for the detected language. Never mix Python and TypeScript patterns.
Detect the package manager before installing netra-sdk. Check in priority order:
| Priority | Signal file | Command |
|---|---|---|
| 1 | uv.lock | uv add netra-sdk |
| 2 | poetry.lock | poetry add netra-sdk |
| 3 | pyproject.toml (no lock file above) | pip install netra-sdk |
| 4 | requirements.txt (no Python indicators above) | pip install netra-sdk |
| 5 | yarn.lock | yarn add netra-sdk |
| 6 | pnpm-lock.yaml | pnpm add netra-sdk |
| 7 | package-lock.json | npm install netra-sdk |
| 8 | bun.lockb | bun add netra-sdk |
| 9 | None found | Ask the user before proceeding |
Do NOT run multiple install commands or install globally.
Based on the detected language and the user's use case, read the appropriate reference files:
references/python/)| Use case | Reference file |
|---|---|
| Instrumenting an LLM application | python/instrumentation.md |
| Running evaluations / test suites | python/evaluation.md |
| Running multi-turn simulations | python/simulation.md |
| Custom metrics (counters, histograms, gauges) | python/custom-metrics.md |
references/typescript/)| Use case | Reference file |
|---|---|
| Instrumenting an LLM application | typescript/instrumentation.md |
| Running evaluations / test suites | typescript/evaluation.md |
| Running multi-turn simulations | typescript/simulation.md |
| Custom metrics (Currently not supported for TS) | typescript/custom-metrics.md |
Follow these rules strictly when generating Netra code:
NEVER use enum values not listed in the Netra's official documentation. Do not guess.
NEVER mix Python and TypeScript conventions. Specifically:
snake_case parameters (as_type, module_name, app_name)camelCase parameters (asType, moduleName, appName){InstrumentSet.OPENAI} (plain set literal)new Set([NetraInstruments.OPENAI]) (Set constructor)Respect lifecycle differences:
Netra.init(...) is synchronousawait Netra.init(...) is asynchronous — always await itwith Netra.start_span(...) as span: auto-closesspan.end() must be called manually in finallyWhen unsure about an API, follow the doc-fetching protocol below rather than guessing.
If a use case is not covered by the reference files:
https://docs.getnetra.ai/llms.txtIf the user is unhappy with the results, ask them to open an issue at https://github.com/KeyValueSoftwareSystems/netra-skills/issues/new.