Skip to content

docs: add verified contribution guide for humans and AI agents - #101

Open
FredianoCampione wants to merge 10 commits into
Open-Source-Bazaar:mainfrom
FredianoCampione:agent/contribution-guide-90
Open

docs: add verified contribution guide for humans and AI agents#101
FredianoCampione wants to merge 10 commits into
Open-Source-Bazaar:mainfrom
FredianoCampione:agent/contribution-guide-90

Conversation

@FredianoCampione

@FredianoCampione FredianoCampione commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

PR-101 PR-101 PR-101 Powered by Pull Request Badge

Summary

Add repository-specific contribution guidance for humans and AI coding agents, and replace the stale GitHub Copilot instructions with rules derived from the current executable configuration.

Changes

  • add CONTRIBUTING.md with the real repository layout, coding rules, validation workflow, security boundaries, and bounty process
  • add a concise root AGENTS.md for deterministic agent pre-flight and handoff
  • update .github/copilot-instructions.md from obsolete Next.js 15 assumptions to the current Next.js 16 / React 19 / TypeScript 5 repository
  • document Corepack setup and synchronization from upstream/main
  • remove nonexistent pnpm lint, babel.config.js, and /policy guidance
  • document the staging side effect of pnpm test, external-fork CI limitations, tracked .env safety, and the difference between reward metadata and actual payment
  • require searching open and closed PRs that touch the same function or files before implementation

Validation

  • corepack pnpm install --frozen-lockfile
  • corepack pnpm exec prettier --check CONTRIBUTING.md AGENTS.md .github/copilot-instructions.md
  • corepack pnpm exec tsc --noEmit
  • corepack pnpm build — 93 static pages generated
  • 40/40 semantic document assertions
  • git diff --check
  • GitHub Markdown rendering checked at desktop width with no horizontal overflow

Scope / Risks

  • Documentation and agent instructions only; no application runtime, dependency, or lockfile changes.
  • pnpm test was intentionally not used because the current script runs git add .; the relevant formatter and TypeScript checks were run directly.
  • The external-fork workflow still requires maintainer approval and does not provide a general PR build/type-check gate without repository secrets.
  • CodeRabbit reports success but skips these Markdown paths by configuration, so the local evidence above is the substantive validation.
  • The reward workflow records allocation metadata after a merged closing PR; it does not prove YIW value, escrow, transfer, or acceptance.

Repository checklist

  • Labels — none assigned
  • Assignees — none assigned
  • Reviewers — none requested

Closes #90


本 PR 新增与当前仓库配置一致的 CONTRIBUTING.mdAGENTS.md,并同步修正自动提供给 GitHub Copilot 的旧说明。更新内容覆盖真实版本、Corepack、上游同步、有效命令、CI 限制、环境文件安全和奖励元数据边界。

Summary by CodeRabbit

  • 文档
    • 精炼并统一 AI 编码助手指导,明确“事实来源”优先级、默认分支与可执行配置要求、安装/启动与验证边界,以及安全与敏感信息禁止项。
    • 新增《AGENTS.md》:为 AI 编码 Agent 提供最小、可执行的约束清单、完成条件与 PR/验证表述规则。
    • 新增《CONTRIBUTING.md》:补充贡献前核验优先级、开发环境与常用命令、本地验证流程、PR 描述必填字段及 reward 规则。

Add current-repository contribution rules for human and AI contributors.

Refs Open-Source-Bazaar#90
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a9d8dbf5-5411-4a04-b456-84e6751716b1

📥 Commits

Reviewing files that changed from the base of the PR and between a12c623 and 6695c22.

📒 Files selected for processing (2)
  • .github/copilot-instructions.md
  • CONTRIBUTING.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTRIBUTING.md

📝 Walkthrough

Walkthrough

本次变更新增 AGENTS.mdCONTRIBUTING.md,并重写 Copilot 指令,统一仓库基线、开发命令、实现规范、验证流程、PR 规则、奖励记录及安全要求。

Changes

贡献与 Agent 指南

Layer / File(s) Summary
仓库基线与开发流程
.github/copilot-instructions.md
补充事实来源优先级、当前技术栈、Node.js 24 配置、fork 同步流程及实际可用命令,并明确不存在 pnpm lint
实现约束与验证规则
.github/copilot-instructions.md, CONTRIBUTING.md
更新 TypeScript、React、MobX、i18n、格式检查、页面验证、CI 限制及敏感信息规则;要求 UI 文本使用 t() 并遵循既有组件模式。
贡献与 Agent 工作协议
AGENTS.md, CONTRIBUTING.md
新增资料核验、开发执行、分支与提交、PR 描述、奖励流程、验证及安全处理规则。

