@ainative/cody-cli 0.2.6 → 0.2.8
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/.ainative/AINATIVE.md +164 -0
- package/.ainative/CRITICAL_FILE_PLACEMENT_RULES.md +139 -0
- package/.ainative/README.md +163 -0
- package/.ainative/SDK_PUBLISHING_GUIDELINES.md +262 -0
- package/.ainative/git-rules.md +150 -0
- package/.ainative/settings.json +116 -0
- package/.ainative/skills/ci-cd-compliance/SKILL.md +33 -0
- package/.ainative/skills/code-quality/SKILL.md +35 -0
- package/.ainative/skills/file-placement/SKILL.md +59 -0
- package/.ainative/skills/git-workflow/SKILL.md +116 -0
- package/.ainative/skills/local-environment-check/SKILL.md +78 -0
- package/.ainative/skills/mandatory-tdd/SKILL.md +112 -0
- package/.ainative/skills/mcp-builder/SKILL.md +150 -0
- package/.claude/RAILWAY_DEPLOYMENT_GUIDE.md +118 -0
- package/.claude/hooks/README.md +68 -0
- package/.claude/hooks/commit-msg +26 -0
- package/.claude/hooks/install-hooks.sh +46 -0
- package/.claude/hooks/pre-commit +62 -0
- package/.claude/mcp.json.example +31 -0
- package/.claude/settings.json +24 -0
- package/.claude/skills/ci-cd-compliance/SKILL.md +33 -0
- package/.claude/skills/code-quality/SKILL.md +35 -0
- package/.claude/skills/file-placement/SKILL.md +59 -0
- package/.claude/skills/git-workflow/SKILL.md +116 -0
- package/.claude/skills/local-environment-check/SKILL.md +78 -0
- package/.claude/skills/mandatory-tdd/SKILL.md +112 -0
- package/.claude/skills/mcp-builder/SKILL.md +150 -0
- package/.cody/CODY.md +17 -0
- package/.cody/hooks/commit-msg +7 -0
- package/.cody/hooks/pre-commit +8 -0
- package/.cody/mcp.json +9 -0
- package/.cody/mcp.json.example +9 -0
- package/.cody/skills/ci-cd-compliance/SKILL.md +12 -0
- package/.cody/skills/code-quality/SKILL.md +10 -0
- package/.cody/skills/database-best-practices/SKILL.md +13 -0
- package/.cody/skills/delivery-checklist/SKILL.md +13 -0
- package/.cody/skills/file-placement/SKILL.md +11 -0
- package/.cody/skills/git-workflow/SKILL.md +9 -0
- package/.cody/skills/mandatory-tdd/SKILL.md +10 -0
- package/dist/cli.js +234 -234
- package/package.json +4 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Git Commit Rules
|
|
2
|
+
|
|
3
|
+
## CRITICAL RULES - ZERO TOLERANCE - NEVER VIOLATE
|
|
4
|
+
|
|
5
|
+
### 1. NO THIRD-PARTY AI TOOL ATTRIBUTION
|
|
6
|
+
|
|
7
|
+
**STOP! READ THIS BEFORE EVERY COMMIT!**
|
|
8
|
+
|
|
9
|
+
You are **STRICTLY FORBIDDEN** from including ANY third-party AI tool references in git commits, pull requests, or GitHub activity.
|
|
10
|
+
|
|
11
|
+
**ABSOLUTELY FORBIDDEN TEXT - DO NOT USE UNDER ANY CIRCUMSTANCES:**
|
|
12
|
+
- "Claude" or "Anthropic" or "claude.com"
|
|
13
|
+
- "Sourcegraph" (when referring to Sourcegraph Cody the external tool)
|
|
14
|
+
- "ChatGPT" or "OpenAI" (as code author)
|
|
15
|
+
- "Copilot" or "GitHub Copilot" (as attribution)
|
|
16
|
+
- "Generated with [third-party tool]"
|
|
17
|
+
- "Co-Authored-By: Claude/ChatGPT/Copilot"
|
|
18
|
+
- "AI-generated" or "AI-assisted" (without your own branding)
|
|
19
|
+
- Any emoji followed by third-party tool attribution
|
|
20
|
+
|
|
21
|
+
### 2. COMMIT MESSAGE FORMAT
|
|
22
|
+
|
|
23
|
+
**CORRECT FORMAT:**
|
|
24
|
+
```
|
|
25
|
+
Add user authentication with JWT
|
|
26
|
+
|
|
27
|
+
- Implement token generation and validation
|
|
28
|
+
- Add password hashing with bcrypt
|
|
29
|
+
- Create login/logout endpoints
|
|
30
|
+
|
|
31
|
+
Refs #123
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**INCORRECT FORMAT:**
|
|
35
|
+
```
|
|
36
|
+
Add user authentication with JWT
|
|
37
|
+
|
|
38
|
+
- Changes made
|
|
39
|
+
- More changes
|
|
40
|
+
|
|
41
|
+
Generated with Claude Code
|
|
42
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. PULL REQUEST DESCRIPTIONS
|
|
46
|
+
|
|
47
|
+
**CORRECT FORMAT:**
|
|
48
|
+
```markdown
|
|
49
|
+
## Summary
|
|
50
|
+
- Clear description of changes
|
|
51
|
+
- What was fixed or added
|
|
52
|
+
- Why these changes were made
|
|
53
|
+
|
|
54
|
+
## Test Plan
|
|
55
|
+
- How to test the changes
|
|
56
|
+
- Expected results
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**ABSOLUTELY FORBIDDEN - NEVER USE:**
|
|
60
|
+
```markdown
|
|
61
|
+
## Summary
|
|
62
|
+
Changes made...
|
|
63
|
+
|
|
64
|
+
Generated with Claude Code
|
|
65
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 4. ENFORCEMENT
|
|
69
|
+
|
|
70
|
+
**These rules apply to:**
|
|
71
|
+
- All commit messages
|
|
72
|
+
- All pull request descriptions
|
|
73
|
+
- All issue comments
|
|
74
|
+
- All GitHub discussions
|
|
75
|
+
- Any public-facing git activity
|
|
76
|
+
|
|
77
|
+
**Violating these rules will:**
|
|
78
|
+
- Create public attribution that must be avoided
|
|
79
|
+
- Associate our work with third-party tools
|
|
80
|
+
- Compromise the professional appearance of our repositories
|
|
81
|
+
|
|
82
|
+
### 5. EXAMPLES
|
|
83
|
+
|
|
84
|
+
#### GOOD COMMIT:
|
|
85
|
+
```
|
|
86
|
+
Add multi-dimension vector support
|
|
87
|
+
|
|
88
|
+
- Support for 384, 768, 1024, and 1536 dimensions
|
|
89
|
+
- Update validation logic for new dimensions
|
|
90
|
+
- Add comprehensive test coverage
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### BAD COMMIT:
|
|
94
|
+
```
|
|
95
|
+
Add multi-dimension vector support
|
|
96
|
+
|
|
97
|
+
- Support for 384, 768, 1024, and 1536 dimensions
|
|
98
|
+
|
|
99
|
+
Generated with Cody AI
|
|
100
|
+
https://sourcegraph.com/cody
|
|
101
|
+
|
|
102
|
+
Co-Authored-By: Cody <noreply@sourcegraph.com>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## FINAL WARNING - READ BEFORE EVERY COMMIT
|
|
108
|
+
|
|
109
|
+
**BEFORE YOU COMMIT, ASK YOURSELF:**
|
|
110
|
+
1. Does my commit contain "Claude", "Anthropic", "ChatGPT", "Copilot" or other third-party AI tools?
|
|
111
|
+
2. Does my commit have "Co-Authored-By: Claude/ChatGPT/Copilot"?
|
|
112
|
+
3. Does my commit have "Generated with [third-party tool]"?
|
|
113
|
+
|
|
114
|
+
**IF YES TO ANY:** STOP! DO NOT COMMIT! REMOVE THIRD-PARTY ATTRIBUTION IMMEDIATELY!
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## AUTOMATED ENFORCEMENT
|
|
119
|
+
|
|
120
|
+
**Pre-commit hook:** Create `.git/hooks/commit-msg` to automatically block third-party AI tool attribution:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
#!/bin/bash
|
|
124
|
+
COMMIT_MSG_FILE=$1
|
|
125
|
+
|
|
126
|
+
# Block third-party AI tool attribution
|
|
127
|
+
if grep -qiE "(claude|anthropic|chatgpt|openai.*generated|copilot.*generated|co-authored-by:.*claude|co-authored-by:.*chatgpt|co-authored-by:.*copilot|generated with claude|generated with chatgpt)" "$COMMIT_MSG_FILE"; then
|
|
128
|
+
echo "ERROR: Commit message contains FORBIDDEN third-party AI attribution!"
|
|
129
|
+
echo ""
|
|
130
|
+
echo "FORBIDDEN: Claude, Anthropic, ChatGPT, Copilot attribution"
|
|
131
|
+
echo ""
|
|
132
|
+
exit 1
|
|
133
|
+
fi
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**This hook will REJECT any commit containing third-party AI tool attribution.**
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## ZERO TOLERANCE POLICY
|
|
141
|
+
|
|
142
|
+
Every commit **MUST** be checked before pushing to ensure:
|
|
143
|
+
- **NO** "Claude" or "Anthropic" references
|
|
144
|
+
- **NO** "ChatGPT" or "OpenAI" attribution
|
|
145
|
+
- **NO** "Copilot" or "GitHub Copilot" attribution
|
|
146
|
+
- **NO** third-party AI tool references
|
|
147
|
+
- **NO** "Co-Authored-By: Claude/ChatGPT/Copilot"
|
|
148
|
+
- **NO** "Generated with [third-party tool]"
|
|
149
|
+
|
|
150
|
+
**Violating this rule requires immediate commit amendment and force push to remove third-party attribution from git history.**
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://google-gemini.github.io/gemini-cli/schemas/settings.schema.json",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"project": {
|
|
5
|
+
"name": "My Project",
|
|
6
|
+
"type": "web-application",
|
|
7
|
+
"framework": "your-framework",
|
|
8
|
+
"language": "your-language"
|
|
9
|
+
},
|
|
10
|
+
"paths": {
|
|
11
|
+
"root": "__REPO_ROOT__",
|
|
12
|
+
"include_directories": [
|
|
13
|
+
"app",
|
|
14
|
+
"components",
|
|
15
|
+
"lib",
|
|
16
|
+
"services",
|
|
17
|
+
"public"
|
|
18
|
+
],
|
|
19
|
+
"exclude_patterns": [
|
|
20
|
+
"node_modules",
|
|
21
|
+
".next",
|
|
22
|
+
"dist",
|
|
23
|
+
"build",
|
|
24
|
+
"*.test.ts",
|
|
25
|
+
"*.test.tsx"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"context": {
|
|
29
|
+
"primary_context_file": ".ainative/AINATIVE.md",
|
|
30
|
+
"supplementary_files": [
|
|
31
|
+
".claude/CLAUDE.md"
|
|
32
|
+
],
|
|
33
|
+
"max_context_files": 10
|
|
34
|
+
},
|
|
35
|
+
"model": {
|
|
36
|
+
"default": "gemini-2.5-pro",
|
|
37
|
+
"context_window": "1M",
|
|
38
|
+
"temperature": 0.7,
|
|
39
|
+
"tool_output_summarization": true
|
|
40
|
+
},
|
|
41
|
+
"tools": {
|
|
42
|
+
"enabled": [
|
|
43
|
+
"file_read",
|
|
44
|
+
"file_write",
|
|
45
|
+
"shell",
|
|
46
|
+
"web_fetch",
|
|
47
|
+
"memory"
|
|
48
|
+
],
|
|
49
|
+
"shell": {
|
|
50
|
+
"allowed_commands": [
|
|
51
|
+
"npm",
|
|
52
|
+
"git",
|
|
53
|
+
"node",
|
|
54
|
+
"npx",
|
|
55
|
+
"curl",
|
|
56
|
+
"grep",
|
|
57
|
+
"find"
|
|
58
|
+
],
|
|
59
|
+
"working_directory": "__REPO_ROOT__"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"security": {
|
|
63
|
+
"trusted_folders": [
|
|
64
|
+
"__REPO_ROOT__"
|
|
65
|
+
],
|
|
66
|
+
"sandbox_profile": "default"
|
|
67
|
+
},
|
|
68
|
+
"ui": {
|
|
69
|
+
"theme": "dark",
|
|
70
|
+
"show_citations": true,
|
|
71
|
+
"show_line_numbers": true
|
|
72
|
+
},
|
|
73
|
+
"privacy": {
|
|
74
|
+
"collect_usage_stats": false
|
|
75
|
+
},
|
|
76
|
+
"extensions": {
|
|
77
|
+
"mcp_servers": {}
|
|
78
|
+
},
|
|
79
|
+
"ai_coding_rules": {
|
|
80
|
+
"git_attribution": {
|
|
81
|
+
"rule": "ZERO_TOLERANCE",
|
|
82
|
+
"description": "NEVER include AI tool attribution in commits, PRs, or issues",
|
|
83
|
+
"forbidden_terms": [
|
|
84
|
+
"Claude",
|
|
85
|
+
"Anthropic",
|
|
86
|
+
"Generated with Claude",
|
|
87
|
+
"Co-Authored-By: Claude",
|
|
88
|
+
"AI-generated"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"commit_style": {
|
|
92
|
+
"format": "conventional",
|
|
93
|
+
"examples": [
|
|
94
|
+
"feat: Add user authentication",
|
|
95
|
+
"fix: Resolve navigation bug",
|
|
96
|
+
"docs: Update API documentation",
|
|
97
|
+
"style: Format code with Prettier",
|
|
98
|
+
"refactor: Simplify pricing logic",
|
|
99
|
+
"test: Add unit tests for services",
|
|
100
|
+
"chore: Update dependencies"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"code_quality": {
|
|
104
|
+
"linting": "required",
|
|
105
|
+
"type_checking": "required",
|
|
106
|
+
"testing": "required_for_features",
|
|
107
|
+
"min_coverage": 80
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"development": {
|
|
111
|
+
"port": 3000,
|
|
112
|
+
"auto_restart": true,
|
|
113
|
+
"hot_reload": true,
|
|
114
|
+
"source_maps": true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-cd-compliance
|
|
3
|
+
description: CI/CD pipeline requirements and deployment standards. Use when (1) Setting up CI/CD pipelines, (2) Debugging CI failures, (3) Configuring deployment workflows, (4) Managing staging/production releases, (5) Investigating build failures. Covers CI gate requirements, merge policies, auto-deploy to staging, production approval process.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI/CD Compliance Rules
|
|
7
|
+
|
|
8
|
+
## CI Gates Sequence
|
|
9
|
+
|
|
10
|
+
**install -> lint/format -> typecheck -> unit -> integration -> (optional e2e) -> package**
|
|
11
|
+
|
|
12
|
+
## Merge Policy
|
|
13
|
+
|
|
14
|
+
* **Merge only if green**
|
|
15
|
+
* Auto-deploy to **staging** on merge
|
|
16
|
+
* Production requires tag/approval
|
|
17
|
+
|
|
18
|
+
## CI Failure Handling
|
|
19
|
+
|
|
20
|
+
When CI fails:
|
|
21
|
+
1. **Explain root cause** in PR comment
|
|
22
|
+
2. **Include the fix** in the same PR when feasible
|
|
23
|
+
3. Don't merge until all gates pass
|
|
24
|
+
|
|
25
|
+
## IDE Integration
|
|
26
|
+
|
|
27
|
+
* Use built-in code actions and terminal to run tests/linters
|
|
28
|
+
* Prefer **unified diffs** in responses so changes are patchable across IDEs
|
|
29
|
+
* Attach artifacts (test output, screenshots, logs) whenever you assert a claim
|
|
30
|
+
|
|
31
|
+
## Reference Files
|
|
32
|
+
|
|
33
|
+
See `references/pipeline-requirements.md` for detailed CI configuration, gate definitions, and failure debugging guide.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality
|
|
3
|
+
description: Coding style standards, security guidelines, and accessibility requirements. Use when (1) Writing new code, (2) Reviewing code for style/security, (3) Implementing UI/UX features, (4) Addressing security concerns, (5) Ensuring accessibility compliance. Covers naming conventions, formatting, security best practices (no secrets/PII), accessibility standards (semantic HTML, keyboard nav), and responsive design.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Quality Standards
|
|
7
|
+
|
|
8
|
+
## Coding Style
|
|
9
|
+
|
|
10
|
+
* **Naming:** camelCase for vars/functions; PascalCase for classes/types
|
|
11
|
+
* **Formatting:** 4-space indentation; target <=80 chars (wrap thoughtfully)
|
|
12
|
+
* **Comments:** Meaningful, current; delete stale comments
|
|
13
|
+
* **Security:** Never log secrets/PII; validate inputs; least privilege by default
|
|
14
|
+
* **Errors/Logs:** Explicit error types; structured logs by level; actionable messages
|
|
15
|
+
|
|
16
|
+
## Accessibility & UX Quality
|
|
17
|
+
|
|
18
|
+
* Favor semantic roles/labels; keyboard nav and focus order must work
|
|
19
|
+
* Include responsive checks at **375, 768, 1024, 1440** with notes/screenshots
|
|
20
|
+
* Use deterministic test IDs; avoid brittle CSS/XPath
|
|
21
|
+
|
|
22
|
+
## Security & Compliance Guardrails
|
|
23
|
+
|
|
24
|
+
* No real credentials in code, tests, or screenshots
|
|
25
|
+
* Use test accounts/fixtures; redact secrets
|
|
26
|
+
* Follow least-privilege and input validation
|
|
27
|
+
* Document threat considerations in PR when relevant
|
|
28
|
+
|
|
29
|
+
## Reference Files
|
|
30
|
+
|
|
31
|
+
See `references/coding-style.md` for detailed style guide, formatting rules, comment standards.
|
|
32
|
+
|
|
33
|
+
See `references/security-checklist.md` for security validation checklist, threat modeling, PII handling.
|
|
34
|
+
|
|
35
|
+
See `references/accessibility-standards.md` for WCAG compliance, semantic HTML patterns, keyboard nav testing.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: file-placement
|
|
3
|
+
description: Enforces ZERO TOLERANCE file placement rules for documentation and scripts. Use when (1) Creating any .md file, (2) Creating any .sh script, (3) Organizing documentation, (4) Writing guides or reports, (5) Adding utility scripts. CRITICAL RULES - NEVER create .md files in root directories (except README.md, CLAUDE.md), NEVER create .sh scripts in backend (except start.sh), ALL documentation goes in docs/ subfolders, ALL scripts go in scripts/ folder.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# File Placement Rules
|
|
7
|
+
|
|
8
|
+
## ZERO TOLERANCE FILE PLACEMENT
|
|
9
|
+
|
|
10
|
+
### STRICT RULES
|
|
11
|
+
|
|
12
|
+
* **FORBIDDEN:** Creating .md files in project root (except README.md, CLAUDE.md)
|
|
13
|
+
* **FORBIDDEN:** Creating .md files in src/backend/ (except README.md)
|
|
14
|
+
* **FORBIDDEN:** Creating scripts (.sh) in src/backend/ (except start.sh)
|
|
15
|
+
|
|
16
|
+
### REQUIRED LOCATIONS
|
|
17
|
+
|
|
18
|
+
## Backend Documentation -> `docs/`
|
|
19
|
+
|
|
20
|
+
* **Issues/Bugs:** `docs/issues/ISSUE_*.md`, `docs/issues/BUG_*.md`, `docs/issues/ROOT_CAUSE_*.md`
|
|
21
|
+
* **Testing/QA:** `docs/testing/*_TEST*.md`, `docs/testing/QA_*.md`
|
|
22
|
+
* **API Documentation:** `docs/api/API_*.md`, `docs/api/*_ENDPOINTS*.md`
|
|
23
|
+
* **Implementation Reports:** `docs/reports/*_IMPLEMENTATION*.md`, `docs/reports/*_SUMMARY.md`
|
|
24
|
+
* **Deployment:** `docs/deployment/DEPLOYMENT_*.md`, `docs/deployment/RAILWAY_*.md`
|
|
25
|
+
* **Quick References:** `docs/quick-reference/*_QUICK_*.md`, `docs/quick-reference/*_REFERENCE.md`
|
|
26
|
+
* **Development Guides:** `docs/development-guides/CODING_*.md`, `docs/development-guides/*_GUIDE.md`
|
|
27
|
+
* **Planning:** `docs/planning/PRD_*.md`, `docs/planning/BACKLOG*.md`
|
|
28
|
+
|
|
29
|
+
## Scripts -> `scripts/`
|
|
30
|
+
|
|
31
|
+
* **ALL test scripts:** `scripts/test_*.sh`
|
|
32
|
+
* **ALL migration scripts:** `scripts/*_migration.sh`
|
|
33
|
+
* **ALL monitoring scripts:** `scripts/monitor_*.sh`
|
|
34
|
+
* **ALL utility scripts:** `scripts/*.sh`
|
|
35
|
+
|
|
36
|
+
## ENFORCEMENT WORKFLOW
|
|
37
|
+
|
|
38
|
+
Before creating ANY .md file or .sh script, you MUST:
|
|
39
|
+
|
|
40
|
+
1. Check if you're creating it in a root directory
|
|
41
|
+
2. If yes, STOP and use the appropriate docs/ or scripts/ subfolder
|
|
42
|
+
3. Choose the correct category based on filename patterns above
|
|
43
|
+
4. Create in the correct location FIRST TIME, not in root then move later
|
|
44
|
+
|
|
45
|
+
## VIOLATION CONSEQUENCES
|
|
46
|
+
|
|
47
|
+
Creating documentation in root directories causes:
|
|
48
|
+
|
|
49
|
+
* Project clutter and disorganization
|
|
50
|
+
* Wasted time reorganizing files
|
|
51
|
+
* Inconsistent documentation structure
|
|
52
|
+
* Developer frustration
|
|
53
|
+
* Loss of findability for important docs
|
|
54
|
+
|
|
55
|
+
**THIS IS A ZERO-TOLERANCE RULE. ALWAYS use docs/ or scripts/ subfolders.**
|
|
56
|
+
|
|
57
|
+
## Reference Files
|
|
58
|
+
|
|
59
|
+
See `references/directory-mapping.md` for complete mapping table of filename patterns to required directory locations.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Git commit, PR, and branching standards with ZERO TOLERANCE for AI attribution. Use when (1) Creating commits, (2) Writing commit messages, (3) Creating pull requests, (4) Writing PR descriptions, (5) Branching or merging code. ABSOLUTE RULE - NEVER include "Claude", "Anthropic", "AI-generated", emojis with "Generated with", or any AI tool attribution in commits, PRs, issues, or documentation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git & PR Workflow Standards
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
* **Small PRs:** <=300 LOC changed ideally
|
|
11
|
+
* **Commit often:** Early, meaningful commits with clear messages
|
|
12
|
+
* **Linear history:** Prefer rebase over merge commits
|
|
13
|
+
* **Professional:** No AI attribution, no tool branding, clean descriptions
|
|
14
|
+
|
|
15
|
+
## ABSOLUTE ZERO-TOLERANCE RULE: NO AI ATTRIBUTION
|
|
16
|
+
|
|
17
|
+
**NEVER, UNDER ANY CIRCUMSTANCES, include ANY of the following in:**
|
|
18
|
+
* Git commit messages
|
|
19
|
+
* Pull request descriptions
|
|
20
|
+
* Issue comments
|
|
21
|
+
* GitHub discussions
|
|
22
|
+
* Code comments
|
|
23
|
+
* Documentation
|
|
24
|
+
* ANY public-facing repository content
|
|
25
|
+
|
|
26
|
+
### STRICTLY FORBIDDEN TEXT - NEVER USE
|
|
27
|
+
|
|
28
|
+
* "Claude"
|
|
29
|
+
* "Anthropic"
|
|
30
|
+
* "claude.com"
|
|
31
|
+
* "Claude Code"
|
|
32
|
+
* "Generated with Claude"
|
|
33
|
+
* "Co-Authored-By: Claude"
|
|
34
|
+
* Any emoji followed by "Generated with" or "Powered by"
|
|
35
|
+
* Any reference to AI assistants, AI code generation, or automated tools
|
|
36
|
+
* Any branding, attribution, or links to third-party AI services
|
|
37
|
+
|
|
38
|
+
### CORRECT FORMAT - ALWAYS USE
|
|
39
|
+
|
|
40
|
+
* Clean, professional commit messages
|
|
41
|
+
* Clear description of what changed
|
|
42
|
+
* Explanation of why the change was made
|
|
43
|
+
* No attribution, no branding, no tool references
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
### FORBIDDEN COMMIT
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Add multi-dimension vector support
|
|
51
|
+
|
|
52
|
+
- Support for 384, 768, 1024, and 1536 dimensions
|
|
53
|
+
|
|
54
|
+
Generated with [Claude Code](https://claude.com/claude-code)
|
|
55
|
+
|
|
56
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### CORRECT COMMIT
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Add multi-dimension vector support
|
|
63
|
+
|
|
64
|
+
- Support for 384, 768, 1024, and 1536 dimensions
|
|
65
|
+
- Update validation logic for new dimensions
|
|
66
|
+
- Add comprehensive test coverage
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### FORBIDDEN PR DESCRIPTION
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## Summary
|
|
73
|
+
Implemented new authentication flow with JWT tokens.
|
|
74
|
+
|
|
75
|
+
## Test Plan
|
|
76
|
+
All tests passing.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
Powered by Claude
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### CORRECT PR DESCRIPTION
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
## Summary
|
|
86
|
+
Implemented new authentication flow with JWT tokens.
|
|
87
|
+
|
|
88
|
+
## Test Plan
|
|
89
|
+
All tests passing.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Enforcement
|
|
93
|
+
|
|
94
|
+
* **ZERO TOLERANCE** rule with **NO EXCEPTIONS**
|
|
95
|
+
* Every commit must be verified before pushing
|
|
96
|
+
* Every PR must be reviewed for attribution before creating
|
|
97
|
+
* If attribution is found, it must be removed immediately via force push or amendment
|
|
98
|
+
* This rule applies to ALL repositories, ALL projects, ALL commits
|
|
99
|
+
|
|
100
|
+
## PR Requirements
|
|
101
|
+
|
|
102
|
+
Every PR must include:
|
|
103
|
+
|
|
104
|
+
* **Problem/Context:** What issue are we solving and why?
|
|
105
|
+
* **Solution summary:** How does this change address the problem?
|
|
106
|
+
* **Test plan:** Commands + results proving functionality
|
|
107
|
+
* **Risk/rollback:** Potential issues and how to revert if needed
|
|
108
|
+
* **Story link + Type + Estimate:** Link to issue/story with type (feature/bug/chore) and points
|
|
109
|
+
|
|
110
|
+
## Reference Files
|
|
111
|
+
|
|
112
|
+
See `references/ai-attribution-enforcement.md` for comprehensive forbidden text list and enforcement details.
|
|
113
|
+
|
|
114
|
+
See `references/pr-templates.md` for complete PR templates for feature, bug, and chore PRs.
|
|
115
|
+
|
|
116
|
+
See `references/branch-conventions.md` for branch naming patterns and examples.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: local-environment-check
|
|
3
|
+
description: Verify local development environment is correctly configured. Use when (1) Setting up a new development machine, (2) Debugging environment issues, (3) Onboarding new team members, (4) Verifying tool versions, (5) Checking port availability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Local Environment Check
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Verify that the local development environment has all required tools, correct versions, and proper configuration before starting work.
|
|
11
|
+
|
|
12
|
+
## Checks to Perform
|
|
13
|
+
|
|
14
|
+
### 1. Required Tools
|
|
15
|
+
```bash
|
|
16
|
+
# Check Node.js
|
|
17
|
+
node --version # Expected: v18+ or v20+
|
|
18
|
+
|
|
19
|
+
# Check npm/bun/pnpm
|
|
20
|
+
npm --version # Expected: 9+
|
|
21
|
+
bun --version # If using bun
|
|
22
|
+
pnpm --version # If using pnpm
|
|
23
|
+
|
|
24
|
+
# Check Python (if applicable)
|
|
25
|
+
python3 --version # Expected: 3.10+
|
|
26
|
+
pip --version
|
|
27
|
+
|
|
28
|
+
# Check Git
|
|
29
|
+
git --version # Expected: 2.30+
|
|
30
|
+
|
|
31
|
+
# Check GitHub CLI
|
|
32
|
+
gh --version
|
|
33
|
+
gh auth status # Verify authenticated
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Environment Variables
|
|
37
|
+
```bash
|
|
38
|
+
# Check required env vars are set
|
|
39
|
+
env | grep -E "^(NODE_ENV|API_URL|DATABASE_URL)" || echo "Missing env vars"
|
|
40
|
+
|
|
41
|
+
# Check .env file exists
|
|
42
|
+
[ -f .env ] && echo ".env exists" || echo "WARNING: No .env file"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. Port Availability
|
|
46
|
+
```bash
|
|
47
|
+
# Check if common dev ports are free
|
|
48
|
+
lsof -i :3000 2>/dev/null && echo "Port 3000 in use" || echo "Port 3000 available"
|
|
49
|
+
lsof -i :5432 2>/dev/null && echo "Port 5432 in use" || echo "Port 5432 available"
|
|
50
|
+
lsof -i :8080 2>/dev/null && echo "Port 8080 in use" || echo "Port 8080 available"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4. Dependencies
|
|
54
|
+
```bash
|
|
55
|
+
# Install and verify dependencies
|
|
56
|
+
npm install # or bun install / pnpm install
|
|
57
|
+
npm run build # Verify build works
|
|
58
|
+
npm test # Verify tests pass
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 5. Git Configuration
|
|
62
|
+
```bash
|
|
63
|
+
# Verify git hooks are installed
|
|
64
|
+
ls -la .git/hooks/pre-commit .git/hooks/commit-msg 2>/dev/null
|
|
65
|
+
|
|
66
|
+
# If missing, install them
|
|
67
|
+
bash .claude/hooks/install-hooks.sh
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Troubleshooting
|
|
71
|
+
|
|
72
|
+
| Issue | Solution |
|
|
73
|
+
|-------|---------|
|
|
74
|
+
| Node version too old | Use `nvm install 20` |
|
|
75
|
+
| Port already in use | Kill process: `kill $(lsof -t -i:3000)` |
|
|
76
|
+
| Missing env vars | Copy from `.env.example`: `cp .env.example .env` |
|
|
77
|
+
| Git hooks not installed | Run `bash .claude/hooks/install-hooks.sh` |
|
|
78
|
+
| npm install fails | Delete `node_modules` and `package-lock.json`, retry |
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandatory-tdd
|
|
3
|
+
description: Enforces Test-Driven Development (TDD) with BDD-style tests and mandatory test execution. Use when (1) Writing any new code or feature, (2) Fixing bugs, (3) Refactoring existing code, (4) Creating pull requests, (5) Closing issues. CRITICAL RULE - Tests MUST be actually executed with proof of passing status and coverage >= 80% before ANY commit, PR, or issue closure.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mandatory TDD/BDD Testing Strategy
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
* **BDD Style:** Use `describe/it` syntax for unit, integration, and functional/API tests
|
|
11
|
+
* **Test-First:** Write failing tests before implementation
|
|
12
|
+
* **Deterministic:** Use data-testid, role, or label selectors (never brittle CSS/XPath)
|
|
13
|
+
* **Fast & Light:** Prefer fast unit/integration tests; save heavy e2e for nightly unless required
|
|
14
|
+
|
|
15
|
+
## Example BDD Structure
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
describe('Calculator', () => {
|
|
19
|
+
describe('addition', () => {
|
|
20
|
+
it('adds two positive numbers', () => {
|
|
21
|
+
expect(add(5, 7)).to.equal(12);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## MANDATORY TEST EXECUTION REQUIREMENT
|
|
28
|
+
|
|
29
|
+
**BEFORE claiming tests pass or closing any issue:**
|
|
30
|
+
|
|
31
|
+
1. **ACTUALLY RUN THE TESTS** - Execute test suite with coverage
|
|
32
|
+
2. **VERIFY THEY PASS** - Confirm all tests show green/passing status
|
|
33
|
+
3. **CHECK COVERAGE** - Verify minimum 80% coverage requirement met
|
|
34
|
+
4. **INCLUDE OUTPUT** - Paste actual test execution output in PR/commit/issue
|
|
35
|
+
|
|
36
|
+
### ABSOLUTELY FORBIDDEN
|
|
37
|
+
|
|
38
|
+
* Writing tests but NOT running them
|
|
39
|
+
* Claiming "All tests passing" without proof
|
|
40
|
+
* Stating "80%+ coverage" without actual coverage report
|
|
41
|
+
* Closing issues without running test suite
|
|
42
|
+
* Creating PRs without executing pytest/jest/etc.
|
|
43
|
+
* Assuming tests work based on syntax checking alone
|
|
44
|
+
|
|
45
|
+
### REQUIRED WORKFLOW
|
|
46
|
+
|
|
47
|
+
**Backend (Python/FastAPI):**
|
|
48
|
+
```bash
|
|
49
|
+
cd /path/to/your/backend
|
|
50
|
+
python3 -m pytest tests/test_your_feature.py -v --cov=app.your.module --cov-report=term-missing
|
|
51
|
+
|
|
52
|
+
# Verify output shows:
|
|
53
|
+
# - All tests passed (green checkmarks)
|
|
54
|
+
# - Coverage >= 80%
|
|
55
|
+
# - No import errors or test failures
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Frontend (TypeScript/React):**
|
|
59
|
+
```bash
|
|
60
|
+
cd /path/to/your/frontend
|
|
61
|
+
npm test -- --coverage
|
|
62
|
+
|
|
63
|
+
# Verify output shows:
|
|
64
|
+
# - All tests passed
|
|
65
|
+
# - Coverage >= 80% for statements, branches, functions, lines
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Evidence Requirement
|
|
69
|
+
|
|
70
|
+
Every PR, commit, or issue closure involving tests MUST include:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
## Test Execution Evidence
|
|
74
|
+
|
|
75
|
+
### Command Run:
|
|
76
|
+
`pytest tests/test_feature.py -v --cov=app.module`
|
|
77
|
+
|
|
78
|
+
### Output:
|
|
79
|
+
test_create_item PASSED [ 5%]
|
|
80
|
+
test_validation PASSED [ 10%]
|
|
81
|
+
==================== 20 passed in 3.42s ====================
|
|
82
|
+
Coverage: 87%
|
|
83
|
+
|
|
84
|
+
### Coverage Report:
|
|
85
|
+
app/api/v1/endpoints/feature.py 422 35 87%
|
|
86
|
+
app/schemas/item.py 192 18 91%
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Why This Matters
|
|
90
|
+
|
|
91
|
+
* **Prevents false confidence** - Tests may have import errors, assertion failures
|
|
92
|
+
* **Catches infrastructure issues** - Broken test setup, missing dependencies
|
|
93
|
+
* **Validates coverage claims** - Actual coverage may be lower than estimated
|
|
94
|
+
* **Ensures production readiness** - Code that doesn't pass tests shouldn't ship
|
|
95
|
+
* **Saves debugging time** - Finding test failures BEFORE merge, not after
|
|
96
|
+
|
|
97
|
+
## Enforcement
|
|
98
|
+
|
|
99
|
+
* **MANDATORY** requirement with **NO EXCEPTIONS**
|
|
100
|
+
* Tests must be run LOCALLY before any git commit
|
|
101
|
+
* Test output must be included in PR descriptions
|
|
102
|
+
* Coverage reports must show actual percentages, not estimates
|
|
103
|
+
* If tests cannot run due to infrastructure issues, **DOCUMENT THE ISSUE** and fix it before proceeding
|
|
104
|
+
* Never claim "tests passing" without proving it with actual command output
|
|
105
|
+
|
|
106
|
+
**THIS IS A ZERO-TOLERANCE RULE. ALWAYS RUN TESTS AND PROVIDE PROOF.**
|
|
107
|
+
|
|
108
|
+
## Reference Files
|
|
109
|
+
|
|
110
|
+
See `references/bdd-patterns.md` for detailed BDD test pattern examples across unit, integration, and API tests.
|
|
111
|
+
|
|
112
|
+
See `references/coverage-requirements.md` for detailed coverage configuration, thresholds, and exclusion patterns.
|