全面的存储库分析

编程数据分析网络安全角色提示

{ “任务”:“综合存储库分析”, “目标”:“对整个代码库进行详尽的分析,以识别、确定优先级、修复和记录所有技术堆栈中的所有可验证的错误、安全漏洞和关键问题”, “分析阶段”:[ { “阶段”:1, "name": "存储库发现和映射", “步骤”:[ { “步骤”:“1.1”...

提示词(中文)

{
“任务”:“综合存储库分析”,
“目标”:“对整个代码库进行详尽的分析,以识别、确定优先级、修复和记录所有技术堆栈中的所有可验证的错误、安全漏洞和关键问题”,

“分析阶段”:[
{
“阶段”:1,
"name": "存储库发现和映射",
“步骤”:[
{
“步骤”:“1.1”,
"title": "架构与结构分析",
“行动”:[
“映射完整的目录结构(src/、lib/、tests/、docs/、config/、scripts/、build/、deploy/)”,
“识别正在使用的所有技术堆栈和框架”,
“解析依赖清单(package.json、requirements.txt、go.mod、pom.xml、Gemfile、Cargo.toml、composer.json)”,
“文档入口点、主要执行路径和模块边界”,
“分析构建系统(Webpack、Gradle、Maven、Make、CMake)”,
“查看 CI/CD 配置(GitHub Actions、GitLab CI、Jenkins、CircleCI)”,
“检查现有文档(自述文件、贡献、API 规范、架构图)”
]
},
{
“步骤”:“1.2”,
"title": "开发环境盘点",
“行动”:[
“确定测试框架(Jest、Mocha、pytest、PHPUnit、Go test、JUnit、RSpec、xUnit)”,
“查看 linter/formatter 配置(ESLint、Prettier、Black、Flake8、RuboCop、golangci-lint、Checkstyle)”,
“扫描内联问题标记(TODO、FIXME、HACK、XXX、BUG、NOTE)”,
“分析 git 历史记录以查找有问题的模式和最近的修补程序”,
“提取现有的测试覆盖率报告和指标”,
“识别已在使用的代码分析工具(SonarQube、CodeClimate 等)”
]
}
]
},
{
“阶段”:2,
"name": "系统性错误发现",
“错误类别”:[
{
“类别”:“关键”,
“严重性”:“P0”,
“类型”:[
“SQL注入漏洞”,
“跨站脚本(XSS)缺陷”,
“跨站请求伪造(CSRF)漏洞”,
“身份验证/授权绕过”,
“远程代码执行(RCE)风险”,
“数据损坏或永久数据丢失”,
“系统崩溃、死锁或无限循环”,
“内存泄漏和资源耗尽”,
“不安全的加密实现”,
“硬编码的秘密或凭证”
]
},
{
“类别”:“功能性”,
“严重性”:“P1-P2”,
“类型”:[
“逻辑错误(不正确的条件、错误的计算、相差一的错误)”,
“状态管理问题(竞争条件、陈旧状态、不当突变)”,
“API 合约或请求/响应映射不正确”,
“输入验证缺失或不足”,
“破坏业务逻辑或违反工作流程”,
“数据转换或序列化不正确”,
“类型不匹配或不安全的类型强制”,
“不正确的异常处理或错误传播”
]
},
{
“类别”:“集成”,
“严重性”:“P2”,
“类型”:[
“外部 API 使用不正确或端点过时”,
“数据库查询错误、SQL语法问题或N+1问题”,
“消息队列处理失败(RabbitMQ、Kafka、SQS)”,
"文件系统操作错误(权限、路径遍历)",
“网络通信问题(超时、重试、连接池)”,
“缓存不一致或失效问题”,
“第三方库误用或版本不兼容”
]
},
{
“类别”:“EDGE_CASES”,
“严重性”:“P2-P3”,
“类型”:[
“空/未定义/零/无指针取消引用”,
“空数组/列表/集合处理”,
“零或负值边缘情况”,
“边界条件(最大/最小整数,字符串长度限制)”,
“缺少错误处理或吞噬异常”,
“超时和重试逻辑失败”,
“没有适当锁定的并发访问问题”,
“数值运算中的上溢/下溢”
]
},
{
“类别”:“代码质量”,
“严重性”:“P3-P4”,
“类型”:[
“已弃用的 API 使用”,
“死代码或无法访问的代码路径”,
“循环依赖”,
“性能瓶颈(低效算法、冗余操作)”,
“类型注释缺失或不正确”,
“不一致的错误处理模式”,
“资源泄漏(文件句柄、数据库连接、网络套接字)”,
“不当记录(敏感数据e

提示词(英文)

{
“Mission: Integrated repository analysis
“Objective: “to conduct a detailed analysis of the entire cod repository in order to identify, prioritize, repair and document all verifiable errors, security gaps and key issues in all technology stacks”.

“Analysis phase”:[
{
“Phase:1,
"name": "Repository Discovery and Map",
“Steps”:[
{
“Step:1.1”,
"title": "Structure and structural analysis",
“Actions:[
“Map complete directory structuresrc/、lib/、tests/、docs/、config/、scripts/、build/、deploy/)”,
“Identification of all technology stacks and frames in use.
“Parsing List of Dependenciespackage.json、requirements.txt、go.mod、pom.xml、Gemfile、Cargo.toml、composer.json)”,
“Document entry points, main execution paths and modular boundaries”
“Analyse build systemsWebpack、Gradle、Maven、Make、CMake)”,
“View CI/CD ConfigureGitHub Actions、GitLab CI、Jenkins、CircleCI)”,
“Check existing documents (self-presentation documents, contributions,API (d) “Analysts, architecture”
]
},
{
“Step:1.2”,
"title": "Develop an environmental inventory",
“Actions:[
“Establish a framework for testingJest、Mocha、pytest、PHPUnit、Go test、JUnit、RSpec、xUnit)”,
“View linter/formatter ConfigureESLint、Prettier、Black、Flake8、RuboCop、golangci-lint、Checkstyle)”,
“Scan Inline Problem Marker (Scanning)TODO、FIXME、HACK、XXX、BUG、NOTE)”,
“Analysis git History to find problematic patterns and recent patches”
“The current test coverage reports and indicators are extracted”
“Identify the code analysis tool already in use (SonarQube、CodeClimate )
]
}
]
},
{
“Phase:2,
"name": "System Error Discovery",
“Error category:[
{
“Category: “Key”,
“Seriousness:P0”,
“Type:[
“SQLIt's not like it's going to be a bad idea.
“Cross-Script()XSS)It's a defect.
“Cross-site request for forgery (CSRF)A leak.
“Organisation/This is the first time that the government has been able to do anything.
“Remote Code ExecutionRCE)Risks”
“Data damage or loss of permanent data”
“A system collapse, a dead lock or an infinite cycle”
“This is the first time that the government has been able to make a difference.
“Unsafe encryption takes place.
“Hard-coded secret or certificate”
]
},
{
“Category: “Function”,
“Seriousness:P1-P2”,
“Type:[
“Logical error (incorrect conditions, miscalculation, miscalculation),
“(c) State regulation (competition conditions, old state, undue mutation)
“API Contract or request/Reaction map incorrect.
“Enter authentication is missing or insufficient.
“Disruption of business logic or violation of workflow”,
“Uncorrect data conversion or serialization”
“The type does not match or the unsafe type is mandatory.”
“Incorrect abnormal handling or error transmission”
]
},
{
“Category "Integration",
“Seriousness:P2”,
“Type:[
“External API Use incorrect or outdated endpoints”
“Database query error,SQLSyntax:N+1Question:
“Message Queue Processor Failed (%1)RabbitMQ、Kafka、SQS)”,
"File system error (authorities, paths)",
“Network communication problems (overtime, retest, connect pool)
“Cache incoherence or invalidity”
“Misuse or uncompatibility of third-party libraries”
]
},
{
“Category:EDGE_CASES”,
“Seriousness:P2-P3”,
“Type:[
“Empty/Undefined/nil/No pointer cancels the reference.
“Empty array/List/A grouping process.
“Zero or negative margin scenarios”
“Boundary conditions (maximum)/Minimum integer, string length limit)”
“The lack of error processing or eating anomalies,
“Timeout and Retry Logical Failure”
“There are no properly locked side access questions.
“Excess in value operation/Surplus”
]
},
{
“Category "Code Quality",
“Seriousness:P3-P4”,
“Type:[
“Invalid API Use it.
“Dead code or unaccessible code path.
“"Cyclical dependence,"
“The performance bottlenecks (low-impact algorithms, redundant operations) are not the same as the ones used in the project.
“Type comment missing or incorrect”
“An inconsistent error-processing mode.
“Resource leakage (file handles, database connections, web patches)
“Misrecording (sensitive data)e

直接拿去用

点击会先把提示词复制到剪贴板,再打开对应模型;没有自动带入的话粘贴即可。