@yuaone/core 0.9.0 → 0.9.2
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.
- package/dist/agent-loop.js +1 -1
- package/dist/agent-loop.js.map +1 -1
- package/dist/system-prompt.js +7 -1
- package/dist/system-prompt.js.map +1 -1
- package/package.json +2 -2
- package/dist/skills/skills/code-review.md +0 -58
- package/dist/skills/skills/debug.md +0 -45
- package/dist/skills/skills/languages/python.md +0 -89
- package/dist/skills/skills/languages/react.md +0 -86
- package/dist/skills/skills/languages/typescript.md +0 -110
- package/dist/skills/skills/plan.md +0 -49
- package/dist/skills/skills/refactor.md +0 -46
- package/dist/skills/skills/security-scan.md +0 -59
- package/dist/skills/skills/test-driven.md +0 -51
- /package/dist/skills/{skills/languages → languages}/bash.md +0 -0
- /package/dist/skills/{skills/languages → languages}/c.md +0 -0
- /package/dist/skills/{skills/languages → languages}/cpp.md +0 -0
- /package/dist/skills/{skills/languages → languages}/csharp.md +0 -0
- /package/dist/skills/{skills/languages → languages}/cuda.md +0 -0
- /package/dist/skills/{skills/languages → languages}/dart.md +0 -0
- /package/dist/skills/{skills/languages → languages}/docker.md +0 -0
- /package/dist/skills/{skills/languages → languages}/elixir.md +0 -0
- /package/dist/skills/{skills/languages → languages}/gdscript.md +0 -0
- /package/dist/skills/{skills/languages → languages}/go.md +0 -0
- /package/dist/skills/{skills/languages → languages}/haskell.md +0 -0
- /package/dist/skills/{skills/languages → languages}/java.md +0 -0
- /package/dist/skills/{skills/languages → languages}/javascript.md +0 -0
- /package/dist/skills/{skills/languages → languages}/kotlin.md +0 -0
- /package/dist/skills/{skills/languages → languages}/lua.md +0 -0
- /package/dist/skills/{skills/languages → languages}/php.md +0 -0
- /package/dist/skills/{skills/languages → languages}/r.md +0 -0
- /package/dist/skills/{skills/languages → languages}/ruby.md +0 -0
- /package/dist/skills/{skills/languages → languages}/rust.md +0 -0
- /package/dist/skills/{skills/languages → languages}/solidity.md +0 -0
- /package/dist/skills/{skills/languages → languages}/sql.md +0 -0
- /package/dist/skills/{skills/languages → languages}/svelte.md +0 -0
- /package/dist/skills/{skills/languages → languages}/swift.md +0 -0
- /package/dist/skills/{skills/languages → languages}/terraform.md +0 -0
- /package/dist/skills/{skills/languages → languages}/verilog.md +0 -0
- /package/dist/skills/{skills/languages → languages}/vue.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../src/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,iBAAiB,EAAsB,MAAM,wBAAwB,CAAC;AAyD/E;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAE9B,cAAc;IACd,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAEnC,wCAAwC;IACxC,MAAM,WAAW,GAAG,uBAAuB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACrE,IAAI,WAAW;QAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE5C,aAAa;IACb,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjC,sCAAsC;IACtC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC5B,WAAW;IACX,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IACnF,CAAC;IAED,eAAe;IACf,IAAI,OAAO,C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core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "YUAN Agent Core Runtime",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"typescript": "^5.7.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "tsc && cp -r src/skills dist/skills",
|
|
47
|
+
"build": "tsc && rm -rf dist/skills && cp -r src/skills dist/skills",
|
|
48
48
|
"dev": "tsc --watch",
|
|
49
49
|
"clean": "rm -rf dist",
|
|
50
50
|
"lint": "tsc --noEmit",
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: general
|
|
3
|
-
- type: review
|
|
4
|
-
- confidence: 0.95
|
|
5
|
-
|
|
6
|
-
# Code Review — Correctness, Security, Performance
|
|
7
|
-
|
|
8
|
-
Review in priority order: Correctness → Security → Performance → Style.
|
|
9
|
-
Style comments without correctness/security concerns are noise.
|
|
10
|
-
|
|
11
|
-
## Severity Levels
|
|
12
|
-
- **CRITICAL** — Will cause data loss, security breach, or crash in production. Must fix before merge.
|
|
13
|
-
- **HIGH** — Likely bug under realistic conditions. Fix before merge.
|
|
14
|
-
- **MEDIUM** — Potential issue under edge cases. Fix recommended.
|
|
15
|
-
- **LOW** — Style, readability, minor improvement. Optional.
|
|
16
|
-
|
|
17
|
-
## Review Checklist
|
|
18
|
-
|
|
19
|
-
### Correctness
|
|
20
|
-
- [ ] Does the logic match the intended behavior?
|
|
21
|
-
- [ ] Are all edge cases handled (null, empty, boundary)?
|
|
22
|
-
- [ ] Are error conditions handled or explicitly ignored?
|
|
23
|
-
- [ ] Are async operations awaited where needed?
|
|
24
|
-
- [ ] Are race conditions possible?
|
|
25
|
-
|
|
26
|
-
### Security
|
|
27
|
-
- [ ] User input validated and sanitized before use?
|
|
28
|
-
- [ ] No string interpolation into SQL/shell/HTML?
|
|
29
|
-
- [ ] No secrets, API keys, or credentials in code?
|
|
30
|
-
- [ ] File paths validated to prevent traversal?
|
|
31
|
-
- [ ] Permissions checked before operations?
|
|
32
|
-
|
|
33
|
-
### Performance
|
|
34
|
-
- [ ] No N+1 queries in loops?
|
|
35
|
-
- [ ] No unbounded operations on user-controlled input size?
|
|
36
|
-
- [ ] Expensive operations cached where appropriate?
|
|
37
|
-
|
|
38
|
-
## Known Error Patterns
|
|
39
|
-
|
|
40
|
-
### Logic Bug — Off By One
|
|
41
|
-
- **Symptom**: Array access, loop bounds, or range checks produce wrong results at edges
|
|
42
|
-
- **Cause**: < vs <=, 0 vs 1 as start index, missing last element
|
|
43
|
-
- **Strategy**: Test with length=0, length=1, and at-boundary inputs
|
|
44
|
-
- **Tool sequence**: file_read → grep (similar patterns) → file_edit
|
|
45
|
-
- **Pitfall**: Do NOT approve logic that was not tested at its boundaries.
|
|
46
|
-
|
|
47
|
-
### Silent Failure
|
|
48
|
-
- **Symptom**: Function catches error and returns undefined/null/false without logging
|
|
49
|
-
- **Cause**: catch block swallows errors
|
|
50
|
-
- **Strategy**: Flag all catch blocks that do not log or rethrow
|
|
51
|
-
- **Tool sequence**: grep (catch) → file_read → comment
|
|
52
|
-
- **Pitfall**: Do NOT approve silent error suppression in production code paths.
|
|
53
|
-
|
|
54
|
-
## Validation Checklist
|
|
55
|
-
- [ ] All CRITICAL issues flagged
|
|
56
|
-
- [ ] All HIGH issues flagged
|
|
57
|
-
- [ ] Security review completed
|
|
58
|
-
- [ ] Review output formatted as severity-labeled list
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: general
|
|
3
|
-
- type: debug
|
|
4
|
-
- confidence: 0.9
|
|
5
|
-
|
|
6
|
-
# Debug — Reproduce, Trace, Fix, Verify
|
|
7
|
-
|
|
8
|
-
Always reproduce the bug before touching any code. A fix you can't verify didn't happen.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
1. **Reproduce** — Write a minimal script or test that triggers the bug. Run it. Confirm it fails.
|
|
12
|
-
2. **Trace** — Read the error message completely. Find the deepest frame in YOUR code (not library internals). Read that file.
|
|
13
|
-
3. **Localize** — Grep for the function/symbol in the error. Read 3 levels of call hierarchy.
|
|
14
|
-
4. **Fix** — Smallest change that resolves the root cause. Not the symptom.
|
|
15
|
-
5. **Verify** — Rerun the reproduction script. Run full test suite. Confirm no regressions.
|
|
16
|
-
|
|
17
|
-
## Known Error Patterns
|
|
18
|
-
|
|
19
|
-
### Fixing the Wrong Location
|
|
20
|
-
- **Symptom**: Fix applied, error persists or appears elsewhere
|
|
21
|
-
- **Cause**: Patched a caller when the bug is in the callee, or patched a copy/subclass instead of the source
|
|
22
|
-
- **Strategy**: 1. Grep all files containing the error pattern 2. Read the deepest implementation, not the surface call 3. Fix the source, not the symptom
|
|
23
|
-
- **Tool sequence**: grep → file_read (implementation) → file_edit → shell_exec (reproduce)
|
|
24
|
-
- **Pitfall**: Do NOT assume the first grep result is the right location. Read at least 2 candidates.
|
|
25
|
-
|
|
26
|
-
### Same Error Repeating After Fix
|
|
27
|
-
- **Symptom**: Retried same fix 2+ times, error unchanged
|
|
28
|
-
- **Cause**: Mental model of the bug is wrong
|
|
29
|
-
- **Strategy**: 1. Stop retrying 2. Read the full error message again from scratch 3. Search for the exact error string in the codebase 4. Try a structurally different approach
|
|
30
|
-
- **Tool sequence**: grep (exact error string) → file_read → re-analyze
|
|
31
|
-
- **Pitfall**: Do NOT make a third attempt with the same approach. The model of the problem is broken.
|
|
32
|
-
|
|
33
|
-
### Test Passes But Bug Persists
|
|
34
|
-
- **Symptom**: Test green, but reported behavior still broken
|
|
35
|
-
- **Cause**: Test does not cover the actual failure path
|
|
36
|
-
- **Strategy**: 1. Read the bug report carefully 2. Write a reproduction that exactly matches the reported flow 3. If test passes, the reproduction is wrong — fix the test first
|
|
37
|
-
- **Tool sequence**: file_read (test) → write_file (reproduction) → shell_exec
|
|
38
|
-
- **Pitfall**: Do NOT declare fixed based on passing tests alone. Run the exact reported scenario.
|
|
39
|
-
|
|
40
|
-
## Validation Checklist
|
|
41
|
-
- [ ] Reproduction script confirms the bug exists before fix
|
|
42
|
-
- [ ] Reproduction script confirms the bug is gone after fix
|
|
43
|
-
- [ ] Full test suite passes (no regressions)
|
|
44
|
-
- [ ] Root cause addressed, not just symptom
|
|
45
|
-
- [ ] No unrelated code changed
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: python
|
|
3
|
-
- type: language
|
|
4
|
-
- confidence: 0.9
|
|
5
|
-
|
|
6
|
-
# Python — Common Errors and Patterns
|
|
7
|
-
|
|
8
|
-
Read the full traceback from bottom to top. The bottom frame is the immediate cause; the top is the entry point.
|
|
9
|
-
|
|
10
|
-
## Known Error Patterns
|
|
11
|
-
|
|
12
|
-
### ModuleNotFoundError
|
|
13
|
-
- **Symptom**: `ModuleNotFoundError: No module named 'x'`
|
|
14
|
-
- **Cause**: Package not installed in the active environment, wrong virtual environment active, or a relative import missing the leading dot (`.`).
|
|
15
|
-
- **Strategy**: 1. Run `pip show <package>` to confirm installation. 2. Confirm the correct virtualenv is active (`which python`). 3. If it is a local module, check whether the import should be relative (`.module`) vs. absolute. 4. If the package is missing, install it and add to requirements.txt or pyproject.toml.
|
|
16
|
-
- **Tool sequence**: shell_exec (`pip show package`) → file_read (requirements.txt or pyproject.toml) → shell_exec (`pip install package`) → file_edit (update requirements)
|
|
17
|
-
- **Pitfall**: Do NOT install globally if the project uses a virtualenv. Installing globally can shadow the wrong version and break other projects.
|
|
18
|
-
|
|
19
|
-
### IndentationError / TabError
|
|
20
|
-
- **Symptom**: `IndentationError: unexpected indent`, `IndentationError: expected an indented block after ...`, or `TabError: inconsistent use of tabs and spaces`
|
|
21
|
-
- **Cause**: Mixed tabs and spaces in the same file, or wrong indent level after a block opener (`def`, `if`, `for`, `class`, `with`, `try`).
|
|
22
|
-
- **Strategy**: 1. Run `python -m py_compile file.py` to get the exact line. 2. Read that line and the line above it. 3. Use `expand` or editor settings to convert all tabs to 4 spaces. 4. Run `black file.py` or `autopep8 --in-place file.py` to auto-fix indentation.
|
|
23
|
-
- **Tool sequence**: shell_exec (`python -m py_compile file.py`) → file_read (reported line) → shell_exec (`black file.py` or `autopep8 --in-place file.py`)
|
|
24
|
-
- **Pitfall**: Do NOT fix indentation by eye in a file with mixed tabs and spaces. Convert all tabs to spaces first, then fix the structure.
|
|
25
|
-
|
|
26
|
-
### AttributeError: 'NoneType' has no attribute 'x'
|
|
27
|
-
- **Symptom**: `AttributeError: 'NoneType' object has no attribute 'foo'`
|
|
28
|
-
- **Cause**: A variable expected to hold an object is `None`. Typically from a function that returns `None` on failure, an uninitialized field, or a failed ORM query.
|
|
29
|
-
- **Strategy**: 1. Find where the variable is assigned (trace the traceback up). 2. Determine whether `None` is a valid value or an error. 3. If `None` is unexpected, add an assertion or raise early: `if obj is None: raise ValueError(...)`. 4. If `None` is valid, add a guard: `if obj is not None: obj.foo`.
|
|
30
|
-
- **Tool sequence**: file_read (assignment site from traceback) → file_edit (add None check or early raise)
|
|
31
|
-
- **Pitfall**: Do NOT use `getattr(obj, 'foo', None)` to hide the `None` object — that shifts the error downstream. Fix the root cause.
|
|
32
|
-
|
|
33
|
-
### TypeError — Wrong Number of Arguments
|
|
34
|
-
- **Symptom**: `TypeError: foo() takes X positional arguments but Y were given` or `TypeError: foo() missing Y required positional arguments`
|
|
35
|
-
- **Cause**: Calling a function with wrong argument count. Common: forgetting `self` when calling a method as a function, or passing too many positional args when some should be keyword args.
|
|
36
|
-
- **Strategy**: 1. Grep the function definition to read its signature. 2. Count the parameters. 3. Check if it is a method (requires `self`). 4. Fix the call site to match the signature.
|
|
37
|
-
- **Tool sequence**: grep (function/method name `def`) → file_read → file_edit (fix call site)
|
|
38
|
-
- **Pitfall**: Do NOT add `*args` or `**kwargs` to the function signature to silence the error. Fix the call.
|
|
39
|
-
|
|
40
|
-
### TypeError — Unsupported Operand Types
|
|
41
|
-
- **Symptom**: `TypeError: unsupported operand type(s) for +: 'int' and 'str'`
|
|
42
|
-
- **Cause**: Mixing incompatible types in an arithmetic or comparison operation. Often from user input (always a string) or mixed data sources.
|
|
43
|
-
- **Strategy**: 1. Read the line in the traceback. 2. Identify which variable has the unexpected type. 3. Add an explicit conversion: `int(x)`, `str(x)`, `float(x)` at the right point. 4. Add a type check if the input source is untrusted.
|
|
44
|
-
- **Tool sequence**: file_read (traceback line) → file_edit (add explicit conversion)
|
|
45
|
-
- **Pitfall**: Do NOT add a bare `try/except` around the operation to hide the error. Convert the type before the operation.
|
|
46
|
-
|
|
47
|
-
### KeyError on Dictionary Access
|
|
48
|
-
- **Symptom**: `KeyError: 'foo'`
|
|
49
|
-
- **Cause**: Accessing `dict['key']` when the key does not exist.
|
|
50
|
-
- **Strategy**: 1. Use `dict.get('key')` to return `None` when missing, or `dict.get('key', default)` for a default value. 2. If the key must exist, add an assertion or raise with a descriptive message: `if 'key' not in d: raise KeyError(f"Expected key 'key' in {d}")`. 3. If reading from external data, validate the schema before access.
|
|
51
|
-
- **Tool sequence**: file_read (traceback line) → file_edit (replace `dict[key]` with `dict.get(key)` or add guard)
|
|
52
|
-
- **Pitfall**: Do NOT wrap the access in bare `except KeyError: pass`. That hides missing data bugs.
|
|
53
|
-
|
|
54
|
-
### Circular Import
|
|
55
|
-
- **Symptom**: `ImportError: cannot import name 'X' from partially initialized module 'y'`
|
|
56
|
-
- **Cause**: Module A imports from module B, and module B imports from module A at the top level.
|
|
57
|
-
- **Strategy**: 1. Grep import statements in both modules to confirm the cycle. 2. Move shared types or functions to a third module that neither imports from the other two. 3. Alternatively, use a lazy import (move the import inside the function that needs it). 4. Avoid restructuring via `importlib.import_module` — that just hides the problem.
|
|
58
|
-
- **Tool sequence**: grep (import statements in both modules) → file_read → file_edit (move shared code to third module or use lazy import)
|
|
59
|
-
- **Pitfall**: Do NOT move the import to the bottom of the file as a workaround. That makes the dependency order implicit and fragile.
|
|
60
|
-
|
|
61
|
-
### RecursionError — Maximum Depth Exceeded
|
|
62
|
-
- **Symptom**: `RecursionError: maximum recursion depth exceeded`
|
|
63
|
-
- **Cause**: A recursive function has no base case, or the base case is never reached for the given input, or two functions call each other indefinitely.
|
|
64
|
-
- **Strategy**: 1. Read the function and identify the base case. 2. Add a print or log to confirm the base case is reachable. 3. If depth is legitimately large, increase with `sys.setrecursionlimit(N)` as a last resort. 4. Convert deep recursion to an iterative loop with an explicit stack.
|
|
65
|
-
- **Tool sequence**: file_read (recursive function) → file_edit (add/fix base case or convert to loop)
|
|
66
|
-
- **Pitfall**: Do NOT just increase the recursion limit without fixing the base case — that defers the crash.
|
|
67
|
-
|
|
68
|
-
### ValueError from Type Conversion
|
|
69
|
-
- **Symptom**: `ValueError: invalid literal for int() with base 10: 'abc'`
|
|
70
|
-
- **Cause**: Attempting to convert a string that does not represent the target type.
|
|
71
|
-
- **Strategy**: 1. Validate the input before conversion. 2. Wrap in a try/except and handle the ValueError specifically. 3. For user-facing input, return an error message rather than crashing.
|
|
72
|
-
- **Tool sequence**: file_read (conversion site) → file_edit (add try/except ValueError or pre-validation)
|
|
73
|
-
- **Pitfall**: Do NOT use a bare `except:` or `except Exception:`. Catch `ValueError` specifically.
|
|
74
|
-
|
|
75
|
-
## Verification
|
|
76
|
-
- Syntax: `python -m py_compile file.py` — exit 0 means no syntax errors.
|
|
77
|
-
- Tests: `pytest` or `python -m pytest` — all tests must pass.
|
|
78
|
-
- Type check (if project uses mypy): `mypy .` — zero errors.
|
|
79
|
-
- Linting: `flake8 .` or `ruff check .`
|
|
80
|
-
|
|
81
|
-
## Validation Checklist
|
|
82
|
-
- [ ] `python -m py_compile` exits 0 on all modified files
|
|
83
|
-
- [ ] All imports resolve in the active virtual environment
|
|
84
|
-
- [ ] No mixed tabs and spaces (run `black` or `autopep8`)
|
|
85
|
-
- [ ] All None-returning function calls guarded before attribute access
|
|
86
|
-
- [ ] All dict accesses use `.get()` or have key existence check
|
|
87
|
-
- [ ] Recursive functions have a reachable base case
|
|
88
|
-
- [ ] Tests pass with `pytest`
|
|
89
|
-
- [ ] mypy exits 0 if the project has a mypy configuration
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: react
|
|
3
|
-
- type: language
|
|
4
|
-
- confidence: 0.9
|
|
5
|
-
|
|
6
|
-
# React — Hook Rules, Rendering, and Common Errors
|
|
7
|
-
|
|
8
|
-
Read the full error message and component stack before touching any code.
|
|
9
|
-
|
|
10
|
-
## Hook Rules (Enforced by eslint-plugin-react-hooks)
|
|
11
|
-
- Call hooks only at the top level of a function component — never inside conditions, loops, or nested functions.
|
|
12
|
-
- Call hooks only from React function components or other custom hooks.
|
|
13
|
-
- Custom hooks must start with `use`.
|
|
14
|
-
- These rules are not style preferences — violating them causes non-deterministic behavior and crashes that are hard to reproduce.
|
|
15
|
-
|
|
16
|
-
## Known Error Patterns
|
|
17
|
-
|
|
18
|
-
### Hook Called Conditionally
|
|
19
|
-
- **Symptom**: ESLint error `React Hook "useX" is called conditionally` — or a runtime crash: `Rendered more hooks than during the previous render`
|
|
20
|
-
- **Cause**: Hook call placed inside an `if` block, after an early `return`, or inside a loop. React requires the same hooks to run in the same order on every render.
|
|
21
|
-
- **Strategy**: Move all hook calls to the top of the component function, above any conditional logic. If the hook should only do something conditionally, move the condition inside the hook's callback or pass a flag to the hook.
|
|
22
|
-
- **Tool sequence**: file_read (component) → file_edit (move hook calls above all conditionals)
|
|
23
|
-
- **Pitfall**: Do NOT wrap hook calls in try/catch or ternary expressions. Restructure the component so all hooks run unconditionally.
|
|
24
|
-
|
|
25
|
-
### Stale Closure in useEffect
|
|
26
|
-
- **Symptom**: Effect reads an old value of state or props. The callback always has the value from the first render regardless of updates.
|
|
27
|
-
- **Cause**: The dependency array is incomplete — it is missing variables that are read inside the effect.
|
|
28
|
-
- **Strategy**: Add every variable read inside the effect body to the dependency array. If adding a function reference creates an infinite loop, wrap the function in `useCallback` with its own deps. If adding an object creates an infinite loop, use `useMemo` or restructure to pass only primitive values.
|
|
29
|
-
- **Tool sequence**: file_read (useEffect block and deps array) → file_edit (add missing deps)
|
|
30
|
-
- **Pitfall**: Do NOT add `// eslint-disable-next-line react-hooks/exhaustive-deps` to suppress the exhaustive-deps warning. Fix the missing dependencies.
|
|
31
|
-
|
|
32
|
-
### Infinite Re-render Loop
|
|
33
|
-
- **Symptom**: Component re-renders continuously; browser tab becomes unresponsive or crashes.
|
|
34
|
-
- **Cause**: One of: (a) `setState` called unconditionally inside `useEffect` with no deps or with deps that always change, (b) an object or array literal created inline is in the dependency array (new reference every render), (c) parent passes a new object/function prop on every render.
|
|
35
|
-
- **Strategy**: 1. Read every `useEffect` in the component. Find any `setState` call without a guard condition. 2. Check the deps array for inline object/array literals — move them outside the component or wrap in `useMemo`/`useCallback`. 3. If the loop comes from a parent prop, memoize the prop at the parent.
|
|
36
|
-
- **Tool sequence**: file_read (all useEffect blocks) → file_edit (add condition or memoize deps)
|
|
37
|
-
- **Pitfall**: Do NOT add an empty dependency array `[]` to stop the loop without understanding why it loops. That causes stale closure bugs.
|
|
38
|
-
|
|
39
|
-
### Hydration Mismatch (Next.js / SSR)
|
|
40
|
-
- **Symptom**: `Error: Text content does not match server-rendered HTML` or `Error: Hydration failed because the initial UI does not match what was rendered on the server`
|
|
41
|
-
- **Cause**: Component renders different content on server vs. client. Common sources: `Date.now()`, `Math.random()`, `window` access, browser-only APIs, locale-dependent formatting.
|
|
42
|
-
- **Strategy**: 1. Identify the value that differs between server and client renders. 2. Move it into a `useEffect` with a local state variable — `useEffect` only runs on the client. 3. Render a placeholder or `null` on first render, then update after mount. 4. Use `suppressHydrationWarning` only on elements with genuinely intentional dynamic content such as timestamps.
|
|
43
|
-
- **Tool sequence**: file_read (component) → file_edit (move dynamic value to useEffect + useState)
|
|
44
|
-
- **Pitfall**: Do NOT use `suppressHydrationWarning` as a general fix. It hides real bugs where content genuinely differs.
|
|
45
|
-
|
|
46
|
-
### Missing key Prop in List
|
|
47
|
-
- **Symptom**: React warning `Each child in a list should have a unique "key" prop`
|
|
48
|
-
- **Cause**: `Array.map()` renders JSX elements without a `key` prop, or key is not unique within the list.
|
|
49
|
-
- **Strategy**: Add a stable, unique `key` to each element. Use the item's ID from data, not the array index.
|
|
50
|
-
- **Tool sequence**: grep (`\.map(`) → file_read (render section) → file_edit (add key prop)
|
|
51
|
-
- **Pitfall**: Do NOT use array index as key when the list can reorder, filter, or have items added or removed. Index keys cause incorrect reconciliation and state bugs.
|
|
52
|
-
|
|
53
|
-
### Cannot Read Property of Undefined (During Render)
|
|
54
|
-
- **Symptom**: `TypeError: Cannot read properties of undefined (reading 'x')` thrown during render
|
|
55
|
-
- **Cause**: Component accesses a property on a value that is `undefined` or `null` at mount time — typically async data, optional props, or uninitialized store state.
|
|
56
|
-
- **Strategy**: 1. Add a loading/null guard before the access: `if (!data) return null` or `data?.property`. 2. Provide a default value in the prop type or initial state. 3. Never assume async data is available at first render.
|
|
57
|
-
- **Tool sequence**: file_read (render return and prop types) → file_edit (add guard)
|
|
58
|
-
- **Pitfall**: Do NOT add `!` non-null assertion in TypeScript to hide this — the crash will still happen at runtime.
|
|
59
|
-
|
|
60
|
-
### Context Value Lost After Rerender
|
|
61
|
-
- **Symptom**: Component reads default context value instead of the provided value; context updates do not propagate.
|
|
62
|
-
- **Cause**: Provider is placed too low in the tree, or `value` prop creates a new object every render causing unnecessary re-renders and sometimes missed updates.
|
|
63
|
-
- **Strategy**: 1. Confirm the consuming component is inside the Provider in the tree. 2. Memoize the context value with `useMemo` to prevent new object reference on every render. 3. Split contexts if one high-frequency value is causing all consumers to re-render.
|
|
64
|
-
- **Tool sequence**: file_read (Provider placement) → file_read (consumer component) → file_edit (add useMemo to context value)
|
|
65
|
-
- **Pitfall**: Do NOT create the context value inline in the JSX without memoization — `value={{ foo, bar }}` creates a new object on every render.
|
|
66
|
-
|
|
67
|
-
### useRef Value Not Triggering Re-render
|
|
68
|
-
- **Symptom**: Component does not update when a `ref.current` value changes.
|
|
69
|
-
- **Cause**: `useRef` mutations do not trigger re-renders — this is by design.
|
|
70
|
-
- **Strategy**: If you need UI to update when a value changes, use `useState` or `useReducer` instead. Use `useRef` only for values that should NOT trigger re-renders: DOM references, timers, previous value tracking, and imperative handles.
|
|
71
|
-
- **Tool sequence**: file_read (ref usage) → file_edit (convert to useState if re-render is needed)
|
|
72
|
-
- **Pitfall**: Do NOT try to force a re-render after mutating a ref. Switch to state.
|
|
73
|
-
|
|
74
|
-
## Verification
|
|
75
|
-
- ESLint: `eslint --ext .tsx,.ts src/` — look for `react-hooks/rules-of-hooks` and `react-hooks/exhaustive-deps` violations.
|
|
76
|
-
- Type check: `tsc --noEmit`
|
|
77
|
-
- Dev server: confirm no console errors beginning with `Warning: ` or `Error: ` in the browser.
|
|
78
|
-
|
|
79
|
-
## Validation Checklist
|
|
80
|
-
- [ ] All hooks called unconditionally at component top level, before any early returns
|
|
81
|
-
- [ ] useEffect dependency arrays include all referenced variables (no exhaustive-deps suppressions)
|
|
82
|
-
- [ ] No inline object or array literals in dependency arrays
|
|
83
|
-
- [ ] All list renders have stable unique keys from data (not array index)
|
|
84
|
-
- [ ] Browser-only code wrapped in useEffect or guarded with `typeof window !== "undefined"`
|
|
85
|
-
- [ ] Context values memoized with useMemo if they are object or array literals
|
|
86
|
-
- [ ] Async data access guarded with null/undefined check at render time
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: typescript
|
|
3
|
-
- type: language
|
|
4
|
-
- confidence: 0.95
|
|
5
|
-
|
|
6
|
-
# TypeScript — Error Pattern Reference
|
|
7
|
-
|
|
8
|
-
Read the exact error code first. Each TS error has a precise meaning — do not guess from the message alone.
|
|
9
|
-
|
|
10
|
-
## Error Code Quick Reference
|
|
11
|
-
- **TS2345** — Argument type mismatch. Read the function signature.
|
|
12
|
-
- **TS2322** — Assignment type mismatch. Read the variable declaration.
|
|
13
|
-
- **TS2304** — Cannot find name. Missing import or typo.
|
|
14
|
-
- **TS2339** — Property does not exist on type. Wrong type assumption.
|
|
15
|
-
- **TS2307** — Cannot find module. Missing package or wrong path.
|
|
16
|
-
- **TS7006** — Parameter implicitly has 'any'. Add explicit type.
|
|
17
|
-
- **TS2531** — Object is possibly null. Add null check.
|
|
18
|
-
- **TS2532** — Object is possibly undefined. Add undefined check.
|
|
19
|
-
- **TS2769** — No overload matches. Read all overload signatures.
|
|
20
|
-
- **TS1005** — Syntax error. Read the exact line and column.
|
|
21
|
-
- **TS2741** — Missing required properties in object literal.
|
|
22
|
-
- **TS2366** — Function lacks ending return statement.
|
|
23
|
-
- **TS2411** — Index signature incompatible.
|
|
24
|
-
- **TS4023** — Exported expression refers to unexported type.
|
|
25
|
-
|
|
26
|
-
## Known Error Patterns
|
|
27
|
-
|
|
28
|
-
### TS2345 — Wrong Argument Type
|
|
29
|
-
- **Symptom**: `Argument of type 'X' is not assignable to parameter of type 'Y'`
|
|
30
|
-
- **Cause**: Passing wrong type to function. Common cases: string where number expected, union type wider than parameter, optional field passed as required.
|
|
31
|
-
- **Strategy**: 1. Read the exact function signature by grepping the function name and reading its definition. 2. Identify which parameter is mismatched. 3. Fix the call site by passing the correct type or narrowing the value. Only add a type assertion if you have verified the runtime type is correct.
|
|
32
|
-
- **Tool sequence**: grep (function name) → file_read (definition) → file_edit (fix call site)
|
|
33
|
-
- **Pitfall**: Do NOT cast to `any` as a first resort. Read the actual expected type before touching the call site.
|
|
34
|
-
|
|
35
|
-
### TS2322 — Wrong Assignment Type
|
|
36
|
-
- **Symptom**: `Type 'X' is not assignable to type 'Y'`
|
|
37
|
-
- **Cause**: Assigning a value to a variable whose declared type does not accept it. Often: number assigned to string, wider union assigned to narrower union, optional assigned to required.
|
|
38
|
-
- **Strategy**: 1. Find the variable declaration (grep or file_read). 2. Decide whether the declaration is wrong (widen it) or the assigned value is wrong (narrow/convert it). 3. Fix the narrower of the two.
|
|
39
|
-
- **Tool sequence**: grep (variable name) → file_read (declaration) → file_edit
|
|
40
|
-
- **Pitfall**: Do NOT widen the type to `any` or `unknown` unless the variable genuinely needs to hold arbitrary values.
|
|
41
|
-
|
|
42
|
-
### TS2339 — Property Does Not Exist
|
|
43
|
-
- **Symptom**: `Property 'x' does not exist on type 'Y'`
|
|
44
|
-
- **Cause**: Accessing a property that is not in the type definition. Common after API response parsing, JSON.parse, or accessing a subtype's property on a base type.
|
|
45
|
-
- **Strategy**: 1. Grep the interface or type definition. 2. Check if the property exists but on a subtype — use type narrowing (`if ('x' in obj)` or `instanceof`). 3. If the property should exist, add it to the interface. 4. If it is conditional, make it optional (`x?: T`).
|
|
46
|
-
- **Tool sequence**: grep (interface name or type name) → file_read → file_edit
|
|
47
|
-
- **Pitfall**: Do NOT extend the interface blindly. Confirm the property actually exists at runtime before adding it to the type.
|
|
48
|
-
|
|
49
|
-
### TS2531 / TS2532 — Possibly Null or Undefined
|
|
50
|
-
- **Symptom**: `Object is possibly 'null'` or `Object is possibly 'undefined'`
|
|
51
|
-
- **Cause**: Using a value that TypeScript knows might be null or undefined without a guard.
|
|
52
|
-
- **Strategy**: Add an explicit check: `if (x !== null && x !== undefined)`, or use nullish coalescing `x ?? defaultValue`, or optional chaining `x?.property`. For function returns, add a null return guard at the top.
|
|
53
|
-
- **Tool sequence**: file_read (lines around error) → file_edit (add null check or optional chain)
|
|
54
|
-
- **Pitfall**: Do NOT use the non-null assertion operator `!` unless you can read code that guarantees non-null at that exact point. Using `!` without proof creates silent runtime crashes.
|
|
55
|
-
|
|
56
|
-
### TS2307 — Cannot Find Module
|
|
57
|
-
- **Symptom**: `Cannot find module './path' or its corresponding type declarations`
|
|
58
|
-
- **Cause**: Import path wrong, package not installed, missing `@types/` package, or tsconfig path alias not resolving.
|
|
59
|
-
- **Strategy**: 1. Verify the file exists at the import path using shell_exec. 2. Check tsconfig.json for path aliases that might apply. 3. Check package.json for the package. 4. If the package exists but lacks types, install `@types/<package>` or add a `.d.ts` declaration stub.
|
|
60
|
-
- **Tool sequence**: shell_exec (`ls <path>`) → file_read (tsconfig.json) → file_read (package.json) → shell_exec (pnpm add @types/package)
|
|
61
|
-
- **Pitfall**: Do NOT assume the import path is wrong — check tsconfig path aliases before renaming imports.
|
|
62
|
-
|
|
63
|
-
### TS7006 — Implicit Any on Parameter
|
|
64
|
-
- **Symptom**: `Parameter 'x' implicitly has an 'any' type`
|
|
65
|
-
- **Cause**: Function parameter has no type annotation and TypeScript cannot infer it from context.
|
|
66
|
-
- **Strategy**: Read how the function is called (grep call sites) to determine what type is actually passed. Add that type as an explicit annotation. If multiple types are possible, use a union type.
|
|
67
|
-
- **Tool sequence**: grep (function name call sites) → file_read (definition) → file_edit (add annotation)
|
|
68
|
-
- **Pitfall**: Do NOT write `: any` to satisfy the compiler. Infer the real type from the call sites.
|
|
69
|
-
|
|
70
|
-
### TS2769 — No Overload Matches
|
|
71
|
-
- **Symptom**: `No overload matches this call` with a list of overload candidates
|
|
72
|
-
- **Cause**: Calling a function with arguments that do not satisfy any of its overload signatures.
|
|
73
|
-
- **Strategy**: 1. Read ALL listed overload signatures in the error output. 2. Identify which argument is causing the mismatch (the error lists which overload got closest). 3. Fix the argument type or add the correct overload if you own the function.
|
|
74
|
-
- **Tool sequence**: file_read (error output fully) → grep (function definition) → file_read → file_edit
|
|
75
|
-
- **Pitfall**: Do NOT add a new overload signature as a first resort if you do not own the library. Fix the call site argument.
|
|
76
|
-
|
|
77
|
-
### TS2741 — Missing Required Properties
|
|
78
|
-
- **Symptom**: `Type 'X' is missing the following properties from type 'Y': a, b, c`
|
|
79
|
-
- **Cause**: Object literal or variable missing required fields for the target interface.
|
|
80
|
-
- **Strategy**: 1. Read the target interface definition. 2. Add all missing required properties. 3. If a property should be optional, make it optional in the interface (if you own it).
|
|
81
|
-
- **Tool sequence**: grep (interface name) → file_read → file_edit (add missing fields)
|
|
82
|
-
- **Pitfall**: Do NOT make all fields optional to silence the error. Required fields exist for a reason.
|
|
83
|
-
|
|
84
|
-
### Type Narrowing Failure
|
|
85
|
-
- **Symptom**: TypeScript still shows a union type inside a conditional block that should have narrowed it
|
|
86
|
-
- **Cause**: The narrowing condition uses a pattern TypeScript does not recognize, or a type guard function is not declared with a type predicate.
|
|
87
|
-
- **Strategy**: Use `typeof x === "string"`, `x instanceof ClassName`, discriminant property check (`x.kind === "foo"`), or a type predicate function `(x): x is SpecificType`. Ensure the check is directly in the condition — TypeScript does not follow complex indirect narrowing.
|
|
88
|
-
- **Tool sequence**: file_read (narrowing block) → file_edit (replace condition with recognized narrowing pattern)
|
|
89
|
-
- **Pitfall**: Do NOT use `x as SpecificType` inside the block to work around failed narrowing. Fix the condition.
|
|
90
|
-
|
|
91
|
-
### Circular Type Reference
|
|
92
|
-
- **Symptom**: `Type alias 'X' circularly references itself` or extremely slow tsc
|
|
93
|
-
- **Cause**: Type A references Type B which references Type A directly.
|
|
94
|
-
- **Strategy**: Break the cycle by introducing an intermediate interface or by using `interface` instead of `type` alias (interfaces handle some recursive cases). Extract shared fields into a base interface.
|
|
95
|
-
- **Tool sequence**: grep (type name references) → file_read → file_edit (introduce base interface)
|
|
96
|
-
- **Pitfall**: Do NOT wrap in `any` to break the cycle. The circular reference usually signals a design issue.
|
|
97
|
-
|
|
98
|
-
## Verification
|
|
99
|
-
Run: `tsc --noEmit`
|
|
100
|
-
- Exit 0 with no output = success.
|
|
101
|
-
- Any line starting with `error TS` = failure. The format is `file(line,col): error TSxxxx: message`.
|
|
102
|
-
- Always read the full error line including file path and column number before acting.
|
|
103
|
-
|
|
104
|
-
## Validation Checklist
|
|
105
|
-
- [ ] `tsc --noEmit` exits 0
|
|
106
|
-
- [ ] No `as any` added without a comment explaining the runtime guarantee
|
|
107
|
-
- [ ] No non-null assertions `!` added without a comment citing the proof
|
|
108
|
-
- [ ] All new interfaces have required fields marked optional only if they can genuinely be absent
|
|
109
|
-
- [ ] No `@ts-ignore` or `@ts-expect-error` added to suppress errors without comment
|
|
110
|
-
- [ ] Import paths verified to exist on disk or in tsconfig aliases
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: general
|
|
3
|
-
- type: plan
|
|
4
|
-
- confidence: 0.8
|
|
5
|
-
|
|
6
|
-
# Plan — Decompose, Sequence, Risk
|
|
7
|
-
|
|
8
|
-
Break the goal into tasks that can be executed independently. The plan is wrong if any task requires knowing the output of a parallel task.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
1. **Understand** — Read relevant files. Do not plan from assumptions.
|
|
12
|
-
2. **Decompose** — Break goal into tasks. Each task = one logical change.
|
|
13
|
-
3. **Sequence** — Order by dependencies. What must be done before what?
|
|
14
|
-
4. **Assign** — Which files does each task touch? (No two tasks touch the same file.)
|
|
15
|
-
5. **Risk** — What can go wrong? What is the rollback?
|
|
16
|
-
|
|
17
|
-
## Task Format
|
|
18
|
-
Each task must specify:
|
|
19
|
-
- Goal (one sentence)
|
|
20
|
-
- Files to create/modify
|
|
21
|
-
- Dependencies (which tasks must complete first)
|
|
22
|
-
- Verification (how to confirm it worked)
|
|
23
|
-
|
|
24
|
-
## Known Error Patterns
|
|
25
|
-
|
|
26
|
-
### Over-decomposed Tasks
|
|
27
|
-
- **Symptom**: 20+ tasks for what should be a 3-task change
|
|
28
|
-
- **Cause**: Planning at line-level instead of logical-change level
|
|
29
|
-
- **Strategy**: Merge tasks that always change together into one task
|
|
30
|
-
- **Pitfall**: Do NOT create a task for each file if they are all part of one logical change.
|
|
31
|
-
|
|
32
|
-
### Under-specified Verification
|
|
33
|
-
- **Symptom**: Task says "done" but it is unclear what "done" means
|
|
34
|
-
- **Cause**: No concrete verification step defined
|
|
35
|
-
- **Strategy**: Every task needs: run X command, see Y output
|
|
36
|
-
- **Pitfall**: Do NOT write "test it works" — write the exact command and expected output.
|
|
37
|
-
|
|
38
|
-
### Missing Rollback
|
|
39
|
-
- **Symptom**: Mid-way through plan, something breaks and there is no way back
|
|
40
|
-
- **Cause**: No checkpoint or rollback strategy
|
|
41
|
-
- **Strategy**: For any plan with 4+ tasks, define a rollback point (git stash, feature flag, etc.)
|
|
42
|
-
- **Pitfall**: Do NOT start a multi-file refactor without a rollback strategy.
|
|
43
|
-
|
|
44
|
-
## Validation Checklist
|
|
45
|
-
- [ ] Each task has a single clear goal
|
|
46
|
-
- [ ] No two parallel tasks modify the same file
|
|
47
|
-
- [ ] Dependencies between tasks are explicit
|
|
48
|
-
- [ ] Each task has a concrete verification step
|
|
49
|
-
- [ ] Rollback strategy defined for 4+ task plans
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: general
|
|
3
|
-
- type: refactor
|
|
4
|
-
- confidence: 0.85
|
|
5
|
-
|
|
6
|
-
# Refactor — Preserve Behavior, Improve Structure
|
|
7
|
-
|
|
8
|
-
Behavior must be identical before and after. Tests are your proof.
|
|
9
|
-
|
|
10
|
-
## Workflow
|
|
11
|
-
1. **Baseline** — Run test suite. All tests must pass. Record the result.
|
|
12
|
-
2. **Impact map** — Grep for all usages of what you are changing. List every file.
|
|
13
|
-
3. **One change** — Make one structural change at a time.
|
|
14
|
-
4. **Verify** — Run tests. Must still pass.
|
|
15
|
-
5. **Repeat** — Next structural change.
|
|
16
|
-
6. **Commit** — Each logical refactor is its own commit.
|
|
17
|
-
|
|
18
|
-
## Known Error Patterns
|
|
19
|
-
|
|
20
|
-
### Partial Rename
|
|
21
|
-
- **Symptom**: Build error or runtime failure after renaming a function/variable
|
|
22
|
-
- **Cause**: Some call sites not updated
|
|
23
|
-
- **Strategy**: grep ALL usages before renaming. Update every occurrence.
|
|
24
|
-
- **Tool sequence**: grep (exact name) → file_read (each result) → file_edit (all occurrences) → shell_exec (build)
|
|
25
|
-
- **Pitfall**: Do NOT rename without grepping first. IDEs miss dynamic usages.
|
|
26
|
-
|
|
27
|
-
### Changed Interface, Missed Consumers
|
|
28
|
-
- **Symptom**: Tests pass for the changed file, but integration tests fail
|
|
29
|
-
- **Cause**: Callers of the changed interface not updated
|
|
30
|
-
- **Strategy**: 1. grep for import of the changed module 2. Read each consumer 3. Update to new interface
|
|
31
|
-
- **Tool sequence**: grep (from.*moduleName, require.*moduleName) → file_read → file_edit
|
|
32
|
-
- **Pitfall**: Do NOT update the implementation without updating all consumers.
|
|
33
|
-
|
|
34
|
-
### Behavior Change During Refactor
|
|
35
|
-
- **Symptom**: Tests that were passing now fail after "only structural" changes
|
|
36
|
-
- **Cause**: Subtle logic change introduced during structural refactor
|
|
37
|
-
- **Strategy**: 1. Stop. 2. git diff the changes. 3. Identify which line changed behavior. 4. Revert behavior, keep structure.
|
|
38
|
-
- **Tool sequence**: shell_exec (git diff) → file_read → file_edit (revert behavior change only)
|
|
39
|
-
- **Pitfall**: Do NOT proceed with failing tests. Fix the regression immediately.
|
|
40
|
-
|
|
41
|
-
## Validation Checklist
|
|
42
|
-
- [ ] Test suite passes before refactor starts (baseline)
|
|
43
|
-
- [ ] All usages of changed symbols grepped and listed
|
|
44
|
-
- [ ] Test suite passes after each individual change
|
|
45
|
-
- [ ] No behavior changes (same inputs produce same outputs)
|
|
46
|
-
- [ ] Build passes
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
## Identity
|
|
2
|
-
- domain: security
|
|
3
|
-
- type: scan
|
|
4
|
-
- confidence: 0.9
|
|
5
|
-
|
|
6
|
-
# Security Scan — OWASP Top 10 Patterns
|
|
7
|
-
|
|
8
|
-
Scan for vulnerabilities before they reach production. Each pattern below is a real-world attack vector.
|
|
9
|
-
|
|
10
|
-
## Scan Order
|
|
11
|
-
1. Injection (SQL, shell, LDAP, XML)
|
|
12
|
-
2. Secrets and credentials in code
|
|
13
|
-
3. Authentication and authorization gaps
|
|
14
|
-
4. Insecure deserialization
|
|
15
|
-
5. Sensitive data exposure
|
|
16
|
-
|
|
17
|
-
## Known Error Patterns
|
|
18
|
-
|
|
19
|
-
### SQL Injection
|
|
20
|
-
- **Symptom**: User input concatenated directly into SQL string
|
|
21
|
-
- **Cause**: String interpolation used instead of parameterized queries
|
|
22
|
-
- **Strategy**: 1. Grep for string concatenation with SQL keywords 2. Replace with parameterized queries or ORM methods
|
|
23
|
-
- **Tool sequence**: grep (SELECT.*+) → file_read → file_edit
|
|
24
|
-
- **Pitfall**: Do NOT use string replacement as a sanitization method. Use parameterized queries only.
|
|
25
|
-
|
|
26
|
-
### Shell Injection
|
|
27
|
-
- **Symptom**: User input passed to shell command execution
|
|
28
|
-
- **Cause**: exec(userInput), shell=True with dynamic input, template string in subprocess
|
|
29
|
-
- **Strategy**: 1. Grep for shell=True, exec(, subprocess with dynamic args 2. Replace with argument arrays, never shell strings
|
|
30
|
-
- **Tool sequence**: grep (shell=True) → file_read → file_edit
|
|
31
|
-
- **Pitfall**: Do NOT use shell=True with any user-controlled input, ever.
|
|
32
|
-
|
|
33
|
-
### Hardcoded Secrets
|
|
34
|
-
- **Symptom**: API keys, passwords, tokens in source code
|
|
35
|
-
- **Cause**: Developer committed credentials directly
|
|
36
|
-
- **Strategy**: 1. Grep for common secret patterns 2. Move to environment variables 3. Add to .gitignore
|
|
37
|
-
- **Tool sequence**: grep (password=, api_key=, secret=, sk-, Bearer) → file_read → file_edit
|
|
38
|
-
- **Pitfall**: Do NOT just delete the secret — rotate it first, then remove from code.
|
|
39
|
-
|
|
40
|
-
### Path Traversal
|
|
41
|
-
- **Symptom**: User-supplied file path used without validation
|
|
42
|
-
- **Cause**: open(userPath), readFile(req.params.filename) without sanitization
|
|
43
|
-
- **Strategy**: 1. Validate path is within allowed directory 2. Use path.resolve() and check it starts with allowed base
|
|
44
|
-
- **Tool sequence**: grep (readFile, open(, fs.) → file_read → file_edit
|
|
45
|
-
- **Pitfall**: Do NOT use path.basename() alone — it does not prevent traversal through symlinks.
|
|
46
|
-
|
|
47
|
-
### Insecure Direct Object Reference
|
|
48
|
-
- **Symptom**: Resource ID from request used directly without ownership check
|
|
49
|
-
- **Cause**: db.find({ id: req.params.id }) without checking userId matches session
|
|
50
|
-
- **Strategy**: Always check that the authenticated user owns the requested resource
|
|
51
|
-
- **Tool sequence**: grep (req.params, req.query) → file_read → file_edit
|
|
52
|
-
- **Pitfall**: Do NOT assume frontend-only authorization is sufficient.
|
|
53
|
-
|
|
54
|
-
## Validation Checklist
|
|
55
|
-
- [ ] No user input in SQL/shell/LDAP strings
|
|
56
|
-
- [ ] No secrets in source code
|
|
57
|
-
- [ ] All file paths validated against base directory
|
|
58
|
-
- [ ] All resource access checks ownership
|
|
59
|
-
- [ ] Dependencies scanned for known vulnerabilities
|