claude-dev-env 1.22.1 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -35,6 +35,13 @@
35
35
  - ☐ Tests (no existence checks, no constant value tests)
36
36
  - ☐ Self-checked before proposing?
37
37
 
38
+ ## Additional Non-overlapping Rules
39
+
40
+ - **task_scope:** Match every action to what was explicitly requested. When intent is ambiguous, research official docs and present options via AskUserQuestion before making any changes. Proceed with edits only on explicit instruction.
41
+
42
+ ## Tool Policies
43
+ - **context7:** Before writing code using any library/framework/SDK/API, call `resolve-library-id` then `query-docs` via Context7 MCP. Use the fetched docs to write code. Applies to all libs including React, Next.js, Django, Express, Prisma.
44
+
38
45
  ## Compaction
39
46
  When compacting, always preserve:
40
47
  - Active task and current goal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "1.22.1",
3
+ "version": "1.23.1",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -53,10 +53,6 @@ def path_contains_glob_metacharacters(candidate_path: str) -> bool:
53
53
  )
54
54
 
55
55
 
56
- def path_contains_whitespace(candidate_path: str) -> bool:
57
- return any(each_character.isspace() for each_character in candidate_path)
58
-
59
-
60
56
  def get_current_project_path() -> str:
61
57
  normalized_project_path = str(Path.cwd()).replace("\\", "/")
62
58
  if path_contains_glob_metacharacters(normalized_project_path):
@@ -64,11 +60,6 @@ def get_current_project_path() -> str:
64
60
  f"Current directory path contains glob metacharacters and cannot "
65
61
  f"be used to build permission rules safely: {normalized_project_path}"
66
62
  )
67
- if path_contains_whitespace(normalized_project_path):
68
- raise ValueError(
69
- f"Current directory path contains whitespace and cannot be used "
70
- f"to build permission rules safely: {normalized_project_path}"
71
- )
72
63
  return normalized_project_path
73
64
 
74
65
 
@@ -0,0 +1,44 @@
1
+ import sys
2
+ from pathlib import Path
3
+
4
+ import pytest
5
+
6
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
7
+
8
+ from _claude_permissions_common import (
9
+ build_permission_rule,
10
+ get_current_project_path,
11
+ path_contains_glob_metacharacters,
12
+ )
13
+
14
+
15
+ def test_return_normalized_path_when_cwd_contains_spaces(
16
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
17
+ ) -> None:
18
+ directory_with_spaces = tmp_path / "dir with spaces"
19
+ directory_with_spaces.mkdir()
20
+ monkeypatch.chdir(directory_with_spaces)
21
+ returned_project_path = get_current_project_path()
22
+ expected_suffix = "/dir with spaces"
23
+ assert returned_project_path.endswith(expected_suffix)
24
+ assert "\\" not in returned_project_path
25
+ built_rule = build_permission_rule("Edit", returned_project_path)
26
+ assert built_rule.startswith("Edit(")
27
+ assert built_rule.endswith("/.claude/**)")
28
+ assert "dir with spaces" in built_rule
29
+
30
+
31
+ def test_raise_when_cwd_contains_glob_metacharacters(
32
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
33
+ ) -> None:
34
+ directory_with_star = tmp_path / "weird[dir]"
35
+ directory_with_star.mkdir()
36
+ monkeypatch.chdir(directory_with_star)
37
+ with pytest.raises(ValueError, match="glob metacharacters"):
38
+ get_current_project_path()
39
+
40
+
41
+ def test_flag_glob_metacharacters_in_any_position() -> None:
42
+ assert path_contains_glob_metacharacters("/home/user/[dir]/project")
43
+ assert path_contains_glob_metacharacters("/home/user/project*")
44
+ assert not path_contains_glob_metacharacters("/home/user/dir with spaces")