diff --git a/.claude/skills/init-project/SKILL.md b/.claude/skills/init-project/SKILL.md index 7de0900..6e13763 100644 --- a/.claude/skills/init-project/SKILL.md +++ b/.claude/skills/init-project/SKILL.md @@ -41,9 +41,7 @@ Guide the user through setting up a new project from this template. 5. **Update README.md** — Replace the template description in README.md with the actual project name and description. -6. **Update .github config** — Replace `YOUR_ORG/YOUR_REPO` in `.github/ISSUE_TEMPLATE/config.yml` with the actual repository path. - -7. **Summary** — Show the user what was configured and suggest next steps: +6. **Summary** — Show the user what was configured and suggest next steps: - Review filled documents - Create initial ADR for major stack decisions (`docs/adr/`) - Begin Phase 1 planning diff --git a/.claude/skills/review-pr/SKILL.md b/.claude/skills/review-pr/SKILL.md index 5f79a84..89ae99a 100644 --- a/.claude/skills/review-pr/SKILL.md +++ b/.claude/skills/review-pr/SKILL.md @@ -1,30 +1,30 @@ --- name: review-pr -description: Review a specific GitHub pull request by number — fetches PR diff and comments via gh CLI, then provides structured review. +description: Review a specific Gitea pull request by number — fetches PR diff and comments via Gitea API, then provides structured review. disable-model-invocation: true argument-hint: "[pr-number]" context: fork agent: code-reviewer -allowed-tools: Bash(gh:*), Read, Grep, Glob +allowed-tools: Bash(bash:*,curl:*,git:*), Read, Grep, Glob --- # Review Pull Request -Review GitHub PR #$ARGUMENTS. +Review PR #$ARGUMENTS. ## Context -PR details: -!`gh pr view $ARGUMENTS` +PR details (JSON): +!`bash .claude/skills/review-pr/gitea-pr.sh $ARGUMENTS view` PR diff: -!`gh pr diff $ARGUMENTS` +!`bash .claude/skills/review-pr/gitea-pr.sh $ARGUMENTS diff` -PR comments: -!`gh pr view $ARGUMENTS --comments 2>/dev/null || echo "No comments"` +Changed files (JSON): +!`bash .claude/skills/review-pr/gitea-pr.sh $ARGUMENTS files` -Changed files: -!`gh pr diff $ARGUMENTS --name-only` +PR comments (JSON): +!`bash .claude/skills/review-pr/gitea-pr.sh $ARGUMENTS comments` ## Steps @@ -33,7 +33,7 @@ Changed files: 3. **Read relevant source files** for full context (not just the diff) 4. **Verify dependencies** — check new packages for CVEs via context7 5. **Check against project rules** — read `RULES.md` -6. **Review in priority order:** Security → Reliability → Performance → Maintainability → Testing +6. **Review in priority order:** Security > Reliability > Performance > Maintainability > Testing 7. **Report:** diff --git a/.claude/skills/review-pr/gitea-pr.sh b/.claude/skills/review-pr/gitea-pr.sh new file mode 100755 index 0000000..5750898 --- /dev/null +++ b/.claude/skills/review-pr/gitea-pr.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Fetch Gitea PR data via API +# Usage: gitea-pr.sh [view|diff|files|comments] +# Requires: GITEA_TOKEN env var (set in .env.local) +set -euo pipefail + +PR="${1:?Usage: gitea-pr.sh [view|diff|files|comments]}" +CMD="${2:-view}" + +REMOTE=$(git remote get-url origin 2>/dev/null) +REMOTE="${REMOTE%.git}" + +if [[ "$REMOTE" == git@* ]]; then + HOST="${REMOTE#git@}"; HOST="${HOST%%:*}" + REPO="${REMOTE#*:}" +else + tmp="${REMOTE#*://}"; HOST="${tmp%%/*}"; REPO="${tmp#*/}" +fi + +API="https://${HOST}/api/v1/repos/${REPO}" +AUTH="Authorization: token ${GITEA_TOKEN:-}" + +case "$CMD" in + view) curl -sf -H "$AUTH" "${API}/pulls/${PR}" ;; + diff) curl -sf -H "$AUTH" "${API}/pulls/${PR}.diff" ;; + files) curl -sf -H "$AUTH" "${API}/pulls/${PR}/files" ;; + comments) curl -sf -H "$AUTH" "${API}/issues/${PR}/comments" ;; + *) echo "Unknown command: $CMD" >&2; exit 1 ;; +esac diff --git a/.env.example b/.env.example index 62b13d8..89dd513 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,9 @@ NODE_ENV=development # --- Email --- # RESEND_API_KEY= +# --- Gitea --- +# GITEA_TOKEN= + # --- CI/CD (Woodpecker) --- # WOODPECKER_TOKEN= # WOODPECKER_URL=https://ci.spektr.design diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18d8629..dac495e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,10 +45,9 @@ chore: update dependencies 1. Create a feature branch from `main` 2. Keep PRs focused — one concern per PR -3. Fill in the PR template (`.github/PULL_REQUEST_TEMPLATE.md`) -4. Ensure no secrets or credentials in the diff -5. Update relevant documentation if behavior changes -6. Request review from the appropriate owner +3. Ensure no secrets or credentials in the diff +4. Update relevant documentation if behavior changes +5. Request review from the appropriate owner ### Branch Naming diff --git a/DOCS.md b/DOCS.md index 2468e9f..cd75d27 100644 --- a/DOCS.md +++ b/DOCS.md @@ -68,6 +68,7 @@ Technical index for developers and AI agents. Use this as the entry point to all - `RECOMMENDATIONS.md` — project-specific decisions and overrides (template). - `CONTRIBUTING.md` — commit conventions, PR rules, how to add docs/agents/ADRs. - `SECURITY.md` — vulnerability disclosure policy. +- `RESEARCH-SDD-TOOLS.md` — SDD tools research (Spec Kit, AI Factory). - `LICENSE` — MIT license. - `package.json` — project metadata and Node.js engine requirement. - `.env.example` — environment variables template. @@ -102,8 +103,9 @@ Technical index for developers and AI agents. Use this as the entry point to all - `.claude/skills/write-tests/` — write tests with Vitest + Testing Library (test-engineer). - `.claude/skills/test-plan/` — test strategy and coverage plan (test-engineer). - `.claude/skills/review/` — code review of current git diff (code-reviewer). -- `.claude/skills/review-pr/` — GitHub PR review by number (code-reviewer). +- `.claude/skills/review-pr/` — Gitea PR review by number (code-reviewer). - `.claude/skills/improve-prompt/` — diagnose and improve LLM prompt (prompt-engineer). +- `.claude/skills/create-skill/` — create or improve a Claude Code skill (meta-skill). ## Claude Code Hooks (`/.claude/hooks`) @@ -114,13 +116,6 @@ Technical index for developers and AI agents. Use this as the entry point to all - `.claude/hooks/commit-docs-reminder.sh` — reminds to check `status-update-checklist.md` before `git commit`. - `.claude/settings.json` — hooks configuration (also: Notification, SessionStart compact context). -## GitHub Templates (`/.github`) - -- `.github/ISSUE_TEMPLATE/bug_report.md` — bug report template. -- `.github/ISSUE_TEMPLATE/feature_request.md` — feature request template. -- `.github/ISSUE_TEMPLATE/config.yml` — issue template configuration. -- `.github/PULL_REQUEST_TEMPLATE.md` — PR description template. - --- ## How to Use This Index diff --git a/README.md b/README.md index e660989..4c11517 100644 --- a/README.md +++ b/README.md @@ -119,15 +119,13 @@ ls -la agents/ ``` your-project/ -├── .github/ # GitHub templates -│ ├── ISSUE_TEMPLATE/ # Issue templates (bug, feature) -│ └── PULL_REQUEST_TEMPLATE.md # PR template ├── docs/ # Complete documentation │ ├── archetypes.md # Product archetypes & optional modules │ ├── project-overview.md # Project overview template │ ├── phases-plan.md # Phase-based development plan │ ├── content-structure.md # Content/page structure │ ├── dev-setup.md # Development setup guide +│ ├── ci-cd.md # Woodpecker CI + Gitea pipeline │ ├── adr/ # Architecture Decision Records │ │ ├── README.md # ADR guidelines │ │ └── 0000-template.md # ADR template @@ -163,20 +161,28 @@ your-project/ │ └── api/ # Backend API (Node.js) ├── packages/ # Shared packages (if monorepo) │ └── shared/ # Types, utils, API client +├── scripts/ # DevOps & CI scripts +│ ├── setup-project.sh # VPS setup (user, dir, nginx, systemd) +│ ├── deploy.sh # VPS deploy (rsync + npm ci + restart) +│ └── ci-lint-fix.sh # ESLint auto-fix with commit-back ├── .claude/ # Claude Code configuration │ ├── settings.json # Hooks configuration +│ ├── status-update-checklist.md # Docs sync checklist for commits │ ├── hooks/ # Hook scripts │ │ ├── protect-files.sh # Block edits to sensitive files │ │ ├── bash-firewall.sh # Block dangerous commands │ │ ├── post-edit-format.sh # Auto-format after edits -│ │ └── audit-log.sh # Log all Bash commands -│ └── skills/ # Slash-command skills (14 total) +│ │ ├── audit-log.sh # Log all Bash commands +│ │ └── commit-docs-reminder.sh # Remind to sync docs on commit +│ └── skills/ # Slash-command skills (15 total) ├── .editorconfig # Editor formatting standards ├── .env.example # Environment variables template +├── .woodpecker.yml # Woodpecker CI pipeline config ├── package.json # Project metadata & engines ├── DOCS.md # Documentation index ├── RULES.md # Project rules & agent protocol ├── RECOMMENDATIONS.md # Project-specific decisions +├── RESEARCH-SDD-TOOLS.md # SDD tools research (Spec Kit, AI Factory) └── README.md # This file ``` diff --git a/RECOMMENDATIONS.md b/RECOMMENDATIONS.md index 71b1e93..c9dcc72 100644 --- a/RECOMMENDATIONS.md +++ b/RECOMMENDATIONS.md @@ -44,7 +44,7 @@ If a choice is not listed here, the default recommendations in `docs/` apply. **Infra / DevOps** - **Hosting/deploy:** _[Vercel/Fly/K8s/etc.]_ -- **CI/CD:** _[GitHub Actions/GitLab/etc.]_ +- **CI/CD:** _[Woodpecker/GitLab/etc.]_ - **Observability:** _[Sentry/OTel/Prometheus/etc.]_ - **Environments:** _dev/stage/prod_ (or specify) diff --git a/SECURITY.md b/SECURITY.md index a7aa7e5..83ba582 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,6 @@ If you discover a security vulnerability in this project, please report it respo **Do not open a public issue.** Instead: 1. Email: **[your-security-email@example.com]** (replace with your contact) -2. Or use [GitHub private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) if enabled on this repository. ### What to include