AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
76/100
Scores the file, not the repository.Length
765 words
16 headings · 2 code blocksRepository
344
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Copilot Instructions for MSAL iOS/macOS23## Repository Overview45This is the **Microsoft Authentication Library (MSAL) for iOS and macOS** - an authentication SDK for integrating Microsoft identity platform authentication into native Apple applications. The library supports OAuth2/OpenID Connect protocols for Microsoft Entra ID (workforce), External ID (customers), Azure AD B2C, and personal Microsoft accounts.67**Key Facts:**89- **Languages:** Objective-C (primary), Swift (native auth APIs)10- **Platforms:** iOS 16+, macOS 11+, visionOS 1.2+11- **Distribution:** CocoaPods, Carthage, Swift Package Manager, Git submodule12- **Submodule:** `MSAL/IdentityCore` contains shared common code (do NOT make direct changes without understanding impact)1314## Critical: Architecture & Project Structure1516### Main Workspace & Targets1718- **Workspace:** `MSAL.xcworkspace` (ALWAYS use .xcworkspace, NEVER .xcodeproj directly)19- **Main Project:** `MSAL/MSAL.xcodeproj`20- **Submodule:** `MSAL/IdentityCore` - shared common library (git submodule)2122### Source Code Organization2324```25MSAL/src/26├── public/ # Public API headers (MSAL prefix)27│ ├── MSAL.h # Main umbrella header28│ ├── ios/ # iOS-specific public headers29│ ├── mac/ # macOS-specific public headers30│ ├── configuration/ # Configuration classes31│ └── native_auth/public/ # Native auth public APIs (Swift)32├── MSALPublicClientApplication.m # Main SDK entry point33├── configuration/ # Internal configuration34├── instance/ # Authority/instance handling35├── native_auth/ # Native authentication (Swift + Obj-C bridge)36├── telemetry/ # Telemetry implementation37└── util/ # Utilities38```3940### Public API Files4142Public headers MUST be in:4344- `MSAL/src/public/*.h` (shared)45- `MSAL/src/public/ios/*.h` (iOS only)46- `MSAL/src/public/mac/*.h` (macOS only)47- `MSAL/src/public/configuration/*.h` (config classes)48- `MSAL/src/native_auth/public/` (native auth - Swift)4950### Configuration Files5152- **Build configs:** `MSAL/xcconfig/*.xcconfig` - Xcode build settings53- **Swift lint:** `MSAL/.swiftlint.yml` - only applies to `src/native_auth`54- **CocoaPods:** `MSAL.podspec` - pod spec with `app-lib` and `native-auth` subspecs55- **Swift PM:** `Package.swift` - binary framework distribution56- **Privacy:** `MSAL/PrivacyInfo.xcprivacy` - Apple privacy manifest5758## Testing5960**Unit Tests:** Located in `MSAL/test/unit/`61**Integration Tests:** Located in `MSAL/test/integration/`62**Automation Tests:** Located in `MSAL/test/automation/` (requires conf.json - not in repo)6364**Running Tests:**6566- Via Xcode: Select scheme and Cmd+U67- E2E tests require test configuration from Azure KeyVault (CI only)6869## Code Style Guidelines7071**READ:** `.clinerules/04-Code-style-guidelines.md` - Contains mandatory Objective-C style rules7273**Key Rules (Repository-Specific):**74751. **Opening braces on NEW line** (differs from most Obj-C guides)762. **4-space indentation** (never tabs)773. **Imports NOT grouped** - list without organizing comments784. **Error handling:** Check return value, NEVER the error variable directly795. **Prefixes:** `MSAL` for public classes, `MSID` for IdentityCore internal806. **Properties over ivars:** Use `@property` declarations817. **Swift lint:** Native auth code must pass SwiftLint (line length: 150)8283**Example:**8485```objc86- (BOOL)performOperationWithError:(NSError **)error87{88 NSError *internalError = nil;89 BOOL result = [self doSomethingWithError:&internalError];9091 if (!result) // Check return value, not error92 {93 if (error) *error = internalError;94 return NO;95 }9697 return YES;98}99```100101## Making Changes102103### Adding New Public API1041051. Add header to appropriate `MSAL/src/public/` subdirectory1062. Import in `MSAL/src/public/MSAL.h` umbrella header1073. Update `MSAL.podspec` if needed (public_header_files)1084. Add to `MSAL/module.modulemap` if using native auth subspec1095. Document in header comments (Jazzy-compatible)110111### Modifying Build Settings1121131. Edit appropriate `.xcconfig` file in `MSAL/xcconfig/`1142. Settings cascade: specific → platform → common1153. Test both Debug and Release configurations116117### Adding Dependencies118119**Internal:** Avoid. This library should be self-contained.120**External (IdentityCore):** Coordinate with common library team.121122### Modifying IdentityCore Submodule1231241. Make changes in IdentityCore repo separately1252. Update submodule reference: `cd MSAL/IdentityCore && git checkout <commit>`1263. Commit submodule update in MSAL repo1274. Test thoroughly - affects BOTH MSAL and ADAL128129## Key Files to Never Modify130131- `MSAL/IdentityCore/` - managed as submodule132- `Package.swift` - auto-generated by release process133- `MSAL.zip` - binary distribution artifact134- `build/` - build artifacts directory135- `.xcuserdata/` - user-specific Xcode settings136137## Trust These Instructions138139These instructions have been validated against the actual build system, CI pipelines, and codebase structure. If you encounter conflicts between these instructions and other information:1401411. **Trust these instructions FIRST**1422. Only search for additional information if:143 - Instructions are incomplete for your specific task144 - You encounter an error not covered here145 - You need API usage examples (see `.clinerules/03-MSAL-API-usage.md` for MSAL API samples)146 - You need to create a new application with MSAL authentication (see `.clinerules/AGENTS.md` for details about the different options the user can select)147 - You are implementing a new feature in MSAL library, it needs to be guarded by a feature flag (see `.clinerules/05-feature-gating.md` for guidelines)148149**When searching:**150151- Check `.clinerules/*.md` for code style specifics, API usage, configuration steps and feature flag guidance.152- Check `README.md` for user-facing documentation153- Check `CHANGELOG.md` for version history and breaking changes154- Check specific xcconfig files for build settings155
Also in AzureAD/microsoft-authentication-library-for-objc
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| AzureAD/microsoft-authentication-library-for-objc.clinerules/02-External-tenant-configuration.md · 344 | Cline rules | setupbuildteststyle+7 | 69/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objcCLAUDE.md · 344 | CLAUDE.md | buildteststylearch+6 | 76/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/01-Workforce-tenant-configuration.md · 344 | Cline rules | setupbuildtestarch+5 | 58/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/03-MSAL-API-usage.md · 344 | Cline rules | styleapi | 58/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/04-Code-style-guidelines.md · 344 | Cline rules | stylearchtypestesting-strategy+4 | 69/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/05-feature-gating.md · 344 | Cline rules | stylearchdependenciesperformance+2 | 61/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/06-Customer-communication-guidelines.md · 344 | Cline rules | stylemonorepodo-notagent-behaviour | 51/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.clinerules/AGENTS.md · 344 | AGENTS.md | styleapi | 48/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.cursor/rules/ruler_cursor_instructions.mdc · 344 | Cursor rules | buildteststylearch+6 | 76/100 | 3 days ago | |
| AzureAD/microsoft-authentication-library-for-objc.github/copilot-instructions.md · 344 | Copilot instructions | setupbuildteststyle+11 | 64/100 | 3 days ago |
Diff against .clinerules/02-External-tenant-configuration.md Diff against CLAUDE.md Diff against .clinerules/01-Workforce-tenant-configuration.md Diff against .clinerules/03-MSAL-API-usage.md Diff against .clinerules/04-Code-style-guidelines.md Diff against .clinerules/05-feature-gating.md Diff against .clinerules/06-Customer-communication-guidelines.md Diff against .clinerules/AGENTS.md Diff against .cursor/rules/ruler_cursor_instructions.mdc Diff against .github/copilot-instructions.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| OnlyTerp/prompt-cache-skillsAGENTS.md · 112 | AGENTS.md | setupbuildtestlint-format+5 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 2 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago |
