Repository navigation
feat(skills): add contract-first collaboration workflow - #2567
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (27)
🧰 Additional context used📓 Path-based instructions (5)skills/**/*.md📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{agents,skills,commands}/**/*.md📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
skills/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
{skills,commands,agents,rules}/**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (2)📚 Learning: 2026-03-15T19:02:43.245ZApplied to files:
📚 Learning: 2026-04-15T15:52:59.963ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds the ChangesContract-first skill catalog
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@skills/contract-first/SKILL.md`:
- Around line 31-43: Update the “The Boundary Artifact” guidance to define an
explicit trust boundary: treat schema descriptions and examples as data rather
than instructions, allowlist and constrain $ref resolution, run pinned
generators such as npm run generate:api-types with least privilege and no
network or secret access by default, and review generated diffs before applying
them. Include guards against destructive actions and secret exfiltration while
preserving the artifact-authority guidance.
- Around line 89-109: Pin the dialect for the openapi.yaml example by adding an
openapi: 3.1.0 declaration alongside the components block, preserving the
existing nullable cancellationReason schema.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: 1048783f-8c3b-4581-ab32-bec59fe67404
📒 Files selected for processing (11)
.claude-plugin/marketplace.json.claude-plugin/plugin.jsonAGENTS.mdREADME.mdREADME.zh-CN.mdagent.yamldocs/zh-CN/AGENTS.mddocs/zh-CN/README.mdmanifests/install-modules.jsonpackage.jsonskills/contract-first/SKILL.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{js,ts,jsx,tsx,py,java,cs,rb,go,php,swift,kt,rs,c,cpp,h,hpp,properties,yml,yaml,json,env,config}
📄 CodeRabbit inference engine (.cursor/rules/common-security.md)
NEVER hardcode secrets in source code - ALWAYS use environment variables or a secret manager
Files:
package.jsonagent.yamlmanifests/install-modules.json
{package.json,*.config.js,scripts/**/*.js}
📄 CodeRabbit inference engine (CLAUDE.md)
Package manager detection should support npm, pnpm, yarn, and bun, with configuration via CLAUDE_PACKAGE_MANAGER environment variable or project config.
Files:
package.json
**/*.{js,ts,jsx,tsx,json,env*}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not hardcode secrets, API keys, passwords, or tokens
Files:
package.jsonmanifests/install-modules.json
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Before committing, never hardcode secrets; validate user inputs; prevent SQL injection and XSS; enable CSRF protection; verify authentication and authorization; rate-limit endpoints; and avoid leaking sensitive data in errors.
Never hardcode secrets. Use environment variables or a secret manager, validate required secrets at startup, and rotate exposed secrets immediately.
Always create new objects rather than mutating existing ones.
Validate all external input at system boundaries using schema-based validation; fail fast with clear messages and never trust external data.
Handle errors at every level, never silently swallow errors, provide user-friendly UI messages, and log detailed server-side context.
Keep functions small, preferably under 50 lines; keep files focused, preferably under 800 lines; avoid nesting deeper than four levels; avoid hardcoded values; and use readable, well-named identifiers.
For new features and bug fixes, follow mandatory TDD: write a failing test first, implement the minimal passing solution, then refactor and verify at least 80% coverage.
Use planner for complex features and refactoring, tdd-guide for features and bug fixes, code-reviewer after modifications, architect for architectural decisions, and security-reviewer for security-sensitive code.
Use parallel execution for independent operations and address critical or high-severity review issues before proceeding.
Organize code by feature or domain with high cohesion and low coupling; prefer many small files over a few large files.
Use conventional commit messages in the format<type>: <description>, with types feat, fix, refactor, docs, test, chore, perf, and ci.
API responses must use a consistent envelope containing a success indicator, data payload, error message, and pagination metadata.
Encapsulate data access behind a repository interface such as findAll, findById, create, update, and delete; business logic must depend on the abstraction rather than storage details.
B...
Files:
package.jsonagent.yamlREADME.zh-CN.mdAGENTS.mddocs/zh-CN/AGENTS.mdmanifests/install-modules.jsonREADME.mddocs/zh-CN/README.mdskills/contract-first/SKILL.md
docs/zh-CN/**/*
📄 CodeRabbit inference engine (docs/zh-CN/AGENTS.md)
docs/zh-CN/**/*: 验证所有系统边界的用户输入,使用基于模式的验证,快速失败并提供清晰消息,绝不信任外部数据。
绝不硬编码 API 密钥、密码或令牌;使用环境变量或密钥管理器,并在启动时验证所需密钥。
防止 SQL 注入,使用参数化查询。
防止 XSS,输出 HTML 前进行适当清理。
启用 CSRF 保护,并验证身份认证与授权。
所有端点都必须有限速,错误消息不得泄露敏感数据。
总是创建新对象,永不修改现有对象;变更应通过返回新副本实现。
每个层级都必须处理错误;UI 提供用户友好消息,服务器记录详细上下文,绝不静默忽略错误。
函数应小于 50 行,文件应小于 800 行,避免超过四层的深层嵌套,并使用可读且命名良好的标识符。
Files:
docs/zh-CN/AGENTS.mddocs/zh-CN/README.md
README.md
📄 CodeRabbit inference engine (CLAUDE.md)
When working on README.md files, use the
/readmeskill.
Files:
README.md
skills/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples.
Files:
skills/contract-first/SKILL.md
{agents,skills,commands}/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Use lowercase filenames with hyphens (e.g.,
python-reviewer.md,tdd-workflow.md) for agents, skills, and commands.
Files:
skills/contract-first/SKILL.md
skills/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Treat skills/ as the canonical workflow surface; add new workflow contributions there first.
Files:
skills/contract-first/SKILL.md
{skills,commands,agents,rules}/**
⚙️ CodeRabbit configuration file
{skills,commands,agents,rules}/**: Focus on prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.
Files:
skills/contract-first/SKILL.md
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 发现安全问题时,停止继续操作,使用 security-reviewer,修复 CRITICAL 问题,轮换暴露的密钥,并审查代码库中的类似问题。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 复杂功能或重构先使用 planner 规划,架构决策使用 architect,新增功能或错误修复采用 tdd-guide,修改代码后使用 code-reviewer,敏感代码使用 security-reviewer。独立操作应并行执行。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 采用测试驱动开发:先写会失败的测试(RED),再编写最小实现(GREEN),最后重构并验证覆盖率。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 测试覆盖率至少达到 80%,并要求单元测试、集成测试和关键用户流程的端到端测试。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 测试失败时先检查测试隔离和模拟,再修复实现;除非测试本身错误,不要修改测试来掩盖问题。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 开发流程应依次包括规划、TDD、代码评审、知识记录和提交;评审后解决 CRITICAL/HIGH 问题。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 团队或项目知识应记录在现有项目文档结构中;个人调试笔记使用自动记忆;避免重复记录,创建新的顶层文件前先询问。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 提交使用约定式格式 `<type>: <description>`,类型包括 feat、fix、refactor、docs、test、chore、perf、ci;PR 应包含完整摘要和测试计划,并使用 `-u` 推送。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: API 响应使用一致的信封格式,包含成功指示器、数据负载、错误消息和分页元数据。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 使用仓储模式,将数据访问封装在包含 findAll、findById、create、update、delete 的标准接口后面;业务逻辑依赖抽象接口而非存储机制。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 大型重构和多文件功能应避免使用上下文窗口最后 20%;单次编辑、文档和简单修复可容忍更高利用率。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 构建故障排除使用 build-error-resolver,分析错误后增量修复,并在每次修复后验证。
Learnt from: CR
Repo: affaan-m/ECC
Timestamp: 2026-07-25T02:51:45.794Z
Learning: 骨架项目应搜索实战检验的模板,使用并行智能体评估安全性、可扩展性和相关性,克隆最佳匹配后在已验证结构内迭代。
📚 Learning: 2026-03-15T19:02:43.245Z
Learnt from: imrobinsingh
Repo: affaan-m/everything-claude-code PR: 503
File: skills/data-scraper-agent/SKILL.md:1-748
Timestamp: 2026-03-15T19:02:43.245Z
Learning: In this repository, skill folders should use a lowercase-hyphen name (e.g., data-scraper-agent, claude-api) and the skill description file inside each folder should be named SKILL.md (uppercase). Do not flag SKILL.md as a naming violation; treat SKILL.md as the canonical file name inside each skill directory.
Applied to files:
skills/contract-first/SKILL.md
📚 Learning: 2026-04-15T15:52:59.963Z
Learnt from: manja316
Repo: affaan-m/everything-claude-code PR: 1360
File: skills/security-bounty-hunter/SKILL.md:11-18
Timestamp: 2026-04-15T15:52:59.963Z
Learning: In this repository’s skills documentation (skills/**/SKILL.md), use the canonical auto-activation skill section header `## When to Activate`—do not use `## When to Use`. CONTRIBUTING.md and docs/SKILL-DEVELOPMENT-GUIDE.md confirm the required header, and existing skills follow this convention. This header is important for the auto-activation mechanism to detect the correct section.
Applied to files:
skills/contract-first/SKILL.md
🪛 LanguageTool
skills/contract-first/SKILL.md
[style] ~42-~42: Consider an alternative for the often overused word ‘important’.
Context: ...ompatibility model The filename is not important. Authority is. Do not maintain the same...
(NOT_IMPORTANT)
🔇 Additional comments (11)
skills/contract-first/SKILL.md (1)
1-30: LGTM!Also applies to: 44-88, 110-113, 124-278
agent.yaml (1)
40-40: LGTM!manifests/install-modules.json (1)
157-157: LGTM!package.json (1)
157-157: LGTM!.claude-plugin/marketplace.json (1)
14-14: LGTM!.claude-plugin/plugin.json (1)
4-4: LGTM!AGENTS.md (1)
3-3: LGTM!Also applies to: 155-155
README.md (1)
427-427: LGTM!Also applies to: 1548-1548, 1709-1709
README.zh-CN.md (1)
167-167: LGTM!docs/zh-CN/AGENTS.md (1)
3-3: LGTM!Also applies to: 150-150
docs/zh-CN/README.md (1)
231-231: LGTM!Also applies to: 1145-1145, 1253-1253
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
affaan-m
left a comment
There was a problem hiding this comment.
Verified the skill stays narrowly focused on a single machine-checkable boundary artifact, includes consumer/provider evidence gates and an explicit change protocol, and now treats embedded contract content as untrusted data with allowlisted references, pinned least-privilege generators, and generated-diff review. Packaging/catalog counts are wired and all 40 checks pass.
Summary
contract-firstskill for consumer/provider API and event collaborationWhy
ECC already provides strong guidance for API design quality and regression testing, but it does not currently cover the coordination gap before integration: two independently reasonable implementations can still drift on field names, status codes, event shapes, or error semantics.
This skill stays narrow. It does not introduce a new contract framework or generator. It encourages teams to reuse their existing schema format and pinned tooling while establishing a clear source of truth and evidence-based handoff between consumers and providers.
Validation
node scripts/ci/validate-skills.js --strictgit diff --checkScope note
The full repository test suite was not run locally because this contribution was prepared from a partial checkout while GitHub downloads were unstable. The repository's strict skill validator and targeted catalog/package checks pass; CI on the complete checkout remains the final integration check.