code-quality
Skill268 starsChanged 48 days agoApache-2.0View on GitHub
Use when writing, reviewing, or refactoring QuantConnect/LEAN algorithm code for style correctness. Triggers: new algorithm code, code review, cleanup, "fix code style", "review code quality", "clean up the algorithm", redundant imports, subscription variable usage, comment format, blank-line rules, multi-line boolean layout, or catch-all error handling. Skip when only debugging runtime behavior or performance, unless the fix also changes style.
77 other projects use a version of this.
Adopted by
Most recently taken up by
- magnusrodseth/dotfilestheir own version, first seen Nov 8, 2026
- KadirHarmanc/nazar-skilltheir own version, first seen Nov 8, 2026
- AndersonAndrad/skillstheir own version, first seen Nov 8, 2026
- Mehul72/skillstheir own version, first seen Nov 8, 2026
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- notque/vexjoy-agenttheir own version, first seen Nov 7, 2026
Used with
Projects with it also use spring-boot, logging-patterns and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ffsshhttiikkSkillspring-boot
Spring Boot framework and Java enterprise patterns
Also in 3 projects that use this
DIL8654Skilllogging-patterns
Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.
Also in 3 projects that use this
mstuder-slalomSkilljpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
Also in 3 projects that use this
ffsshhttiikkSkilldesign-patterns
Practical application and coding skills for Design Patterns
Also in 4 projects that use this
glommerSkillpr-workflow
General guidelines for Commits, formatting, CI, dependencies, security
Also in 4 projects that use this
vm0-aiSkillcli-design
Design patterns and conventions for the Okou CLI user experience
Also in 3 projects that use this
Other versions77 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 77
- tursodatabase/turso★ 25ksame name
- superdesigndev/treg★ 7.7ksame name
- doorkeeper-gem/doorkeeper★ 5.5ksame name
- static-web-server/static-web-server★ 2.4ksame name
- piomin/claude-ai-spring-boot★ 1.4ksame name
- microsoft/winappCli★ 1.4ksame name
- glommer/pgmicro★ 1.2ksame name
- vm0-ai/vm0★ 1.2ksame name
- rommapp/argosy-launcher★ 710same name
- waybarrios/opencode-power-pack★ 547same name
67 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs-styleSkill
- calendarSkill
- code-qualitySkill
- cryptoSkill
- data-exportSkill
- data-issuesSkill
- debug-algorithmSkill
- debug-performanceSkill
- equity-fundamental-dataSkill
- equity-optionsSkill
- futuresSkill
- historical-data-equity-optionsSkill
- historySkill
- indicatorsSkill
- loggingSkill
- option-strategiesSkill
- ordersSkill
- pricingSkill
- scheduled-eventsSkill
- universesSkill
- calendarSkill
- cryptoSkill
- data-exportSkill
- data-issuesSkill
- debug-algorithmSkill
- debug-performanceSkill
- equity-fundamental-dataSkill
- equity-optionsSkill
- futuresSkill
- historical-data-equity-optionsSkill
- historySkill
- indicatorsSkill
- loggingSkill
- option-strategiesSkill
- ordersSkill
- pricingSkill
- scheduled-eventsSkill
- universesSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use AlgorithmImports for LEAN APIs and common algorithm types.
- Very specific: line 16
Start every Python file in the project, not only main.py, with from AlgorithmImports import *.
- Distinctive: line 29
Use x in data and x not in data, not data.contains_key(x).
- Distinctive: line 31
Follow PEP 8: block comments start with # , use complete sentences, start sentences with capitals, and end sentences with periods.
- Distinctive: line 41
Put and/or at the end of each continued line.
- Distinctive: line 56
Use two blank lines before top-level classes, one blank line before methods inside classes, and no blank lines inside method bodies.
- Very specific: line 58
Do not wrap algorithm logic in try / except blocks.
“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
QuantConnect Algorithm Code Quality
Apply these rules to main.py and custom data classes. The goal is compiling code that does not hide real failures.
Imports
Use AlgorithmImports for LEAN APIs and common algorithm types. Do not add redundant imports for datetime, timedelta, date, pandas, numpy, or math. Put required standard library imports before AlgorithmImports, separated by one blank line.
Start every Python file in the project, not only main.py, with from AlgorithmImports import *. The algorithm class inherits only from QCAlgorithm; hold shared logic in helper objects such as self._risk = RiskHelper(self).
Subscription Variables
Store the Security returned by add_data, add_equity, or add_crypto. Pass that Security directly anywhere a Symbol is expected; do not store or use .symbol.
# Bad
self._custom_symbol = self.add_data(MyData, "TICKER").symbol
data[self._custom_btc.symbol]
# Good
self._custom_btc = self.add_data(MyData, "TICKER")
if self._custom_btc not in data:
return
bar = data[self._custom_btc]Use x in data and x not in data, not data.contains_key(x).
Comments
Follow PEP 8: block comments start with # , use complete sentences, start sentences with capitals, and end sentences with periods. Inline comments are rare, separated from code by at least two spaces, and start with # .
# Bad
# add equity
x = price*quantity #calculate value
# Good
# Add the equity subscription.
x = price * quantity # Calculate the order value.Multi-Line Boolean Expressions
Put and/or at the end of each continued line.
# Bad
if (
close > ema_fast
and open_ > ema_fast
and rsi > 50):
return
# Good
if (close > ema_fast and
open_ > ema_fast and
rsi > 50):
returnBlank Lines
Use two blank lines before top-level classes, one blank line before methods inside classes, and no blank lines inside method bodies.
Error Handling
Do not wrap algorithm logic in try / except blocks. Exceptions reveal invalid state, missing data, and incorrect assumptions; catch-all handlers make bugs invisible.
# Bad
try:
self.set_holdings(self._spy, target_weight)
except Exception:
pass
# Good
if target_weight:
self.set_holdings(self._spy, target_weight)Dictionary Keys and Values
LEAN dictionaries such as self.portfolio, self.securities, and the Slice collections expose keys(), values(), and items() as methods. Call them with parentheses to iterate the collection.
for holding in self.portfolio.values():
pass
for symbol, bar in slice.bars.items():
passChecklist
- Standard library imports precede AlgorithmImports.
- Stored subscription variables are Security objects, not .symbol values.
- Comments follow language-specific rules.
- Multi-line boolean expressions follow language-specific continuation style.
- Blank lines match language rules.
- Algorithm code has no
try / except; it uses explicit guards for expected conditions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

