flaskAvoid common Flask mistakes β context errors, circular imports, session configuration, and production gotchas.
Install via ClawdBot CLI:
clawdbot install ivangdavila/flaskRequires:
current_app only works inside request or with app.app_context() β "working outside application context" errorg is per-request storage β lost after request ends, use for db connectionswith app.app_context(): or pass data, not proxiescreate_app() factory pattern avoids circular imports β import current_app not apprequest, session only inside request β "working outside request context" errorurl_for needs context β url_for('static', filename='x', _external=True) for absolute URLsfrom app import app in models causes circular β use factory patterncurrent_appinit_app(app) pattern β create without app, bind laterSECRET_KEY required for sessions β random bytes, not weak stringSESSION_COOKIE_SECURE=True in production β only send over HTTPSSESSION_COOKIE_HTTPONLY=True β JavaScript can't accessdebug=True in production = remote code execution β attacker can run PythonFLASK_DEBUG env var β not hardcodedurl_prefix set at registration β app.register_blueprint(bp, url_prefix='/api')@bp.route('/users') becomes /api/usersblueprint.before_request only for that blueprint β app.before_request for alldb.session.commit() explicitly β autocommit not defaultdb.session.rollback() on error β or session stays in bad stateflask run is dev server β use Gunicorn/uWSGI in productionthreaded=True for dev server concurrency β but still not production-readyPROPAGATE_EXCEPTIONS=True for proper error handling with Sentry etc.return redirect('/login') vs return redirect(url_for('login')) β url_for is refactor-safereturn jsonify(data) β not return json.dumps(data)request.form β JSON body in request.json or request.get_json()request.args for query params β request.args.get('page', default=1, type=int)AI Usage Analysis
Analysis is being generated⦠refresh in a few seconds.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Query the DeepWiki MCP server for GitHub repository documentation, wiki structure, and AI-powered questions.
Automated GitHub PR code review with diff analysis, lint integration, and structured reports. Use when reviewing pull requests, checking for security issues,...
Essential Git commands and workflows for version control, branching, and collaboration.
Advanced git operations beyond add/commit/push. Use when rebasing, bisecting bugs, using worktrees for parallel development, recovering with reflog, managing subtrees/submodules, resolving merge conflicts, cherry-picking across branches, or working with monorepos.
Format commit messages using the Conventional Commits specification. Use when creating commits, writing commit messages, or when the user mentions commits, git commits, or commit messages. Ensures commits follow the standard format for automated tooling, changelog generation, and semantic versioning.