Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Synced from thatfactory/agent-guidelines; keep tracked but collapse GitHub diffs.
AgentGuidelines/** linguist-generated
33 changes: 33 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Pull Request CI

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
name: Swift Format
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Lint Swift Sources
run: AgentGuidelines/Scripts/swift_format.sh lint-strict Sources Tests

test:
name: Test
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
clean: true

- name: Run Tests
run: swift test -v
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: CI

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
name: Swift Format
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Lint Swift Sources
run: AgentGuidelines/Scripts/swift_format.sh lint-strict Sources Tests

test:
name: Test
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
clean: true

- name: Run Tests
run: swift test -v
23 changes: 23 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Nightly Tests

on:
schedule:
- cron: '0 4 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
nightly_tests:
name: Nightly Tests
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
clean: true

- name: Run Tests
run: swift test -v
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
name: Release
run-name: Release ${{ github.event.release.tag_name }}

on:
release:
types:
- published

permissions:
actions: read
contents: read
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test Release
runs-on: [self-hosted, macOS]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
clean: true

- name: Run Tests
run: swift test -v

build_docs:
name: Build DocC
runs-on: [self-hosted, macOS]
needs: test
steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
clean: true

- name: Generate DocC
run: |
set -euo pipefail
swift package --allow-writing-to-directory ./public generate-documentation \
--target CloudSaveKit \
--disable-indexing \
--output-path ./public \
--transform-for-static-hosting \
--hosting-base-path cloudsavekit

cat > ./public/index.html <<'INDEX'
<!doctype html>
<meta http-equiv="refresh" content="0; url=/cloudsavekit/documentation/cloudsavekit/" />
<title>CloudSaveKit Documentation</title>
INDEX

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./public
name: github-pages

deploy_docs:
name: Deploy DocC
needs: build_docs
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

notify_package_collection:
name: Notify Package Collection
runs-on: ubuntu-latest
needs: deploy_docs
steps:
- name: Trigger Swift Package Collection Rebuild
env:
COLLECTION_REPO: thatfactory/swift-package-collection
WORKFLOW_FILE: publish.yml
REF: main
GH_TOKEN: ${{ secrets.COLLECTION_TRIGGER_TOKEN }}
SOURCE_REPO: ${{ github.repository }}
SOURCE_VERSION: ${{ github.event.release.tag_name }}
run: |
set -euo pipefail

if [ -z "${GH_TOKEN:-}" ]; then
echo "Missing COLLECTION_TRIGGER_TOKEN secret"
exit 1
fi

curl --fail-with-body -sS -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/$COLLECTION_REPO/actions/workflows/$WORKFLOW_FILE/dispatches" \
-d "{\"ref\":\"$REF\",\"inputs\":{\"source_repo\":\"$SOURCE_REPO\",\"source_version\":\"$SOURCE_VERSION\"}}"
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
*.xcworkspace
xcuserdata/
Package.resolved
DerivedData/
.swiftpm/configuration/registries.json
.netrc
/public-check
1 change: 1 addition & 0 deletions .swift-format
47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CloudSaveKit

## Context

CloudSaveKit is a pure Swift package that coordinates a host application's durable local store with a private CloudKit database through `CKSyncEngine`. Read [README.md](README.md) and the DocC catalog before changing public behavior.

The package is persistence-, UI-, and application-architecture agnostic. Host applications own their local database, record schemas, merge semantics, and user-facing recovery policy.

## Shared guidelines

Read only the guides relevant to the task:

- [Swift](AgentGuidelines/Guidelines/Swift/Swift.md)
- [Swift style](AgentGuidelines/Guidelines/Swift/SwiftStyle.md)
- [Swift format](AgentGuidelines/Guidelines/Swift/SwiftFormat.md)
- [Unit and integration testing](AgentGuidelines/Guidelines/Testing/UnitTesting.md)
- [Documentation](AgentGuidelines/Guidelines/Documentation.md)
- [Logging](AgentGuidelines/Guidelines/Logging.md)
- [Packages](AgentGuidelines/Guidelines/Packages.md)
- [CI/CD](AgentGuidelines/Guidelines/CICD.md)
- [Git repositories and SSH-first cloning](AgentGuidelines/Guidelines/Git/Repositories.md)
- [GitHub pull requests](AgentGuidelines/Guidelines/GitHub/PullRequests.md)
- [Xcode MCP](AgentGuidelines/Guidelines/Xcode/MCP.md)
- [Xcode security audits](AgentGuidelines/Guidelines/Xcode/Security.md)

Redux, SwiftData, SwiftUI, and application-localization guidance do not apply to the package target.

## Physical folder map

| Role | Physical folder |
|---|---|
| Package sources | `Sources/CloudSaveKit/` |
| DocC catalog | `Sources/CloudSaveKit/CloudSaveKit.docc/` |
| Unit tests | `Tests/CloudSaveKitTests/` |

## Package specialization

- Use `CKSyncEngine` rather than duplicating its scheduling, batching, state tracking, or transient retry behavior.
- Do not add a local database, Redux, UI, product record schema, or game-specific conflict policy.
- Persist every engine state update through the host-provided client boundary.
- Keep status and errors privacy-safe; never log record contents or identifiers.
- Update tests, DocC, README examples, and release notes when public behavior changes.
- Use logging subsystem `com.thatfactory.cloudsavekit`, category `sync`, and canonical package emoji `☁️`.

## Codex review scope

For consumer pull requests, do not substantively review `AgentGuidelines/**` after exact tagged-tree provenance has been verified. Verify its `VERSION`, compare its tree with the matching central tag, and verify the required `.gitattributes` rule. If provenance does not match exactly, review the subtree contents and stop the merge. Report substantive guideline feedback against the central `agent-guidelines` pull request.
60 changes: 60 additions & 0 deletions AgentGuidelines/.agents/skills/agent-guidelines-audit/SKILL.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions AgentGuidelines/.github/workflows/ci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions AgentGuidelines/.github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading