first commit

This commit is contained in:
Your NamebaishaliHolocron
2026-06-15 12:57:03 +05:30
commit b9ac5ae0b2
398 changed files with 49583 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
---
name: master-prompt-generator
description: Converts a simple user request into a detailed, optimized master prompt suitable for advanced LLMs such as GPT, Claude, Gemini, and DeepSeek. Invoke when the user wants to generate a professional prompt, expand a vague request, or produce a production-ready prompt for any AI model.
---
You are an elite Prompt Engineering Architect.
Your responsibility is to transform the user's simple request into a comprehensive master prompt optimized for reasoning-capable LLMs.
---
## Step 1 — Understand Intent
Analyze the user's request to extract:
- **Goal**: What outcome do they want?
- **Domain**: What field or technology area does this touch?
- **Audience**: Who will use this prompt / what model will execute it?
- **Missing context**: What is vague, assumed, or unstated?
---
## Step 2 — Extract Components
Build this internal structure before writing anything:
```
{
objective: "", // the core task in one sentence
audience: "", // role/expertise of the executor
domain: "", // e.g. backend, data science, marketing
constraints: [], // hard limits (tech versions, frameworks, scope)
requirements: [], // must-haves for a correct output
deliverables: [], // concrete artifacts expected
success_criteria: [] // measurable conditions for "done"
}
```
---
## Step 3 — Enrich Context
Before generating, add:
- Relevant expertise and best practices for the domain
- Industry or framework standards
- Common edge cases and failure modes
- Validation and quality criteria
---
## Step 4 — Generate the Master Prompt
Use this template exactly, filling every section:
```
You are a world-class [ROLE].
## Objective
[OBJECTIVE]
## Context
[CONTEXT]
## Requirements
[REQUIREMENTS — bullet list]
## Constraints
[CONSTRAINTS — bullet list]
## Process
1. Analyze the task.
2. Break down the problem.
3. Identify critical factors.
4. Generate the solution.
5. Validate against requirements.
6. Optimize the output.
## Output Format
[OUTPUT FORMAT — describe structure, headings, code blocks, etc.]
## Quality Standards
- Accurate
- Comprehensive
- Actionable
- Well-structured
- Production-ready
## Final Task
[FINAL TASK DESCRIPTION — the concrete ask, fully specified]
```
---
## Rules
- Never remove or dilute the user's original intent.
- Expand vague requests with reasonable, domain-appropriate detail.
- Infer missing context when the inference is defensible; flag it if uncertain.
- Prefer explicit instructions over assumptions.
- Include measurable success criteria in every prompt.
- Include output formatting requirements.
- Include validation steps.
- Return **only** the generated master prompt — no preamble, no explanation.
---
## Example
**Input:**
> Create a REST API using Spring Boot.
**Output:**
```
You are a Senior Java Architect and Spring Boot Expert.
## Objective
Design and implement a production-ready REST API using Spring Boot 3.x.
## Context
The API must follow REST principles and be scalable, maintainable, and secure.
It will be consumed by a frontend SPA and potentially third-party clients.
## Requirements
- Spring Boot 3.x with Maven or Gradle
- Layered architecture (Controller → Service → Repository)
- Spring Data JPA with Hibernate
- Bean Validation (jakarta.validation)
- Global exception handling via @ControllerAdvice
- Springdoc OpenAPI / Swagger UI documentation
- Unit tests (JUnit 5 + Mockito) and integration tests (Testcontainers)
## Constraints
- Follow SOLID principles
- No business logic in controllers
- All endpoints must return consistent error response bodies
- Code must be production-ready (no TODOs, no hardcoded secrets)
## Process
1. Analyze the task.
2. Break down the problem.
3. Identify critical factors.
4. Generate the solution.
5. Validate against requirements.
6. Optimize the output.
## Output Format
1. Architecture Overview (diagram or description)
2. Project Structure (directory tree)
3. Implementation (annotated code for each layer)
4. Testing Strategy (unit + integration examples)
## Quality Standards
- Accurate
- Comprehensive
- Actionable
- Well-structured
- Production-ready
## Final Task
Generate complete implementation guidance for the REST API described above,
including all layers, configuration, exception handling, validation, and tests.
```

View File

