@workingpayload/agent-skills 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/APIForge/skill.md +150 -17
  2. package/AccessPlus/skill.md +122 -18
  3. package/AlgoMaster/skill.md +110 -17
  4. package/Architekt AI/skill.md +125 -17
  5. package/AuthCraft/skill.md +129 -17
  6. package/AutoScriptor/skill.md +122 -17
  7. package/BoilerCore/skill.md +121 -17
  8. package/BugHunter Pro/skill.md +118 -17
  9. package/ChangeScribe/skill.md +98 -17
  10. package/CodeSage/skill.md +148 -17
  11. package/CommitCraft/skill.md +97 -16
  12. package/CoverageMax/skill.md +145 -16
  13. package/CronGenius/skill.md +141 -16
  14. package/DataPolish/skill.md +126 -16
  15. package/DataWeaver/skill.md +135 -16
  16. package/DockMaster/skill.md +142 -16
  17. package/DocuGenie/skill.md +122 -16
  18. package/EdgeGuard/skill.md +144 -16
  19. package/EnvWizard/skill.md +140 -16
  20. package/ErrorMedic/skill.md +136 -16
  21. package/FeatureSmith/skill.md +123 -16
  22. package/FlexiLayout/skill.md +128 -16
  23. package/FlowTester/skill.md +138 -16
  24. package/FunctionForge/skill.md +120 -16
  25. package/InputShield/skill.md +128 -16
  26. package/IssueForge/skill.md +132 -16
  27. package/KubeCrafter/skill.md +133 -16
  28. package/LogicLens/skill.md +116 -16
  29. package/MockSmith/skill.md +130 -16
  30. package/ModelSensei/skill.md +122 -16
  31. package/PRMentor/skill.md +103 -32
  32. package/PerfDetective/skill.md +90 -32
  33. package/PipelinePro/skill.md +146 -32
  34. package/PolyglotShift/skill.md +94 -32
  35. package/PromptForge/skill.md +118 -32
  36. package/QueryPulse/skill.md +123 -32
  37. package/README.md +416 -329
  38. package/ReadMeCraft/skill.md +127 -32
  39. package/RefactorX/skill.md +84 -32
  40. package/RenderBoost/skill.md +148 -32
  41. package/SEOMancer/skill.md +140 -16
  42. package/ScrapeMaster/skill.md +157 -32
  43. package/SecretSniffer/skill.md +107 -16
  44. package/SecureScan/skill.md +114 -16
  45. package/ServiceSplitter/skill.md +137 -16
  46. package/SpeedSmith/skill.md +139 -16
  47. package/StackWise/skill.md +139 -16
  48. package/TaskOrchestrator/skill.md +119 -16
  49. package/TestCrafter/skill.md +142 -16
  50. package/TraceMind/skill.md +127 -16
  51. package/UISmith/skill.md +115 -16
  52. package/bin/cli.js +377 -0
  53. package/extension-extender/SKILL.md +122 -0
  54. package/fastapi-furious/SKILL.md +148 -0
  55. package/package.json +41 -28
  56. package/python-master/SKILL.md +108 -0
  57. package/react-ranger/SKILL.md +93 -0
  58. package/scripts/build_index.py +282 -0
  59. package/scripts/doctor.py +541 -0
  60. package/scripts/install.py +397 -0
  61. package/scripts/route.py +348 -0
  62. package/scripts/score.py +355 -0
  63. package/scripts/test_skill.py +473 -0
  64. package/scripts/validate.py +254 -0
  65. package/skills-routing.json +1131 -0
  66. package/skills.json +3261 -0
  67. package/Extension-Extender/SKILL.md +0 -41
  68. package/Extension-Extender/references/ui-guidelines.md +0 -26
  69. package/Fastapi-Furious/README.md +0 -16
  70. package/Fastapi-Furious/SKILL.md +0 -37
  71. package/Python-Master/README.md +0 -11
  72. package/Python-Master/SKILL.md +0 -37
  73. package/React-Ranger/README.md +0 -17
  74. package/React-Ranger/SKILL.md +0 -37
  75. package/cli.js +0 -181
  76. package/parse_skills.py +0 -44
  77. /package/{Extension-Extender → extension-extender}/assets/manifest.json +0 -0
  78. /package/{Extension-Extender → extension-extender}/assets/popup.css +0 -0
  79. /package/{Extension-Extender → extension-extender}/assets/popup.html +0 -0
  80. /package/{Extension-Extender → extension-extender}/assets/popup.js +0 -0
@@ -1,32 +1,154 @@
1
1
  ---
2
2
  name: flowtester
3
- description: Perfects tasks related to writing end-to-end integration tests, simulating complex user journeys, and verifying cross-service workflows. Use when a user asks to handle testing or requires assistance with integration tests..
3
+ description: Writes end-to-end and integration tests using Playwright or Cypress with the Page Object Model, AAA pattern, and CI-friendly configuration. Use when a user needs help with E2E test structure, test isolation, flaky test debugging, API contract testing, or CI pipeline integration.
4
4
  ---
