clawic/skills/flask
Claude Code and agent skill by clawic/skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Avoid common Flask mistakes — context errors, circular imports, session configuration, and production gotchas.
Install
npx vskill@latest install clawic/skills/flaskSKILL.md
The same SKILL.md was published earlier as clawic/skills/flask.
Application Context
current_apponly works inside request or withapp.app_context()— "working outside application context" errorgis per-request storage — lost after request ends, use for db connections- Background tasks need context —
with app.app_context():or pass data, not proxies create_app()factory pattern avoids circular imports — importcurrent_appnotapp
Request Context
request,sessiononly inside request — "working outside request context" errorurl_forneeds context —url_for('static', filename='x', _external=True)for absolute URLs- Test client provides context automatically — but manual context for non-request code
Circular Imports
from app import appin models causes circular — use factory pattern- Import inside function for late binding — or use
current_app - Blueprints help organize — register at factory time, not import time
- Extensions init with
init_app(app)pattern — create without app, bind later
Sessions and Security
SECRET_KEYrequired for sessions — random bytes, not weak string- No SECRET_KEY = unsigned cookies — anyone can forge session data
SESSION_COOKIE_SECURE=Truein production — only send over HTTPSSESSION_COOKIE_HTTPONLY=True— JavaScript can't access
Debug Mode
debug=Truein production = remote code execution — attacker can run Python- Use
FLASK_DEBUGenv var — not hardcoded - Debug PIN in logs if debug enabled — extra layer, but still dangerous
Blueprints
url_prefixset at registration —app.register_blueprint(bp, url_prefix='/api')- Blueprint routes relative to prefix —
@bp.route('/users')becomes/api/users blueprint.before_requestonly for that blueprint —app.before_requestfor all
SQLAlchemy Integration
db.session.commit()explicitly — autocommit not default- Session scoped to request by Flask-SQLAlchemy — but background tasks need own session
- Detached object error — object from different session, refetch or merge
db.session.rollback()on error — or session stays in bad state
Production
flask runis dev server — use Gunicorn/uWSGI in productionthreaded=Truefor dev server concurrency — but still not production-ready- Static files through nginx — Flask serving static is slow
PROPAGATE_EXCEPTIONS=Truefor proper error handling with Sentry etc.
Common Mistakes
return redirect('/login')vsreturn redirect(url_for('login'))— url_for is refactor-safe- JSON response:
return jsonify(data)— notreturn json.dumps(data) - Form data in
request.form— JSON body inrequest.jsonorrequest.get_json() request.argsfor query params —request.args.get('page', default=1, type=int)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/flask/SKILL.md
Popularity
- Repository stars
- 18
- Repository forks
- 5
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/clawic/skills/flask)