Initial commit
This commit is contained in:
36
hooks/examples/context/code-review-start.md
Normal file
36
hooks/examples/context/code-review-start.md
Normal file
@@ -0,0 +1,36 @@
|
||||
## Project-Specific Code Review Requirements
|
||||
|
||||
This file demonstrates convention-based context injection.
|
||||
|
||||
**Location:** `.claude/context/code-review-start.md`
|
||||
|
||||
**Triggered by:** Running a code review command (SlashCommandStart hook)
|
||||
|
||||
**Purpose:** Inject project-specific review requirements automatically.
|
||||
|
||||
---
|
||||
|
||||
### Additional Security Checks
|
||||
|
||||
For this project, code reviews MUST verify:
|
||||
|
||||
1. **Authentication:** All API endpoints require valid JWT
|
||||
2. **Input Validation:** All user inputs use allowlist validation
|
||||
3. **Rate Limiting:** Public endpoints have rate limits configured
|
||||
4. **Logging:** No PII in application logs
|
||||
|
||||
### Performance Requirements
|
||||
|
||||
- Database queries: No N+1 patterns
|
||||
- API response time: < 200ms for p95
|
||||
- Memory usage: No leaks detected in tests
|
||||
|
||||
### Documentation
|
||||
|
||||
- Public APIs have JSDoc/TSDoc comments
|
||||
- Complex algorithms have inline explanations
|
||||
- Breaking changes noted in CHANGELOG.md
|
||||
|
||||
---
|
||||
|
||||
**To use:** Copy to `.claude/context/code-review-start.md` in your project.
|
||||
32
hooks/examples/context/plan-start.md
Normal file
32
hooks/examples/context/plan-start.md
Normal file
@@ -0,0 +1,32 @@
|
||||
## Project Planning Template
|
||||
|
||||
**Location:** `.claude/context/plan-start.md`
|
||||
|
||||
**Triggered by:** Running a planning command (SlashCommandStart hook)
|
||||
|
||||
Your implementation plan must include:
|
||||
|
||||
### Architecture Impact
|
||||
- Which services/modules are affected?
|
||||
- Any new dependencies introduced?
|
||||
- Database schema changes required?
|
||||
|
||||
### API Surface
|
||||
- New endpoints or breaking changes?
|
||||
- Version bump needed?
|
||||
- Backward compatibility strategy?
|
||||
|
||||
### Testing Strategy
|
||||
- Unit test coverage target (80%+)
|
||||
- Integration tests for new flows
|
||||
- E2E tests for user-facing features
|
||||
|
||||
### Deployment Considerations
|
||||
- Feature flags required?
|
||||
- Migration scripts needed?
|
||||
- Rollback strategy?
|
||||
|
||||
### Success Criteria
|
||||
- What does "done" look like?
|
||||
- How to verify it works?
|
||||
- What metrics to monitor?
|
||||
41
hooks/examples/context/session-start.md
Normal file
41
hooks/examples/context/session-start.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Session Start Context
|
||||
|
||||
This file provides environment context at the beginning of each Claude Code session.
|
||||
|
||||
## Plugin Environment
|
||||
|
||||
**CLAUDE_PLUGIN_ROOT:** `${pwd}`
|
||||
|
||||
This variable points to the root directory of the CipherPowers plugin installation.
|
||||
|
||||
## Path Reference Convention
|
||||
|
||||
When referencing plugin files in agents, commands, or skills, always use:
|
||||
|
||||
```markdown
|
||||
@${CLAUDE_PLUGIN_ROOT}skills/skill-name/SKILL.md
|
||||
@${CLAUDE_PLUGIN_ROOT}standards/standard-name.md
|
||||
@${CLAUDE_PLUGIN_ROOT}principles/principle-name.md
|
||||
@${CLAUDE_PLUGIN_ROOT}templates/template-name.md
|
||||
```
|
||||
|
||||
**Do NOT use relative paths without the variable:**
|
||||
```markdown
|
||||
@skills/... ❌ Does not work in subagent contexts
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Copy this file to your project's `.claude/context/` directory to inject plugin environment information at session start:
|
||||
|
||||
```bash
|
||||
mkdir -p .claude/context
|
||||
cp ${CLAUDE_PLUGIN_ROOT}hooks/examples/context/session-start.md \
|
||||
.claude/context/session-start.md
|
||||
```
|
||||
|
||||
**Note:** SessionStart is not currently a supported hook in Claude Code. This file serves as a template for injecting environment context via other hooks (e.g., UserPromptSubmit, SlashCommandStart).
|
||||
|
||||
## Alternative: User Prompt Hook
|
||||
|
||||
If SessionStart hook becomes available, this context will auto-inject. Until then, consider using UserPromptSubmit hook or command-specific context injection.
|
||||
40
hooks/examples/context/test-driven-development-start.md
Normal file
40
hooks/examples/context/test-driven-development-start.md
Normal file
@@ -0,0 +1,40 @@
|
||||
## Project TDD Standards
|
||||
|
||||
**Location:** `.claude/context/test-driven-development-start.md`
|
||||
|
||||
**Triggered by:** When `test-driven-development` skill loads (SkillStart hook)
|
||||
|
||||
This project uses:
|
||||
|
||||
- **Test framework:** Vitest
|
||||
- **Test location:** `src/**/__tests__/*.test.ts`
|
||||
- **Coverage requirement:** 80% line coverage minimum
|
||||
- **Property testing:** Use fast-check for algorithms
|
||||
|
||||
### File Structure
|
||||
```
|
||||
src/
|
||||
components/
|
||||
Button/
|
||||
Button.tsx
|
||||
__tests__/
|
||||
Button.test.tsx
|
||||
```
|
||||
|
||||
### Naming Convention
|
||||
- Use `describe/it` blocks (not `test()`)
|
||||
- Test names: "should [behavior] when [condition]"
|
||||
- File naming: `{Component}.test.ts`
|
||||
|
||||
### Mocking Strategy
|
||||
- Mock external services (APIs, databases)
|
||||
- Do NOT mock internal modules (test real behavior)
|
||||
- Use MSW for HTTP mocking
|
||||
|
||||
### RED-GREEN-REFACTOR
|
||||
1. Write failing test first
|
||||
2. Run test (verify it fails for right reason)
|
||||
3. Write minimal code to pass
|
||||
4. Run test (verify it passes)
|
||||
5. Refactor (if needed)
|
||||
6. Commit
|
||||
Reference in New Issue
Block a user