5
5
 
6
6
  # FlowTester
7
7
 
8
8
  ## Overview
9
9
 
10
- The FlowTester skill specializes in writing end-to-end integration tests, simulating complex user journeys, and verifying cross-service workflows. It is designed to be the perfect, flawless assistant for testing, providing robust, industry-standard solutions.
10
+ Produces production-quality integration and E2E tests using Playwright (preferred) or Cypress, structured with the Page Object Model (POM), Arrange-Act-Assert (AAA) pattern, proper test isolation, and CI pipeline hooks. Addresses flaky tests with deterministic waiting strategies.
11
11
 
12
12
  ## Workflow
13
13
 
14
- When asked to work on testing or related tasks, follow these steps:
14
+ ### 1. Clarify Scope
15
15
 
16
- ### 1. Analysis & Pre-flight
17
- - Analyze the user's request thoroughly.
18
- - Identify the core requirements for writing end-to-end integration tests, simulating complex user journeys, and verifying cross-service workflows.
19
- - Ensure all context and preconditions are understood.
16
+ Determine the test type needed:
17
+ - **E2E (browser):** Full user journey through the UI — use Playwright or Cypress.
18
+ - **Integration (API):** Cross-service contract verification — use Playwright's `request` fixture, Supertest, or Pact for consumer-driven contracts.
19
+ - **Component integration:** Isolated component with real child components — use Playwright Component Testing or Cypress Component Testing.
20
20
 
21
- ### 2. Execution & Implementation
22
- - Apply the core logic of FlowTester perfectly.
23
- - Prioritize clean architecture, high efficiency, and robust error handling.
24
- - Strive for a flawless, comprehensive solution that directly addresses the user's needs.
21
+ Identify: the user journey to test, the entry URL, required auth state, and any third-party services to stub.
25
22
 
26
- ### 3. Validation & Polish
27
- - Review the generated output against industry best practices for testing.
28
- - Ensure the result perfectly resolves the user's request without omissions.
23
+ ### 2. Set Up Page Object Model
29
24
 
30
- ## Resources
25
+ Create one PO class per page/feature area. POs encapsulate selectors and actions — tests contain only assertions and flow.
31
26
 
