feat: initial commit
This commit is contained in:
commit
4b3cd1d2b1
453 files changed
+52428
No files matched your search
@@ -0,0 +1,17 @@
|
||||
---
|
||||
description: Auto-document session to Anytype (asks Work/Private) and saves to today's daily page
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Auto Document Session (Work/Private)
|
||||
|
||||
- Ask me which Anytype space: **Work Journal** or **Private Journal**.
|
||||
- Use **@Git** to gather staged diffs/commit messages and **@Past Chats** for today’s key exchanges.
|
||||
- Summarize as Markdown sections:
|
||||
1) Date & Context
|
||||
2) Git Changes
|
||||
3) Cursor Interaction Summary
|
||||
4) Completed Work
|
||||
5) Pending Work / Next Steps
|
||||
- Using the Anytype MCP, **create or append** to the daily page titled `YYYY-MM-DD` in the chosen space. If missing, create it; then append the entry (separate entries with `---`).
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
You write commit messages by reading the staged diff, current branch name, and recent history.
|
||||
|
||||
## Detect style
|
||||
1. Look at the last 30 commit subjects.
|
||||
- If ≥70% match Conventional Commits (`^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([\w\-./]+\))?: `) → use **Conventional**.
|
||||
2. Else, if the branch name matches a project/issue pattern, use **ProjectIssue**:
|
||||
- Accept: `project-issue-branch`, `project/issue-branch`, `PROJECT-123/feature-x`, `proj-123-scope-x`.
|
||||
- Extract `project` = leading letters/dashes, `issue` = number block (e.g., `123` or `PROJ-123`).
|
||||
|
||||
## Message rules (both styles)
|
||||
- Subject: imperative mood, ≤ 50 chars, no period.
|
||||
- Scope: infer from top-level changed path (e.g., `api`, `ui`, `build`, `docs`).
|
||||
- Body: explain **why** and **what**, wrap at 72 cols; list key changes as bullets.
|
||||
- Footer: include references (`Refs: #<issue>`), co-authors, and `BREAKING CHANGE:` when applicable.
|
||||
|
||||
## Types
|
||||
feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
|
||||
|
||||
## Formats
|
||||
- **Conventional**
|
||||
`<type>(<scope>): <subject>`
|
||||
[blank line]
|
||||
`<body>`
|
||||
[blank line if footers]
|
||||
`Refs: <ticket or link>`
|
||||
`BREAKING CHANGE: <details>`
|
||||
|
||||
- **ProjectIssue**
|
||||
`<project>-<issue>: #time <used time> - <body>`
|
||||
|
||||
## Issue/branch parsing
|
||||
Examples → extracted
|
||||
- `checkout-321-add-paypal` → `checkout-321`
|
||||
- `PAY-1042/refactor-provider` → `PAY-1042`
|
||||
- `proj-77-auth-cleanup` → `proj-77`
|
||||
- `feature/PAY-88-retry` → `PAY-88`
|
||||
|
||||
## Output
|
||||
- Propose **3 options** following the chosen style.
|
||||
- Each option = subject + body (+ footers if relevant).
|
||||
- If multiple scopes changed, pick dominant one by lines changed; otherwise omit scope.
|
||||
- If history is mixed, prefer **Conventional** unless branch clearly encodes issue.
|
||||
|
||||
## Examples
|
||||
- Conventional:
|
||||
`feat(api): add refund endpoint`
|
||||
Body: explain why/what, bullets, breaking change if needed
|
||||
|
||||
- ProjectIssue:
|
||||
`PAY-1042: #time 0h - normalize provider errors`
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Error Handling Rules
|
||||
- Always return errors instead of panicking (except in `main` or tests).
|
||||
- Wrap errors with `%w` when using `fmt.Errorf` for context.
|
||||
- Do not ignore errors; handle or log them explicitly.
|
||||
- Use sentinel errors or `errors.Is` / `errors.As` for checking.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Go Code Style Rules
|
||||
- Always run `gofmt` or `goimports` before committing.
|
||||
- Follow Go naming conventions:
|
||||
- Exported identifiers: PascalCase.
|
||||
- Unexported identifiers: camelCase.
|
||||
- Keep line length <= 100 characters.
|
||||
- Group standard library imports first, then third-party, then local modules.
|
||||
- Avoid unnecessary abbreviations in variable names.
|
||||
- Use `error` as the last return value in functions.
|
||||
- Prefer `context.Context` as the first argument in long-lived or external-facing funcs.
|
||||
|
||||
# Go Code Style Rules
|
||||
- Always run `gofmt` or `goimports` before committing.
|
||||
- Follow Go naming conventions:
|
||||
- Exported identifiers: PascalCase.
|
||||
- Unexported identifiers: camelCase.
|
||||
- Keep line length <= 100 characters.
|
||||
- Group standard library imports first, then third-party, then local modules.
|
||||
- Avoid unnecessary abbreviations in variable names.
|
||||
- Use `error` as the last return value in functions.
|
||||
- Prefer `context.Context` as the first argument in long-lived or external-facing funcs.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Testing Rules
|
||||
- Write tests for all exported functions.
|
||||
- Use `*_test.go` files with `testing` package.
|
||||
- Test names must describe the behavior: `TestFunctionName_Scenario`.
|
||||
- Use table-driven tests for multiple cases.
|
||||
- Ensure test coverage > 80%.
|
||||
- Use `t.Helper()` in test helpers.
|
||||
- Benchmarks must be named `BenchmarkFunctionName`.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Documentation
|
||||
- Update README on env vars, setup, and run commands.
|
||||
- Public services/classes need PHPDoc when intent isn’t obvious.
|
||||
- Changelog follows Keep a Changelog; SemVer for releases.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Errors & Exceptions
|
||||
- Never suppress errors with @.
|
||||
- Throw domain-specific exceptions; do not return error strings.
|
||||
- Catch only what you can handle; rethrow with previous exception.
|
||||
- Use Value Objects for validation; avoid silent defaults.
|
||||
- Log unexpected exceptions once at the edge (middleware/handler).
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Security
|
||||
- Never commit secrets; load via env (vlucas/phpdotenv or server env).
|
||||
- Escape output (HTML/JS) and use parameterized queries everywhere.
|
||||
- Validate and sanitize all input; centralize validation.
|
||||
- Use password_hash()/password_verify(); never custom crypto.
|
||||
- Enable SameSite, HttpOnly, Secure cookies; rotate session IDs on login.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Security
|
||||
- Never commit secrets; load via env (vlucas/phpdotenv or server env).
|
||||
- Escape output (HTML/JS) and use parameterized queries everywhere.
|
||||
- Validate and sanitize all input; centralize validation.
|
||||
- Use password_hash()/password_verify(); never custom crypto.
|
||||
- Enable SameSite, HttpOnly, Secure cookies; rotate session IDs on login.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# PHP Code Style
|
||||
- Follow PSR-12 strictly; run php-cs-fixer or PHP_CodeSniffer on commit.
|
||||
- Enable strict_types=1 in all files.
|
||||
- Use typed properties/params/returns; avoid mixed unless documented.
|
||||
- One class per file; namespaces match directory structure.
|
||||
- Limit line length to 120; prefer early returns to reduce nesting.
|
||||
- Prefer short array syntax []; no Yoda conditions.
|
||||
- Use null coalesce (??) and nullsafe (?->) where appropriate.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# Testing
|
||||
- Use PHPUnit or Pest; tests live in tests/.
|
||||
- Aim ≥ 85% coverage for domain/services; integration tests for I/O.
|
||||
- Test names: testMethod_Scenario_ExpectedResult.
|
||||
- Use data providers/table tests for variants.
|
||||
- Mock only external boundaries (HTTP/DB/FS); avoid over-mocking.
|
||||
Reference in new issue
Block a user