[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80662":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":28,"discoverSource":29},80662,"claude-code-for-hydrology","lorenliu13\u002Fclaude-code-for-hydrology","lorenliu13","Learn Claude Code best practices through hands-on hydrology Python exercises — built for the water science research community","",null,"Python",57,15,3,0,2,8,1,45.41,"MIT License",false,"main",true,[],"2026-06-12 04:01:29","\u003Cimg src=\"cover.png\" alt=\"Claude Code for Hydrology\" width=\"100%\"\u002F>\n\n# Claude Code for Hydrology\n\nA collection of self-contained exercises for learning [Claude Code](https:\u002F\u002Fclaude.ai\u002Fcode) best practices, built specifically for the **hydrological research community**. All code examples use real hydrology concepts — streamflow analysis, drought indices, model performance metrics, and USGS gauge data.\n\nEach exercise demonstrates a **\"before vs. after\" prompt pattern** — you try a vague prompt, clear context, then try a specific prompt, and compare what Claude produces.\n\n---\n\n## Who This Is For\n\nHydrologists, water scientists, and researchers who want to use AI-assisted coding more effectively. No prior Claude Code experience needed — just Python familiarity and curiosity about LLM-based workflows.\n\n---\n\n## Prerequisites\n\n- [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) installed (`npm install -g @anthropic-ai\u002Fclaude-code`)\n- Python 3.10+ with `pip`\n- Basic familiarity with the terminal\n\n---\n\n## Quick Start\n\n```bash\n# 1. Clone the repo\ngit clone https:\u002F\u002Fgithub.com\u002Florenliu13\u002Fclaude-code-for-hydrology.git\ncd claude-code-for-hydrology\n\n# 2. Install Python dependencies\npip install -r requirements.txt\n\n# 3. Open Claude Code\nclaude\n```\n\nThen pick an exercise below and follow its `README.md`.\n\n---\n\n## Exercises\n\nThe exercises are ordered from highest-leverage fundamentals to more advanced workflows. Start at the beginning — each exercise builds on the habits established by the previous ones.\n\n**Foundations (Exercises 1–4)** cover the core prompting practices that improve every interaction with Claude Code. These are the skills you will use in every session.\n\n**Workflows (Exercises 5–9)** introduce tools and patterns that automate, extend, and scale what you can do — once the foundations are solid.\n\n| # | Folder | Best Practice | Level |\n|---|--------|--------------|-------|\n| 1 | [`01_explore_plan_code\u002F`](01_explore_plan_code\u002F) | Explore → Plan → Code with plan mode | Beginner |\n| 2 | [`02_specific_context\u002F`](02_specific_context\u002F) | Reference specific files and symptoms in prompts | Beginner |\n| 3 | [`03_verify_your_work\u002F`](03_verify_your_work\u002F) | Give Claude tests so it can verify its own output | Beginner |\n| 4 | [`04_init_claude_md\u002F`](04_init_claude_md\u002F) | Use `\u002Finit` to create CLAUDE.md for persistent project context | Beginner |\n| 5 | [`05_skills\u002F`](05_skills\u002F) | Create custom skills for domain knowledge and repeatable workflows | Intermediate |\n| 6 | [`06_subagent_review\u002F`](06_subagent_review\u002F) | Orchestrate coder and reviewer subagents in sequence | Advanced |\n| 7 | [`07_aws_cli_workflow\u002F`](07_aws_cli_workflow\u002F) | Use AWS CLI with Claude to download public hydrological datasets | Intermediate |\n| 8 | [`08_mcp_usgs_gauge\u002F`](08_mcp_usgs_gauge\u002F) | Use MCP fetch server to query the USGS NWIS API | Intermediate |\n| 9 | [`09_parallel_fanout\u002F`](09_parallel_fanout\u002F) | Spawn subagents in parallel for multi-configuration analysis; aggregate with a reporter subagent | Advanced |\n\n---\n\n## How Each Exercise Works\n\n1. Read the `README.md` inside the exercise folder — it explains the concept and both prompts.\n2. Try the **\"before\" prompt** — observe what Claude produces without guidance.\n3. Clear context with `\u002Fclear` in Claude Code.\n4. Try the **\"after\" prompt** — compare the quality of the result.\n\nThe difference between the two prompts is the lesson.\n\n---\n\n## Running Tests\n\nEach exercise folder contains a `test_*.py` file. To run tests for an exercise:\n\n```bash\npython -m pytest 01_explore_plan_code\u002F -v\n```\n\nOr run all exercises at once:\n\n```bash\npython -m pytest -v\n```\n\n> **Note:** Use `python3` instead of `python` on systems where Python 2 is the default.\n\n---\n\n## Exercise Details\n\n### Exercise 1 — Explore → Plan → Code\n**Concept:** Use plan mode (`Shift+Tab` twice) to separate exploration from implementation. Claude reads existing code before making changes, preventing it from overwriting things it hasn't seen.\n\nFeature to add: `compute_exceedance_flows()` returning Q90 and Q95 flow thresholds.\n\n### Exercise 2 — Specific Context\n**Concept:** Vague prompts make Claude guess. Naming the file, function, failing test, and symptom lets Claude go directly to the root cause instead of exploring blind.\n\nBug to fix: swapped mean\u002Fstd in the Standardized Precipitation Index (SPI) formula.\n\n### Exercise 3 — Verify Your Work\n**Concept:** The single highest-leverage habit is giving Claude tests with known expected values. Claude becomes its own quality checker and can iterate without your involvement.\n\nMetrics covered: Nash-Sutcliffe Efficiency (NSE) and Kling-Gupta Efficiency (KGE).\n\n### Exercise 4 — Initialize CLAUDE.md\n**Concept:** Use `\u002Finit` to generate a `CLAUDE.md` that gives Claude persistent project context across sessions — so you stop re-explaining your codebase every time you open a new conversation.\n\n### Exercise 5 — Skills\n**Concept:** Create reusable skills for domain knowledge (`\u002Fhydro-context`) and repeatable workflows (`\u002Fflow-report`) so you don't re-explain hydrology conventions every session. Skills compose with everything else in this repo.\n\n### Exercise 6 — Subagent Review\n**Concept:** Orchestrate a coder subagent and a reviewer subagent in sequence. The parent agent controls context isolation and loops until the review passes — offloading an entire quality gate to Claude.\n\n### Exercise 7 — AWS CLI Workflow\n**Concept:** Combine Claude with the AWS CLI to discover and download public hydrological datasets (USGS, NOAA, etc.) without leaving the terminal. Claude handles flag lookup and command construction; you supply the science intent.\n\n### Exercise 8 — MCP USGS Gauge\n**Concept:** Use the MCP fetch server to query the USGS NWIS API in real time, then implement correct response parsing in Python. Demonstrates how MCP tools extend Claude's reach to live external data.\n\n### Exercise 9 — Parallel Fan-Out with Subagents\n**Concept:** When the same analysis must run across multiple independent configurations, spawn one subagent per configuration simultaneously — then collect all results with a single reporter subagent. Wall time equals the slowest single subagent, not the sum of all. Applied here to computing SPI drought indices (SPI-1, SPI-3, SPI-6, SPI-12) in parallel and aggregating findings into a unified comparison report.\n\n---\n\n## Contributing\n\nContributions are welcome. If you have an idea for a new best-practice exercise:\n\n1. Fork the repo and create a branch.\n2. Add a new numbered folder following the existing pattern (a subject Python file, a test file, and a README with before\u002Fafter prompts).\n3. Open a pull request with a short description of the best practice being demonstrated.\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","该项目旨在通过实际的水文学Python练习，帮助水科学研究者学习Claude Code的最佳实践。核心功能包括一系列自包含的练习，涵盖从基础到高级的各种工作流程，如流分析、干旱指数计算、模型性能评估等，并且每个练习都采用“前后对比”的提示模式来展示如何更有效地与AI助手交流。技术特点在于利用Claude Code工具结合具体的水文数据处理任务，强调了清晰上下文的重要性以及如何验证代码输出。适合希望提高AI辅助编码能力的水文学家、水资源科学家及相关研究人员使用，在熟悉Python编程的基础上探索基于大语言模型的工作流程。","2026-06-11 04:01:32","CREATED_QUERY"]