32
- - **`references/best-practices.md`**: Core principles for testing.
27
+ ```typescript
28
+ // pages/LoginPage.ts
29
+ export class LoginPage {
30
+ readonly emailInput = this.page.getByLabel('Email');
31
+ readonly passwordInput = this.page.getByLabel('Password');
32
+ readonly submitButton = this.page.getByRole('button', { name: 'Sign in' });
33
+ readonly errorMessage = this.page.getByRole('alert');
34
+ constructor(private page: Page) {}
35
+ async login(email: string, password: string) {
36
+ await this.emailInput.fill(email);
37
+ await this.passwordInput.fill(password);
38
+ await this.submitButton.click();
39
+ }
40
+ async goto() { await this.page.goto('/login'); }
41
+ }
42
+ ```
43
+
44
+ Selector priority: `getByRole` > `getByLabel` > `getByTestId` > CSS. Never use positional selectors like `nth-child`.
45
+
46
+ ### 3. Write Tests with AAA Pattern
47
+
48
+ ```typescript
49
+ test('authenticates valid user → redirects to dashboard', async ({ page }) => {
50
+ const loginPage = new LoginPage(page);
51
+ await loginPage.goto();
52
+ // Act
53
+ await loginPage.login('user@example.com', 'correct-password');
54
+ // Assert
55
+ await expect(page).toHaveURL('/dashboard');
56
+ });
57
+
58
+ test('shows error for invalid credentials', async ({ page }) => {
59
+ const loginPage = new LoginPage(page);
60
+ await loginPage.goto();
61
+ await loginPage.login('user@example.com', 'wrong-password');
62
+ await expect(loginPage.errorMessage).toContainText('Invalid email or password');
63
+ });
64
+ ```
65
+
66
+ ### 4. Test Isolation
67
+
68
+ - Use `test.beforeEach` to reset state, never `test.afterEach` (failures skip teardown).
69
+ - Seed DB state via API calls in `beforeEach`, not via UI interactions.
70
+ - Use Playwright's `storageState` to persist authenticated sessions across tests without re-logging in every test.
71
+
72
+ ```typescript
73
+ // playwright.config.ts
74
+ export default defineConfig({
75
+ globalSetup: './global-setup.ts', // creates storageState file
76
+ use: {
77
+ storageState: 'playwright/.auth/user.json',
78
+ baseURL: process.env.BASE_URL ?? 'http://localhost:3000',
79
+ },
80
+ });
81
+ ```
82
+
83
+ ### 5. Stub External Services
84
+
85
+ Use **MSW (Mock Service Worker)** for browser-level API stubbing in component/integration tests:
86
+ ```typescript
87
+ // Playwright: intercept at network level
88
+ await page.route('**/api/payments/**', route =>
89
+ route.fulfill({ status: 200, body: JSON.stringify({ status: 'success' }) })
90
+ );
91
+ ```
92
+
93
+ For Cypress: use `cy.intercept()` with `cy.fixture()` for response bodies.
94
+
95
+ ### 6. Eliminate Flaky Tests
96
+
97
+ | Anti-pattern | Fix |
98
+ |---|---|
99
+ | `page.waitForTimeout(2000)` | `await expect(locator).toBeVisible()` |
100
+ | Hardcoded test IDs that change | `data-testid` attributes on stable elements |
101
+ | Shared global state between tests | `storageState` reset per test group |
102
+ | Race conditions on navigation | `await page.waitForURL('/target')` after click |
103
+ | Animation interference | `page.emulateMedia({ reducedMotion: 'reduce' })` |
104
+
105
+ ### 7. CI Integration
106
+
107
+ ```yaml
108
+ - run: npx playwright install --with-deps chromium
109
+ - run: npx playwright test --workers=4 --reporter=html --shard=1/4
110
+ env: { BASE_URL: "${{ secrets.STAGING_URL }}" }
111
+ - uses: actions/upload-artifact@v4
112
+ if: always()
113
+ with: { name: playwright-report, path: playwright-report/ }
114
+ ```
115
+
116
+ Use `--shard=N/M` across matrix jobs to parallelize large suites.
117
+
118
+ ## Output Format
119
+
120
+ Deliver:
121
+ 1. Page Object files in `tests/pages/`.
122
+ 2. Test spec files in `tests/<feature>/`.
123
+ 3. `playwright.config.ts` or `cypress.config.ts` snippet.
124
+ 4. CI workflow YAML fragment.
125
+ 5. Any MSW handler files if API stubbing is needed.
126
+
127
+ ## Edge Cases
128
+
129
+ **Auth-protected routes:** Create a `global-setup.ts` that programmatically logs in once via the API, saves `storageState` to disk, and reuses it for all tests — avoids per-test login overhead and prevents rate-limiting.
130
+
131
+ **Dynamic data in assertions:** Never assert on data that changes between runs (e.g., `createdAt` timestamps). Assert on structure and type using regex or partial matchers: `expect(text).toMatch(/Order #\d+/)`.
132
+
133
+ **Cypress vs. Playwright for multi-tab/multi-origin:** Cypress cannot handle multiple browser tabs or cross-origin iframes in the same test. If the flow opens a new tab (e.g., OAuth popup), use Playwright's `context.waitForEvent('page')` pattern instead.
134
+
135
+ **File download assertions:**
136
+ ```typescript
137
+ const [download] = await Promise.all([
138
+ page.waitForEvent('download'),
139
+ page.getByRole('button', { name: 'Export CSV' }).click(),
140
+ ]);
141
+ expect(download.suggestedFilename()).toMatch(/^report-\d{4}\.csv$/);
142
+ const path = await download.path();
143
+ const stats = fs.statSync(path!);
144
+ expect(stats.size).toBeGreaterThan(100); // non-empty file
145
+ ```
146
+
147
+ **Shared staging DB isolation:** When parallel workers share a staging DB, namespace data per worker using unique prefixes or schemas. Wrap each test in a transaction and roll back on teardown:
148
+ ```typescript
149
+ // Per-worker prefix
150
+ const prefix = `test_w${process.env.TEST_WORKER_INDEX ?? 0}_${Date.now()}`;
151
+ // Seed: createUser({ email: `${prefix}@example.com` })
152
+ // After each test: DELETE FROM ... WHERE email LIKE '${prefix}%'
153
+ // Or: wrap in a DB transaction and ROLLBACK in afterEach
154
+ ```
@@ -1,32 +1,136 @@
1
1
  ---
2
2
  name: functionforge
3
- description: Perfects tasks related to writing pure, modular, and highly testable utility functions, emphasizing functional programming principles. Use when a user asks to handle codegen or requires assistance with generates functions..
3
+ description: Writes pure, testable utility functions using functional programming principles — immutability, referential transparency, Result/Either types, currying, and pipe/compose. Use when a user needs to generate or refactor functions with explicit type signatures, safe error handling, or composable data transforms.
4
4
  ---
5
5
 
6
6
  # FunctionForge
7
7
 
8
8
  ## Overview
9
9
 
10
- The FunctionForge skill specializes in writing pure, modular, and highly testable utility functions, emphasizing functional programming principles. It is designed to be the perfect, flawless assistant for codegen, providing robust, industry-standard solutions.
10
+ Produces pure functions with explicit type signatures, safe error-handling via Result/Either types, and composable pipelines using pipe/compose. Every function is side-effect-free, deterministic, and independently testable.
11
11
 
12
12
  ## Workflow
13
13
 
14
- When asked to work on codegen or related tasks, follow these steps:
14
+ ### 1. Write the Type Signature First
15
15
 
