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
16 changes: 8 additions & 8 deletions AGENT_ROLES.md → .agents/roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file defines the runnable AI role workflow for DevLog work.

It is not background documentation. Use it to split work across AI models, pass task packets between roles, and decide which review or verification gates must run before completion.

Use `AGENT_WORKFLOWS.md` for task-specific runbooks that combine these roles into executable workflows.
Use `.agents/workflows.md` for task-specific runbooks that combine these roles into executable workflows.

`AGENTS.md` remains the canonical repository rule file. If this file conflicts with `AGENTS.md`, follow `AGENTS.md`.

Expand All @@ -18,7 +18,7 @@ Use `AGENT_WORKFLOWS.md` for task-specific runbooks that combine these roles int
- The main agent owns integration, final diff inspection, and the final user report.
- Build-only verification is allowed. Do not run, launch, install, boot, or open the app or Simulator unless the user explicitly requests it in the current turn.
- Keep generated Xcode workspace/project and `Package.resolved` churn out of source control unless an approved dependency-lock policy requires it.
- Keep AI workflow documents at the repository root, such as `AGENT_ROLES.md`. Do not put them under `docs/`.
- Keep AI workflow and rule documents under `.agents/`. Do not put them under `docs/`.

## Model assignment

Expand Down Expand Up @@ -97,7 +97,7 @@ Use this sequence for non-trivial AI-assisted work.

Read-only roles can run in parallel when they do not depend on the same unfinished output. Editing roles should run sequentially unless their assigned files and ownership boundaries are disjoint.

For full issue, implementation, review, CI, and docs-only runbooks, use `AGENT_WORKFLOWS.md`.
For full issue, implementation, review, CI, and docs-only runbooks, use `.agents/workflows.md`.

## Task packet

