diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..930aca9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,42 @@ +--- +name: Bug Report +about: Report a bug or unexpected behavior in git-ai +title: '[Bug] ' +labels: ['bug', 'triage'] +assignees: '' +--- + +## Bug Description + + + +## Steps to Reproduce + +1. Run `git-ai ...` +2. See error + +## Expected Behavior + + + +## Actual Behavior + + + +## Environment + +- **OS:** +- **Node.js version:** +- **git-ai version:** +- **Git version:** +- **AI provider:** + +## Logs / Stack Trace + +``` + +``` + +## Additional Context + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..a293724 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: 💬 Discussion / Question + url: https://github.com/BeyteFlow/git-ai/discussions + about: Ask questions and discuss ideas in GitHub Discussions diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..e12a988 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,33 @@ +--- +name: Feature Request +about: Suggest a new feature or improvement for git-ai +title: '[Feature] ' +labels: ['enhancement', 'triage'] +assignees: '' +--- + +## Feature Description + + + +## Problem It Solves + + + + +## Proposed Solution + + + +## Alternatives Considered + + + +## Additional Context + + + +## Would you be willing to contribute this feature? + +- [ ] Yes, I'd like to open a PR for this +- [ ] No, I'm just suggesting diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ecf94b7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,34 @@ +version: 2 +updates: + # Maintain dependencies for npm + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'weekly' + day: 'monday' + time: '09:00' + open-pull-requests-limit: 10 + labels: + - 'dependencies' + commit-message: + prefix: 'chore(deps)' + prefix-development: 'chore(deps-dev)' + groups: + production-dependencies: + dependency-type: 'production' + development-dependencies: + dependency-type: 'development' + + # Maintain dependencies for GitHub Actions + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' + day: 'monday' + time: '09:00' + open-pull-requests-limit: 10 + labels: + - 'dependencies' + - 'ci/cd' + commit-message: + prefix: 'chore(actions)' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..72c10b2 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,57 @@ +# Pull Request auto-labeler configuration +# https://github.com/actions/labeler + +'ci/cd': + - changed-files: + - any-glob-to-any-file: + - '.github/**' + +'dependencies': + - changed-files: + - any-glob-to-any-file: + - 'package.json' + - 'package-lock.json' + - 'yarn.lock' + +'documentation': + - changed-files: + - any-glob-to-any-file: + - '**/*.md' + - 'docs/**' + +'cli': + - changed-files: + - any-glob-to-any-file: + - 'src/cli/**' + +'core': + - changed-files: + - any-glob-to-any-file: + - 'src/core/**' + +'ai': + - changed-files: + - any-glob-to-any-file: + - 'src/services/aiService.ts' + +'git': + - changed-files: + - any-glob-to-any-file: + - 'src/services/gitService.ts' + +'github': + - changed-files: + - any-glob-to-any-file: + - 'src/services/githubService.ts' + +'ui': + - changed-files: + - any-glob-to-any-file: + - 'src/ui/**' + +'tests': + - changed-files: + - any-glob-to-any-file: + - '**/*.test.ts' + - '**/*.spec.ts' + - 'tests/**' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..a17fbb4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,42 @@ +## Description + + + +## Related Issue + + + +Closes # + +## Type of Change + + + +- [ ] 🐛 Bug fix (non-breaking change that fixes an issue) +- [ ] ✨ New feature (non-breaking change that adds functionality) +- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change) +- [ ] 📝 Documentation update +- [ ] 🔧 Refactor / internal improvement +- [ ] 🤖 CI/CD or tooling change +- [ ] ⬆️ Dependency update + +## Checklist + +- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) guidelines (if present) +- [ ] My code follows the existing code style +- [ ] I have added or updated tests that cover my changes +- [ ] All existing tests pass locally +- [ ] I have updated the documentation where necessary +- [ ] My changes do not introduce new security vulnerabilities + +## How Has This Been Tested? + + + +## Screenshots (if applicable) + + + +## Additional Notes + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dce05ec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + build-and-test: + name: Build & Test + runs-on: ubuntu-latest + permissions: + contents: read + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint --if-present + + - name: Build + run: npm run build --if-present + + - name: Run tests + run: npm test --if-present diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..95e1019 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: CodeQL + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + schedule: + - cron: '30 4 * * 1' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + language: [javascript-typescript] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + queries: security-extended,security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..b3f4dd2 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,42 @@ +name: Labeler + +on: + pull_request: + types: [opened, synchronize, reopened] + issues: + types: [opened, reopened] + +jobs: + label-pr: + name: Label Pull Request + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + permissions: + contents: read + pull-requests: write + + steps: + - name: Label PR based on changed files + uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yml + + label-issue: + name: Label Issue + runs-on: ubuntu-latest + if: github.event_name == 'issues' + permissions: + issues: write + + steps: + - name: Add triage label to new issues + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['triage'] + });