Estimated code review effort: 2 (简单) | ~10 分钟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次新增贡献指南与 AI Agent 指南的文档改动。
Linked Issues check ✅ Passed PR 新增了可供人类与 Agent 使用的 Markdown 贡献指南,并符合 #90 对社区规范文档的要求。
Out of Scope Changes check ✅ Passed 所有改动都集中在文档与代理指引上,未见与目标无关的代码或依赖变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Document upstream synchronization, Corepack setup, CI limitations, reward metadata, and tracked environment-file safety.
Replace stale commands, versions, routes, and validation assumptions with current executable configuration.
@FredianoCampione

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@FredianoCampione

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@FredianoCampione

Copy link
Copy Markdown
Contributor Author

@coderabbitai configuration

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Configuration used: Path: .coderabbit.yaml

CodeRabbit configuration
# Source: Repository YAML (base)
language: zh-CN
# Source: Repository YAML (base)
tone_instructions: |
  使用专业中文语气。重点关注:1) 统一用 React Bootstrap;2) MobX
  observer/observable/action/computed 是否正确;3) 全部 UI 文本用 t();4) GitHub
  API 认证/错误处理与 Base64 统一用 web-utility;5) Pages Router 的数据获取正确;
  6) TypeScript 强类型;7) 性能(next/image、避免多余渲染);8) 结构清晰。