16
- ### 1. Analysis & Pre-flight
17
- - Analyze the user's request thoroughly.
18
- - Identify the core requirements for writing pure, modular, and highly testable utility functions, emphasizing functional programming principles.
19
- - Ensure all context and preconditions are understood.
16
+ Before implementation, define the full type signature. This constrains the solution space and serves as documentation.
20
17
 
21
- ### 2. Execution & Implementation
22
- - Apply the core logic of FunctionForge perfectly.
23
- - Prioritize clean architecture, high efficiency, and robust error handling.
24
- - Strive for a flawless, comprehensive solution that directly addresses the user's needs.
18
+ ```typescript
19
+ // TypeScript
20
+ declare function parsePositiveInt(input: unknown): Result<number, ValidationError>
21
+ declare function formatCurrency(amount: number, locale: string): string
22
+ declare function groupBy<T, K extends string>(
23
+ key: (item: T) => K,
24
+ items: T[]
25
+ ): Record<K, T[]>
26
+ ```
25
27
 
26
- ### 3. Validation & Polish
27
- - Review the generated output against industry best practices for codegen.
28
- - Ensure the result perfectly resolves the user's request without omissions.
28
+ ### 2. Enforce Purity Constraints
29
29
 
30
- ## Resources
30
+ A function is pure if:
31
+ - **Same inputs always produce same outputs** (no `Date.now()`, `Math.random()`, or global reads inside)
32
+ - **No observable side effects** (no mutations, no I/O, no exceptions thrown for control flow)
31
33
 
32
- - **`references/best-practices.md`**: Core principles for codegen.
34
+ ```typescript
35
+ // IMPURE — mutates input
36
+ function sortItems(items: Item[]): Item[] {
37
+ return items.sort((a, b) => a.name.localeCompare(b.name)); // sort mutates in place
38
+ }
39
+
40
+ // PURE — returns new array
41
+ function sortItems(items: readonly Item[]): Item[] {
42
+ return [...items].sort((a, b) => a.name.localeCompare(b.name));
43
+ }
44
+ ```
45
+
46
+ Use `readonly` / `Readonly<T>` / `as const` in TypeScript. Use `Object.freeze()` for runtime immutability when needed.
47
+
48
+ ### 3. Return Result/Either Instead of Throwing
49
+
50
+ ```typescript
51
+ // Using neverthrow (TypeScript)
52
+ import { ok, err, Result } from 'neverthrow';
53
+
54
+ type ValidationError = { code: string; message: string };
55
+
56
+ function parseEmail(input: unknown): Result<string, ValidationError> {
57
+ if (typeof input !== 'string') {
58
+ return err({ code: 'TYPE_ERROR', message: 'Expected string' });
59
+ }
60
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input)) {
61
+ return err({ code: 'INVALID_FORMAT', message: 'Not a valid email address' });
62
+ }
63
+ return ok(input.toLowerCase().trim());
64
+ }
65
+
66
+ // Caller handles both paths explicitly — no try/catch surprises
67
+ const result = parseEmail(userInput);
68
+ if (result.isOk()) {
69
+ sendEmail(result.value);
70
+ } else {
71
+ showError(result.error.message);
72
+ }
73
+ ```
74
+
75
+ In Python: use `returns.result` `Success`/`Failure` or a simple dataclass wrapper.
76
+
77
+ ### 4. Apply Currying for Partial Application
78
+
79
+ ```typescript
80
+ const multiply = (factor: number) => (value: number): number => value * factor;
81
+ const double = multiply(2);
82
+ const prices = [10, 20, 30].map(double); // [20, 40, 60]
83
+ ```
84
+
85
+ Curry data-last to enable point-free style with `pipe`.
86
+
87
+ ### 5. Compose with pipe / compose
88
+
89
+ ```typescript
90
+ import { pipe } from 'fp-ts/function';
91
+ // or: import { pipe } from 'remeda';
92
+
93
+ const processOrder = (raw: unknown) =>
94
+ pipe(
95
+ raw,
96
+ validateOrder, // unknown -> Result<RawOrder, Error>
97
+ map(normalizeOrder), // Result<RawOrder, Error> -> Result<Order, Error>
98
+ map(applyDiscount(0.1)),
99
+ map(formatForShipment)
100
+ );
101
+ ```
102
+
103
+ `pipe(value, f, g, h)` = left-to-right, readable as a data pipeline.
104
+ `compose(h, g, f)(value)` = right-to-left, mathematical composition order.
105
+
106
+ Prefer `pipe` for readability. Use `compose` only when building reusable composed functions.
107
+
108
+ ### 6. Verify Referential Transparency
109
+
110
+ A function has referential transparency if replacing any call with its return value does not change program behavior. Verify by: running twice with identical inputs (results must be deeply equal), checking for hidden mutable closure state, and confirming no dependence on call order.
111
+
112
+ ## Output Format
113
+
114
+ Deliver for each function: type signature, pure implementation, unit tests (happy path + error + boundary), and a `pipe`/`compose` usage example if composable.
115
+
116
+ ## Edge Cases
117
+
118
+ **Async purity:** Async functions that fetch data are not pure, but can be kept referentially transparent by injecting the fetch dependency: `fetchUser(httpClient)(id)`. This keeps business logic pure and testable with a mocked client.
119
+
120
+ **null / undefined inputs:** Always guard at the boundary with a `Result`-returning parser. Never let `null` propagate into pure computation — use `Option<T>` (from `fp-ts` or `effect`) for values that may be absent.
121
+
122
+ **Recursive functions and stack overflow:** For deeply recursive operations, use trampolining or convert to iterative with an explicit stack.
123
+
124
+ **Monetary value precision:** Never use floating-point for money. Store values as integer cents (`amount: number` in whole cents), or use `big.js`/`decimal.js` (JS) or Python's `Decimal` for arbitrary precision. Example: `new Decimal('19.99').times('1.08').toFixed(2)`.
125
+
126
+ **Mixed sync/async pipe composition:** When a pipeline mixes sync and async steps, use `TaskEither` from `fp-ts` to lift sync `Either` values into the async chain, or explicitly `await` intermediate `Result` values before passing to the next pure step:
127
+ ```typescript
128
+ import { pipe } from 'fp-ts/function';
129
+ import * as TE from 'fp-ts/TaskEither';
130
+ const processAsync = (raw: unknown) =>
131
+ pipe(
132
+ TE.fromEither(validateOrder(raw)), // sync Either → TaskEither
133
+ TE.chainW(order => TE.tryCatch(() => fetchPrice(order), toError)),
134
+ TE.map(applyDiscount(0.1)),
135
+ );
136
+ ```
@@ -1,32 +1,144 @@
1
1
  ---
