agcel 1.0.1

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 (100) hide show
  1. package/.agent/workflows/api-gen.md +59 -0
  2. package/.agent/workflows/architect.md +44 -0
  3. package/.agent/workflows/brainstorm.md +223 -0
  4. package/.agent/workflows/build.md +38 -0
  5. package/.agent/workflows/changelog.md +51 -0
  6. package/.agent/workflows/checkpoint.md +138 -0
  7. package/.agent/workflows/commit.md +223 -0
  8. package/.agent/workflows/debug.md +57 -0
  9. package/.agent/workflows/deploy.md +76 -0
  10. package/.agent/workflows/doc.md +247 -0
  11. package/.agent/workflows/execute-plan.md +225 -0
  12. package/.agent/workflows/feature.md +255 -0
  13. package/.agent/workflows/fix.md +323 -0
  14. package/.agent/workflows/help.md +63 -0
  15. package/.agent/workflows/index.md +148 -0
  16. package/.agent/workflows/load.md +112 -0
  17. package/.agent/workflows/mode.md +170 -0
  18. package/.agent/workflows/optimize.md +53 -0
  19. package/.agent/workflows/plan.md +337 -0
  20. package/.agent/workflows/pr.md +74 -0
  21. package/.agent/workflows/product-plan.md +36 -0
  22. package/.agent/workflows/production-deploy.md +39 -0
  23. package/.agent/workflows/refactor.md +63 -0
  24. package/.agent/workflows/research.md +116 -0
  25. package/.agent/workflows/review.md +344 -0
  26. package/.agent/workflows/security-scan.md +56 -0
  27. package/.agent/workflows/ship.md +221 -0
  28. package/.agent/workflows/spawn.md +177 -0
  29. package/.agent/workflows/status.md +59 -0
  30. package/.agent/workflows/tdd.md +139 -0
  31. package/.agent/workflows/test.md +340 -0
  32. package/.agent/workflows/verify.md +35 -0
  33. package/LICENSE +21 -0
  34. package/README.md +67 -0
  35. package/dist/commands/init.js +142 -0
  36. package/dist/commands/install.js +98 -0
  37. package/dist/commands/list.js +49 -0
  38. package/dist/commands/restart.js +17 -0
  39. package/dist/commands/start.js +41 -0
  40. package/dist/commands/status.js +24 -0
  41. package/dist/commands/stop.js +29 -0
  42. package/dist/commands/uninstall.js +78 -0
  43. package/dist/index.js +58 -0
  44. package/dist/server/index.js +174 -0
  45. package/dist/utils/index.js +63 -0
  46. package/package.json +54 -0
  47. package/skills/api-security-best-practices/SKILL.md +291 -0
  48. package/skills/api-security-best-practices/references/examples.md +617 -0
  49. package/skills/architecture/SKILL.md +59 -0
  50. package/skills/architecture/context-discovery.md +43 -0
  51. package/skills/architecture/examples.md +94 -0
  52. package/skills/architecture/pattern-selection.md +68 -0
  53. package/skills/architecture/patterns-reference.md +50 -0
  54. package/skills/architecture/trade-off-analysis.md +77 -0
  55. package/skills/aws-serverless/SKILL.md +327 -0
  56. package/skills/brainstorming/SKILL.md +234 -0
  57. package/skills/c4-context/SKILL.md +154 -0
  58. package/skills/ci-cd-engineer/SKILL.md +50 -0
  59. package/skills/code-auditing/SKILL.md +55 -0
  60. package/skills/copywriting/SKILL.md +248 -0
  61. package/skills/database-engineer/SKILL.md +47 -0
  62. package/skills/doc-coauthoring/SKILL.md +379 -0
  63. package/skills/docker-expert/SKILL.md +412 -0
  64. package/skills/langgraph/SKILL.md +291 -0
  65. package/skills/postgresql/SKILL.md +73 -0
  66. package/skills/pricing-strategy/SKILL.md +360 -0
  67. package/skills/product-manager/SKILL.md +57 -0
  68. package/skills/prompt-engineer/README.md +659 -0
  69. package/skills/prompt-engineer/SKILL.md +256 -0
  70. package/skills/python-patterns/SKILL.md +445 -0
  71. package/skills/qa-engineer/SKILL.md +42 -0
  72. package/skills/rag-engineer/SKILL.md +94 -0
  73. package/skills/react-patterns/SKILL.md +202 -0
  74. package/skills/secure-refactoring/SKILL.md +54 -0
  75. package/skills/security-documentation/SKILL.md +53 -0
  76. package/skills/senior-architect/SKILL.md +213 -0
  77. package/skills/senior-architect/references/architecture_patterns.md +103 -0
  78. package/skills/senior-architect/references/system_design_workflows.md +103 -0
  79. package/skills/senior-architect/references/tech_decision_guide.md +103 -0
  80. package/skills/senior-architect/scripts/architecture_diagram_generator.py +114 -0
  81. package/skills/senior-architect/scripts/dependency_analyzer.py +114 -0
  82. package/skills/senior-architect/scripts/project_architect.py +114 -0
  83. package/skills/seo-audit/SKILL.md +491 -0
  84. package/skills/sql-injection-testing/SKILL.md +452 -0
  85. package/skills/test-driven-development/SKILL.md +375 -0
  86. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  87. package/skills/test-fixing/SKILL.md +123 -0
  88. package/skills/testing-patterns/SKILL.md +263 -0
  89. package/skills/typescript-expert/SKILL.md +202 -0
  90. package/skills/typescript-expert/references/advanced-topics.md +252 -0
  91. package/skills/typescript-expert/references/tsconfig-strict.json +92 -0
  92. package/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
  93. package/skills/typescript-expert/references/utility-types.ts +335 -0
  94. package/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
  95. package/skills/ui-ux-designer/SKILL.md +46 -0
  96. package/skills/vercel-deployment/SKILL.md +83 -0
  97. package/skills/vulnerability-scanner/SKILL.md +280 -0
  98. package/skills/vulnerability-scanner/checklists.md +121 -0
  99. package/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  100. package/skills/writing-plans/SKILL.md +120 -0
