cilipep/ai-agent-with-tslab/tslab-indicator-authoring
- community
Checking that the SKILL.md file is still in the repository.
Author C# indicator/handler DLLs for TSLab: pick correct handler interfaces (stream vs values vs precalc), apply TSLab attributes, use canonical helper APIs (Series/Indicators), and implement optimization-safe caching/memory pooling (IContext.GetData, IMemoryManagement). Package and load via HandlersFolder hot reload or upload/replace/delete via /api/indicator-dlls (DB-backed).
Install
npx vskill@latest install cilipep/ai-agent-with-tslab/tslab-indicator-authoringSKILL.md
TSLab: C# Indicator Authoring (Handler DLLs)
Use this skill when the user asks to implement an indicator in C# (a handler class), compile it into a .dll, and load it into TSLab (disk handlers folder or DB via Web API).
If the user asks to use an existing indicator inside a block script (wire blocks via API ops), prefer $tslab-indicator-blocks and $tslab-api-script-edit.
What The Agent Should Do (End-to-End)
When acting as an implementation agent, follow this exact loop and report back what happened:
- Get the runtime contracts (do not guess):
GET /api/sdk/contracts- Use this response as the runtime source of truth for:
- which marker interfaces/attributes exist
- observed
Execute(...)/PreCalc(...)signatures that actually occur in this build - copy/paste-ready templates (safe starting points)
- If you need details for a specific type/method:
GET /api/sdk/types/details?name=<FullTypeName>
- Confirm the indicator spec:
- Inputs and their types (price series, security, positions, option series, etc.)
- Output type(s) and count
- Parameters (periods, flags, thresholds)
- Stream vs values expectation (and whether bar index / precalc is needed)
- Implement the handler code by starting from a shipped template:
- Use
references/examples-templates.mdand adapt minimally.
- Package as a DLL:
- Create/update a small class library project that references TSLab handler contracts (
TSLab.Script.Handlers) and helper APIs (TSLab.Script.Helpers). - Build in Debug when the user wants PDB/breakpoints.
- Load and verify:
- Disk hot reload: copy
.dll(and.pdb) to HandlersFolder. - DB upload: use
/api/indicator-dlls/{name}withdescription. - Verify the handler is discoverable and schema is correct via:
GET /api/handlersandGET /api/handlers/{typeName}
- Provide a short outcome report:
- Handler
typeName - How it was loaded (disk vs DB) + name/version
- Description sources: API
description+ embedded resource keys - Any caveats (stream/value wiring, caching keys, optimization)
Hard Rules
- Do not reference repo source files (they are not available in delivery agent environments). Use:
GET /api/sdk/contractsandGET /api/sdk/types/detailsGET /api/handlers/{typeName}- Do not reinvent core primitives. Use the existing TSLab APIs (available at runtime in TSLab):
TSLab.Script.Helpers.SeriesTSLab.Script.Helpers.IndicatorsTSLab.Script.Handlers.IContext(GetData, memory context, optimization flags)- For temporary buffers, prefer pooled arrays (
Context.GetArray<T>/Context.ReleaseArray) and passContextintoSeries.*where supported. - Cached data from
Context.GetData(...)must be treated as immutable. Never mutate lists/arrays returned from cache. - If several exported handlers share an expensive base calculation over the same
ISecurity/series and parameters, compute that base once throughContext.GetData(...)and reuse it. Do not make sibling handlers each rescan the sameBarswindow, allocate per-bar bin arrays, or recompute the same regression/profile loop independently. - A lifecycle timeout on a freshly uploaded DLL is usually a handler-performance bug, not a reason to wait longer or change providers. Reduce unsafe defaults, replace per-bar nested scans with rolling/cached bulk series, rebuild/upload the DLL, and rerun the same artifact.
Quick Workflow (Author -> Load -> Verify)
- Decide the handler mode:
- Market data series: usually stream (
IStreamHandler). - Trading/positions/account analytics: usually values (
IValuesHandler*). - If values mode requires pre-pass:
IValuesHandlerWithPrecalc+PreCalc(...). - If values mode needs bar index:
IValuesHandlerWithNumber. - Read:
references/contracts-stream-vs-values.md.
- Implement the handler:
- Use the shipped templates/snippets in this skill (and mirror TSLab built-in patterns).
- Use
Series.*/Indicators.*helpers and optimization-safe pooling/caching. - Read:
references/examples-templates.md,references/helpers-series-indicators.md,
references/caching-and-memory.md.
- Add metadata:
[HandlerCategory],[Description].[InputsCount]+[Input(..., isValue: ...)],[OutputsCount],[OutputType].- Embedded resources for handler display name/description (optional but recommended).
- Read:
references/attributes-and-metadata.md.
- Package and load:
- Disk: copy
.dll(and.pdbfor debugging) intoHandlersFolder. Hot reload should pick it up. - DB: upload via Web API:
- Use
$tslab-api-indicator-dllsandPOST /api/indicator-dlls/{name}with multipartfileand optionaldescription.
- Verify:
GET /api/handlersandGET /api/handlers/{typeName}should show the handler and its IO/params.- Add it to a test script and run once.
What To Read Next (Only When Needed)
- Stream/value/precalc rules and
InputAttribute.IsValue:references/contracts-stream-vs-values.md - Attributes and embedded resources for descriptions:
references/attributes-and-metadata.md - Using
Series/Indicatorscorrectly:references/helpers-series-indicators.md - Caching + memory pooling + optimization gotchas:
references/caching-and-memory.md - Shipped templates you can copy/paste:
references/examples-templates.md - Build vs source-only + upload modes:
references/build-and-upload-workflow.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.mimocode/skills/tslab-indicator-authoring/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cilipep/ai-agent-with-tslab/tslab-indicator-authoring)