# Source: defaults
early_access: false
# Source: defaults
enable_free_tier: true
# Source: defaults
inheritance: false
reviews:
  # Source: defaults
  profile: chill
  # Source: defaults
  request_changes_workflow: false
  # Source: Repository YAML (base)
  high_level_summary: true
  # Source: defaults
  high_level_summary_instructions: ''
  # Source: Repository YAML (base)
  high_level_summary_placeholder: 这是 Open Source Bazaar 项目的 PR 变更摘要
  # Source: defaults
  high_level_summary_in_walkthrough: false
  # Source: defaults
  auto_title_placeholder: '`@coderabbitai`'
  # Source: defaults
  auto_title_instructions: ''
  # Source: defaults
  review_status: true
  # Source: defaults
  review_details: false
  # Source: defaults
  review_progress: true
  # Source: defaults
  commit_status: true
  # Source: defaults
  fail_commit_status: false
  # Source: defaults
  collapse_walkthrough: true
  # Source: defaults
  changed_files_summary: true
  # Source: defaults
  sequence_diagrams: true
  # Source: defaults
  estimate_code_review_effort: true
  # Source: defaults
  assess_linked_issues: true
  # Source: defaults
  related_issues: true
  # Source: defaults
  related_prs: true
  # Source: defaults
  suggested_labels: true
  # Source: defaults
  labeling_instructions: []
  # Source: defaults
  mutually_exclusive_groups: {}
  # Source: defaults
  auto_apply_labels: false
  # Source: defaults
  suggested_reviewers: true
  # Source: defaults
  auto_assign_reviewers: false
  # Source: defaults
  suggested_reviewers_instructions: []
  # Source: defaults
  in_progress_fortune: true
  # Source: defaults
  poem: false
  # Source: defaults
  enable_prompt_for_ai_agents: true
  # Source: Repository YAML (base)
  path_filters:
    - src/**
    - pages/**
    - components/**
    - models/**
    - '!**/*.md'
    - '!**/*.{bin,csv}'
    - '!node_modules/**'
    - '!.next/**'
    - '!public/**/*.{png,jpg,jpeg,gif,webp,svg,ico,mp4,mp3,woff,woff2,ttf,otf}'
    - '!out/**'
    - '!next-env.d.ts'
    - '!package-lock.json'
    - '!pnpm-lock.yaml'
    - '!yarn.lock'
    - '!**/__snapshots__/**'
  # Source: defaults
  path_instructions: []
  # Source: defaults
  abort_on_close: true
  # Source: defaults
  disable_cache: false
  slop_detection:
    # Source: defaults
    enabled: true
  auto_review:
    # Source: defaults
    enabled: true
    # Source: defaults
    description_keyword: ''
    # Source: defaults
    auto_incremental_review: true
    # Source: defaults
    auto_pause_after_reviewed_commits: 5
    # Source: defaults
    ignore_title_keywords: []
    # Source: defaults
    labels: []
    # Source: defaults
    drafts: false
    # Source: defaults
    base_branches: []
    # Source: defaults
    ignore_usernames: []
  finishing_touches:
    docstrings:
      # Source: defaults
      enabled: true
    unit_tests:
      # Source: defaults
      enabled: true
    simplify:
      # Source: defaults
      enabled: false
    autofix:
      # Source: defaults
      enabled: true
    fix_ci:
      # Source: defaults
      enabled: true
    resolve_merge_conflict:
      # Source: defaults
      enabled: true
    # Source: defaults
    custom: []
  pre_merge_checks:
    # Source: defaults
    override_requested_reviewers_only: false
    docstrings:
      # Source: defaults
      mode: warning
      # Source: defaults
      threshold: 80
    title:
      # Source: defaults
      mode: warning
      # Source: defaults
      requirements: ''
    description:
      # Source: defaults
      mode: warning
    issue_assessment:
      # Source: defaults
      mode: warning
    # Source: defaults
    custom_checks: []
  # Source: defaults
  post_merge_actions: []
  tools:
    ast-grep:
      # Source: defaults
      rule_dirs: []
      # Source: defaults
      util_dirs: []
      # Source: defaults
      essential_rules: true
      # Source: defaults
      packages: []
    shellcheck:
      # Source: defaults
      enabled: true
    ruff:
      # Source: defaults
      enabled: true
    markdownlint:
      # Source: defaults
      enabled: true
    github-checks:
      # Source: defaults
      enabled: true
      # Source: defaults
      timeout_ms: 90000
    languagetool:
      # Source: defaults
      enabled: true
      # Source: defaults
      enabled_rules: []
      # Source: defaults
      disabled_rules: []
      # Source: defaults
      enabled_categories: []
      # Source: defaults
      disabled_categories: []
      # Source: defaults
      enabled_only: false
      # Source: defaults
      level: default
    biome:
      # Source: defaults
      enabled: true
    hadolint:
      # Source: defaults
      enabled: true
    swiftlint:
      # Source: defaults
      enabled: true
    phpstan:
      # Source: defaults
      enabled: true
      # Source: defaults
      level: default
    phpmd:
      # Source: defaults
      enabled: true
    phpcs:
      # Source: defaults
      enabled: true
    golangci-lint:
      # Source: defaults
      enabled: true
    yamllint:
      # Source: defaults
      enabled: true
    gitleaks:
      # Source: defaults
      enabled: true
    trufflehog:
      # Source: defaults
      enabled: true
    checkov:
      # Source: defaults
      enabled: true
    tflint:
      # Source: defaults
      enabled: true
    detekt:
      # Source: defaults
      enabled: true
    eslint:
      # Source: defaults
      enabled: true
      e18e:
        # Source: defaults
        enabled: true
    flake8:
      # Source: defaults
      enabled: true
    fbinfer:
      # Source: defaults
      enabled: true
      # Source: defaults
      enable_java: false
    fortitudeLint:
      # Source: defaults
      enabled: true
    rubocop:
      # Source: defaults
      enabled: true
    buf:
      # Source: defaults
      enabled: true
    regal:
      # Source: defaults
      enabled: true
    actionlint:
      # Source: defaults
      enabled: true
    zizmor:
      # Source: defaults
      enabled: true
    pmd:
      # Source: defaults
      enabled: true
    clang:
      # Source: defaults
      enabled: true
    cppcheck:
      # Source: defaults
      enabled: true
    opengrep:
      # Source: defaults
      enabled: true
    semgrep:
      # Source: defaults
      enabled: true
    circleci:
      # Source: defaults
      enabled: true
    clippy:
      # Source: defaults
      enabled: true
    sqlfluff:
      # Source: defaults
      enabled: true
    squawk:
      # Source: defaults
      enabled: true
    trivy:
      # Source: defaults
      enabled: true
    prismaLint:
      # Source: defaults
      enabled: true
    pylint:
      # Source: defaults
      enabled: true
    oxc:
      # Source: defaults
      enabled: true
    shopifyThemeCheck:
      # Source: defaults
      enabled: true
    luacheck:
      # Source: defaults
      enabled: true
    brakeman:
      # Source: defaults
      enabled: true
    dotenvLint:
      # Source: defaults
      enabled: true
    htmlhint:
      # Source: defaults
      enabled: true
    stylelint:
      # Source: defaults
      enabled: true
    checkmake:
      # Source: defaults
      enabled: true
    osvScanner:
      # Source: defaults
      enabled: true
    oasdiff:
      # Source: defaults
      enabled: true
    reactDoctor:
      # Source: defaults
      enabled: true
    presidio:
      # Source: defaults
      enabled: true
    blinter:
      # Source: defaults
      enabled: true
    smartyLint:
      # Source: defaults
      enabled: true
    emberTemplateLint:
      # Source: defaults
      enabled: true
    skillspector:
      # Source: defaults
      enabled: true
    psscriptanalyzer:
      # Source: defaults
      enabled: true
