refactor: rename code-review.mdc → gitea-review.mdc, add gitea-resolve-issue.mdc
Organize cursor rules by platform-action pattern. - gitea-review.mdc — PR code review workflow - gitea-resolve-issue.mdc — pick up and resolve Gitea issues
This commit is contained in:
parent
85e58ae239
commit
9ecd624104
127
cursor/gitea-resolve-issue.mdc
Normal file
127
cursor/gitea-resolve-issue.mdc
Normal file
@ -0,0 +1,127 @@
|
||||
# Resolve Gitea Issues (tea CLI)
|
||||
|
||||
How to pick up and resolve issues from our self-hosted Gitea (git.shazhou.work) using the `tea` CLI.
|
||||
|
||||
## 1. Find and Read the Issue
|
||||
|
||||
```bash
|
||||
# List open issues
|
||||
tea issues
|
||||
|
||||
# Read a specific issue with full context and comments
|
||||
tea issues 3
|
||||
|
||||
# Filter by label
|
||||
tea issues --label bug
|
||||
|
||||
# Specify repo explicitly (when not in repo dir)
|
||||
tea issues --repo uncaged/nerve
|
||||
```
|
||||
|
||||
**Always read the issue first** — understand what's being asked, check comments for extra context or decisions.
|
||||
|
||||
## 2. Check for Project Conventions
|
||||
|
||||
Before writing code, look for project-specific rules:
|
||||
|
||||
```bash
|
||||
# Contribution guide
|
||||
cat CONTRIBUTING.md 2>/dev/null
|
||||
|
||||
# Cursor rules for this project
|
||||
ls .cursor/rules/*.mdc 2>/dev/null
|
||||
cat .cursor/rules/*.mdc 2>/dev/null
|
||||
|
||||
# Linter / formatter config
|
||||
ls .editorconfig .eslintrc* .prettierrc* pyproject.toml biome.json 2>/dev/null
|
||||
|
||||
# CI config (to know what checks will run)
|
||||
ls .github/workflows/ .gitea/workflows/ 2>/dev/null
|
||||
```
|
||||
|
||||
Follow whatever standards the project defines.
|
||||
|
||||
## 3. Create a Branch
|
||||
|
||||
```bash
|
||||
# Branch naming: type/issue-number-short-description
|
||||
git checkout -b fix/3-login-redirect
|
||||
git checkout -b feat/12-add-search
|
||||
git checkout -b chore/7-update-deps
|
||||
```
|
||||
|
||||
## 4. Implement the Fix / Feature
|
||||
|
||||
- Make focused changes that address the issue
|
||||
- Write or update tests if applicable
|
||||
- Run existing tests to make sure nothing breaks
|
||||
|
||||
```bash
|
||||
# Run tests (detect project type)
|
||||
# Node: npm test / npx vitest
|
||||
# Python: pytest
|
||||
# Rust: cargo test
|
||||
# Go: go test ./...
|
||||
```
|
||||
|
||||
## 5. Commit and Push
|
||||
|
||||
```bash
|
||||
# Commit with issue reference
|
||||
git add -A
|
||||
git commit -m "fix: resolve login redirect loop
|
||||
|
||||
Fixes #3"
|
||||
|
||||
git push -u origin fix/3-login-redirect
|
||||
```
|
||||
|
||||
Commit message should reference the issue number with `Fixes #N`, `Closes #N`, or `Refs #N`.
|
||||
|
||||
## 6. Create a Pull Request
|
||||
|
||||
```bash
|
||||
tea pr create --title "fix: resolve login redirect loop" \
|
||||
--description "## What
|
||||
Fix the login redirect loop when session expires.
|
||||
|
||||
## Why
|
||||
Users get stuck in an infinite redirect after token expiry (#3).
|
||||
|
||||
## Changes
|
||||
- \`src/auth/middleware.ts\` — check token expiry before redirect
|
||||
- \`src/auth/session.ts\` — add graceful session cleanup
|
||||
|
||||
## Ref
|
||||
Fixes #3"
|
||||
```
|
||||
|
||||
### PR Description Must Include:
|
||||
- **What** — what this PR does
|
||||
- **Why** — why the change is needed
|
||||
- **Changes** — file-level breakdown of what changed and why
|
||||
- **Ref** — link to the issue (`Fixes #N`)
|
||||
|
||||
## 7. Respond to Review Feedback
|
||||
|
||||
```bash
|
||||
# Check PR comments
|
||||
tea pr <number> --comments
|
||||
|
||||
# Make requested changes, then push
|
||||
git add -A
|
||||
git commit -m "address review: add input validation"
|
||||
git push
|
||||
```
|
||||
|
||||
## 8. Verify Resolution
|
||||
|
||||
After PR is merged:
|
||||
|
||||
```bash
|
||||
# Confirm issue is closed (auto-closed by Fixes #N)
|
||||
tea issues 3
|
||||
|
||||
# If not auto-closed, close manually
|
||||
tea issues close 3
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user