2
2
  name: inputshield
3
- description: Perfects tasks related to implementing rigorous input validation, sanitization, and preventing XSS, SQL injection, and payload vulnerabilities. Use when a user asks to handle security or requires assistance with validation..
3
+ description: Implements rigorous input validation, sanitization, and encoding to prevent OWASP Top 10 vulnerabilities including XSS, SQL injection, and command injection. Use when a user needs schema validation with Zod/Joi/Pydantic, parameterized queries, CSP headers, allowlist strategies, or context-specific output encoding.
4
4
  ---
5
5
 
6
6
  # InputShield
7
7
 
8
8
  ## Overview
9
9
 
10
- The InputShield skill specializes in implementing rigorous input validation, sanitization, and preventing XSS, SQL injection, and payload vulnerabilities. It is designed to be the perfect, flawless assistant for security, providing robust, industry-standard solutions.
10
+ Designs and implements a defense-in-depth input validation strategy: schema validation at the boundary (Zod/Joi/Pydantic), parameterized queries for database access, context-specific output encoding for XSS prevention, and HTTP security headers (CSP, CORS). Follows OWASP Top 10 2021 guidelines.
11
11
 
12
12
  ## Workflow
13
13
 
14
- When asked to work on security or related tasks, follow these steps:
14
+ ### 1. Identify All Input Surfaces
15
15
 
16
- ### 1. Analysis & Pre-flight
17
- - Analyze the user's request thoroughly.
18
- - Identify the core requirements for implementing rigorous input validation, sanitization, and preventing XSS, SQL injection, and payload vulnerabilities.
19
- - Ensure all context and preconditions are understood.
16
+ Enumerate every point where untrusted data enters the system:
17
+ - HTTP request body, query params, path params, headers, cookies
18
+ - File uploads (name, MIME type, content)
19
+ - WebSocket messages
20
+ - Environment variables read at runtime
21
+ - Data imported from external APIs or files
20
22
 
21
- ### 2. Execution & Implementation
22
- - Apply the core logic of InputShield perfectly.
23
- - Prioritize clean architecture, high efficiency, and robust error handling.
24
- - Strive for a flawless, comprehensive solution that directly addresses the user's needs.
23
+ Mark each surface with its trust level: **untrusted** (external user), **semi-trusted** (internal service), or **trusted** (own DB read).
25
24
 
26
- ### 3. Validation & Polish
27
- - Review the generated output against industry best practices for security.
28
- - Ensure the result perfectly resolves the user's request without omissions.
25
+ ### 2. Validate at the Boundary — Schema First
29
26
 
