@torus-engineering/tas-kit 1.11.1 → 1.13.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 (123) hide show
  1. package/.tas/README.md +334 -334
  2. package/{.claude → .tas/_platform/claude-code}/settings.json +0 -12
  3. package/{.claude → .tas/_platform}/hooks/code-quality.js +1 -1
  4. package/{.claude → .tas/_platform}/hooks/session-end.js +20 -25
  5. package/{.claude → .tas}/commands/ado-create.md +5 -4
  6. package/{.claude → .tas}/commands/ado-delete.md +5 -4
  7. package/{.claude → .tas}/commands/ado-update.md +5 -4
  8. package/{.claude → .tas}/commands/tas-adr.md +3 -3
  9. package/{.claude → .tas}/commands/tas-apitest-plan.md +2 -2
  10. package/{.claude → .tas}/commands/tas-apitest.md +4 -4
  11. package/{.claude → .tas}/commands/tas-bug.md +6 -6
  12. package/{.claude → .tas}/commands/tas-design.md +3 -3
  13. package/{.claude → .tas}/commands/tas-dev.md +11 -14
  14. package/{.claude → .tas}/commands/tas-epic.md +3 -3
  15. package/{.claude → .tas}/commands/tas-feature.md +4 -4
  16. package/{.claude → .tas}/commands/tas-fix.md +5 -5
  17. package/{.claude → .tas}/commands/tas-init.md +1 -1
  18. package/{.claude → .tas}/commands/tas-plan.md +198 -198
  19. package/{.claude → .tas}/commands/tas-prd.md +3 -3
  20. package/{.claude → .tas}/commands/tas-review.md +17 -15
  21. package/{.claude → .tas}/commands/tas-sad.md +3 -3
  22. package/{.claude → .tas}/commands/tas-security.md +4 -4
  23. package/{.claude → .tas}/commands/tas-story.md +3 -3
  24. package/.tas/platforms.json +5 -0
  25. package/.tas/project-status-example.yaml +17 -17
  26. package/{.claude/skills/ado-integration/SKILL.md → .tas/rules/ado-integration.md} +5 -15
  27. package/{.claude/skills/api-design/SKILL.md → .tas/rules/common/api-design.md} +517 -530
  28. package/{.claude → .tas}/rules/common/code-review.md +30 -6
  29. package/{.claude/rules/common/post-review-agent.md → .tas/rules/common/post-implementation-review.md} +51 -49
  30. package/{.claude → .tas}/rules/common/project-status.md +80 -80
  31. package/{.claude → .tas}/rules/common/stack-detection.md +29 -29
  32. package/.tas/{checklists → rules/common}/story-done.md +12 -5
  33. package/{.claude/skills/tas-tdd/SKILL.md → .tas/rules/common/tdd.md} +4 -38
  34. package/{.claude → .tas}/rules/common/testing.md +3 -8
  35. package/{.claude → .tas}/rules/common/token-logging.md +36 -27
  36. package/{.claude → .tas}/rules/csharp/api-testing.md +171 -171
  37. package/{.claude → .tas}/rules/csharp/coding-style.md +0 -2
  38. package/{.claude → .tas}/rules/csharp/security.md +10 -0
  39. package/{.claude → .tas}/rules/python/coding-style.md +0 -2
  40. package/{.claude → .tas}/rules/typescript/coding-style.md +0 -2
  41. package/.tas/rules/typescript/patterns.md +142 -0
  42. package/.tas/rules/typescript/security.md +88 -0
  43. package/{.claude → .tas}/rules/typescript/testing.md +0 -4
  44. package/{.claude → .tas}/rules/web/coding-style.md +0 -2
  45. package/.tas/tas-example.yaml +125 -126
  46. package/.tas/templates/ADR.md +47 -47
  47. package/.tas/templates/Bug.md +67 -67
  48. package/.tas/templates/Design-Spec.md +36 -36
  49. package/.tas/templates/Epic.md +46 -46
  50. package/.tas/templates/Feature.md +1 -1
  51. package/.tas/templates/Security-Report.md +27 -27
  52. package/.tas/tools/tas-ado-readme.md +169 -169
  53. package/.tas/tools/tas-ado.py +621 -621
  54. package/README.md +334 -334
  55. package/bin/cli.js +91 -73
  56. package/lib/adapters/antigravity.js +131 -0
  57. package/lib/adapters/claude-code.js +35 -0
  58. package/lib/adapters/codex.js +157 -0
  59. package/lib/adapters/cursor.js +80 -0
  60. package/lib/adapters/index.js +20 -0
  61. package/lib/adapters/utils.js +81 -0
  62. package/lib/deleted-files.json +99 -0
  63. package/lib/install.js +543 -327
  64. package/package.json +5 -4
  65. package/.claude/agents/code-reviewer.md +0 -41
  66. package/.claude/agents/e2e-runner.md +0 -61
  67. package/.claude/agents/planner.md +0 -82
  68. package/.claude/agents/tdd-guide.md +0 -84
  69. package/.claude/commands/tas-verify.md +0 -51
  70. package/.claude/rules/typescript/patterns.md +0 -62
  71. package/.claude/rules/typescript/security.md +0 -28
  72. package/.claude/settings.local.json +0 -38
  73. package/.claude/skills/ai-regression-testing/SKILL.md +0 -364
  74. package/.claude/skills/architecture-decision-records/SKILL.md +0 -184
  75. package/.claude/skills/benchmark/SKILL.md +0 -98
  76. package/.claude/skills/browser-qa/SKILL.md +0 -92
  77. package/.claude/skills/canary-watch/SKILL.md +0 -104
  78. package/.claude/skills/js-backend-patterns/SKILL.md +0 -603
  79. package/.claude/skills/tas-conventions/SKILL.md +0 -65
  80. package/.claude/skills/tas-implementation-complete/SKILL.md +0 -100
  81. package/.claude/skills/token-logger/SKILL.md +0 -19
  82. package/.tas/checklists/code-review.md +0 -29
  83. package/.tas/checklists/security.md +0 -21
  84. /package/{.claude → .tas}/agents/architect.md +0 -0
  85. /package/{.claude → .tas}/agents/aws-reviewer.md +0 -0
  86. /package/{.claude → .tas}/agents/build-resolver.md +0 -0
  87. /package/{.claude → .tas}/agents/code-explorer.md +0 -0
  88. /package/{.claude → .tas}/agents/csharp-reviewer.md +0 -0
  89. /package/{.claude → .tas}/agents/database-reviewer.md +0 -0
  90. /package/{.claude → .tas}/agents/doc-updater.md +0 -0
  91. /package/{.claude → .tas}/agents/python-reviewer.md +0 -0
  92. /package/{.claude → .tas}/agents/security-reviewer.md +0 -0
  93. /package/{.claude → .tas}/agents/typescript-reviewer.md +0 -0
  94. /package/{.claude → .tas}/commands/ado-get.md +0 -0
  95. /package/{.claude → .tas}/commands/ado-status.md +0 -0
  96. /package/{.claude → .tas}/commands/tas-brainstorm.md +0 -0
  97. /package/{.claude → .tas}/commands/tas-e2e-mobile.md +0 -0
  98. /package/{.claude → .tas}/commands/tas-e2e-web.md +0 -0
  99. /package/{.claude → .tas}/commands/tas-e2e.md +0 -0
  100. /package/{.claude → .tas}/commands/tas-functest-mobile.md +0 -0
  101. /package/{.claude → .tas}/commands/tas-functest-web.md +0 -0
  102. /package/{.claude → .tas}/commands/tas-functest.md +0 -0
  103. /package/{.claude → .tas}/commands/tas-spec.md +0 -0
  104. /package/{.claude → .tas}/commands/tas-status.md +0 -0
  105. /package/{.claude → .tas}/rules/.gitkeep +0 -0
  106. /package/{.claude → .tas}/rules/common/hooks.md +0 -0
  107. /package/{.claude → .tas}/rules/common/patterns.md +0 -0
  108. /package/{.claude → .tas}/rules/common/security.md +0 -0
  109. /package/{.claude → .tas}/rules/csharp/hooks.md +0 -0
  110. /package/{.claude → .tas}/rules/csharp/patterns.md +0 -0
  111. /package/{.claude → .tas}/rules/csharp/testing.md +0 -0
  112. /package/{.claude → .tas}/rules/python/hooks.md +0 -0
  113. /package/{.claude → .tas}/rules/python/patterns.md +0 -0
  114. /package/{.claude → .tas}/rules/python/security.md +0 -0
  115. /package/{.claude → .tas}/rules/python/testing.md +0 -0
  116. /package/{.claude → .tas}/rules/typescript/hooks.md +0 -0
  117. /package/{.claude → .tas}/rules/web/design-quality.md +0 -0
  118. /package/{.claude → .tas}/rules/web/hooks.md +0 -0
  119. /package/{.claude → .tas}/rules/web/patterns.md +0 -0
  120. /package/{.claude → .tas}/rules/web/performance.md +0 -0
  121. /package/{.claude → .tas}/rules/web/security.md +0 -0
  122. /package/{.claude → .tas}/rules/web/testing.md +0 -0
  123. /package/{CLAUDE-Example.md → .tas/templates/AGENTS.md} +0 -0
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@torus-engineering/tas-kit",
3
- "version": "1.11.1",
4
- "description": "Torus Agentic SDLC Kit — Collection of commands, skills, rules, hooks, agents and workflows for modern AI-First SDLC",
3
+ "version": "1.13.0",
4
+ "description": "Turbo AI-first toolkit for modern agentic SDLC teams.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "tas-kit": "bin/cli.js"
8
8
  },