Expand Down Expand Up @@ -128,7 +128,7 @@ Use this template when assigning a `Lightweight` or `Fast` role through its conf
```md
You are the `<Role Name>` for the DevLog iOS repository.

Read `AGENTS.md` first. Then read `AGENT_ROLES.md` and follow the `<Role Name>` section.
Read `AGENTS.md` first. Then read `.agents/roles.md` and follow the `<Role Name>` section.

Assigned model tier: `<Lightweight | Fast>`
Custom agent: `<configured custom agent name>`
Expand All @@ -153,7 +153,7 @@ The receiving model must start by identifying its active role and must end with
| --- | --- | --- |
| Issue planning | Planner | Add GitHub/CI Analyst when live issue or PR state is the source of truth. |
| Swift implementation | Planner, Implementer, Code Reviewer, Verification Runner | Add Architecture Watcher when boundary or dependency risk exists. |
| Module, DI, SDK, Widget, StorePattern, or architecture docs | Planner, Architecture Watcher, Implementer, Code Reviewer, Verification Runner | Architecture Watcher must read `AGENTS.md`, `.gemini/styleguide.md`, `README.md`, and `.hermes/skills/devlog-architecture-harness/references/devlog-architecture-flow.md`. |
| Module, DI, SDK, Widget, StorePattern, or architecture docs | Planner, Architecture Watcher, Implementer, Code Reviewer, Verification Runner | Architecture Watcher must read `AGENTS.md`, `.gemini/styleguide.md`, `README.md`, and `.agents/rules/architecture.md`. |
| Review feedback | GitHub/CI Analyst, Planner, Implementer, Code Reviewer, Verification Runner | Use thread-aware review inspection when unresolved review threads matter. |
| CI failure | GitHub/CI Analyst, Planner, Verification Runner | Add Implementer only after the failure source is identified. |
| PR or release text | Documentation Writer | Add Code Reviewer when text must match actual diff. |
Expand Down Expand Up @@ -229,8 +229,8 @@ Must read before reviewing:
- `AGENTS.md`
- `.gemini/styleguide.md`
- `README.md`
- `.hermes/skills/devlog-architecture-harness/references/devlog-architecture-flow.md`
- `.hermes/skills/devlog-architecture-harness/references/devlog-workflow-rules.md` when PR, commit, Xcode project, CI, widget, Store, localization, release, or build tooling is involved
- `.agents/rules/architecture.md`
- `.agents/rules/project-workflows.md` when PR, commit, Xcode project, CI, widget, Store, localization, release, or build tooling is involved

Must inspect:

Expand Down Expand Up @@ -399,7 +399,7 @@ Before reporting completion:
### Docs-only AI workflow change

1. Planner creates a task packet from the issue.
2. Implementer edits `AGENTS.md` and `AGENT_ROLES.md`.
2. Implementer edits `AGENTS.md` and `.agents/roles.md`.
3. Code Reviewer checks whether the workflow is executable and scoped.
4. Verification Runner runs `git diff --check` and file-presence checks.
5. Main agent reports changed files, architecture boundary decision, and verification result.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
# DevLog Architecture Flow
# DevLog Architecture Rules

## Purpose

This reference defines the DevLog-specific harness flow for AI-assisted architecture work.
This reference defines the DevLog-specific flow and boundaries for AI-assisted architecture work.

The goal is not to make the AI decide more architecture policy. The goal is to make the AI stop before it makes project-specific architecture decisions that should be confirmed by the user.

Use this reference with `AGENTS.md` and `.hermes/skills/devlog-architecture-harness/SKILL.md`.
Use this reference with `AGENTS.md`, `.agents/rules/general.md`, and `.agents/roles.md`.

This repository is a Tuist-generated, workspace-based modular iOS app. There is no root `Package.swift`; module projects are generated from `Workspace.swift` and each module's `Project.swift`.

## High-level harness flow
## When to use

Read this file before work that changes any of these areas:

- Module boundaries or file ownership across `Application/*` and `Widget/*` targets.
- Swift imports or Tuist target dependencies.
- DI assembler wiring or same-layer dependency injection.
- Repository, service, store, or use case contracts.
- Firebase, social login, network, link metadata, notification, or WidgetKit dependency placement.
- Widget snapshot, App Group, or widget deep-link data flow.
- Architecture diagrams, README architecture text, or PR architecture explanations.

Before editing, also read `.gemini/styleguide.md` and `README.md`. Read `.agents/rules/project-workflows.md` when the task involves PR review, commits, Xcode project files, CI, widgets, Store reducers, localization, release, or build tooling.

Then inspect the concrete files, Swift imports, and Tuist target dependencies related to the requested change. Do not rely on layer names alone.

## Mandatory flow

1. Identify the changed layer and owning target before editing.
2. Inspect the current Swift import direction and Xcode target/framework dependency before deciding.
3. Classify the change as mechanical, architectural, or ambiguous.
4. Stop and ask the user before editing when the architecture boundary is ambiguous.
5. Keep the diff limited to the requested architecture scope.
6. Follow `.agents/rules/project-workflows.md` for verification after Swift or iOS project changes.
7. Report the changed files, architecture decision, verification result, and unresolved user decisions.

## Safe mechanical changes

These may proceed after inspection when they do not change architecture meaning:

- Removing unused imports.
- Updating import statements after an already-approved file move.
- Fixing access control needed by an already-approved module boundary.
- Updating tests to match an already-approved public contract.
- Editing docs to reflect the current verified architecture.

## High-level architecture flow

```mermaid
flowchart TD
Expand Down Expand Up @@ -309,7 +345,7 @@ Widget UI should consume snapshot data. It should not fetch app services or doma
flowchart TD
Changed["Files changed"]
Swift{"Swift/iOS project code changed?"}
Docs{"Docs or harness only?"}
Docs{"Docs or architecture rules only?"}
Xcode["Build with Xcode Local MCP"]
Diff["Inspect git diff scope"]
NoBuild["No iOS build required"]
Expand Down Expand Up @@ -346,4 +382,4 @@ Before editing architecture code, the AI should be able to answer these question
- Swift logic was preserved unless explicitly approved.
- Diff scope was checked.
- Xcode Local MCP build was used for Swift/iOS code changes.
- Docs-only or harness-only changes were reported as such, without claiming app build verification.
- Docs-only or architecture-rule-only changes were reported as such, without claiming app build verification.
31 changes: 31 additions & 0 deletions .agents/rules/general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# DevLog General Agent Rules

## Logic preservation and optimization

- Reuse the existing program logic as-is whenever possible.
- Change logic only when the new approach produces exactly the same result and strictly improves time or space complexity.
- If there is no clear complexity improvement, keep the original logic.

## Code modification response style

- When asked to modify code, return only the precise changed locations and the modified code for those locations.
- Do not include full files, unrelated code, or explanatory text unless explicitly requested.
- You do not need to paste code in the prompt after updating it in the repository.

## Naming and Swift style

- In Swift, do not write explicit type annotations unless required.
- Use `opfic` in new Swift file headers.
- Prefer `<` and `<=` over `>` and `>=` when writing comparisons, if the condition can be expressed clearly that way.

## Documentation placement

- Keep AI workflow and rule documents under `.agents/`.
- Keep `docs/` for README images and draw.io sources.
- Do not add AI workflow documents under `docs/`.

## Repository-local rules

- DevLog-specific working rules belong in this repository, not in global agent memory.
- Treat `AGENTS.md` and the routed `.agents/` documents as the canonical DevLog AI working rules.
- If global memory conflicts with this repository, follow the repository.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This reference holds DevLog-specific working rules that should live with the pro

## Canonical source

- Treat this repository's `AGENTS.md` and `.hermes/skills/devlog-architecture-harness` as the canonical DevLog working rules.
- Treat this repository's `AGENTS.md` and routed `.agents/` documents as the canonical DevLog working rules.
- Use global memory only as historical context. If global memory conflicts with this repository, follow the repository.
- Before changing architecture rules, update the repository-local rules first.

## Verification

- Follow `AGENTS.md` for the canonical lint and build verification policy.
- Treat this section as the canonical lint and build verification policy routed by `AGENTS.md`.
- Run Homebrew SwiftLint (`swiftlint`) on changed Swift files.
- Lint production Swift files with the applicable source `.swiftlint.yml` config.
- Lint test Swift files with `.swiftlint-tests.yml` or the module `Tests/.swiftlint.yml` that inherits from it. Do not use the root production config for tests.
Expand Down Expand Up @@ -43,6 +43,11 @@ This reference holds DevLog-specific working rules that should live with the pro

## Commit guidance

- Commit messages must start with a short prefix used by recent local commits, such as `feat`, `fix`, `refactor`, `chore`, `test`, `docs`, `ui`, or `rollback`.
- Write commit message prose in Korean.
- Keep implementation names such as `ToastPresenter`, `toastHost`, `MainView`, `Presentation`, file paths, commands, branch names, and commit hashes in their original form.
- Do not translate implementation names into Korean unless the user explicitly asks for a user-facing Korean label.
- Do not write a commit message body.
- If the user says they will commit or asks only for a commit message, provide commit-message guidance instead of committing.
- Before proposing a commit message, inspect the actual diff and recent `git log`.
- When recent history contains GitHub merge commits, do not infer commit-message style from merge subjects such as `[#123] ... (#456)`. Open the merge commit with `git show --no-patch --format=full <merge-commit>` and use the individual commit messages in the body, or inspect nearby non-merge commits.
Expand Down
36 changes: 19 additions & 17 deletions AGENT_WORKFLOWS.md → .agents/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

This file defines executable AI workflows for DevLog work.

Use this after reading `AGENTS.md` and `AGENT_ROLES.md`. `AGENT_ROLES.md` defines what each role may do. This file defines how to combine those roles for common project tasks.
Use this after reading `AGENTS.md` and `.agents/roles.md`. `.agents/roles.md` defines what each role may do. This file defines how to combine those roles for common project tasks.

If this file conflicts with `AGENTS.md`, follow `AGENTS.md`.

## Main-agent protocol

The main agent must run every workflow with this protocol.

1. Read `AGENTS.md`, then `AGENT_ROLES.md`, then this file.
1. Read `AGENTS.md`, then `.agents/roles.md`, then this file.
2. Select one workflow from this file.
3. Create the task packet.
4. Assign only the roles required by the selected workflow.
5. Assign each role a model tier from `AGENT_ROLES.md`.
6. Keep `Primary` roles with the active main agent, and dispatch every `Lightweight` or `Fast` role through the custom agent mapped in `AGENT_ROLES.md`.
5. Assign each role a model tier from `.agents/roles.md`.
6. Keep `Primary` roles with the active main agent, and dispatch every `Lightweight` or `Fast` role through the custom agent mapped in `.agents/roles.md`.
7. Dispatch read-only `Lightweight` or `Fast` roles in parallel only when they do not depend on unfinished edits.
8. Do not complete a required `Lightweight` or `Fast` role directly in `Primary`, including when the dispatch tool would inherit the active `Primary` model.
9. Keep `Primary` editing roles sequential unless the files and ownership boundaries are disjoint.
Expand Down Expand Up @@ -50,7 +50,7 @@ Stop and ask the user before editing when:
| PR review comment, unresolved thread, requested changes | Review-thread follow-up |
| Failing GitHub Actions, CI log, workflow failure | CI failure triage |
| PR body, release note, README, issue wording | Documentation-only writing |
| AI role, AGENTS, workflow, harness docs | AI workflow maintenance |
| AI role, AGENTS, workflow, or architecture-rule docs | AI workflow maintenance |

## Issue-driven implementation

Expand Down Expand Up @@ -262,7 +262,7 @@ Report:

## AI workflow maintenance

Use for `AGENTS.md`, `AGENT_ROLES.md`, this file, `.hermes` harness relationship, or AI role routing changes.
Use for `AGENTS.md`, `.agents/roles.md`, this file, `.agents/rules`, or AI role routing changes.

### Role order

Expand All @@ -271,23 +271,25 @@ Use for `AGENTS.md`, `AGENT_ROLES.md`, this file, `.hermes` harness relationship
3. Code Reviewer.
4. Verification Runner.

Architecture Watcher is required only if the change modifies architecture policy, layer maps, ambiguity gates, or harness architecture rules.
Architecture Watcher is required only if the change modifies architecture policy, layer maps, ambiguity gates, or architecture rules.

### Execution

- Keep AI workflow entry files at the repository root.
- Keep `AGENTS.md` as the repository-root AI workflow entrypoint.
- Do not add AI workflow documents under `docs/`.
- `AGENTS.md` should stay the short canonical entrypoint.
- `AGENT_ROLES.md` should define role permissions, output formats, and handoff packet shape.
- `AGENT_WORKFLOWS.md` should define executable role sequences.
- `.hermes/skills/devlog-architecture-harness` may remain as the detailed architecture reference unless the task explicitly removes or replaces it.
- `.agents/roles.md` should define role permissions, output formats, and handoff packet shape.
- `.agents/workflows.md` should define executable role sequences.
- `.agents/rules/general.md` should define general logic preservation, response style, and Swift coding rules.
- `.agents/rules/architecture.md` should define detailed architecture boundaries and ambiguity gates.
- `.agents/rules/project-workflows.md` should define project-specific verification and delivery rules.
Comment thread
opficdev marked this conversation as resolved.

### Verification

Verification Runner must run:

```sh
git diff --check -- AGENTS.md AGENT_ROLES.md AGENT_WORKFLOWS.md
git diff --check -- AGENTS.md .agents .codex/agents
```

If only Markdown workflow files changed, no iOS build is required.
Expand Down Expand Up @@ -323,7 +325,7 @@ Do not parallelize:

## Role prompt snippets

Use the activation template from `AGENT_ROLES.md`, then set `<Role Name>` to one of:
Use the activation template from `.agents/roles.md`, then set `<Role Name>` to one of:

- `Planner`
- `Implementer`
Expand All @@ -345,14 +347,14 @@ Include the selected workflow name in the task packet `Source` or `Goal` field s
- Source: https://github.com/opficdev/DevLog_iOS/issues/704
- Goal: Define AI agent roles and executable role-based workflows for this repository.
- Scope: Update root AI workflow files and README visual summary only.
- Out of scope: Swift/iOS app code, target dependency changes, `.hermes` removal, GitHub Actions changes, app launch.
- Expected changed files: `AGENTS.md`, `AGENT_ROLES.md`, `AGENT_WORKFLOWS.md`, `README.md`
- Out of scope: Swift/iOS app code, target dependency changes, architecture rule relocation, GitHub Actions changes, app launch.
- Expected changed files: `AGENTS.md`, `.agents/roles.md`, `.agents/workflows.md`, `README.md`
- Current owner: repository workflow documentation
- Architecture risk: none
- Required roles: Planner, Implementer, Code Reviewer, Verification Runner
- Model assignment: Planner=Primary, Implementer=Primary, Code Reviewer=code_reviewer (Lightweight), Verification Runner=verification_runner (Lightweight)
- Verification: `git diff --check -- AGENTS.md AGENT_ROLES.md AGENT_WORKFLOWS.md README.md`
- Stop conditions: README `docs/` asset policy changes, Swift/iOS code changes, request to remove architecture harness immediately
- Verification: `git diff --check -- AGENTS.md .agents .codex/agents README.md`
- Stop conditions: README `docs/` asset policy changes, Swift/iOS code changes, request to remove architecture rules immediately
```

### Review-thread follow-up example
Expand Down
6 changes: 3 additions & 3 deletions .codex/agents/architecture_watcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Read AGENTS.md and AGENT_ROLES.md before reviewing.
Act only as the Architecture Watcher defined in AGENT_ROLES.md.
Read AGENTS.md and .agents/roles.md before reviewing.
Act only as the Architecture Watcher defined in .agents/roles.md.
Inspect the requested architecture scope and relevant manifests without editing files or changing GitHub state.
Do not run, launch, install, boot, or open the app or Simulator.
Return exactly the Architecture Watch Result format from AGENT_ROLES.md.
Return exactly the Architecture Watch Result format from .agents/roles.md.
"""
6 changes: 3 additions & 3 deletions .codex/agents/code_reviewer.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ model = "gpt-5.3-codex-spark"
model_reasoning_effort = "medium"
sandbox_mode = "read-only"
developer_instructions = """
Read AGENTS.md and AGENT_ROLES.md before reviewing.
Act only as the Code Reviewer defined in AGENT_ROLES.md.
Read AGENTS.md and .agents/roles.md before reviewing.
Act only as the Code Reviewer defined in .agents/roles.md.
Review the assigned diff without editing files, staging changes, committing, pushing, or changing GitHub state.
Prioritize correctness, regressions, architecture drift, scope drift, and missing tests over style preferences.
Return exactly the Code Review Result format from AGENT_ROLES.md with file and line references when possible.
Return exactly the Code Review Result format from .agents/roles.md with file and line references when possible.
"""
Loading
Loading