30
- ## Resources
27
+ **TypeScript (Zod):**
28
+ ```typescript
29
+ import { z } from 'zod';
31
30
 
32
- - **`references/best-practices.md`**: Core principles for security.
31
+ const CreateUserSchema = z.object({
32
+ email: z.string().email().max(255).toLowerCase(),
33
+ username: z.string()
34
+ .min(3).max(30)
35
+ .regex(/^[a-zA-Z0-9_-]+$/, 'Only alphanumeric, underscore, hyphen allowed'),
36
+ age: z.number().int().min(13).max(120).optional(),
37
+ role: z.enum(['viewer', 'editor', 'admin']), // allowlist, never freeform
38
+ });
39
+
40
+ type CreateUserInput = z.infer<typeof CreateUserSchema>;
41
+
42
+ // In Express route handler:
43
+ const result = CreateUserSchema.safeParse(req.body);
44
+ if (!result.success) {
45
+ return res.status(400).json({ errors: result.error.flatten() });
46
+ }
47
+ const data: CreateUserInput = result.data; // type-safe from here
48
+ ```
49
+
50
+ **Python (Pydantic v2):**
51
+ ```python
52
+ class CreateUserRequest(BaseModel):
53
+ email: EmailStr
54
+ username: str
55
+ role: Literal['viewer', 'editor', 'admin']
56
+ @field_validator('username')
57
+ @classmethod
58
+ def username_alphanumeric(cls, v: str) -> str:
59
+ if not re.match(r'^[a-zA-Z0-9_-]{3,30}$', v): raise ValueError('Invalid format')
60
+ return v
61
+ ```
62
+
63
+ **Rules:**
64
+ - Always use **allowlists** (define what is permitted) over denylists (block known bad values).
65
+ - Validate **type → format → range → business rule** in that order.
66
+ - Reject on first failure; do not attempt to sanitize malformed input.
67
+
68
+ ### 3. Prevent SQL Injection — Parameterized Queries Only
69
+
70
+ ```typescript
71
+ // VULNERABLE — never do this
72
+ const query = `SELECT * FROM users WHERE email = '${email}'`;
73
+
74
+ // SAFE — parameterized (node-postgres)
75
+ const { rows } = await pool.query(
76
+ 'SELECT id, name FROM users WHERE email = $1 AND active = $2',
77
+ [email, true]
78
+ );
79
+
80
+ // SAFE — ORM (Prisma)
81
+ const user = await prisma.user.findUnique({ where: { email } });
82
+
83
+ // SAFE — raw query with ORM escape (TypeORM)
84
+ await dataSource.query('SELECT * FROM users WHERE email = ?', [email]);
85
+ ```
86
+
87
+ Never interpolate user data into SQL strings, even after regex validation.
88
+
89
+ ### 4. Prevent XSS — Context-Specific Output Encoding
90
+
91
+ Different contexts require different encoding:
92
+
93
+ | Context | Encoding method |
94
+ |---|---|
95
+ | HTML body | `DOMPurify.sanitize(html)` or `escapeHtml(text)` |
96
+ | HTML attribute | `encodeURIComponent()` or template engine auto-escape |
97
+ | JavaScript string | `JSON.stringify()` — never template literal interpolation |
98
+ | CSS value | Allowlist permitted values; reject anything else |
99
+ | URL parameter | `encodeURIComponent()` |
100
+
101
+ Use `DOMPurify.sanitize(html, { ALLOWED_TAGS: ['b','i','em','strong','a'], ALLOWED_ATTR: ['href'] })` only for rich-text rendering. For plain text: use framework auto-escaping (React JSX, Jinja2). Never use `dangerouslySetInnerHTML` / `v-html` with untrusted data.
102
+
103
+ ### 5. Set HTTP Security Headers
104
+
105
+ Use `helmet` (Express) with CSP directives: `defaultSrc: ["'self'"]`, `scriptSrc` with a per-request nonce, `objectSrc: ["'none'"]`, `frameAncestors: ["'none'"]`. Set `referrerPolicy: strict-origin-when-cross-origin`. Always set cookies with `httpOnly; Secure; SameSite=Strict`.
106
+
107
+ ### 6. File Upload Validation
108
+
109
+ Check file signature (magic bytes) via `file-type` library — not just extension or `Content-Type`. Enforce size limits. Store outside web root; serve via signed URLs (S3, GCS):
110
+ ```typescript
111
+ const detected = await fromBuffer(buffer);
112
+ const allowed = ['image/jpeg', 'image/png', 'image/webp'];
113
+ if (!detected || !allowed.includes(detected.mime)) throw new ValidationError('Not permitted');
114
+ if (buffer.length > 5 * 1024 * 1024) throw new ValidationError('Exceeds 5MB');
115
+ ```
116
+
117
+ ## Output Format
118
+
119
+ For each input surface, deliver:
120
+ 1. Schema definition (Zod/Joi/Pydantic) with all constraints documented.
121
+ 2. Integration point (where validation runs in the request lifecycle).
122
+ 3. Error response format (RFC 7807 Problem Details recommended).
123
+ 4. Any headers or encoding additions required.
124
+
125
+ ## Edge Cases
126
+
127
+ **Open redirect via URL inputs:** Validate that redirect URLs are either relative paths or match an explicit allowlist of trusted domains. `new URL(input).hostname` must match `ALLOWED_REDIRECT_HOSTS`.
128
+
129
+ **Unicode normalization attacks:** Input like `SELECT` (fullwidth characters) may bypass keyword denylists. Normalize to NFKC before validation: `input.normalize('NFKC')`.
130
+
131
+ **Mass assignment / over-posting:** Use `z.pick()` or Pydantic's `model_validate(..., strict=True)`. Never spread the entire validated object into an ORM call.
132
+
133
+ **GraphQL-specific validation:** Enforce query depth limiting (reject depth > 7), complexity analysis (assign cost per field, reject above budget), and disable introspection in production. Guard against batch attacks by rate-limiting per operation name and rejecting arrays of operations exceeding a threshold.
134
+ ```typescript
135
+ import depthLimit from 'graphql-depth-limit';
136
+ const schema = makeExecutableSchema({ ... });
137
+ app.use('/graphql', graphqlHTTP({
138
+ validationRules: [depthLimit(7)],
139
+ // disable introspection:
140
+ // fieldResolver: (src, args, ctx, info) => { if (info.fieldName === '__schema') throw new Error('Forbidden'); }
141
+ }));
142
+ ```
143
+
144
+ **SVG upload risk:** SVGs are XML that can contain embedded `<script>` tags and event handlers. Never serve user-uploaded SVGs as `image/svg+xml` without sanitization. Pipe through DOMPurify (server-side via `jsdom`) or `svg-sanitizer`, or convert to PNG/WebP via `sharp` before serving.
@@ -1,32 +1,148 @@
1
1
  ---
