diff --git a/cursor/gitea-resolve-issue.mdc b/cursor/gitea-resolve-issue.mdc new file mode 100644 index 0000000..9eaf4a9 --- /dev/null +++ b/cursor/gitea-resolve-issue.mdc @@ -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 --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 +``` diff --git a/cursor/code-review.mdc b/cursor/gitea-review.mdc similarity index 100% rename from cursor/code-review.mdc rename to cursor/gitea-review.mdc