You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .amazonq/rules/development-rules.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
- Use snake_case for Python methods
12
12
- Include type hints: `list[str]`, `dict[str, int]`, `Type | None`
13
13
- Follow linting rules (black, isort, ruff, mypy)
14
+
-**NO noise docstrings**: Avoid docstrings that merely restate the function name (e.g., `"""Test CLI help command."""` for `test_cli_help()`). Only add docstrings when they provide meaningful context beyond what the code itself conveys
Copy file name to clipboardExpand all lines: .amazonq/rules/problem-creation.md
+14-60Lines changed: 14 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
5
5
When user requests a problem by **number** or **name/slug**, the assistant will:
6
6
7
-
1.**Scrape** problem data using `.templates/leetcode/scrape.py`
7
+
1.**Scrape** problem data using `lcpy scrape`
8
8
2.**Transform** data into proper JSON template format
9
9
3.**CRITICAL: Include images** - Extract image URLs from scraped data and add to readme_examples with format: `\n\n` before code blocks
10
10
- Check scraped data for image URLs in the `raw_content` field
11
11
- Look for patterns: `https://assets.leetcode.com/uploads/...` or `<img alt="" src="..." />`
12
12
- Common patterns: `kthtree1.jpg`, `kthtree2.jpg`, `clone_graph.png`, `container.jpg`
13
13
- Images provide crucial visual context, especially for tree and graph problems
14
14
- Always verify images are included in `readme_examples` and accessible
15
-
4.**Create** JSON file in `.templates/leetcode/json/{problem_name}.json`
15
+
4.**Create** JSON file in `leetcode_py/cli/resources/leetcode/json/problems/{problem_name}.json`
16
16
5.**Update** Makefile with `PROBLEM ?= {problem_name}`
17
17
6.**Generate** problem structure using `make p-gen`
18
18
7.**Verify** with `make p-lint` - fix template issues in JSON if possible, or manually fix generated files if template limitations
@@ -22,15 +22,15 @@ When user requests a problem by **number** or **name/slug**, the assistant will:
22
22
23
23
```bash
24
24
# Fetch by number
25
-
poetry run python .templates/leetcode/scrape.py -n 1
25
+
lcpy scrape -n 1
26
26
27
27
# Fetch by slug
28
-
poetry run python .templates/leetcode/scrape.py -s "two-sum"
28
+
lcpy scrape -s "two-sum"
29
29
```
30
30
31
31
## JSON Template Format
32
32
33
-
Required fields for `.templates/leetcode/json/{problem_name}.json`:
33
+
Required fields for `leetcode_py/cli/resources/leetcode/json/problems/{problem_name}.json`:
34
34
35
35
**CRITICAL: Use single quotes for Python strings in playground fields to avoid JSON escaping issues with Jupyter notebooks.**
36
36
@@ -41,61 +41,15 @@ Required fields for `.templates/leetcode/json/{problem_name}.json`:
41
41
-`playground_assertion`: Use single quotes for string literals
**Reference examples in `.templates/leetcode/examples/` for complete templates:**
45
-
46
-
-`basic.json5` - All standard problems (array, string, tree, linked list, etc.)
47
-
-`design.json5` - Data structure design problems (LRU Cache, etc.)
48
-
49
-
````json
50
-
{
51
-
"problem_name": "two_sum",
52
-
"solution_class_name": "Solution",
53
-
"problem_number": "1",
54
-
"problem_title": "Two Sum",
55
-
"difficulty": "Easy",
56
-
"topics": "Array, Hash Table",
57
-
"tags": ["grind-75"],
58
-
"readme_description": "Given an array of integers `nums` and an integer `target`, return indices of the two numbers such that they add up to `target`.",
59
-
"readme_examples": [
60
-
{
61
-
"content": "\n\n```\nInput: nums = [2,7,11,15], target = 9\nOutput: [0,1]\n```\n**Explanation:** Because nums[0] + nums[1] == 9, we return [0, 1]."
0 commit comments