2
2
  name: issueforge
3
- description: Perfects tasks related to creating detailed, structured bug reports and feature requests for issue trackers like Jira or GitHub. Use when a user asks to handle git or requires assistance with issues..
3
+ description: Creates detailed, well-structured bug reports and feature requests for GitHub Issues and Jira. Use when a user wants to file a bug, write a feature request, define reproduction steps, assign severity/priority, or generate acceptance criteria for an issue tracker.
4
4
  ---
5
5
 
6
6
  # IssueForge
7
7
 
8
8
  ## Overview
9
9
 
10
- The IssueForge skill specializes in creating detailed, structured bug reports and feature requests for issue trackers like Jira or GitHub. It is designed to be the perfect, flawless assistant for git, providing robust, industry-standard solutions.
10
+ Produces complete, actionable issue tickets for GitHub and Jira: bug reports with reproduction steps and environment details, feature requests with acceptance criteria, and correct severity/priority classification. Output is copy-paste ready for the target tracker.
11
11
 
12
12
  ## Workflow
13
13
 
14
- When asked to work on git or related tasks, follow these steps:
14
+ ### 1. Classify the Issue Type
15
15
 
16
- ### 1. Analysis & Pre-flight
17
- - Analyze the user's request thoroughly.
18
- - Identify the core requirements for creating detailed, structured bug reports and feature requests for issue trackers like Jira or GitHub.
19
- - Ensure all context and preconditions are understood.
16
+ Determine the issue type from the user's description:
17
+ - **Bug:** Something is broken or behaves contrary to specification.
18
+ - **Feature Request:** New capability that does not exist yet.
19
+ - **Task / Chore:** Engineering work without direct user-facing change (migration, refactor, dependency update).
20
+ - **Spike:** Time-boxed investigation to reduce uncertainty.
20
21
 
21
- ### 2. Execution & Implementation
22
- - Apply the core logic of IssueForge perfectly.
23
- - Prioritize clean architecture, high efficiency, and robust error handling.
24
- - Strive for a flawless, comprehensive solution that directly addresses the user's needs.
22
+ Ask for missing information before drafting — a bug report without reproduction steps is not actionable.
25
23
 
26
- ### 3. Validation & Polish
27
- - Review the generated output against industry best practices for git.
28
- - Ensure the result perfectly resolves the user's request without omissions.
24
+ ### 2. Bug Report Template
29
25
 
