代码库分析器
- 作者仓库星标 5
- 许可证 MIT
- 作者仓库 AINativeBook
- 领域
- 运维部署
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @SARAMALI15792 · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 1 阶段:执行完整的代码库架构分析
分析完整的项目结构 识别: 前端框架及架构 后端框架及架构 数据库类型及连接方式
第2阶段:执行身份验证系统深度跟踪
识别:登录路由 注册路由 Token生成逻辑 Token验证中间件
第 3 阶段:执行文件级和线路级连接审核
检查每个导入/导出 验证: 所有 API 路由均与前端调用匹配 所有控制器均已正确连接 所有中间件均已应用
第 4 阶段:执行部署和生产调试
分析:构建流程 托管平台中的环境变量 后端服务器配置 反向代理(如果有)
第 5 阶段:实施 CI/CD 管道设置以进行自动测试
实施 CI/CD 解决方案: 自动运行测试: 每次推送 每个拉取请求 测试:
第 6 阶段:制定稳定性改进计划
创建: 重构建议 安全改进 日志记录改进 监控建议
# Codebase Analyser
Perform comprehensive deep analysis of entire codebase and deployment pipeline to identify why functionality is not working correctly in production. Execute systematic investigation across all aspects of the application including architecture, authentication, file-level connections, deployment, CI/CD pipeline, and stability improvements.
## When to Use This Skill
Use this skill when:
- Deployed application functionality is not working correctly in production
- Need comprehensive deep analysis of entire codebase
- Authentication system issues in production
- Deployment pipeline debugging is required
- CI/CD setup for auto-testing is needed
- Stability improvements and refactoring suggestions are required
- File-level and line-level connection audits are needed
## How to Execute the Skill
### Phase 1: Perform Full Codebase Architecture Analysis
1. Analyze the complete project structure
2. Identify:
- Frontend framework and architecture
- Backend framework and architecture
- Database type and connection method
- Authentication system implementation
- API communication pattern
- Environment configuration (.env usage)
- Deployment configuration
3. Create a clear architecture map showing:
- How frontend communicates with backend
- How backend communicates with database
- How authentication flows through the system
### Phase 2: Execute Authentication System Deep Trace
1. Identify:
- Login route
- Registration route
- Token generation logic
- Token validation middleware
- Session or JWT handling
- Password hashing method
- Cookie handling (if any)
2. Trace authentication flow step-by-step:
- User submits login form (frontend)
- Request sent to backend
- Backend processes credentials
- Token created
- Token returned to frontend
- Token stored (localStorage/cookies)
- Protected routes accessed
3. Check for:
- CORS issues
- Missing credentials in fetch/axios
- Wrong base URLs
- Environment variable misconfiguration
- Production vs development differences
- Missing middleware
- Expired tokens
- Wrong secret keys
- API route mismatches
### Phase 3: Execute File-Level and Line-Level Connection Audit
1. Check every import/export
2. Verify that:
- All API routes match frontend calls
- All controllers are properly connected
- All middleware is applied
- Database models are properly registered
- No circular dependencies exist
3. Identify any dead code or unused functions
4. Detect any runtime-only production errors
Provide a categorized issue list:
- Critical
- Major
- Minor
### Phase 4: Execute Deployment & Production Debugging
Analyze:
- Build process
- Environment variables in hosting platform
- Backend server configuration
- Reverse proxy (if any)
- Port binding
- Production logs
- CORS production policy
- HTTPS issues
Explain why it might work locally but fail after deployment.
### Phase 5: Implement CI/CD Pipeline Setup for Auto-Testing
Implement a CI/CD solution that:
1. Automatically runs tests on:
- Every push
- Every pull request
2. Tests:
- API endpoints
- Authentication flow
- Database connection
- Environment variable validation
- Frontend build success
3. Fails deployment if tests fail
4. Runs linting and type-checking
5. Verifies that backend can start successfully
6. Verifies that frontend can build without errors
Provide:
- Suggested GitHub Actions (or CI provider) config
- Example workflow YAML file
- Suggested test structure
- Suggested test libraries
### Phase 6: Create Stability Improvement Plan
Create:
1. Refactoring suggestions
2. Security improvements
3. Logging improvements
4. Monitoring suggestions
5. Error handling improvements
6. Recommended production-grade best practices
## Resources Available
- Run `scripts/codebase_analysis.py` for automated codebase analysis
- Reference `references/production_debugging.md` for common production issues and debugging patterns
- Use `assets/github-workflow.yml` as a template for CI/CD workflow
## Important Guidelines
- Do not give generic advice
- Analyze the actual code deeply
- Explain root causes clearly
- Provide fixes with code examples
- Be systematic and structured
- Focus on production-specific issues
- Prioritize critical issues that prevent functionality
- Identify environment-specific configurations
- Ensure comprehensive coverage of all system components 章节与文件索引
按说明文件中的顺序排列。
何时使用此技能
第 1 阶段:执行完整的代码库架构分析
第2阶段:执行身份验证系统深度跟踪
第 3 阶段:执行文件级和线路级连接审核
第 4 阶段:执行部署和生产调试
文件/命令 -> scripts/codebase_analysis.py · references/production_debugging.md · assets/github-workflow.yml · CI/CD · localStorage/cookies · fetch/axios · import/export
内容校验值 -> 72668f33e125
当前原文的自动摘译,尚未人工审校。
何时使用此技能
在以下情况下使用此技能: 已部署的应用程序功能在生产中无法正常工作 需要对整个代码库进行全面深入的分析 生产中的身份验证系统问题 需要部署管道调试