[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71SAJXNFNQPFK11M6AM92SZ":3,"skill-same:01M71SAJXNFNQPFK11M6AM92SZ":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":13,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M71SAJXNFNQPFK11M6AM92SZ","project-code-standards",null,"carl0sfelipe\u002FBTC-Daytrade-Tycoon","carl0sfelipe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F37373901?v=4","01M71S9G7B0AEN2B6ZS16TQXF8","Carlos Felipe Siqueira Batista Soares","01M71S9G80E5RQ5H3K5JB6QA4R",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fproject-code-standards\u002FSKILL.md",[],[18,19,20,21,22],"code","code standards","standards","project","project code standards","2026-11-10 13:02:02",false,"# Project Code Standards\n\n📐 **project-code-standards** | Rigorous coding principles for this codebase\n\nEvery agent that reads this skill MUST follow these principles when writing or refactoring code in this project. No exceptions.\n\n---\n\n## Code Style\n\n### Function Size\n- **4–20 lines per function.** If a function exceeds 20 lines, split it.\n- One thing per function. One responsibility per module (SRP).\n\n### File Size\n- **Under 500 lines per file.** Split by responsibility.\n- Prefer small focused modules over god files.\n\n### Naming\n- Names must be **specific and unique**.\n- Avoid generic names: `data`, `handler`, `Manager`, `utils`, `helpers`.\n- Prefer names that return **\u003C5 grep hits** in the codebase.\n- Example: prefer `calcBreakevenPrice` over `getPrice`.\n\n### Types\n- **Explicit types only.** No `any`, no `Dict`, no untyped functions.\n- Return types on all public functions.\n- Interface names: noun or adjective + noun (`FloatingPnL`, `CandleUpdate`).\n\n### Duplication\n- **No code duplication.** Extract shared logic into a function\u002Fmodule immediately.\n- Rule of three: if you see the same shape three times, extract it.\n\n### Control Flow\n- **Early returns over nested ifs.**\n- **Maximum 2 levels of indentation** per function.\n- Use guard clauses at the top.\n\n### Error Messages\n- Exception messages must include the **offending value** and the **expected shape**.\n- Bad: `\"Invalid price\"`\n- Good: `\"Invalid price: received NaN, expected positive number\"`\n\n---\n\n## Comments\n\n### Keep Intent\n- **Keep your own comments.** Don't strip them on refactor — they carry intent and provenance.\n- If you move code, move the comment with it.\n\n### Write WHY, Not WHAT\n- Skip `\u002F\u002F increment counter` above `i++`.\n- Explain why a non-obvious choice was made.\n- Example:\n  ```ts\n  \u002F\u002F Lightweight-charts requires Time as a branded type cast.\n  \u002F\u002F See: https:\u002F\u002Fgithub.com\u002Ftradingview\u002Flightweight-charts\u002Fissues\u002F1234\n  time: c.time as Time,\n  ```\n\n### Docstrings\n- Public functions get a docstring: **intent + one usage example**.\n  ```ts\n  \u002F**\n   * Calculates breakeven price including the taker fee round-trip.\n   * @example\n   * calcBreakevenPrice({ side: \"long\", entry: 50000, feePct: 0.0006 })\n   * \u002F\u002F => 50030\n   *\u002F\n  ```\n\n### Provenance\n- Reference issue numbers \u002F commit SHAs when a line exists because of a specific bug or upstream constraint.\n  ```ts\n  \u002F\u002F Workaround for Safari iOS private mode throwing on localStorage.\n  \u002F\u002F See: commit a29730f, issue #42\n  ```\n\n---\n\n## Tests\n\n### Run Command\n- Tests run with a single command: `npm test`.\n\n### Coverage Rule\n- **Every new function gets a test.**\n- **Every bug fix gets a regression test.**\n\n### Mocking\n- Mock external I\u002FO (API, DB, filesystem) with **named fake classes**, not inline stubs.\n- Bad: `jest.mock(\"fs\", () => ({ readFile: jest.fn() }))`\n- Good: `class FakeFilesystem implements Filesystem { ... }`\n\n### F.I.R.S.T\n- **Fast** — run in \u003C100ms per test file.\n- **Independent** — no shared mutable state between tests.\n- **Repeatable** — same result every run, any environment.\n- **Self-validating** — boolean pass\u002Ffail, no manual inspection.\n- **Timely** — written before or with the code, never after.\n\n---\n\n## Dependencies\n\n### Injection\n- Inject dependencies through **constructor\u002Fparameter**, not global\u002Fimport.\n- If a function needs `fetch`, accept `fetch` as an argument.\n\n### Wrapping Third-Party\n- Wrap third-party libraries behind a **thin interface owned by this project**.\n- Example: `createSimulationChart(container, options)` wraps `createChart` from lightweight-charts.\n- This isolates breaking changes and makes testing possible without the real lib.\n\n---\n\n## Structure\n\n### Framework Convention\n- Follow the framework's convention (Next.js: `app\u002F`, `components\u002F`, `hooks\u002F`, `lib\u002F`, `store\u002F`).\n\n### Predictable Paths\n- `src\u002Flib\u002Fchart\u002F` — chart-specific pure functions\n- `src\u002Fhooks\u002Fchart\u002F` — chart-specific React hooks\n- `src\u002Fcomponents\u002Ftrading\u002F` — trading UI components\n- One module per file. One responsibility per folder.\n\n---\n\n## Formatting\n\n- Use the language default formatter: **Prettier** for TypeScript\u002FTSX.\n- Do not discuss style in code review. Let the formatter decide.\n- Run `npx prettier --write` before committing.\n\n---\n\n## Logging\n\n### Structured JSON\n- When logging for debugging \u002F observability, use **structured JSON**.\n  ```ts\n  console.log(JSON.stringify({ event: \"candle_update\", idx: 42, price: 50000 }));\n  ```\n\n### Plain Text\n- Use plain text **only** for user-facing CLI output.\n\n---\n\n## Checklist Before Commit\n\n- [ ] No function >20 lines\n- [ ] No file >500 lines\n- [ ] No `any` or untyped exports\n- [ ] Early returns used, max 2 indent levels\n- [ ] Tests pass: `npm test`\n- [ ] New functions have tests\n- [ ] Bug fixes have regression tests\n- [ ] Prettier formatted\n- [ ] Comments explain WHY, not WHAT\n- [ ] Docstrings on public functions\n",{},"main","102841b422f974cb78b35daff23006042229f235",".claude\u002Fskills\u002Fproject-code-standards","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon","https:\u002F\u002Fbtc-daytrade-tycoon.vercel.app","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe","2026-08-18 05:17:56",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add carl0sfelipe\u002FBTC-Daytrade-Tycoon --skill project-code-standards",{"tool":40,"command":41},"bunx","bunx skills add carl0sfelipe\u002FBTC-Daytrade-Tycoon --skill project-code-standards",{"tool":43,"command":44},"pnpm","pnpm dlx skills add carl0sfelipe\u002FBTC-Daytrade-Tycoon --skill project-code-standards","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fproject-code-standards\u002FSKILL.md",true,[],[49,60,70,79,92,103],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":23},"01M71SAHQZ05PN12TVFW76KSKP","bmad-technical-research","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-technical-research\u002FSKILL.md",[],[55,56,57,58,59],"technical research","bmad technical research","research","technical","bmad",{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":23},"01M71SAG8KF5K8WH5TKJZN6N2S","bmad-sprint-planning","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-sprint-planning\u002FSKILL.md",[],[66,67,68,69,59],"sprint planning","bmad sprint planning","sprint","planning",{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":23},"01M71SAFHDBST2JQ0PX71FE3AB","bmad-shard-doc","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-shard-doc\u002FSKILL.md",[],[76,77,59,78],"doc","shard","bmad shard doc",{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":23},"01M71SAEKNTM79GP6JZFTNH8YZ","bmad-review-edge-case-hunter","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-review-edge-case-hunter\u002FSKILL.md",[],[59,85,86,87,88,89,90,91],"review","bmad review edge case hunter","bmad review","edge","hunter","bmad review edge case","case",{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":23},"01M71SADMP1516D2BQSY3CDVW6","bmad-review-adversarial-general","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-review-adversarial-general\u002FSKILL.md",[],[85,59,98,99,87,100,101,102],"bmad review adversarial general","review adversarial","general","adversarial","bmad review adversarial",{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":23},"01M71SACVVK64CTYZH0K7FFP07","bmad-retrospective","https:\u002F\u002Fgithub.com\u002Fcarl0sfelipe\u002FBTC-Daytrade-Tycoon\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fbmad-retrospective\u002FSKILL.md",[],[109,59,110],"retrospective","bmad retrospective"]