mirror of
https://github.com/efremidze/swift-architecture-skill.git
synced 2026-09-14 20:49:06 +08:00
294d8ee0b1
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
4.3 KiB
4.3 KiB
Contributing Guide
Thanks for contributing to swift-architecture-skill.
This repository is documentation-first: it defines a routing skill (SKILL.md), a references index (references/_index.md), and architecture playbooks (references/*.md) used by coding agents.
Before You Start
- Read
swift-architecture-skill/SKILL.mdto understand how architecture selection and routing works. - Review
swift-architecture-skill/references/_index.mdto see the current navigation and routing model. - Review
swift-architecture-skill/references/selection-guide.mdto see current decision criteria. - Skim one or two existing playbooks (for example
mvvm.md,tca.md) to match structure and tone.
Repository Structure
swift-architecture-skill/
SKILL.md
agents/openai.yaml
references/
_index.md
selection-guide.md
mvvm.md
mvi.md
tca.md
clean-architecture.md
viper.md
reactive.md
mvp.md
coordinator.md
What Good Contributions Look Like
- Concrete, implementation-ready guidance instead of abstract advice
- Modern Swift patterns (Swift 5.9+, async/await, actors, SwiftUI-first where appropriate)
- Clear anti-patterns and direct fixes
- Consistent playbook sections and checklist quality
Add or Update a Playbook
When editing any architecture playbook in swift-architecture-skill/references/, keep this structure:
- Overview and when to use it
- Core concepts and principles
- Code patterns with Swift examples
- Anti-patterns with fixes
- Testing strategy
- PR review checklist
Content expectations:
- Use protocol-based dependency injection
- Include error handling in async operations
- Prefer value-based navigation modeling (enum/struct) over UIKit reference wiring
- Keep examples focused and syntactically correct
Add a New Architecture
- Create a new playbook in
swift-architecture-skill/references/<architecture>.md. - Follow the required playbook structure listed above.
- Update
swift-architecture-skill/SKILL.md:- Add the architecture to the mapping in Architecture Router
- Mention it in any architecture list that should include it
- Update
swift-architecture-skill/references/_index.md:- Add a one-line description
- Add or adjust any problem-router entries
- Update
swift-architecture-skill/references/selection-guide.md:- Add decision criteria signals
- Add it to the decision matrix/flow if applicable
- Document valid combinations with other patterns when relevant
- If needed, update
README.mdso supported architectures and project structure stay accurate.
Swift Example Conventions
- Swift naming conventions (
PascalCasetypes,camelCasemembers) private(set)for externally read-only state in ViewModels@MainActoron test classes that testMainActor-isolated types- Effects handle their own errors and map to explicit failure actions
- Comments only for non-obvious architectural decisions
Validation Checklist
Use both automated and manual checks:
- Run automated validators:
python -m skills_ref.cli validate ./swift-architecture-skill
./tooling/scripts/validate/testing-snippets.sh
python3 ./tooling/scripts/validate/testing-quality.py
./tooling/scripts/run/benchmarks.py
python3 ./tooling/scripts/validate/benchmark-coverage.py
python3 ./tooling/scripts/run/corpus.py
python3 ./tooling/scripts/validate/architecture.py
-
Complete manual review:
- Markdown formatting is clean and readable
- Cross-file references are correct (
SKILL.mdandselection-guide.mdstay in sync) - New guidance is specific enough for an agent to apply directly
Useful Commands
find . -name "*.md"
grep -r "pattern" swift-architecture-skill/references/
wc -l swift-architecture-skill/references/*.md
For automated validation commands, use the canonical list under Validation Checklist.
Pull Request Checklist
Before opening a PR, confirm:
- Scope is focused and architecture-specific where applicable
- New or changed examples follow modern Swift concurrency practices
- Anti-pattern sections include actionable corrections
swift-architecture-skill/SKILL.mdreflects any new architecture referencesswift-architecture-skill/references/selection-guide.mdreflects decision updatesREADME.mdwas updated if public-facing architecture lists changed