🔄 AI Refactor Workflow

1
Human Defines Task
Human
Developer selects task and defines clear scope and goal for refactor
Define scope
Set clear goals
Identify target files
2
Claude Refactor
Claude.ai
Claude creates code changes in sandbox Git clone (NEVER pushes to main)
Clone repository to sandbox
Make code changes
Create patch/branch
Generate commit message
3
Automatic Code Checking
Automated
Runs comprehensive automated tests and static analysis
Static analysis (ESLint, TypeScript)
Run project tests
Dependency audit
Secret scan
Sandbox boot test
4
AI Code Reviewer
Continue Models
Reviews diff for code quality, style, errors, and design risks
Check code style
Identify logic errors
Review design patterns
Flag potential bugs
Generate review report
5
AI Security Researcher
Security AI
Validates code against security advisories from trusted cache ONLY
Check against CWE database
Validate OWASP compliance
Review NVD advisories
Scan for known vulnerabilities
Generate security report

🔒 Trusted Security Cache

Server-side script fetches updates via HTTPS on schedule. AIs read from cache only - NO direct web access.

CWE (MITRE)
OWASP Top 10
NVD Advisories
6
Human Approval
Human
Final review with structured reports from all AI checks
Review code quality report
Review security report
Check test results
Verify changes match intent
Approve or reject
7
Branch Merge
Gitea
Code merged to main ONLY after all gates pass and human approves
Verify all checks passed
Confirm human approval
Merge to main branch
Tag release (if applicable)
Update changelog
🎭 Roles Legend
Human Decision Maker
Claude Refactor (Claude.ai)
AI Reviewer (Continue)
AI Security Researcher
Automated Checks
Gitea (Git Server)

🔒 Security & Safety Rules