Skip to content

Add agent-agnostic AI skill structure with Docs/ reference guides#14

Open
amccall-mindera wants to merge 3 commits into
mainfrom
task/harmonise-ai-agent-skills
Open

Add agent-agnostic AI skill structure with Docs/ reference guides#14
amccall-mindera wants to merge 3 commits into
mainfrom
task/harmonise-ai-agent-skills

Conversation

@amccall-mindera

Copy link
Copy Markdown
Contributor

Summary

Introduces a fully tool-agnostic AI agent structure for the Android repo, consistent with Alfie-iOS and Alfie-Flutter.

Changes

New files

  • AGENTS.md — repo root source of truth (agents table, critical rules, pointers to Docs/)
  • .ai/agents/ — 7 standardised agents: feature-orchestrator, feature-developer, graphql-specialist, localization-specialist, security-specialist, spec-writer, testing-specialist
  • Docs/ — 7 reference guides extracted from copilot-instructions.md:
    • Architecture.md, GraphQL.md, Localization.md
    • CodeStyle.md, Testing.md, Development.md, QuickReference.md

Modified

  • .github/copilot-instructions.md → slimmed to 5-line stub pointing to AGENTS.md

Why

Mirrors the structure established in Alfie-iOS (PR #62). All content is preserved — just reorganised so any AI tool (GitHub Copilot, Claude, Cursor, or any AGENTS.md-compatible tool) loads minimal context by default and reads detailed guides on-demand.

- Create AGENTS.md at repo root as tool-agnostic source of truth
- Create Docs/ with 7 reference guides extracted from copilot-instructions.md:
  Architecture.md, GraphQL.md, Localization.md, CodeStyle.md,
  Testing.md, Development.md, QuickReference.md
- Add 7 standardised .ai/agents/ files:
  feature-orchestrator, feature-developer, graphql-specialist,
  localization-specialist, security-specialist, spec-writer, testing-specialist
- Slim .github/copilot-instructions.md to a 5-line stub referencing AGENTS.md
- Update all agent reference links to point to Docs/ files

Agents are now named and structured consistently with Alfie-iOS and Alfie-Flutter.
Agents located in .ai/agents/ for tool-agnostic compatibility (works with
GitHub Copilot, Claude, Cursor, and any AGENTS.md-compatible tool).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@amccall-mindera amccall-mindera force-pushed the task/harmonise-ai-agent-skills branch from ece27dd to d98fb82 Compare May 1, 2026 11:21
- feature-developer: use UseCaseResult.Success/Error (not Result.success/failure) to match project pattern; add model/ directory to module structure tree
- testing-specialist: update mock stub to return UseCaseResult.Success to match UseCase return type
- feature-orchestrator: fix phase dependency diagram — Phase 2 (security review) requires Phase 1 (spec) to complete first

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@amccall-mindera amccall-mindera marked this pull request as ready for review May 13, 2026 21:54
Copilot AI review requested due to automatic review settings May 13, 2026 21:54
@amccall-mindera amccall-mindera enabled auto-merge May 13, 2026 21:54

Copilot AI 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.

Pull request overview

This PR restructures the repo’s AI-assistant guidance into an agent-agnostic format (root AGENTS.md + .ai/agents/*) and extracts the previously large Copilot instruction set into dedicated reference docs under Docs/, leaving .github/copilot-instructions.md as a lightweight pointer for compatibility.

Changes:

  • Add AGENTS.md plus 7 standardized agent definition files under .ai/agents/.
  • Add 7 reference guides under Docs/ (Architecture, GraphQL, Localization, CodeStyle, Testing, Development, QuickReference).
  • Replace the existing .github/copilot-instructions.md with a stub that points to AGENTS.md.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
AGENTS.md Root “source of truth” for agent usage, critical rules, and links to detailed guides.
.github/copilot-instructions.md Stub Copilot instructions redirecting to AGENTS.md.
Docs/Architecture.md Clean Architecture / MVVM / navigation reference guide extracted into Docs/.
Docs/CodeStyle.md Compose + Hilt + Detekt + conventions reference guide extracted into Docs/.
Docs/Development.md Development workflow + verification + CI/CD reference guide extracted into Docs/.
Docs/GraphQL.md GraphQL/Apollo Kotlin integration guide extracted into Docs/.
Docs/Localization.md Strings/plurals naming and usage guide extracted into Docs/.
Docs/QuickReference.md “Things to avoid”, key directories/deps, review checklist, and context quick lookup.
Docs/Testing.md JUnit5/MockK/Turbine patterns and coverage guidance extracted into Docs/.
.ai/agents/feature-orchestrator.agent.md Defines the multi-phase orchestration workflow and delegation templates.
.ai/agents/feature-developer.agent.md Implementation guidance for feature work (Compose + MVVM + Hilt).
.ai/agents/graphql-specialist.agent.md Guidance for GraphQL operations, mappers, and service patterns.
.ai/agents/localization-specialist.agent.md Guidance for string resources, naming conventions, and plurals.
.ai/agents/security-specialist.agent.md Security review/audit checklist and remediation guidance.
.ai/agents/spec-writer.agent.md Spec authoring workflow and required sections for feature specs.
.ai/agents/testing-specialist.agent.md Test authoring workflow and patterns for ViewModels/use cases/mappers.
Comments suppressed due to low confidence (2)

Docs/Testing.md:76

  • This use case test snippet uses assertThat(...).isInstanceOf(...), but the codebase’s tests predominantly use kotlin.test assertions (assertIs, assertEquals, etc.). Consider updating the example to match existing test conventions to avoid introducing an additional assertion library expectation.
    fun `given repository returns brands when invoked then returns success`() = runTest {
        val brands = listOf(Brand(id = "1", name = "Test Brand"))
        coEvery { brandRepository.getBrands() } returns RepositoryResult.Success(brands)

        val result = useCase()

        assertThat(result).isInstanceOf(UseCaseResult.Success::class.java)
    }

Docs/Architecture.md:113

  • In this when example, HomeUIState.Loaded is defined with homeUI, but the snippet calls LoadedContent(state.data) (no data property). This won’t compile as written and is inconsistent with the UI state definition just above. Update it to reference the correct property (e.g. state.homeUI) or bind when (val s = state) and use s.homeUI.
    when (state) {
        is HomeUIState.Loading -> LoadingContent()
        is HomeUIState.Loaded -> LoadedContent(state.data)
        is HomeUIState.Error -> ErrorContent()
    }

Comment thread Docs/Testing.md
Comment on lines +36 to +41
fun `given success when loadData then emits Content`() = runTest {
coEvery { getFeatureUseCase() } returns Result.success(mockData)
viewModel.loadData()
viewModel.uiState.test {
assertThat(awaitItem()).isInstanceOf(FeatureUIState.Content::class.java)
}
Comment thread Docs/GraphQL.md
Comment on lines +59 to +67
```kotlin
internal class ProductService @Inject constructor(
private val apolloClient: ApolloClient
) {
suspend fun getProduct(productId: String): Result<GetProductQuery.Product> =
apolloClient.query(GetProductQuery(productId))
.execute()
.mapData { it.product }
}
Comment on lines +20 to +35
## Example Pattern

**Query** (`network/src/main/graphql/GetProduct.graphql`):
```graphql
query GetProduct($id: String!) {
product(id: $id) { ...ProductFields }
}
```

**Fragment** (`network/src/main/graphql/fragment/ProductFields.graphql`):
```graphql
fragment ProductFields on Product {
id name brand
price { amount currency }
}
```
Comment on lines +33 to +40
├── di/<Name>Module.kt # Hilt @Module
├── presentation/
│ ├── <Name>Screen.kt # @Destination Composable
│ ├── <Name>ViewModel.kt # @HiltViewModel + StateFlow
│ ├── <Name>UIFactory.kt # Maps domain model → UI model
│ └── model/
│ ├── <Name>UI.kt # UI data model
│ └── <Name>UIState.kt # Sealed interface for states
Comment thread Docs/QuickReference.md Outdated
- **Firebase**: Analytics, Crashlytics, Remote Config (BOM 32.7.3)
- **DataStore**: Preferences storage (v1.1.2)
- **Room**: Local database (if needed)
- **Timber**: Logging (latest)
Comment thread Docs/Architecture.md
#### Data Layer
- **Location**: `data/src/main/java/au/com/alfie/ecomm/data/`
- **Purpose**: Data sources, repositories implementation, DTOs, and data mapping
- **Pattern**: Repository pattern with protocol-based interfaces
Comment thread Docs/Development.md Outdated
### Phase Dependencies

```
Phases 1-4 (parallel) --> Phase 5 --> Phase 6 --> Phase 7 --> Phase 8
Comment thread Docs/CodeStyle.md
**Example Usage**:
```kotlin
Text(
text = "Hello",
Comment thread Docs/Architecture.md Outdated
is UseCaseResult.Success -> _state.value = HomeUIState.Loaded(
uiFactory(result.data)
)
is UseCaseResult.Error -> _state.value = HomeUIState.Error
Comment on lines +18 to +36
## ViewModel Test Pattern

```kotlin
@ExtendWith(MockKExtension::class)
class FeatureViewModelTest {
@MockK private lateinit var getFeatureUseCase: GetFeatureUseCase
private lateinit var viewModel: FeatureViewModel

@BeforeEach
fun setUp() { viewModel = FeatureViewModel(getFeatureUseCase) }

@Test
fun `given success when loadData then emits Content`() = runTest {
coEvery { getFeatureUseCase() } returns UseCaseResult.Success(mockData)
viewModel.loadData()
viewModel.uiState.test {
assertThat(awaitItem()).isInstanceOf(FeatureUIState.Content::class.java)
}
}
- Docs/Development.md: fix phase dependency diagram (Phase 1 precedes 2-4)
- Docs/Testing.md + testing-specialist.agent.md: use UseCaseResult.Success and assertIs instead of Result.success and assertThat().isInstanceOf()
- Docs/GraphQL.md: fix service pattern to use GraphService + unwrap() matching repo convention
- graphql-specialist.agent.md: fix query/fragment file paths to match repo structure
- AGENTS.md: remove reference to non-existent Docs/Specs/Features path
- security-specialist.agent.md: remove circular reference to QuickReference
- Docs/Architecture.md: add missing message param to HomeUIState.Error example
- Docs/QuickReference.md: pin Timber version to v5.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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