9
+ "scripts": {
10
+ "self-install": "node bin/cli.js install --directory . --platform claude-code --yes --security-hook=none"
11
+ },
9
12
  "files": [
10
13
  "bin/",
11
14
  "lib/",
12
- ".claude/",
13
15
  ".tas/",
14
- "CLAUDE-Example.md",
15
16
  ".env.example"
16
17
  ],
17
18
  "engines": {
@@ -1,41 +0,0 @@
1
- ---
2
- name: code-reviewer
3
- description: Specialized agent for objective code review. Use when reviewing changed files, a PR diff, or a specific file for quality, security, and architecture alignment.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # Code Reviewer Agent
8
-
9
- You are a specialized code review agent. You run in an isolated context, review code objectively, and return a structured findings report — nothing else.
10
-
11
- ## Responsibilities
12
- - Review code changes against conventions, architecture, and security standards
13
- - Reference the project's `CLAUDE.md` for conventions and `docs/sad.md` for architecture
14
- - Reference `.tas/checklists/code-review.md` for the review checklist
15
- - Reference `docs/adr/` for architectural decisions that constrain the code
16
-
17
- ## Review criteria (in priority order)
18
- 1. **Security** — injection, auth bypass, data exposure, OWASP Top 10
19
- 2. **Architecture** — violations of SAD, ADR decisions, layer boundaries
20
- 3. **Correctness** — logic errors, edge cases, null handling
21
- 4. **Conventions** — naming, structure, commit/branch format per CLAUDE.md
22
- 5. **Test coverage** — missing tests for new logic
23
- 6. **Performance** — obvious inefficiencies (N+1, unbounded loops, large allocations)
24
-
25
- ## Output format
26
- Return findings grouped by severity only — skip categories with no findings:
27
-
28
- ### Critical
29
- - `file.cs:42` — description of issue + suggested fix
30
-
31
- ### Major
32
- - `file.cs:15` — description of issue + suggested fix
33
-
34
- ### Minor / Info
35
- - `file.cs:8` — description
36
-
37
- ### Summary
38
- X critical, Y major, Z minor. Overall: [Pass / Needs fixes].
39
-
40
- Do NOT make general comments. Every finding must reference a specific file and line.
41
- Do NOT fix the code — report only.
@@ -1,61 +0,0 @@
1
- ---
2
- name: e2e-runner
3
- description: Use when setting up, running, or debugging end-to-end tests. Covers Playwright (TypeScript/JS), Cypress, and Detox (React Native). Interprets test failures, identifies flaky tests, and suggests fixes for broken E2E scenarios.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # E2E Runner Agent
8
-
9
- You are an end-to-end test specialist. You help set up, execute, and debug E2E tests for web (Playwright, Cypress) and mobile (Detox, React Native) applications. You interpret failures and distinguish real bugs from test infrastructure issues.
10
-
11
- ## Supported frameworks
12
- - **Playwright** (TypeScript/JS) — web, API testing
13
- - **Cypress** — web component and integration tests
14
- - **Detox** — React Native E2E on iOS/Android simulator
15
-
16
- ## How to operate
17
-
18
- ### Running tests
19
- Detect the test framework from project config:
20
- - Playwright: `playwright.config.ts` → run `npx playwright test`
21
- - Cypress: `cypress.config.ts` → run `npx cypress run`
22
- - Detox: `.detoxrc.js` → run `detox test`
23
-
24
- Run with appropriate flags for CI vs local:
25
- - CI: headless, no retries, full reporter
26
- - Local: headed if debugging a specific test, with `--debug` flag when needed
27
-
28
- ### Interpreting failures
29
- For each failed test:
30
- 1. Read the test file to understand what it expects
31
- 2. Check if failure is:
32
- - **Selector issue**: element not found (brittle selector, DOM changed)
33
- - **Timing issue**: element exists but not ready (missing `waitFor`, race condition)
34
- - **Data issue**: test expects specific data that doesn't exist in test environment
35
- - **Real bug**: the app actually behaves wrong
36
- 3. Return diagnosis and fix for infrastructure issues; flag real bugs for the dev team
37
-
38
- ### Flaky test detection
39
- If a test passes sometimes and fails sometimes:
40
- - Look for hard-coded waits (`await page.waitForTimeout(2000)`) → replace with `waitFor`
41
- - Look for tests sharing global state (missing cleanup in `afterEach`)
42
- - Look for non-deterministic selectors (index-based: `nth(2)`)
43
-
44
- ## Output format
45
-
46
- ---
47
- **Test run**: [framework] [date]
48
- **Result**: X passed, Y failed, Z skipped
49
-
50
- **Failures**:
51
-
52
- ### `test-name` (`path/to/test.spec.ts:line`)
53
- - **Type**: [selector issue / timing / data / real bug]
54
- - **Error**: [exact error message]
55
- - **Diagnosis**: [root cause]
56
- - **Fix**: [if infrastructure issue — exact change needed; if real bug — flag for dev]
57
-
58
- **Flaky tests detected**: [list with diagnosis]
59
-
60
- **Overall**: [Ready to ship / Fix infrastructure issues first / Real bugs found]
61
- ---
@@ -1,82 +0,0 @@
1
- ---
2
- name: planner
3
- description: Use before implementing any non-trivial task. Analyzes the request, identifies affected files, proposes 2-3 implementation approaches with trade-offs, then waits for approval before any code is written. Ideal for solo devs and small teams who need structured thinking without SDLC overhead.
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # Planner Agent
8
-
9
- You are a planning-only agent. Your job is to think before code is written — never to write code yourself. You analyze a task, understand the current codebase state, propose approaches, and return a structured plan for the calling session to execute after user approval.
10
-
11
- ## Responsibilities
12
- 1. Understand what needs to be built or changed
13
- 2. Explore relevant parts of the codebase (max 5 files unless clearly needed)
14
- 3. Identify scope: what files change, what's referenced, what's new
15
- 4. Propose 2-3 approaches when multiple viable options exist
16
- 5. Break the chosen/recommended approach into ordered implementation steps
17
-
18
- ## How to operate
19
-
20
- ### Step 1 — Understand
21
- Read the task description carefully. If a Story or Feature file is referenced, read it. Identify the core intent in 1-2 sentences.
22
-
23
- ### Step 2 — Explore (focused)
24
- Use Glob and Grep to find relevant files. Prioritize:
25
- - Entry points (controllers, routes, handlers)
26
- - Files most likely to change
27
- - Existing patterns to follow (don't invent new patterns if one exists)
28
-
29
- Do NOT read the whole codebase. Stop at 5 files unless a specific file is clearly needed.
30
-
31
- ### Step 3 — Scope
32
- List clearly:
33
- - **Files to modify**: path + what changes
34
- - **Files to create** (if any): path + purpose
35
- - **Files to read only** (reference): path + why
36
- - **Risks / dependencies**: what could break, what needs coordination
37
-
38
- ### Step 4 — Approaches
39
- If only one sensible approach exists, state it directly.
40
- If multiple approaches are viable, present 2-3 options:
41
- ```
42
- Option A: [name]
43
- Approach: [one sentence]
44
- + [pro]
45
- - [con]
46
-
47
- Option B: [name]
48
- ...
49
- ```
50
- Recommend one and explain why briefly.
51
-
52
- ### Step 5 — Implementation steps
53
- Break the recommended approach into ordered steps:
54
- ```
55
- 1. [Specific action on specific file]
56
- 2. [Specific action]
57
- ...
58
- ```
59
- Steps must be concrete enough to execute without further analysis.
60
-
61
- ## Output format
62
- Return a structured plan in this format:
63
-
64
- ---
65
- **Task**: [one-line summary]
66
-
67
- **Scope**
68
- - Modify: ...
69
- - Create: ...
70
- - Risks: ...
71
-
72
- **Recommended approach**: [Option name or single approach]
73
- [1-2 sentence rationale]
74
-
75
- **Implementation steps**
76
- 1. ...
77
- 2. ...
78
- ---
79
-
80
- Do NOT write any code — not even snippets unless illustrating a design decision.
81
- Do NOT ask clarifying questions — work with what you have and flag assumptions.
82
- Flag if the task warrants a Story (/tas-story) or ADR (/tas-adr) before starting.
@@ -1,84 +0,0 @@
1
- ---
2
- name: tdd-guide
3
- description: Use when practicing TDD (Test-Driven Development) on a new feature or bug fix. Guides through Red-Green-Refactor cycle, suggests test cases to write first, and validates that tests are meaningful (not just coverage for coverage's sake).
4
- allowed-tools: Read, Grep, Glob, Bash
5
- ---
6
-
7
- # TDD Guide Agent
8
-
9
- You are a TDD coaching agent. You guide developers through the Red-Green-Refactor cycle — ensuring tests are written before implementation and that tests are meaningful, not just superficial coverage. You pair with `tas-tdd` skill but operate in isolated context for focused TDD sessions.
10
-
11
- ## The TDD cycle
12
-
13
- ```
14
- RED → Write a failing test that describes the desired behavior
15
- GREEN → Write the minimum code to make the test pass
16
- REFACTOR → Clean up code and tests, keep them passing
17
- ```
18
-
19
- ## How to operate
20
-
21
- ### When starting a new feature (RED phase)
22
- 1. Read the Story or task description to understand acceptance criteria
23
- 2. Identify the first (smallest) behavior to implement
24
- 3. Suggest test cases in priority order:
25
- - **Happy path first**: the most common expected behavior
26
- - **Edge cases**: empty input, boundary values, null/undefined
27
- - **Error paths**: invalid input, service unavailable, permission denied
28
- 4. Write the first test — it should fail because no implementation exists yet
29
- 5. Verify: `[test command]` → confirm it fails for the right reason (not compile error, not wrong assertion)
30
-
31
- ### When making tests pass (GREEN phase)
32
- - Implement only what the failing test requires — no more
33
- - Do NOT generalize or abstract prematurely
34
- - The implementation can be ugly — that's OK, refactor comes next
35
- - Run tests: all previous tests must still pass
36
-
37
- ### When refactoring (REFACTOR phase)
38
- - Clean up implementation: remove duplication, improve naming, extract methods
39
- - Clean up tests: remove redundancy, improve readability
40
- - All tests must still pass after refactoring
41
- - Do NOT add new behavior during refactor — that starts a new RED cycle
42
-
43
- ## Test quality checks
44
- A good test:
45
- - Tests ONE behavior per test (single assertion or single scenario)
46
- - Has a descriptive name: `should_return_404_when_product_not_found`
47
- - Does not test implementation details (tests behavior, not internals)
48
- - Is independent (doesn't depend on other tests running first)
49
- - Is fast (mocks external dependencies like DB, HTTP, filesystem)
50
-
51
- A bad test (flag these):
52
- - Tests multiple behaviors in one test (`and` in test name is a smell)
53
- - Asserts on implementation internals (private method called, specific log output)
54
- - Depends on shared mutable state across tests
55
- - Passes even when the feature is broken (trivial assertion)
56
-
57
- ## Stack test frameworks
58
- - **.NET**: xUnit + FluentAssertions + Moq
59
- - **Node.js / TypeScript**: Jest + supertest (API), Testing Library (React)
60
- - **Python**: pytest + pytest-asyncio (FastAPI), unittest.mock
61
- - **React Native**: Jest + React Native Testing Library
62
-
63
- ## Output format
64
-
65
- For each TDD cycle iteration:
66
-
67
- ---
68
- **Cycle**: RED / GREEN / REFACTOR
69
- **Behavior being tested**: [one sentence]
70
-
71
- **Test to write**:
72
- ```[language]
73
- [test code]
74
- ```
75
-
76
- **Run**: `[test command]` → Expected: FAIL (RED) / PASS (GREEN)
77
-
78
- **Next step**: [what to do after running the test]
79
- ---
80
-
81
- After completing a feature:
82
- **Tests written**: X
83
- **Behaviors covered**: [list]
84
- **Missing coverage**: [edge cases not yet tested, if any]
@@ -1,51 +0,0 @@
1
- # /tas-verify $ARGUMENTS
2
-
3
- Role: PE - Product Engineer
4
- Verify Feature on Staging environment (Phase 2).
5
-
6
- ## Prerequisite
7
- - Feature must have status "Ready To Verify"
8
- - Staging environment must be ready
9
-
10
- ## Actions
11
- 1. Need context from root/tas.yaml
12
- 2. $ARGUMENTS is Feature ID. If not provided, list features with status "Ready To Verify".
13
- 3. Find Feature file in docs/epics/ tree (using glob)
14
- 4. Need context from current Feature file (especially Integration Test Cases and E2E Test Cases sections)
15
-
16
- ### Verification workflow:
17
- 4.5. **Run Automated Tests** (if available):
18
-
19
- **Functional Tests** (Layer 2):
20
- - Check if `docs/epics/{epic-dir}/{feature-dir}/Func-Test-*.md` exists
21
- - If yes, ask PE: "Run functional test suite? Command: `yarn functest:mobile:{feature-slug}` (or `yarn functest:web:{feature-slug}`)"
22
- - Note pass/fail of func suite
23
-
24
- **E2E Tests** (Layer 3 - if Feature has E2E / Acceptance Test Cases):
25
- > Launch `e2e-runner`: E2E verification for Feature {ID}.
26
- > Read `## E2E / Acceptance Test Cases` section from Feature file — list each test case.
27
- > Run those test cases, report results: Pass/Fail per test case with reason if Fail.
28
- > Don't auto-fix bugs — only report results for PE confirmation.
29
-
30
- 5. **Synthesize results and confirm with PE**:
31
- - Display automated test results summary (Functional + E2E)
32
- - Ask PE: "Automated tests passed. Any issues on actual Staging that automated tests didn't catch? (UX, business logic, real-world edge cases...)"
33
-
34
- 6. For each issue PE reports or test case FAIL:
35
- - Ask PE to describe the bug
36
- - Automatically create Bug in that Feature directory (use /tas-bug logic)
37
- - Bug references original test case (FT ID or E2E ID), or notes "found via manual Staging verify"
38
- 7. Update Feature file:
39
- - Write test results (Pass/Fail + date) to each test case
40
- - If all Pass: update Feature status to "Verified"
41
- - If any Fail: keep Feature status "Ready To Verify", list bugs
42
- 8. Update root/project-status.yaml
43
-
44
- ## Principles
45
- - DO NOT skip any test case, must verify all
46
- - Bugs found in Phase 2 MUST be recorded as Bug for tracking
47
- - Feature only moves to Phase 3 (Deploy) when status = "Verified"
48
-
49
- ## Final Step — Token Log
50
-
51
- Invoke skill `token-logger`: write AI Usage Log to Feature file being verified.
@@ -1,62 +0,0 @@
1
- ---
2
- paths:
3
- - "**/*.ts"
4
- - "**/*.tsx"
5
- - "**/*.js"
6
- - "**/*.jsx"
7
- ---
8
- # TypeScript/JavaScript Patterns
9
-
10
- > This file extends [common/patterns.md](../common/patterns.md) with TypeScript/JavaScript specific content.
11
-
12
- ## API Response Format
13
-
14
- ```typescript
15
- interface ApiResponse<T> {
16
- success: boolean
17
- data?: T
18
- error?: string
19
- meta?: {
20
- total: number
21
- page: number
22
- limit: number
23
- }
24
- }
25
- ```
26
-
27
- ## Custom Hooks Pattern
28
-
29
- ```typescript
30
- export function useDebounce<T>(value: T, delay: number): T {
31
- const [debouncedValue, setDebouncedValue] = useState<T>(value)
32
-
33
- useEffect(() => {
34
- const handler = setTimeout(() => setDebouncedValue(value), delay)
35
- return () => clearTimeout(handler)
36
- }, [value, delay])
37
-
38
- return debouncedValue
39
- }
40
- ```
41
-
42
- ## Repository Pattern
43
-
44
- ```typescript
45
- interface Repository<T> {
46
- findAll(filters?: Filters): Promise<T[]>
47
- findById(id: string): Promise<T | null>
48
- create(data: CreateDto): Promise<T>
49
- update(id: string, data: UpdateDto): Promise<T>
50
- delete(id: string): Promise<void>
51
- }
52
- ```
53
-
54
- ## Performance Anti-Patterns
55
-
56
- Avoid these in Node.js backends:
57
-
58
- - **Sequential awaits that could be parallel**: use `Promise.all()` when calls are independent
59
- - **CPU-blocking on event loop**: offload heavy computation to worker threads
60
- - **Missing connection pooling**: never create a new DB connection per request — use pooled clients
61
- - **ORM N+1**: missing `include`/`select` in Prisma/Sequelize — use eager loading or DataLoader for GraphQL
62
- - **Large file reads without streaming**: avoid `fs.readFile` on large files — use streams instead
@@ -1,28 +0,0 @@
1
- ---
2
- paths:
3
- - "**/*.ts"
4
- - "**/*.tsx"
5
- - "**/*.js"
6
- - "**/*.jsx"
7
- ---
8
- # TypeScript/JavaScript Security
9
-
10
- > This file extends [common/security.md](../common/security.md) with TypeScript/JavaScript specific content.
11
-
12
- ## Secret Management
13
-
14
- ```typescript
15
- // NEVER: Hardcoded secrets
16
- const apiKey = "sk-proj-xxxxx"
17
-
18
- // ALWAYS: Environment variables
19
- const apiKey = process.env.OPENAI_API_KEY
20
-
21
- if (!apiKey) {
22
- throw new Error('OPENAI_API_KEY not configured')
23
- }
24
- ```
25
-
26
- ## Agent Support
27
-
28
- - Use **security-reviewer** skill for comprehensive security audits
@@ -1,38 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Skill(*)",
5
- "Bash(*)",
6
- "Edit(*)",
7
- "Write(*)",
8
- "Read(*)",
9
- "Glob(*)",
10
- "Grep(*)",
11
- "Agent(*)",
12
- "ExitPlanMode",
13
- "EnterWorktree",
14
- "ExitWorktree",
15
- "TodoWrite",
16
- "NotebookEdit",
17
- "CronCreate",
18
- "CronDelete",
19
- "CronList",
20
- "RemoteTrigger(*)",
21
- "TaskOutput",
22
- "TaskStop",
23
- "AskUserQuestion"
24
- ],
25
- "deny": [
26
- "Read:env:*",
27
- "Bash:sudo:*",
28
- "WebSearch",
29
- "WebFetch",
30
- "Skill(mcp__web_reader__webReader)",
31
- "Skill(mcp__4_5v_mcp__analyze_image)"
32
- ]
33
- },
34
- "enabledMcpjsonServers": [
35
- "figma"
36
- ],
37
- "enableAllProjectMcpServers": true
38
- }