30
- ## Resources
26
+ ```markdown
27
+ ## Bug Report
31
28
 
32
- - **`references/best-practices.md`**: Core principles for git.
29
+ **Summary:** <One-line description — what is wrong, not what the user expected>
30
+
31
+ **Severity:** Critical | High | Medium | Low
32
+ **Priority:** P1 | P2 | P3 | P4
33
+ **Component:** <Frontend / Backend / API / Infrastructure / etc.>
34
+ **Assignee:** <leave blank if unknown>
35
+
36
+ ---
37
+
38
+ ### Description
39
+ <2–3 sentence explanation of the problem and its impact on users/business.>
40
+
41
+ ### Environment
42
+ | Field | Value |
43
+ |---|---|
44
+ | App version | v2.4.1 |
45
+ | Browser/OS | Chrome 123 / macOS 14.4 |
46
+ | API env | Production / Staging / Local |
47
+ | User role | Admin / Free tier |
48
+ | Feature flags | List active flags/experiments and their variant (e.g., `checkout-v2=enabled`, `experiment-price-display=control`) |
49
+
50
+ ### Steps to Reproduce
51
+ 1. Navigate to `<URL or feature>`
52
+ 2. <Action>
53
+ 3. <Action>
54
+ 4. Observe: <what actually happens>
55
+
56
+ ### Expected Behavior
57
+ <What should happen per spec/design.>
58
+
59
+ ### Actual Behavior
60
+ <What actually happens. Include error message verbatim if applicable.>
61
+
62
+ ### Evidence
63
+ - [ ] Screenshot / screen recording attached
64
+ - [ ] Console error log attached
65
+ - [ ] Network request/response attached (redact auth tokens)
66
+
67
+ ### Possible Cause / Hypothesis
68
+ <Optional — include if known. Do not guess without evidence.>
69
+
70
+ ### Workaround
71
+ <If one exists, document it to unblock affected users.>
72
+ ```
73
+
74
+ ### 3. Feature Request Template
75
+
76
+ ```markdown
77
+ ## Feature Request
78
+ **Summary:** <Imperative verb + outcome>
79
+ **Priority:** P1–P4 | **Component:** <team> | **Epic:** <link>
80
+
81
+ ### Problem Statement
82
+ When <situation>, users want to <motivation>, so they can <outcome>.
83
+
84
+ ### Proposed Solution
85
+ <Experience description — not an implementation spec.>
86
+
87
+ ### Acceptance Criteria
88
+ Scenario: <happy path>
89
+ Given <precondition> / When <action> / Then <outcome>
90
+
91
+ ### Out of Scope
92
+ - <What this issue does NOT cover>
93
+
94
+ ### Success Metric
95
+ <e.g., "Export used by >20% of dashboard visitors">
96
+ ```
97
+
98
+ ### 4. Assign Severity and Priority
99
+
100
+ **Severity** (impact of the defect):
101
+ | Level | Definition |
102
+ |---|---|
103
+ | Critical | Data loss, security breach, complete feature outage with no workaround |
104
+ | High | Major feature broken, workaround exists but is unacceptable |
105
+ | Medium | Feature degraded; workaround available |
106
+ | Low | Cosmetic issue, minor inconvenience |
107
+
108
+ **Priority** (urgency of fix):
109
+ | Level | SLA |
110
+ |---|---|
111
+ | P1 | Fix and deploy within 24 hours |
112
+ | P2 | Fix in current sprint |
113
+ | P3 | Scheduled for next sprint or backlog grooming |
114
+ | P4 | Nice-to-have; fix when capacity allows |
115
+
116
+ Severity and priority are independent: a Low severity bug can be P2 if it affects a key sales demo flow.
117
+
118
+ ### 5. GitHub vs. Jira Formatting Differences
119
+
120
+ **GitHub Issues:** Use Markdown headers, task lists, and code fences. Apply labels (`bug`, `priority: high`, `component: auth`). Reference related issues with `#N`; use `Closes #N` in the PR description, not the issue.
121
+
122
+ **Jira:** Use structured fields (`Issue Type`, `Priority`, `Component`, `Fix Version`, `Sprint`) — do not embed them in the description body. Link with `blocks`, `is blocked by`, `relates to`, `duplicates`. Story points go in the `Story Points` field.
123
+
124
+ ## Output Format
125
+
126
+ Ask the user: "Is this for GitHub or Jira?" before generating the final ticket. Then output the complete ticket body formatted for that tracker, ready to paste.
127
+
128
+ Include a one-line **PR/branch name suggestion**: `fix/auth-token-expiry-redirect` or `feat/csv-export-reports`.
129
+
130
+ ## Edge Cases
131
+
132
+ **Duplicate detection:** Before finalizing, ask the user if they searched the tracker for existing issues. If they provide a similar issue URL, add a `Duplicate of #<N>` reference or a "Related Issues" section rather than creating a new ticket.
133
+
134
+ **Security vulnerabilities:** If the bug involves a potential security issue (auth bypass, data exposure, injection), do NOT file it as a public GitHub issue. Output a note instructing the user to use the repository's private security advisory (`https://github.com/<org>/<repo>/security/advisories/new`) or the organization's responsible disclosure process instead.
135
+
136
+ **Insufficient reproduction steps:** If the user cannot reliably reproduce the bug, label it `needs-repro` and add a comment template asking for: browser console output, network tab HAR export, and the exact data/state when the issue occurred. Do not assign P1/P2 to an unreproducible bug.
137
+
138
+ **Performance regression fields:** For performance bugs, add a dedicated section:
139
+ ```
140
+ ### Performance Regression
141
+ | Metric | Baseline (last release) | Current |
142
+ |---|---|---|
143
+ | p50 latency | 120 ms | 890 ms |
144
+ | p99 latency | 340 ms | 4,200 ms |
145
+ | Throughput | 850 req/s | 210 req/s |
146
+
147
+ **Profiling data:** Attach flamegraph or profiler output. Note the profiling tool and sampling duration.
148
+ ```