@@ -0,0 +1,252 @@
1
+ # TypeScript Advanced Topics
2
+
3
+ ## 1. Advanced Type System Expertise
4
+
5
+ ### Type-Level Programming Patterns
6
+
7
+ **Branded Types for Domain Modeling**
8
+ ```typescript
9
+ // Create nominal types to prevent primitive obsession
10
+ type Brand<K, T> = K & { __brand: T };
11
+ type UserId = Brand<string, 'UserId'>;
12
+ type OrderId = Brand<string, 'OrderId'>;
13
+
14
+ // Prevents accidental mixing of domain primitives
15
+ function processOrder(orderId: OrderId, userId: UserId) { }
16
+ ```
17
+ - Use for: Critical domain primitives, API boundaries, currency/units
18
+ - Resource: https://egghead.io/blog/using-branded-types-in-typescript
19
+
20
+ **Advanced Conditional Types**
21
+ ```typescript
22
+ // Recursive type manipulation
23
+ type DeepReadonly<T> = T extends (...args: any[]) => any
24
+ ? T
25
+ : T extends object
26
+ ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
27
+ : T;
28
+
29
+ // Template literal type magic
30
+ type PropEventSource<Type> = {
31
+ on<Key extends string & keyof Type>
32
+ (eventName: `${Key}Changed`, callback: (newValue: Type[Key]) => void): void;
33
+ };
34
+ ```
35
+ - Use for: Library APIs, type-safe event systems, compile-time validation
36
+ - Watch for: Type instantiation depth errors (limit recursion to 10 levels)
37
+
38
+ **Type Inference Techniques**
39
+ ```typescript
40
+ // Use 'satisfies' for constraint validation (TS 5.0+)
41
+ const config = {
42
+ api: "https://api.example.com",
43
+ timeout: 5000
44
+ } satisfies Record<string, string | number>;
45
+ // Preserves literal types while ensuring constraints
46
+
47
+ // Const assertions for maximum inference
48
+ const routes = ['/home', '/about', '/contact'] as const;
49
+ type Route = typeof routes[number]; // '/home' | '/about' | '/contact'
50
+ ```
51
+
52
+ ### Performance Optimization Strategies
53
+
54
+ **Type Checking Performance**
55
+ ```bash
56
+ # Diagnose slow type checking
57
+ npx tsc --extendedDiagnostics --incremental false | grep -E "Check time|Files:|Lines:|Nodes:"
58
+
59
+ # Common fixes for "Type instantiation is excessively deep"
60
+ # 1. Replace type intersections with interfaces
61
+ # 2. Split large union types (>100 members)
62
+ # 3. Avoid circular generic constraints
63
+ # 4. Use type aliases to break recursion
64
+ ```
65
+
66
+ **Build Performance Patterns**
67
+ - Enable `skipLibCheck: true` for library type checking only (often significantly improves performance on large projects, but avoid masking app typing issues)
68
+ - Use `incremental: true` with `.tsbuildinfo` cache
69
+ - Configure `include`/`exclude` precisely
70
+ - For monorepos: Use project references with `composite: true`
71
+
72
+ ## 2. Real-World Problem Resolution
73
+
74
+ ### Complex Error Patterns
75
+
76
+ **"The inferred type of X cannot be named"**
77
+ - Cause: Missing type export or circular dependency
78
+ - Fix priority:
79
+ 1. Export the required type explicitly
80
+ 2. Use `ReturnType<typeof function>` helper
81
+ 3. Break circular dependencies with type-only imports
82
+ - Resource: https://github.com/microsoft/TypeScript/issues/47663
83
+
84
+ **Missing type declarations**
85
+ - Quick fix with ambient declarations:
86
+ ```typescript
87
+ // types/ambient.d.ts
88
+ declare module 'some-untyped-package' {
89
+ const value: unknown;
90
+ export default value;
91
+ export = value; // if CJS interop is needed
92
+ }
93
+ ```
94
+ - For more details: [Declaration Files Guide](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)
95
+
96
+ **"Excessive stack depth comparing types"**
97
+ - Cause: Circular or deeply recursive types
98
+ - Fix priority:
99
+ 1. Limit recursion depth with conditional types
100
+ 2. Use `interface` extends instead of type intersection
101
+ 3. Simplify generic constraints
102
+ ```typescript
103
+ // Bad: Infinite recursion
104
+ type InfiniteArray<T> = T | InfiniteArray<T>[];
105
+
106
+ // Good: Limited recursion
107
+ type NestedArray<T, D extends number = 5> =
108
+ D extends 0 ? T : T | NestedArray<T, [-1, 0, 1, 2, 3, 4][D]>[];
109
+ ```
110
+
111
+ **Module Resolution Mysteries**
112
+ - "Cannot find module" despite file existing:
113
+ 1. Check `moduleResolution` matches your bundler
114
+ 2. Verify `baseUrl` and `paths` alignment
115
+ 3. For monorepos: Ensure workspace protocol (workspace:*)
116
+ 4. Try clearing cache: `rm -rf node_modules/.cache .tsbuildinfo`
117
+
118
+ **Path Mapping at Runtime**
119
+ - TypeScript paths only work at compile time, not runtime
120
+ - Node.js runtime solutions:
121
+ - ts-node: Use `ts-node -r tsconfig-paths/register`
122
+ - Node ESM: Use loader alternatives or avoid TS paths at runtime
123
+ - Production: Pre-compile with resolved paths
124
+
125
+ ### Migration Expertise
126
+
127
+ **JavaScript to TypeScript Migration**
128
+ ```bash
129
+ # Incremental migration strategy
130
+ # 1. Enable allowJs and checkJs (merge into existing tsconfig.json):
131
+ # Add to existing tsconfig.json:
132
+ # {
133
+ # "compilerOptions": {
134
+ # "allowJs": true,
135
+ # "checkJs": true
136
+ # }
137
+ # }
138
+
139
+ # 2. Rename files gradually (.js → .ts)
140
+ # 3. Add types file by file using AI assistance
141
+ # 4. Enable strict mode features one by one
142
+
143
+ # Automated helpers (if installed/needed)
144
+ command -v ts-migrate >/dev/null 2>&1 && npx ts-migrate migrate . --sources 'src/**/*.js'
145
+ command -v typesync >/dev/null 2>&1 && npx typesync # Install missing @types packages
146
+ ```
147
+
148
+ **Tool Migration Decisions**
149
+
150
+ | From | To | When | Migration Effort |
151
+ |------|-----|------|-----------------|
152
+ | ESLint + Prettier | Biome | Need much faster speed, okay with fewer rules | Low (1 day) |
153
+ | TSC for linting | Type-check only | Have 100+ files, need faster feedback | Medium (2-3 days) |
154
+ | Lerna | Nx/Turborepo | Need caching, parallel builds | High (1 week) |
155
+ | CJS | ESM | Node 18+, modern tooling | High (varies) |
156
+
157
+ ### Monorepo Management
158
+
159
+ **Nx vs Turborepo Decision Matrix**
160
+ - Choose **Turborepo** if: Simple structure, need speed, <20 packages
161
+ - Choose **Nx** if: Complex dependencies, need visualization, plugins required
162
+ - Performance: Nx often performs better on large monorepos (>50 packages)
163
+
164
+ **TypeScript Monorepo Configuration**
165
+ ```json
166
+ // Root tsconfig.json
167
+ {
168
+ "references": [
169
+ { "path": "./packages/core" },
170
+ { "path": "./packages/ui" },
171
+ { "path": "./apps/web" }
172
+ ],
173
+ "compilerOptions": {
174
+ "composite": true,
175
+ "declaration": true,
176
+ "declarationMap": true
177
+ }
178
+ }
179
+ ```
180
+
181
+ ## 3. Modern Tooling Expertise
182
+
183
+ ### Biome vs ESLint
184
+
185
+ **Use Biome when:**
186
+ - Speed is critical (often faster than traditional setups)
187
+ - Want single tool for lint + format
188
+ - TypeScript-first project
189
+ - Okay with 64 TS rules vs 100+ in typescript-eslint
190
+
191
+ **Stay with ESLint when:**
192
+ - Need specific rules/plugins
193
+ - Have complex custom rules
194
+ - Working with Vue/Angular (limited Biome support)
195
+ - Need type-aware linting (Biome doesn't have this yet)
196
+
197
+ ### Type Testing Strategies
198
+
199
+ **Vitest Type Testing (Recommended)**
200
+ ```typescript
201
+ // in avatar.test-d.ts
202
+ import { expectTypeOf } from 'vitest'
203
+ import type { Avatar } from './avatar'
204
+
205
+ test('Avatar props are correctly typed', () => {
206
+ expectTypeOf<Avatar>().toHaveProperty('size')
207
+ expectTypeOf<Avatar['size']>().toEqualTypeOf<'sm' | 'md' | 'lg'>()
208
+ })
209
+ ```
210
+
211
+ **When to Test Types:**
212
+ - Publishing libraries
213
+ - Complex generic functions
214
+ - Type-level utilities
215
+ - API contracts
216
+
217
+ ## 4. Debugging Mastery
218
+
219
+ ### CLI Debugging Tools
220
+ ```bash
221
+ # Debug TypeScript files directly (if tools installed)
222
+ command -v tsx >/dev/null 2>&1 && npx tsx --inspect src/file.ts
223
+ command -v ts-node >/dev/null 2>&1 && npx ts-node --inspect-brk src/file.ts
224
+
225
+ # Trace module resolution issues
226
+ npx tsc --traceResolution > resolution.log 2>&1
227
+ grep "Module resolution" resolution.log
228
+
229
+ # Debug type checking performance (use --incremental false for clean trace)
230
+ npx tsc --generateTrace trace --incremental false
231
+ # Analyze trace (if installed)
232
+ command -v @typescript/analyze-trace >/dev/null 2>&1 && npx @typescript/analyze-trace trace
233
+
234
+ # Memory usage analysis
235
+ node --max-old-space-size=8192 node_modules/typescript/lib/tsc.js
236
+ ```
237
+
238
+ ### Custom Error Classes
239
+ ```typescript
240
+ // Proper error class with stack preservation
241
+ class DomainError extends Error {
242
+ constructor(
243
+ message: string,
244
+ public code: string,
245
+ public statusCode: number
246
+ ) {
247
+ super(message);
248
+ this.name = 'DomainError';
249
+ Error.captureStackTrace(this, this.constructor);
250
+ }
251
+ }
252
+ ```
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Strict TypeScript 5.x",
4
+ "compilerOptions": {
5
+ // =========================================================================
6
+ // STRICTNESS (Maximum Type Safety)
7
+ // =========================================================================
8
+ "strict": true,
9
+ "noUncheckedIndexedAccess": true,
10
+ "noImplicitOverride": true,
11
+ "noPropertyAccessFromIndexSignature": true,
12
+ "exactOptionalPropertyTypes": true,
13
+ "noFallthroughCasesInSwitch": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ // =========================================================================
16
+ // MODULE SYSTEM (Modern ESM)
17
+ // =========================================================================
18
+ "module": "ESNext",
19
+ "moduleResolution": "bundler",
20
+ "resolveJsonModule": true,
21
+ "esModuleInterop": true,
22
+ "allowSyntheticDefaultImports": true,
23
+ "isolatedModules": true,
24
+ "verbatimModuleSyntax": true,
25
+ // =========================================================================
26
+ // OUTPUT
27
+ // =========================================================================
28
+ "target": "ES2022",
29
+ "lib": [
30
+ "ES2022",
31
+ "DOM",
32
+ "DOM.Iterable"
33
+ ],
34
+ "declaration": true,
35
+ "declarationMap": true,
36
+ "sourceMap": true,
37
+ // =========================================================================
38
+ // PERFORMANCE
39
+ // =========================================================================
40
+ "skipLibCheck": true,
41
+ "incremental": true,
42
+ // =========================================================================
43
+ // PATH ALIASES
44
+ // =========================================================================
45
+ "baseUrl": ".",
46
+ "paths": {
47
+ "@/*": [
48
+ "./src/*"
49
+ ],
50
+ "@/components/*": [
51
+ "./src/components/*"
52
+ ],
53
+ "@/lib/*": [
54
+ "./src/lib/*"
55
+ ],
56
+ "@/types/*": [
57
+ "./src/types/*"
58
+ ],
59
+ "@/utils/*": [
60
+ "./src/utils/*"
61
+ ]
62
+ },
63
+ // =========================================================================
64
+ // JSX (for React projects)
65
+ // =========================================================================
66
+ // "jsx": "react-jsx",
67
+ // =========================================================================
68
+ // EMIT
69
+ // =========================================================================
70
+ "noEmit": true, // Let bundler handle emit
71
+ // "outDir": "./dist",
72
+ // "rootDir": "./src",
73
+ // =========================================================================
74
+ // DECORATORS (if needed)
75
+ // =========================================================================
76
+ // "experimentalDecorators": true,
77
+ // "emitDecoratorMetadata": true
78
+ },
79
+ "include": [
80
+ "src/**/*.ts",
81
+ "src/**/*.tsx",
82
+ "src/**/*.d.ts"
83
+ ],
84
+ "exclude": [
85
+ "node_modules",
86
+ "dist",
87
+ "build",
88
+ "coverage",
89
+ "**/*.test.ts",
90
+ "**/*.spec.ts"
91
+ ]
92
+ }