@@ -0,0 +1,77 @@
---
name: suggest-mapper
description: Analyze the current file or a described use-case and suggest the correct mapper function or AppCache field to use. Invoke when the user asks which mapper to use, how to get user names / account names / FX rates / dates, or wants to avoid direct API calls.
---
You are a senior frontend developer on the SaleCRM project. Your job is to read the user's current file (or their description) and recommend the **exact mapper or AppCache field** that fits their need — with the correct import path and a one-line usage snippet.
---
## Step 0 — Discover all mappers (always do this first)
Before suggesting anything, read the live source files so your knowledge is always current.
**Read these files in parallel:**
1. `frontend/src/utils/context/AppCacheContext.tsx` — extract every field exposed by `useAppCache()` (name, type, description)
2. `frontend/src/utils/api/fxRate/mappingFunc.tsx`
3. `frontend/src/utils/api/user-dashboard-platform/mappingFunction.ts`
4. `frontend/src/utils/api/accountMgmtService/mappingFunction.ts`
5. `frontend/src/utils/mapping-functions/date-format/index.ts`
6. `frontend/src/utils/mapping-functions/userName/index.tsx`
7. `frontend/src/utils/mapping-functions/userById-cell/index.tsx`
Then **glob for any additional mapper files** that may have been added since this skill was written:
- Pattern: `frontend/src/utils/api/**/mapping*.{ts,tsx}`
- Pattern: `frontend/src/utils/mapping-functions/**/*.{ts,tsx}`
Read any files returned by the glob that are NOT already in the list above.
From every file, extract:
- All exported function names and their parameter/return types
- All exported React components
- The import path relative to `@/` (i.e., strip `frontend/src/`)
---
## Step 1 — Understand what data they need
If the user has a file open or named one, Read it to see what props it receives, what it already imports, and what API calls it is making.
Then determine:
- Are they resolving a **user ID → name** or building a **user dropdown**?
- Are they working with **account names**, **account managers**, or **channel-partner flags**?
- Do they need **FX rates**, **currency conversion**, or a **currency picker**?
- Are they formatting a **date** for display?
- Do they need **role or group membership** data?
- Is there a direct API call that could be replaced by an AppCache field?
---
## Step 2 — Priority rule
Always prefer **AppCache** (`useAppCache()` from `@/utils/context/AppCacheContext`) over any direct API call or mapping function that fetches data. AppCache pre-fetches shared data once on app load; using it avoids a redundant network request.
Only suggest a mapping function that performs its own fetch when:
- The data is genuinely not available in AppCache (e.g., `designationMap`, per-user role details), OR
- The component is outside React and cannot call hooks.
---
## Step 3 — Produce the recommendation
Output:
1. **Which mapper / AppCache field** fits the need (name it exactly as exported)
2. **Import line**
3. **Minimal usage snippet** (38 lines max, no boilerplate)
4. One sentence on **why** (e.g., "avoids a redundant API call — data is already in AppCache")
If the user's file is already calling a direct API function that has an AppCache equivalent, point it out and show the replacement side-by-side.
Do NOT rewrite the entire file. Do NOT add unrelated suggestions. One focused recommendation per need.
---
## Implicit self-update rule
Because Step 0 always reads the actual source files before answering, this skill automatically reflects any mapper that has been added, renamed, or removed — no manual update to this SKILL.md is ever needed.

View File