chat:
  # Source: defaults
  art: true
  # Source: defaults
  allow_non_org_members: true
  # Source: defaults
  auto_reply: true
  integrations:
    jira:
      # Source: defaults
      usage: auto
    linear:
      # Source: defaults
      usage: auto
knowledge_base:
  # Source: defaults
  opt_out: false
  web_search:
    # Source: defaults
    enabled: true
  code_guidelines:
    # Source: defaults
    enabled: true
    # Source: defaults
    filePatterns: []
  learnings:
    # Source: defaults
    scope: auto
    # Source: defaults
    approval_delay: 0
  issues:
    # Source: defaults
    scope: auto
  jira:
    # Source: defaults
    usage: auto
    # Source: defaults
    project_keys: []
  linear:
    # Source: defaults
    usage: auto
    # Source: defaults
    team_keys: []
  pull_requests:
    # Source: defaults
    scope: auto
  mcp:
    # Source: defaults
    usage: auto
    # Source: defaults
    disabled_servers: []
  # Source: defaults
  automatic_repository_linking: false
  # Source: defaults
  linked_repositories: []
code_generation:
  docstrings:
    # Source: defaults
    path_instructions: []
  unit_tests:
    # Source: defaults
    path_instructions: []
issue_enrichment:
  auto_enrich:
    # Source: defaults
    enabled: false
  planning:
    # Source: defaults
    enabled: true
    auto_planning:
      # Source: defaults
      enabled: true
      # Source: defaults
      labels: []
  labeling:
    # Source: defaults
    labeling_instructions: []
    # Source: defaults
    auto_apply_labels: false

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/copilot-instructions.md:
- Line 53: Update the upstream remote setup at
.github/copilot-instructions.md:53 and CONTRIBUTING.md:72 to first read and
validate the existing upstream URL, adding the remote only when it is missing;
make both documented workflows use this same idempotent sequence.
- Around line 70-71: 统一修正文档中的验证命令占位符,避免尖括号在 Shell 代码块中被解析为重定向;在
.github/copilot-instructions.md 第70-71行和第110-111行、AGENTS.md
第45-46行、CONTRIBUTING.md 第151-152行,将 Prettier 和 ESLint
示例替换为语法有效且可按变更范围替换的示例路径,或将占位符移到代码块外,确保命令可直接执行。

In `@AGENTS.md`:
- Line 81: 统一 PR 文档中的 issue 关闭规则:在 AGENTS.md 第 81 行删除无条件使用 Closes #<issue> 的要求;在
CONTRIBUTING.md 第 173-179 行将 Closes `#90` 改为仅在该 PR 应关闭对应 issue 时使用的条件性示例或占位符。

In `@CONTRIBUTING.md`:
- Around line 142-144: Update the Markdown validation command in CONTRIBUTING.md
to include .github/copilot-instructions.md alongside CONTRIBUTING.md and
AGENTS.md, ensuring Prettier checks all three modified files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b5f94d79-954f-48cb-a5a4-493b0620fbc0

📥 Commits

Reviewing files that changed from the base of the PR and between d143245 and 6948d1e.

📒 Files selected for processing (3)
  • .github/copilot-instructions.md
  • AGENTS.md
  • CONTRIBUTING.md

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread AGENTS.md Outdated
Comment thread CONTRIBUTING.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 81-85: Remove the `git push origin main` command from the workflow
before creating the feature branch. Keep fetching and fast-forwarding local
`main`, then create `feat/short-description` directly from the updated
`upstream/main` without modifying the remote `origin/main`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0339f91e-4cdc-482b-ba87-c496dfb2650c

📥 Commits

Reviewing files that changed from the base of the PR and between 6948d1e and a12c623.

📒 Files selected for processing (3)
  • .github/copilot-instructions.md
  • AGENTS.md
  • CONTRIBUTING.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/copilot-instructions.md

Comment thread CONTRIBUTING.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

开源市集代码贡献指南

2 participants