How fintan-contents/promptis works
Main Components
• VS Code Host & Extension Host
• Extension Activation Module (extension.ts)
• Command Dispatcher & ChatHandler (chatHandler.ts)
• Prompt Loader & Utilities (chatutil.ts, util.ts)
• Configuration Manager (config.ts)
• OpenAPI-generated Chat API Client (src/openapi + api.ts)
• Prompt Repository (prompts/*.md)
• Build & Packaging Toolchain (esbuild.js, package.json, .devcontainer)
• CI/CD & Testing (GitHub workflows, src/test)
• External Services:
– GitHub Copilot Chat Extension / Chat Service API
– Telemetry Server
Relationships and Data Flows
• Developer workspace → esbuild → packaged VS Code extension (vsix) → Marketplace/Local install
• GitHub Actions → lint / test / release workflows → artifact publication
1. User types “@promptis /command” in a VS Code editor chat window
2. VS Code Extension Host invokes extension.ts → registers the command
3. Command Dispatcher (chatHandler) loads matching prompt files from the prompts directory via chatutil
4. Configuration Manager supplies paths/filters from config.ts or user settings
5. ChatHandler calls Chat API via api.ts, which uses the OpenAPI client under src/openapi
6. Chat responses flow back into VS Code chat UI
7. Telemetry events collected and sent to the telemetry server (optional)
• Unit tests in src/test cover modules (api.test.ts, chatHandler.test.ts etc.)
• GitHub Actions run tests and coverage reporting
Architectural Patterns & Principles
• Modular separation: Activation → Command Handling → Prompt Loading → API Calling → UI Display
• Single-Responsibility:
– extension.ts: registration/activation
– chatHandler.ts: orchestration of commands
– chatutil.ts/util.ts: file I/O, prompt parsing, filtering
– api.ts + OpenAPI client: HTTP client abstraction
• Code Generation: OpenAPI generator produces the client in src/openapi from openapi.yaml
• Configuration-as-Code: user settings align with config.ts defaults
• Test-driven: structured test directory mirrors src modules