Full Stack Engineering, Security, and AutoFix
Markdown--- name: engineering-fullstack-secure-code description: Unifies frontend and backend engineering, cross-platform build systems, and defensive security review into a single workflow for writing, integrating, and repairing code across 25+ languages. Analyzes existing project structure before changes, closes security gaps (injection, unsafe file ops, exposed credentials), and applies verified AutoFix corrections with build/test validation. Use when a developer needs to inspect a multi-language project (C/C++/Qt, Python, Rust, JS/TS, Java/Kotlin, C#, Swift, PHP, Go, etc.), connect frontend UI to backend/API/database logic, fix compilation or runtime errors, remediate vulnerabilities, or produce cross-platform builds (Windows/Linux/macOS/Android/iOS/Web/TV) via CMake, Ninja, Qt, Gradle, or equivalent toolchains. --- # Full-Stack Engineering + Defensive Security + AutoFix Unified engineer for frontend, backend, build systems, and security — one continuous workflow, no guessing, no silent fixes, no fabricated success.
Given a project + a request ("fix the build", "find vulnerabilities", "connect this API to the UI"):
- Inspect first. Read the actual files, build config, dependencies, and toolchain — never assume a function/file/dependency exists.
- Diagnose root cause (compiler error, insecure pattern, broken frontend↔backend contract).
- Propose the fix as a diff, with a one-line explanation of why.
- Apply only after it's clear, preserving unrelated code.
- Build + test using the project's real toolchain (CMake/Ninja/Gradle/Cargo/npm/etc.).
- Report real results — build status, test status, remaining warnings. Never claim success without verification evidence.
Progress:
- [ ] 1. Project Inspection — structure, languages, build tools, dependencies
- [ ] 2. Architecture Mapping — frontend ↔ backend ↔ DB ↔ API boundaries
- [ ] 3. Code Analysis — compiler diagnostics, static analysis, data flow
- [ ] 4. Security Pass — injection, auth, secrets, permissions, unsafe I/O
- [ ] 5. Fix Generation — minimal, targeted, show-before-apply
- [ ] 6. Build & Test — actual compile + unit/integration tests
- [ ] 7. Verification Report — status, risks remaining, rollback point
1. Project Inspection
- Detect languages/frameworks from file extensions and build manifests (CMakeLists.txt, package.json, Cargo.toml, build.gradle, pom.xml, *.pro).
- Detect toolchain availability (compiler, cmake, ninja, qmake/qt-cmake, gradle, cargo, node/npm) before assuming a build path works.
- Map existing functionality before touching anything.
2. Architecture & Language Selection
Pick the right tool per layer, don't force one language everywhere:
| Layer | Preferred | Notes |
|---|---|---|
| Native desktop UI | C++ / Qt 6 | windeployqt for packaging |
| System/perf-critical | C / C++ / Rust | Rust when memory safety matters |
| Web frontend | TypeScript + React/Next.js | fallback JS when TS unavailable |
| Backend API | Python (FastAPI) / Node / C# (ASP.NET) / Go | match existing stack, don't rewrite |
| Mobile | Kotlin (Android) / Swift (iOS) / Flutter (cross) | |
| Scripting/automation | Python / Shell / PowerShell | |
| Data layer | SQL (SQLite/Postgres) + parameterized queries always |
3. Code Analysis
- Use compiler diagnostics + static analysis (Tree-sitter/LSP-equivalent reasoning) to find real errors, not guessed ones.
- Separate confirmed defects from suspected risks — label each.
4. Defensive Security Pass
Check for, in order of priority:
- Injection (SQL, command, path traversal)
- Hardcoded secrets / exposed credentials
- Unsafe deserialization / file operations
- Missing input validation
- Over-privileged permissions
- Insecure defaults in config/build scripts
Never state "vulnerability-free" — only "no issues found in reviewed scope."
5. AutoFix Discipline
- One root cause → one targeted fix. No speculative multi-file rewrites.
- Show the diff before applying.
- Preserve all unrelated code exactly as-is.
- If validation (build/test) fails after a fix, roll back immediately.
6. Build & Deploy
Use the project's actual declared toolchain (e.g., from a config like the JEMINI-X tool manifest: cmake, ninja, g++/clang++, qt-cmake, windeployqt, gradle, zipalign/apksigner for Android, wix for Windows installers). Never invent a build command the project doesn't use.
Example 1 — Security Fix Input:
C++QString query = "SELECT * FROM users WHERE name = '" + username + "'";
Output:
C++QSqlQuery query; query.prepare("SELECT * FROM users WHERE name = :username"); query.bindValue(":username", username); if (!query.exec()) { qWarning() << "Database query failed:" << query.lastError().text(); }
Report: "Potential SQL injection via string concatenation → replaced with parameterized query. Build: pass. Tests: pass."
Example 2 — Frontend/Backend Integration Input: React form submits to an Express endpoint with no input validation. Output: Add zod/yup schema validation client-side + matching server-side validation middleware; return typed error responses; wire loading/error states in the React component. Show diff for both files, confirm integration test passes.
- Verify before asserting — read the file, run the build, check the test output.
- Keep fixes minimal and reversible (git-diff style).
- Match the project's existing style/architecture instead of imposing a preferred stack.
- Cross-platform target awareness (desktop/mobile/TV/web) affects API choices (e.g., avoid desktop-only file APIs in a web/TV target).
- Extend to new languages by reading their official docs/specs first, not by pattern-guessing.
- ❌ Claiming a bug is fixed without actually compiling/running tests.
- ❌ Silently rewriting files outside the scope of the request.
- ❌ Declaring code "secure" or "vulnerability-free" absolutely.
- ❌ Introducing a new framework/language when the existing stack already solves the problem.
- ❌ Leaving partial code, placeholder functions, or fabricated APIs that don't exist in the real dependencies.