warren-githut/personal-os-automation/ikko-sql-firewall-patterns
Claude Code and agent skill by warren-githut/personal-os-automation
- community
Checking that the SKILL.md file is still in the repository.
Hard rule + patterns khi viết script query IKKO SQL (iikoAPI) — LUÔN qua sqlclient.run_query() (firewall read-only), KHÔNG connect thẳng pyodbc. Pitfalls: .env MSSQL_DATABASE trống, stdout rebind, Target May-Dec constraint. Dùng khi build/refactor bất kỳ parser/script query IKKO SQL.
Install
npx vskill@latest install warren-githut/personal-os-automation/ikko-sql-firewall-patternsSKILL.md
The same SKILL.md was published earlier as warren-githut/personal-os-automation/ikko-sql-firewall-patterns.
IKKO SQL Firewall & Integration Patterns
Bài học từ code reviewrevenue_sql_parser.py(2026-07-24, C1 CRITICAL).Áp dụng cho MỌI script query IKKO SQL trong vault.
🔴 HARD RULE — LUÔN qua sqlclient.run_query()
vault/.scripts/sqlserver_client/sqlclient.py có firewall is_readonly() chặn mọi INSERT/UPDATE/DELETE/MERGE/DROP/ALTER/CREATE/TRUNCATE/GRANT/REVOKE/EXEC/...
KHÔNG connect thẳng pyodbc.connect() — bypass firewall = rủi ro ghi IKKO.
❌ SAI
✅ ĐÚNG
Lazy-load pattern (tránh re-import)
Pitfalls (đã gặp & fix 2026-07-24)
| # | Pitfall | Fix | ||||
|---|---|---|---|---|---|---|
| P1 | .env MSSQL_DATABASE= trống → load_env() dùng setdefault không ghi đè → default master → sai DB (không có dbo.Orders) | Sửa .env thành iikoAPI HOẶC force os.environ["MSSQL_DATABASE"]="iikoAPI" sau load_env | ||||
| P2 | Parser import OCR parser có sys.stdout = io.TextIOWrapper(...) ở module level → chiếm stdout script gọi | Save _orig=sys.stdout trước import, restore ngay sau; hoặc ghi dry-run vào sys.stderr | ||||
| P3 | Target Achv parse: month_idx = m-5 không guard → tháng 1-4 lấy sai cell (budget chỉ có May-Dec) | if m < 5: return {} | ||||
| P4 | Target regex non-greedy `\ | (.*?)\ | ` chỉ bắt 1 cell | Dùng greedy `\ | (.*)` bắt hết đến cuối dòng | |
| P5 | Dead imports (importlib.util, defaultdict) / dead const (DB_STORES) | Chạy grep trước commit |
Verify sau mỗi fix
- [ ] Script vẫn qua
sqlclient.run_query()(grep không cópyodbc.connect) - [ ]
--drychạy ra số khớp OCR 99.x% - [ ] Target Achv đúng cho tháng 5-12,
—cho 1-4
Security
- Security scanPassed, 90 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 repositoryCheckingpersonal_vault/_skills/data-science/ikko-sql-firewall-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
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/warren-githut/personal-os-automation/ikko-sql-firewall-patterns)