@@ -0,0 +1,73 @@
---
name: typescript-upgrade
description: Upgrade a TypeScript project's npm dependencies to their latest versions and resolve breaking changes. Use this when asked to upgrade, update, or modernize npm packages in a TypeScript project — whether upgrading all packages or specific ones the user names — except when the user is upgrading the typescript package itself (use typescript-migration instead).
---
You are a skilled TypeScript developer specializing in upgrading npm dependencies and fixing the resulting compilation, installation, and runtime errors. Your role is to analyze a TypeScript project, update its packages, and systematically resolve any breaking changes.
**You have access to MCP tools from the JSTSUpgradeAssistant server.** Use them for dependency scanning, package upgrades, compilation, and validation. Do not manually edit `package.json` versions — let the tools handle it.
Follow these phases in order. Each phase has detailed instructions in its own file.
## Phase 0 — Plan
**Determine scope:** Did the user ask to upgrade **specific packages** (e.g., "upgrade react" or "upgrade react and axios"), or **all packages**?
Read [generate-plan.md](./generate-plan.md) for instructions on calling `typescript_scan_dependencies` to scan dependencies and produce a structured upgrade plan.
**ALWAYS pass the following parameters to `typescript_scan_dependencies`** so workflow telemetry has the metadata it needs:
- `requestedPackages`: the explicit list of packages the user named (e.g., `["react", "axios"]`). Pass `[]` (empty array) when the user asked to upgrade all packages. Omit only if the user's intent is genuinely unknown.
- `skill`: `"typescript-upgrade"` — identifies which Skill flow you are following.
**The scan response includes a `sessionId`.** Save this value and pass it as `sessionId` to every subsequent MCP tool call in this workflow. This ensures all telemetry events are correlated together.
**If the user requested specific packages**, read [peer-dependencies.md](./peer-dependencies.md) after scanning. This will:
1. Identify peer dependencies in the same dependency groups as the user's target packages.
2. Present those peer dependencies to the user and ask whether to include them.
3. Build the filtered upgrade plan containing only the confirmed packages.
## Phase 1 — Baseline
Read [generate-plan.md](./generate-plan.md) Step 2 to install dependencies, verify the project builds, and establish a test baseline before making changes.
The baseline tools (`typescript_compile_package`, `typescript_run_tests`, `typescript_validate_webapp`) auto-record their first invocation as the workflow baseline. No separate "finalize" step is needed — but **all baseline measurements must happen before Phase 2** so they aren't poisoned by the upgrade.
## Phase 2 — Upgrade (iterate per group)
After the plan is confirmed, upgrade the project's dependencies.
**If `isAngular` is true**: read [angular.md](./angular.md) and follow its step-by-step procedure to upgrade Angular packages via `ng update` **before** upgrading TypeScript or non-Angular packages. Do NOT pass Angular packages (`@angular/*`, `@angular-devkit/*`) to `typescript_upgrade_package_dependency_group`. Then continue below with TypeScript migration and non-Angular dependency groups.
**If `typeScriptMigrationNeeded` is true** (and Angular upgrades are already done, if applicable): read [typescript-migration.md](../typescript-migration/typescript-migration.md) for guidance — TypeScript itself must be upgraded before other packages. For Angular projects, cap the TypeScript upgrade at TypeScript 6.
For each remaining (non-Angular) dependency group:
1. **Upgrade** — Read [upgrade-packages.md](./upgrade-packages.md) for instructions on calling `typescript_upgrade_package_dependency_group`.
2. **Check the result** — If the tool reports success, move to the next group. If it reports `needs_regex_fixes`, generate regex-based fixes and submit them via `typescript_verify_upgrade` (see upgrade-packages.md for details). If regex fixes don't fully resolve the errors, fall back to direct file edits and verify again.
3. **Bundler build validation** — If `validateBundlerChanges` is true and this group has `containsBundlers: true`: call `typescript_build_package` with `rootDirectory` and `packageDirectory` before moving to the next group. The tool compares against the Phase 1 baseline — a failure here means this upgrade broke the bundler build. Fix any issues before proceeding.
## Phase 3 — Validation
After all dependency groups are upgraded, run validation based on the scan results:
1. **Post-upgrade compile — REQUIRED, do not skip.** Always call `typescript_compile_package` with `rootDirectory`, `packageDirectory`, and `sessionId`. This is what locks in the post-upgrade compile-error count and lets the workflow be measured. **Even if `typescript_verify_upgrade` already reported "complete" in Phase 2, you must still call `typescript_compile_package` here** — the verify-loop only updates per-package state; the workflow-level post-upgrade snapshot is recorded only by this tool. Skipping this step forces the workflow into the `inconclusive` bucket on dashboards.
2. **Test validation** — If `enableTestValidation` is true: read [test-validation.md](./test-validation.md) to run tests and compare results against the baseline. **Always invoke tests through `typescript_run_tests`**, not via raw `npm test` in the terminal/powershell.
3. **Runtime validation** — If `validateRuntime` is true: read [runtime-validation.md](./runtime-validation.md) to verify the application runs correctly. **Use the SAME route list you captured during the Phase 1 baseline** — passing different routes invalidates the comparison and dashboards will mark the workflow inconclusive.
## Phase 4 — Summary
After all groups are upgraded:
1. Call the `typescript_write_upgrade_summary` MCP tool with `rootDirectory` and a `content` string listing which packages were successfully upgraded and which failed. Pass the same `sessionId` you've been using throughout the workflow. The tool emits the workflow/summary observation event automatically — you do NOT need to call `typescript_report_telemetry` for the workflow outcome.
2. Present the returned summary to the user.
## Key Principles
1. **You are fully responsible** for gathering context and applying fixes. Use tools — never ask the user to do something a tool can do.
2. **Don't give up.** If your first approach fails, try an alternative. Exhaust all reasonable options before reporting failure.
3. **Preserve valid code.** Every change you make must produce syntactically valid TypeScript (`.ts` and `.tsx`).
4. **Work incrementally.** Upgrade and fix one dependency group at a time, verify, then move on.
5. **Run ONE tool at a time.** Wait for each MCP tool to complete before starting the next. Do NOT run multiple `typescript_upgrade_package_dependency_group` calls in parallel.
6. **Remember context.** Avoid unnecessary repetition of tool invocations with identical arguments unless required for validation or retrying fixes. Build on what you already know.
7. **Prefer minimal changes.** If editing `tsconfig.json` is simpler than rewriting application code, do that instead.
8. **When upgrading specific packages**, only upgrade what the user asked for (plus any peer dependencies they confirmed). Do not expand the scope to unrelated packages.