claude-dev-env 1.20.1 → 1.21.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
@@ -1,16 +1,43 @@
1
1
  # Claude Development Assistant
2
2
 
3
- Canonical behavior policy lives in `~/.claude/system-prompts/software-engineer.xml`.
3
+ ## Code Rules (NON-NEGOTIABLE)
4
+ @~/.claude/docs/CODE_RULES.md
4
5
 
5
- ## Canonical Pointers
6
+ ## Core Philosophy
6
7
 
7
- - Code quality rules: `~/.claude/docs/CODE_RULES.md` (pointer to `<code_quality>`)
8
- - Git workflow: `~/.claude/rules/git-workflow.md` (pointer to `<git_workflow>`)
9
- - Development protocol: `<behavior_protocol>` in the system prompt; lean rule `~/.claude/rules/bdd.md`; on-demand `bdd-protocol` skill
10
- - Tool usage and workflow: `<tool_usage>` and `<agent_workflow>` in the system prompt
8
+ **TDD IS NON-NEGOTIABLE.** Build it right, build it simple. Maintainable > Clever.
11
9
 
12
- ## Additional Non-overlapping Rules
10
+ ## Working with Claude
13
11
 
14
- - Prompt workflow controls: `@~/.claude/rules/prompt-workflow-context-controls.md`
15
- - Testing quality specifics: `@~/.claude/rules/testing.md`
16
- - Path-scoped Tasklings preferences load automatically via `~/.claude/rules/tasklings-preferences.md`
12
+ ### Expectations
13
+
14
+ 1. **ALWAYS FOLLOW TDD** - No production code without failing test
15
+ 2. **MANDATORY SELF-CHECK before proposing** - See protocol below
16
+ 3. Assess refactoring after every green
17
+
18
+ ### Mandatory Self-Check Protocol
19
+
20
+ **BEFORE proposing plans/implementation:**
21
+
22
+ ☐ Project rules review (e.g. Tasklings `tasklings-preferences` when in that repo path)
23
+ ☐ "Is this KISS?" (simplest? unnecessary complexity?)
24
+ ☐ "Over-engineering?" (multiple files? premature abstractions?)
25
+ ☐ Test infrastructure? (ONE file, functions, YAGNI)
26
+ ☐ Tests add value? (no existence checks, no constant tests)
27
+
28
+ ## Pre-PR Submission Checklist
29
+
30
+ **Run `/check-pr` OR verify:**
31
+ - ☐ KISS / preferences (multiple requirements.txt? over-engineered?)
32
+ - ☐ KISS (simplest? one file? functions not classes?)
33
+ - ☐ Files (proper modules, correct dirs, no empty __init__.py)
34
+ - ☐ Quality (no dupes, types complete, no Any/any)
35
+ - ☐ Tests (no existence checks, no constant value tests)
36
+ - ☐ Self-checked before proposing?
37
+
38
+ ## Compaction
39
+ When compacting, always preserve:
40
+ - Active task and current goal
41
+ - Full list of modified files
42
+ - Any failing test names or error messages
43
+ - Current git branch and PR state
@@ -1 +1,210 @@
1
- # CODE_RULES pointer: canonical code-quality policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<code_quality>`.
1
+ # Code Rules Reference
2
+
3
+ Compact reference for agents. Hook-enforced rules marked with ⚡.
4
+
5
+ ---
6
+
7
+ ## COMMENT PRESERVATION (ABSOLUTE RULE)
8
+
9
+ **NEVER remove existing comments.** If you are not adding or removing code on a line, do not touch its comments.
10
+
11
+ - Existing comments are SACRED — never delete, rewrite, or "clean up" existing comments
12
+ - New inline comments are not needed — write self-documenting code instead
13
+ - Module-level docstrings are allowed in all files
14
+ - Docstrings for new files/methods/classes are allowed
15
+ - **Test files are exempt:** comments and docstrings inside test functions are allowed
16
+ - The hook enforces BOTH directions: blocks new inline comments AND blocks deletion of existing comments
17
+
18
+ **Scope:** Only evaluate comments on lines YOU are actively changing. If code is untouched, its comments are untouched.
19
+
20
+ ---
21
+
22
+ ## CORE PRINCIPLES
23
+
24
+ ### Self-Documenting Code
25
+ New code explains itself through naming. Do not add new inline comments — use descriptive names instead. Docstrings on functions/methods/classes are allowed.
26
+
27
+ > **Full readability standard:** `~/.claude/skills/readability-review/SKILL.md` — 8-dimension rubric (naming, SRP, abstraction, control flow, domain language, call sites, state clarity, visual rhythm). Run `/check` for parallel team review or `/readability-review` standalone.
28
+
29
+ ### Centralized Configuration
30
+ One source of truth. Every constant lives in ONE place (`config/`).
31
+
32
+ ### Reuse Before Create
33
+ Search first. Import second. Create last.
34
+
35
+ ### Encapsulation Enables Cleaner Naming
36
+ Expose constants via helper functions: `isMaxLevel(level)` > `level >= MAXIMUM_LEVEL`
37
+
38
+ ---
39
+
40
+ ## ⚡ HOOK-ENFORCED RULES
41
+
42
+ These rules are automatically enforced by `code-rules-enforcer.py`. Violations block Write/Edit.
43
+
44
+ | Rule | What's Checked |
45
+ |------|----------------|
46
+ | No NEW comments | `#` / `//` in new production code only (existing comments NEVER removed; shebangs, type:, noqa, eslint, docstrings, module docstrings, and all test files exempt) |
47
+ | Imports at top | No `import` inside function bodies |
48
+ | Logging format args | No `log_*(f"...")` - use `log_*("...", arg)` |
49
+ | File line count | Advisory only — see [File length guidance](#65-file-length-guidance) |
50
+ | Magic values | No literals in production function bodies (0, 1, -1 exempt). **Test files exempt.** Includes string templates — if you strip the interpolations from an f-string and the remaining literal text is structural (paths, URLs, patterns), those fragments are magic values that belong in config |
51
+ | Constants location | No `UPPER_SNAKE =` outside `config/` in **production code**. **Test files may define local constants.** |
52
+
53
+ ---
54
+
55
+ ## 3. REUSE CONSTANTS (DRY CONFIG)
56
+
57
+ **Before writing ANY constant:**
58
+
59
+ ```bash
60
+ # Find config files
61
+ # Search your project for existing config files before creating new ones
62
+
63
+ # Search for value
64
+ grep -r "VALUE" config/
65
+ ```
66
+
67
+ **Decision tree:**
68
+ 1. Search exact value → Found? → IMPORT IT
69
+ 2. Search semantic match → Found? → USE EXISTING NAME
70
+ 3. Config file exists? → ADD TO EXISTING
71
+ 4. Create new (rare)
72
+
73
+ ---
74
+
75
+ ## 4. CONFIG LOCATIONS
76
+
77
+ | Constant Type | Location |
78
+ |---------------|----------|
79
+ | Timeouts, delays, retries | `config/timing.py` |
80
+ | Ports, URLs, thresholds | `config/constants.py` |
81
+ | CSS selectors | `config/selectors.py` |
82
+
83
+ ---
84
+
85
+ ## 5. NO ABBREVIATIONS
86
+
87
+ Full words only. No mental translation.
88
+
89
+ | Bad | Good |
90
+ |-----|------|
91
+ | `ctx`, `cfg`, `msg` | `context`, `configuration`, `message` |
92
+ | `btn`, `idx`, `cnt` | `button`, `index`, `count` |
93
+ | `tmp`, `elem`, `val` | `temporary_value`, `element`, `value` |
94
+
95
+ **Exception:** `i`, `j`, `k` in loops; `e` for exception.
96
+
97
+ **Extended naming rules** (from readability-review rubric):
98
+ - Loop vars: `each_order`, `each_user` (prefix `each_`)
99
+ - Booleans: `is_valid`, `has_permission`, `should_retry` (prefix `is_`/`has_`/`should_`/`can_`)
100
+ - Collections: `all_orders`, `all_users` (prefix `all_`)
101
+ - Maps: `price_by_product`, `user_by_id` (pattern `X_by_Y`)
102
+ - Preposition params: `from_path=`, `to=`, `into=`
103
+ - **Banned names:** `result`, `data`, `output`, `response`, `value`, `item`, `temp`
104
+ - **Banned prefixes:** `handle`, `process`, `manage`, `do`
105
+
106
+ ---
107
+
108
+ ## 6. COMPLETE TYPE HINTS
109
+
110
+ ```python
111
+ def function_name(
112
+ parameter: str,
113
+ optional: Optional[str] = None,
114
+ ) -> ReturnType:
115
+ ```
116
+
117
+ - ALL parameters typed
118
+ - ALL returns typed
119
+ - No `Any` type
120
+ - No `# type: ignore`
121
+
122
+ *(Also enforced by mypy_validator.py hook)*
123
+
124
+ ---
125
+
126
+ ## 6.5 FILE LENGTH GUIDANCE
127
+
128
+ File length is a **smell signal, not a hard threshold**. Long files often hide multiple responsibilities, but legitimately long files exist (migrations, generated code, registries, fixtures). The hook surfaces advisories instead of blocking.
129
+
130
+ **Two advisory thresholds (non-blocking, stderr only):**
131
+
132
+ | Threshold | Source basis | Hook behavior |
133
+ |-----------|--------------|---------------|
134
+ | `>= 400` lines | Robert C. Martin, *Clean Code* (2008), Ch. 5 "Formatting" — small files preferred; Martin Fowler, *Refactoring* — "Large Class" code smell | Soft advisory: "consider splitting" |
135
+ | `>= 1000` lines | pylint default `max-module-lines=1000`; SonarQube rule S104 default `1000` | Strong nudge: "exceeds widely-used static-analysis defaults" |
136
+
137
+ **What we deliberately reject:**
138
+
139
+ - **Hard numeric blocks** — Google's Python Style Guide imposes no file-length cap (only a ~40-line function review hint at https://google.github.io/styleguide/pyguide.html). A blocking rule produces false positives on legitimate cases.
140
+ - **A single magic number** — Different sources land at 200 (*Clean Code* preference), 750 (some SonarQube language profiles), or 1000 (pylint, Sonar Java). No source justifies a single universal cap.
141
+
142
+ **When to actually split:**
143
+
144
+ The size signal matters *because* of what it usually indicates: multiple responsibilities (Single Responsibility Principle — Robert C. Martin, *Agile Software Development*, 2002), poor cohesion (Steve McConnell, *Code Complete 2e*, 2004, Ch. 5–6), or the "Large Class" / "Long Function" smells (Fowler). Use the readability rubric (`~/.claude/skills/readability-review/SKILL.md`) when an advisory fires — split based on cohesion, not line count.
145
+
146
+ ---
147
+
148
+ ## 7. RIGHT-SIZED ENGINEERING
149
+
150
+ **Simple > Clever. Functions > Classes. Concrete > Abstract.**
151
+
152
+ Never: ABC for single impl, DI frameworks, factory for single type
153
+ Always: Functions when no state, concrete classes, simple imports
154
+
155
+ ---
156
+
157
+ ## 8. TDD PROCESS
158
+
159
+ 1. **RED** - Failing test first
160
+ 2. **GREEN** - Minimum code to pass
161
+ 3. **REFACTOR** - Only if valuable
162
+
163
+ ---
164
+
165
+ ## 9. SELF-CONTAINED COMPONENTS
166
+
167
+ Components own their complete feature. Parents just render `<Child />`.
168
+
169
+ Child handles: state, modals, overlays, toasts
170
+ Parent knows: nothing about child's internals
171
+
172
+ ---
173
+
174
+ ## 10. NO REDUNDANT DATA FETCHES
175
+
176
+ If you already have data, don't fetch again.
177
+
178
+ ```typescript
179
+ // BAD
180
+ const profile = await getProfile();
181
+ const localProfile = await db.profile.first(); // same data!
182
+
183
+ // GOOD
184
+ const profile = await db.profile.first();
185
+ // ... use profile throughout ...
186
+ ```
187
+
188
+ ---
189
+
190
+ ## QUICK CHECKLIST
191
+
192
+ ```
193
+ Before ANY code:
194
+ [ ] Searched existing configs?
195
+ [ ] Importing from centralized config?
196
+
197
+ Hook will enforce:
198
+ [⚡] No NEW comments (existing comments NEVER removed)
199
+ [⚡] No magic values
200
+ [⚡] Imports at top
201
+ [⚡] Logging format args
202
+ [ ] File length reasonable (advisory at 400, strong nudge at 1000 — see §6.5)
203
+ [⚡] Constants in config/
204
+
205
+ Manual check:
206
+ [ ] No abbreviations?
207
+ [ ] Complete type hints?
208
+ [ ] Self-contained components?
209
+ [ ] Readability: /check or /readability-review
210
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "1.20.1",
3
+ "version": "1.21.1",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +1,47 @@
1
- # Agent-spawn-protocol pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<agent_workflow>`.
1
+ # Agent Spawn Protocol (Mandatory)
2
+
3
+ **When this applies:** Before any Agent or Task tool invocation (Explore, implementation, research, or team subagents).
4
+
5
+ <agent_spawn_protocol>
6
+
7
+ ## Before spawning ANY agent — no exceptions
8
+
9
+ Every Agent and Task tool call must follow this protocol. This includes Explore agents, research agents, execution agents, and team members.
10
+
11
+ ### Step 1: Context sufficiency check
12
+
13
+ Before writing any agent prompt, verify you can answer all of these:
14
+ - [ ] What specific files, directories, or areas of the codebase are involved?
15
+ - [ ] What constraints apply? (patterns to follow, things NOT to change, boundaries)
16
+ - [ ] What does success look like? (expected output, acceptance criteria)
17
+ - [ ] Is the task unambiguous enough to delegate?
18
+
19
+ If ANY answer is "I don't know" -- investigate first (read files, search code) or ask the user. Do NOT spawn with incomplete context.
20
+
21
+ ### Step 2: Craft the prompt with /prompt-generator
22
+
23
+ Run the `/prompt-generator` skill to produce a structured prompt. Feed it:
24
+ - The task description and goal
25
+ - Target files/directories discovered in Step 1
26
+ - Constraints and boundaries
27
+ - Expected output format
28
+ - Acceptance criteria
29
+
30
+ The skill will ask 1-3 clarifying questions if information is missing -- this is the built-in context verification.
31
+
32
+ Use the skill's output as the agent's `prompt` parameter.
33
+
34
+ ### Step 3: Spawn the agent
35
+
36
+ Pass the structured prompt from Step 2 to the Agent/Task tool.
37
+
38
+ </agent_spawn_protocol>
39
+
40
+ ## Why
41
+
42
+ Agents receiving vague prompts waste tokens exploring in circles, produce code that misses constraints, and require expensive rework. A 30-second investment in prompt quality via /prompt-generator saves 5-minute agent failures. This applies equally to Explore agents (which waste context on unfocused searches) and execution agents (which write wrong code).
43
+
44
+ ## Relationship to other rules
45
+
46
+ - **conservative-action.md** gates acting when ambiguous. This extends that: do not delegate when the task is ambiguous—investigate or ask the user first.
47
+ - Project-specific rules or `~/.claude/CLAUDE.md` may define *whether* to use subagents or teams; this rule governs *how* to craft prompts when you do delegate.
@@ -1 +1,27 @@
1
- # Cleanup-temp-files pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<cleanup>`.
1
+ # Clean Up Temporary Files
2
+
3
+ **When this applies:** After tasks that created scratch files, debug dumps, or one-off scripts the user did not ask to keep.
4
+
5
+ Source: [Anthropic — Reduce file creation in agentic coding](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#reduce-file-creation-in-agentic-coding)
6
+
7
+ ## During a task
8
+
9
+ - Prefer working in memory over creating scratchpad files. Use variables and tool results instead of writing intermediate data to disk.
10
+ - When a temporary file is genuinely needed (e.g., a helper script, a test fixture, a debug output), track it mentally for cleanup.
11
+
12
+ ## When a task is complete
13
+
14
+ - Remove every temporary file, script, or helper file you created during the task.
15
+ - Leave the working directory cleaner than you found it.
16
+ - If a file was created at the user's explicit request (not as a byproduct of your process), leave it in place.
17
+
18
+ ## What counts as temporary
19
+
20
+ - Scripts written to test a hypothesis or run a one-off check
21
+ - Debug output files, log dumps, or intermediate data exports
22
+ - Helper files created to work around tool limitations
23
+ - Any file the user did not ask for and would not expect to find after the task
24
+
25
+ ## Why
26
+
27
+ Temporary files accumulate across sessions and clutter the project root. Latest models sometimes use files as scratchpads during iteration, and these leftovers confuse both the user and future sessions if not cleaned up.
@@ -1 +1,11 @@
1
- # Code-reviews pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<code_review_response>`.
1
+ # Responding to Code Reviews
2
+
3
+ **When this applies:** GitHub PR review feedback on a branch you are fixing.
4
+
5
+ **MANDATORY PROTOCOL (use pr-review-responder skill):**
6
+
7
+ 1. Fetch ALL reviewer comments BEFORE any fixes
8
+ 2. Create TodoWrite checklist - One item per comment
9
+ 3. Fix systematically - Mark each todo complete
10
+ 4. Reply to EACH comment inline
11
+ 5. Create ONE review fix commit - DO NOT squash with original
@@ -1 +1,43 @@
1
- # Code-standards pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<code_quality>`.
1
+ # Code Standards
2
+
3
+ > **MANDATORY REFERENCE:** CODE_RULES.md - Load for ALL code generation.
4
+ > This is the single source of truth for code standards. Non-negotiable.
5
+
6
+ @~/.claude/docs/CODE_RULES.md
7
+
8
+ **Key principles (see CODE_RULES.md for complete reference):**
9
+ - Self-documenting code (no comments)
10
+ - Centralized configuration (one source of truth)
11
+ - Reuse constants (search before creating)
12
+ - No magic values (everything named)
13
+ - No abbreviations (full words)
14
+ - Complete type hints
15
+ - TDD (test first)
16
+
17
+ ## Function Parameters - Required vs Optional
18
+
19
+ **Use required parameters when no valid use case exists for optional.**
20
+ **Remove unused parameters.**
21
+
22
+ ## Encapsulation - Logic Belongs in Models
23
+
24
+ **NEVER scatter construction logic in calling code.**
25
+
26
+ Path/URL building, formatting, transformations -> Put in model methods.
27
+ If you find yourself building the same string pattern in multiple places, it belongs in the model.
28
+
29
+ ## Document Temporary Code
30
+
31
+ **Scaffolding/placeholder code MUST have TODO comments.**
32
+
33
+ When code exists only to enable testing before full implementation:
34
+ - Add `// TODO: Replace with...` explaining what will replace it
35
+ - Explain WHY it's temporary, not just WHAT it does
36
+
37
+ ## Naming Reflects Behavior
38
+
39
+ **Name components after what they ARE, not abstract concepts.**
40
+
41
+ If it overlays the viewport -> "Overlay" not "Screen"
42
+ If it validates input -> "Validator" not "Handler"
43
+ Names should describe observable behavior or visual appearance.
@@ -1 +1,20 @@
1
- # Conservative-action pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<task_scope>`.
1
+ # Conservative Action
2
+
3
+ Source: [Anthropic - Tool Usage](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#tool-usage)
4
+
5
+ <do_not_act_before_instructions>
6
+ When the user's intent is ambiguous, default to research and recommendations rather than taking action. Provide information, explain options, and surface tradeoffs — then let the user decide before making changes.
7
+
8
+ Proceed with edits, file modifications, or implementations only when the user explicitly requests them.
9
+ </do_not_act_before_instructions>
10
+
11
+ ## Deciding whether to act
12
+
13
+ - If the user asks a question, answer the question. Do not also fix the thing they asked about.
14
+ - If the user describes a problem, investigate and recommend. Do not jump to implementation.
15
+ - If the user says "do it", "go ahead", "make the change", or similarly explicit language, proceed with action.
16
+ - When in doubt, ask: "Would you like me to make this change, or just show you the approach?"
17
+
18
+ ## Why
19
+
20
+ Acting prematurely wastes effort and round-trips when the user wanted a different approach. Exploring first produces better outcomes than committing early. This is especially important with models that have a strong action bias.
package/rules/context7.md CHANGED
@@ -1 +1,12 @@
1
- # Context7 pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<context7>`.
1
+ ---
2
+ alwaysApply: true
3
+ ---
4
+
5
+ When working with libraries, frameworks, or APIs — use Context7 MCP to fetch current documentation instead of relying on training data. This includes setup questions, code generation, API references, and anything involving specific packages.
6
+
7
+ ## Steps
8
+
9
+ 1. Call `resolve-library-id` with the library name and the user's question
10
+ 2. Pick the best match — prefer exact names and version-specific IDs when a version is mentioned
11
+ 3. Call `query-docs` with the selected library ID and the user's question
12
+ 4. Answer using the fetched docs — include code examples and cite the version
@@ -1 +1,27 @@
1
- # Explore-thoroughly pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<investigation>`.
1
+ # Explore Thoroughly
2
+
3
+ Source: [Anthropic - Overthinking and Excessive Thoroughness](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#overthinking-and-excessive-thoroughness)
4
+
5
+ Note: This deliberately chooses exploration depth over the "commit and execute quickly" pattern from the same source. Thorough upfront exploration is preferred for the intended workflow.
6
+
7
+ ## Before committing to an approach
8
+
9
+ - Read the relevant files. Understand what exists before proposing what to change.
10
+ - Map the existing patterns: naming conventions, file organization, architectural decisions.
11
+ - Identify constraints that could invalidate an approach before investing effort in it.
12
+ - For unfamiliar codebases or high-stakes changes, invest more time exploring than feels necessary.
13
+
14
+ ## Exploration scales with risk
15
+
16
+ - Small change to a familiar file: a quick read of the file and its immediate neighbors is sufficient.
17
+ - New feature or cross-cutting change: read broadly across the codebase to understand how similar things are done.
18
+ - Architectural decision: explore the full landscape before recommending a direction.
19
+
20
+ ## Relationship to other rules
21
+
22
+ - **conservative-action.md** gates *whether* to act. This rule governs *how deeply* to investigate.
23
+ - **research-mode.md** ensures factual claims are grounded. This rule ensures implementation plans are grounded in the actual codebase.
24
+
25
+ ## Why
26
+
27
+ Premature commitment leads to wasted effort when the chosen approach conflicts with existing patterns or misses important context. Thorough exploration surfaces constraints early and produces better-informed solutions.
@@ -1 +1,42 @@
1
- # Git-workflow pointer: canonical git workflow policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<git_workflow>`.
1
+ # Git Workflow
2
+
3
+ User-level rule: applies to **every** git repo that uses GitHub with `gh` (no exceptions for “small” or non-primary repos unless the user says otherwise in the session).
4
+
5
+ ## Workflow Decision Tree
6
+
7
+ **When to use stacked PRs:** Feature B depends on Feature A's implementation
8
+
9
+ **When to extract shared infrastructure first:** Multiple features need same utilities/helpers
10
+
11
+ **Extract Shared Infrastructure Pattern:**
12
+ 1. Create infrastructure PR with only shared code
13
+ 2. Get reviewed and MERGE infrastructure first
14
+ 3. Launch parallel feature PRs that use merged infrastructure
15
+
16
+ ## PR Submission Rules
17
+
18
+ **ALWAYS create PRs as DRAFT:** Use `gh pr create --draft` for ALL PRs
19
+
20
+ ## Git Golden Rules (NON-NEGOTIABLE)
21
+
22
+ 1. **DRAFT BEFORE PUSH**: When pushing ANYTHING to a PR, it MUST be in draft state first
23
+ - Before push: `gh pr ready --undo`
24
+ - After review approved: `gh pr ready`
25
+
26
+ 2. **ONE COMMIT PER REVIEW STAGE**: Each review round gets exactly ONE commit
27
+ - Initial feature: 1 commit
28
+ - After review #1: 2 commits (initial + review #1 fixes)
29
+ - After review #2: 3 commits (initial + review #1 fixes + review #2 fixes)
30
+ - NEVER squash multiple review stages into one commit
31
+ - NEVER have multiple commits for the same review stage
32
+
33
+ ## Never Commit Working Documents or Images
34
+
35
+ **NEVER commit these files to the repo:**
36
+
37
+ | Pattern | Reason |
38
+ |---------|--------|
39
+ | `docs/plans/*.md` | Working documents for planning, not repo content |
40
+ | `*.plan.md` | Temporary planning files |
41
+ | `SESSION_STATE.md` | Local session state |
42
+ | `*.png *.jpg *.jpeg *.gif *.webp *.avif *.svg *.ico` | Images go to external storage, not GitHub |
@@ -1 +1,23 @@
1
- # Parallel-tools pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<agent_workflow>`.
1
+ # Parallel Tool Calls
2
+
3
+ Source: [Anthropic - Parallel Tool Calling](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#optimize-parallel-tool-calling)
4
+
5
+ <use_parallel_tool_calls>
6
+ When multiple tool calls have no dependencies between them, make all independent calls in a single response. Only sequence calls when a later call needs an earlier call's result.
7
+ </use_parallel_tool_calls>
8
+
9
+ ## Examples
10
+
11
+ - Reading 3 files: call all 3 Read operations at once.
12
+ - Running independent searches: launch all Grep/Glob calls simultaneously.
13
+ - Checking git status + reading a config file: both in one response.
14
+ - Reading a file, then editing based on its content: sequential (edit depends on read result).
15
+
16
+ ## Guard rails
17
+
18
+ - Use real parameter values only. Do not guess or use placeholders to force parallelism.
19
+ - If you are unsure whether calls are independent, run them sequentially.
20
+
21
+ ## Why
22
+
23
+ Explicit reinforcement of parallel calling boosts compliance to near 100%. Sequential calls for independent operations waste time and round-trips for the user.
@@ -1 +1,23 @@
1
- # Research-mode pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<investigation>`.
1
+ # Research Mode (Global)
2
+
3
+ Three anti-hallucination constraints are ALWAYS active.
4
+
5
+ Source: [Anthropic - Reduce Hallucinations](https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)
6
+
7
+ ## 1. Say "I don't know"
8
+ If you don't have a credible source for a claim, say so. Don't guess. Don't infer. "I don't have data on this" is always a valid answer.
9
+
10
+ ## 2. Verify with citations
11
+ Every recommendation, claim, or piece of advice must cite a specific source:
12
+ - A file in the current project
13
+ - An external source found via web search (with URL)
14
+ - A named expert, paper, or researcher
15
+ - Official documentation
16
+
17
+ If you generate a claim and cannot find a supporting source, retract it. Do not present it.
18
+
19
+ ## 3. Direct quotes for factual grounding
20
+ When working from documents, extract the actual text first before analyzing. Ground your response in word-for-word quotes, not paraphrased summaries. Reference the quote when making your point.
21
+
22
+ ## Exceptions
23
+ Creative thinking, brainstorming, and novel ideas don't require citation. You can synthesize across sources to reach new conclusions, but the inputs must be grounded.
@@ -1 +1,28 @@
1
- # Right-sized-engineering pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<scope_discipline>`.
1
+ # Right-Sized Engineering
2
+
3
+ **Build it right, but build it simple.** Good engineering principles at the appropriate scale.
4
+
5
+ ## Always Do
6
+ - Extract constants and configuration (no hardcoding)
7
+ - Create reusable functions (no copy-paste)
8
+ - Use proper error handling
9
+ - Follow DRY from the start
10
+ - Single responsibility per function
11
+
12
+ ## Never Do (Solo Scale)
13
+ - Abstract base classes for single implementations
14
+ - Dependency injection frameworks
15
+ - Complex patterns (CQRS, microservices)
16
+ - Multiple inheritance hierarchies
17
+ - Over-abstracted interfaces
18
+
19
+ ## Complexity Budget
20
+
21
+ **State BEFORE implementation:** Files (target 1-2, max 3), Lines (~50-300), Checkpoints ("Is this MINIMUM?", "Fewer files?", "Functions vs classes?")
22
+
23
+ ## YAGNI for API Surface
24
+
25
+ **Don't expose optional parameters until they're actually used.**
26
+
27
+ If a value will always be a constant for now, use the constant internally.
28
+ Only add the parameter when callers actually need to vary it.
@@ -1 +1,17 @@
1
- # Self-contained-docs pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<documentation>`.
1
+ # Self-Contained Documentation
2
+
3
+ **When this applies:** All generated artifacts — gists, decision docs, PR descriptions, issue bodies, plans, SKILL.md content. Exception: Obsidian session logs (intentionally conversation-scoped).
4
+
5
+ ## Rule
6
+
7
+ Every document must be fully self-contained. A reader with zero prior context must understand every statement without needing access to the conversation that produced it.
8
+
9
+ ## Patterns to Catch and Replace
10
+
11
+ | Pattern | Example | Fix |
12
+ |---|---|---|
13
+ | References to options/choices discussed in conversation | "This is not Option A from the original framing" | Delete the sentence, or restate the decision on its own terms |
14
+ | "As discussed" / "as we decided" / "from the prior session" | "As discussed, we'll use embeddings" | "Sref matching uses sentence-transformer embeddings" |
15
+ | Pronouns pointing to conversation context | "This approach addresses the concerns raised earlier" | State what the concerns were inline, or delete |
16
+ | Relative framing ("instead of X") where X was only discussed verbally | "Instead of the three options considered" | State the chosen approach directly without referencing alternatives the reader can't see |
17
+ | Session-specific sequencing | "After Round 3 we decided..." | State the decision as a fact |
package/rules/tdd.md ADDED
@@ -0,0 +1,7 @@
1
+ # TDD Process: Red-Green-Refactor
2
+
3
+ **TEST-DRIVEN DEVELOPMENT IS NON-NEGOTIABLE.** Every single line of production code must be written in response to a failing test. No exceptions.
4
+
5
+ 1. **Red**: Write failing test. NO PRODUCTION CODE.
6
+ 2. **Green**: MINIMUM code to pass. Resist urge for more.
7
+ 3. **Refactor**: Assess improvements. Only if valuable.
package/rules/testing.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Reference:** TEST_QUALITY.md - Load when writing or reviewing tests.
4
4
 
5
- @${CLAUDE_PLUGIN_ROOT}/docs/TEST_QUALITY.md
5
+ @~/.claude/docs/TEST_QUALITY.md
6
6
 
7
7
  ## Complete Mocks for Testability
8
8
 
@@ -1 +1,34 @@
1
- # Vault-context pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<obsidian_vault>`.
1
+ # Obsidian Vault Context
2
+
3
+ An Obsidian vault stores session reports, decisions, and research documents across all projects. Its filesystem location is configured per user via the `OBSIDIAN_VAULT_PATH` environment variable (or the equivalent path exposed by the user's Obsidian MCP server). Do not assume a specific OS path; resolve the vault location from the configured MCP tools before reading files directly.
4
+
5
+ ## Available MCP Tools
6
+
7
+ - `mcp__obsidian__search_notes` -- search by content or frontmatter (`searchFrontmatter: true`)
8
+ - `mcp__obsidian__read_note` -- read a single note by path
9
+ - `mcp__obsidian__read_multiple_notes` -- read several notes at once
10
+
11
+ ## Vault Structure
12
+
13
+ - `sessions/` -- session reports with frontmatter: `type: session-report`, `project`, `session`, `date`, `status`, `blocked`, `tags`
14
+ - `decisions/` -- decision notes with frontmatter: `type: decision|procedural|fact|gotcha`, `project`, `date`, `status: Active|Superseded`, `tags`
15
+ - `Research/` -- deep research documents
16
+
17
+ ## When to Search
18
+
19
+ IMPORTANT: Before starting substantive project work, search the vault for prior sessions and decisions for the current project. Also search when:
20
+ - Encountering a component or system with known history
21
+ - A task might repeat or reverse a prior decision
22
+ - You need context on why something was built a certain way
23
+
24
+ Search by `project` frontmatter field first, then by content keywords like "blocked", "superseded", "decision", "gotcha".
25
+
26
+ ## Session Logging
27
+
28
+ When the user invokes `/session-log`, treat **short and long sessions the same**: run the full logging flow. Session length does not change the requirements below.
29
+
30
+ At the end of substantive sessions, offer to run `/session-log` if not already invoked.
31
+
32
+ When running `/session-log`, include `vault_context_retrieved: true|false` in frontmatter based on whether vault MCP tools were used this session.
33
+
34
+ After writing a session log, ALWAYS output a `/rename` command with a descriptive session name based on the session's primary outcome. Format: `/rename [Project] - [Primary Outcome]`. This is a mandatory output requirement, not optional.
@@ -1 +1,42 @@
1
- # Verify-before-asking pointer: canonical policy lives in `~/.claude/system-prompts/software-engineer.xml` under `<investigation>`.
1
+ # Verify Before Asking
2
+
3
+ **When this applies:** Before asking the user any clarifying question during discovery, scoping, or implementation planning.
4
+
5
+ ## Rule
6
+
7
+ If a question can be answered by inspecting files, running a command, querying a database, reading a config, or using any available tool, answer it yourself. Only ask the user questions that require their judgment, preference, or knowledge that is not accessible to automated inspection.
8
+
9
+ ## Decision Checklist
10
+
11
+ Before writing any AskUserQuestion or asking a clarifying question in chat, evaluate:
12
+
13
+ | Check | Action |
14
+ |---|---|
15
+ | Does the answer live in a file on disk? | Read the file. |
16
+ | Does the answer live in a directory structure? | List the directory. |
17
+ | Does the answer live in a database? | Query the database. |
18
+ | Does the answer live in git history? | Run `git log` or `git blame`. |
19
+ | Is the answer determined by file naming patterns or contents? | Glob a sample and inspect. |
20
+ | Is the answer a value in a config or environment variable? | Read the config or check the env. |
21
+ | Is the answer retrievable from any available MCP tool? | Use the tool. |
22
+
23
+ Only after confirming the answer cannot be obtained through any available tool, ask the user.
24
+
25
+ ## Questions That Belong to the User
26
+
27
+ Reserve user questions for:
28
+ - **Preferences** — "Do you want approach A or B?" when both are viable and the user has a stake.
29
+ - **Missing context the user holds** — passwords, account names, intent, future plans.
30
+ - **Judgment calls** — tradeoffs the user needs to evaluate.
31
+ - **Scope decisions** — what to include or exclude from a piece of work.
32
+
33
+ ## Examples
34
+
35
+ **Wrong:** "Are there multiple images per folder, or just one image + one mp4?"
36
+ **Right:** List the folder contents directly, then state what was found.
37
+
38
+ **Wrong:** "What columns does the themes table have?"
39
+ **Right:** Query `information_schema.columns` and report the schema.
40
+
41
+ **Wrong:** "Is there a Prisma schema in this project?"
42
+ **Right:** Glob for `schema.prisma` and check.