一键导入
source-command-audit-deprecation
Audit for deprecated APIs, libraries, patterns, language features across Python, TS/React, Rust, third-party deps
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit for deprecated APIs, libraries, patterns, language features across Python, TS/React, Rust, third-party deps
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Shared audit protocol — project layout, methodology, dedup, finding format. Referenced by all audit skills.
Verify previously fixed issues have not regressed; check that the fix code is still present and tests exist
Unified severity scale and classification rules for all Auralis audit skills
| name | source-command-audit-deprecation |
| description | Audit for deprecated APIs, libraries, patterns, language features across Python, TS/React, Rust, third-party deps |
Use this skill when the user asks to run the migrated source command audit-deprecation.
Audit the entire Auralis codebase for deprecated APIs, libraries, patterns, and language features across Python, TypeScript/React, Rust, and all third-party dependencies. Then create GitHub issues for every new confirmed finding.
Shared protocol: Read .Codex/commands/_audit-common.md first for project layout, severity framework, methodology, deduplication rules, and GitHub issue template.
| Severity | Deprecation-Specific Examples |
|---|---|
| CRITICAL | Python 3.14 removed module still imported, React 18 removed API still called (e.g. ReactDOM.render), Pydantic V1 syntax on V2 |
| HIGH | datetime.utcnow() (deprecated 3.12), SQLAlchemy 1.x Query API, MUI deprecated component props |
| MEDIUM | Legacy React lifecycle methods, deprecated Node.js APIs, old Vite config keys |
| LOW | Old naming conventions, superseded utility functions, stale type patterns |
Key locations: All .py files under auralis/, auralis-web/backend/, tests/
Check:
datetime.utcnow() / datetime.utcfromtimestamp() — deprecated since 3.12, use datetime.now(timezone.utc) insteadasyncio.get_event_loop() without running loop — deprecated, use asyncio.get_running_loop() or asyncio.Runnertyping module legacy imports — Optional[X] vs X | None, List/Dict/Tuple vs list/dict/tuple (PEP 585/604)pkg_resources — deprecated in favor of importlib.resources / importlib.metadatadistutils — removed in Python 3.12+os.path patterns where pathlib.Path is preferred and the codebase already uses pathlib elsewhereunittest legacy assertions (assertEquals, assertNotEquals) — deprecated aliasesconfigparser legacy methods (readfp, has_key)collections ABCs imported from collections instead of collections.abcimp module — removed in 3.12, use importlibdaemon property set after start() — deprecatedssl deprecated functions/constants (e.g., ssl.PROTOCOL_TLS)locale.getdefaultlocale() — deprecated since 3.11Key locations: auralis/core/, auralis/dsp/, auralis/analysis/, auralis/io/
Check:
np.bool, np.int, np.float, np.complex, np.object, np.str — removed in NumPy 1.24+, use Python builtinsnp.product → np.prod, np.cumproduct → np.cumprod, np.sometrue → np.any, np.alltrue → np.allnp.in1d → np.isinnp.row_stack → np.vstacknp.AxisError imported from wrong locationscipy.fft vs scipy.fftpack — fftpack is legacyscipy.signal deprecated function signatures (e.g., old windows parameter names)librosa deprecated parameters or function names (if used)soundfile deprecated APIsKey locations: auralis-web/backend/
Check:
class Config: → model_config = ConfigDict(...), .dict() → .model_dump(), .json() → .model_dump_json(), validator → field_validator, root_validator → model_validatorfrom pydantic import validator — deprecated, use field_validator with mode='before'/'after'schema_extra → json_schema_extraorm_mode = True → from_attributes = True@app.on_event("startup") / @app.on_event("shutdown") — deprecated in FastAPI, use lifespan context managerResponse.media_type deprecated patternssession.query(Model) → select(Model) + session.execute(), Query.filter() → select().where()declarative_base() → DeclarativeBase class (SQLAlchemy 2.0)engine.execute() — removed in SQLAlchemy 2.0Column() → mapped_column() with Mapped[] type annotationsrelationship() without Mapped[] annotationsessionmaker deprecated bind parameter patternautocommit mode — deprecated in SQLAlchemy 2.0Key locations: auralis-web/frontend/src/
Check:
ReactDOM.render() — removed in React 18, use createRoot()componentWillMount, componentWillReceiveProps, componentWillUpdate — deprecated since React 16.3findDOMNode — deprecated, use refsdefaultProps on function components — deprecated in React 18.3+React.FC / React.FunctionComponent — discouraged pattern (implicit children prop removed in React 18)ref="myRef") — deprecated, use useRef / createRefUNSAFE_ lifecycle methods still presentcontextTypes, childContextTypes) — use createContextreact-redux deprecated APIs — connect() HOC where hooks (useSelector, useDispatch) are availablecreateStore → configureStore (Redux Toolkit)makeStyles (JSS) vs sx prop / styled, deprecated component props per MUI version@mui/styles — deprecated in MUI v5, replaced by @mui/system or styled-components/emotionoptimizeDeps.include syntax changes)tsconfig.json options (e.g., moduleResolution: "node" vs "bundler")PropTypes — deprecated when TypeScript is used project-wideKey locations: auralis-web/frontend/package.json, desktop/package.json, build configs
Check:
node: protocol — are Node.js built-ins imported with the node: prefix where applicable?fs.exists, url.parse → new URL(), querystring → URLSearchParams)package.json deprecated fields (main without exports, engines mismatches).eslintrc.* → eslint.config.js flat config)cleanup auto-behavior, waitFor patterns)desktop/)Key locations: vendor/auralis-dsp/
Check:
#[pyfunction], #[pymethods] signature changes)Cargo.toml keys or dependency specification syntaxmaturin deprecated configuration optionsKey locations: Entire codebase
Check:
@deprecated decorators or # deprecated comments — are callers still using deprecated internal APIs?DeprecationWarning emissions — is the codebase raising warnings that indicate migration is incomplete?requirements.txt / package.json that block upgradesKey locations: pyproject.toml, pytest.ini, .github/, Makefile, *.cfg
Check:
setup.cfg / setup.py — should these be consolidated into pyproject.toml?pytest.ini deprecated options or marker syntaxactions/checkout@v2 → @v4, actions/setup-python@v3 → @v5)mypy deprecated configuration optionsblack / ruff deprecated configuration options or rulesFor each finding:
Write your report to: docs/audits/AUDIT_DEPRECATION_<TODAY>.md (use today's date, format YYYY-MM-DD).
### <ID>: <Short Title>
- **Severity**: CRITICAL | HIGH | MEDIUM | LOW
- **Dimension**: Python Stdlib | NumPy/SciPy | FastAPI/Pydantic/SQLAlchemy | React/Redux/MUI | Node/npm/Build | Rust/PyO3 | Internal | Config/CI
- **Location**: `<file-path>:<line-range>` (+ count of affected files if widespread)
- **Status**: NEW | Existing: #NNN | Regression of #NNN
- **Deprecated API**: Exact function/class/method/pattern that is deprecated
- **Deprecated Since**: Version where deprecation was introduced
- **Removal Version**: Version where it will be / was removed (if known)
- **Replacement**: The modern equivalent API/pattern
- **Affected Files**: Count and list of files using the deprecated pattern
- **Evidence**: Code snippet showing current usage
- **Migration Path**: Step-by-step instructions to migrate
- **Risk**: What breaks if we don't migrate, and when
docs/audits/AUDIT_DEPRECATION_<TODAY>.md/audit-publish docs/audits/AUDIT_DEPRECATION_<TODAY>.md
Use labels when publishing: severity label + deprecation + layer labels (backend, frontend, audio-engine, rust-dsp, config) + maintenance