192 lines
11 KiB
Markdown
192 lines
11 KiB
Markdown
# AGENTS.md
|
|
|
|
> Project instructions for AI agents.
|
|
|
|
Museion — the Agentic Writing Environment (AWE): a native SwiftUI macOS app where scholars, texts, and AI minds work under a single roof. Named for the Mouseion of Alexandria.
|
|
|
|
- **Stack**: native Xcode project (`Museion.xcodeproj` at repo root, filesystem-synchronized groups — disk is truth). SwiftUI on macOS 26.5+, latest Xcode/Swift only (ADR-0001). Swift language mode 6 with default MainActor isolation, tabs.
|
|
- **Forge**: Gitea @ git.babylondreams.de (`tea` CLI), CI via Gitea Actions (ADR-0003) — needs a self-hosted macOS runner.
|
|
- **License**: GPL-3.0-or-later (ADR-0002).
|
|
|
|
Commands:
|
|
|
|
```bash
|
|
open Museion.xcodeproj # develop in Xcode
|
|
./scripts/build-and-run.sh # build + launch from CLI (⌘R equivalent)
|
|
xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' build # build
|
|
xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' test # test (unit + UI)
|
|
swiftformat . && swiftlint . # lint (run --fix first if dirty)
|
|
```
|
|
|
|
# DOX framework
|
|
|
|
- DOX is highly performant AGENTS.md hierarchy installed here
|
|
- Agent must follow DOX instructions across any edits
|
|
|
|
## Core Contract
|
|
|
|
- AGENTS.md files are binding work contracts for their subtrees
|
|
- Work products, source materials, instructions, records, assets, and durable docs must stay understandable from the nearest applicable AGENTS.md plus every parent AGENTS.md above it
|
|
|
|
## Read Before Editing
|
|
|
|
1. Read the root AGENTS.md
|
|
2. Identify every file or folder you expect to touch
|
|
3. Walk from the repository root to each target path
|
|
4. Read every AGENTS.md found along each route
|
|
5. If a parent AGENTS.md lists a child AGENTS.md whose scope contains the path, read that child and continue from there
|
|
6. Use the nearest AGENTS.md as the local contract and parent docs for repo-wide rules
|
|
7. If docs conflict, the closer doc controls local work details, but no child doc may weaken DOX
|
|
|
|
Do not rely on memory. Re-read the applicable DOX chain in the current session before editing.
|
|
|
|
## Update After Editing
|
|
|
|
Every meaningful change requires a DOX pass before the task is done.
|
|
|
|
Update the closest owning AGENTS.md when a change affects:
|
|
|
|
- purpose, scope, ownership, or responsibilities
|
|
- durable structure, contracts, workflows, or operating rules
|
|
- required inputs, outputs, permissions, constraints, side effects, or artifacts
|
|
- user preferences about behavior, communication, process, organization, or quality
|
|
- AGENTS.md creation, deletion, move, rename, or index contents
|
|
|
|
Update parent docs when parent-level structure, ownership, workflow, or child index changes. Update child docs when parent changes alter local rules. Remove stale or contradictory text immediately. Small edits that do not change behavior or contracts may leave docs unchanged, but the DOX pass still must happen.
|
|
|
|
## Hierarchy
|
|
|
|
- Root AGENTS.md is the DOX rail: project-wide instructions, global preferences, durable workflow rules, and the top-level Child DOX Index
|
|
- Child AGENTS.md files own domain-specific instructions and their own Child DOX Index
|
|
- Each parent explains what its direct children cover and what stays owned by the parent
|
|
- The closer a doc is to the work, the more specific and practical it must be
|
|
|
|
## Child Doc Shape
|
|
|
|
- Create a child AGENTS.md when a folder becomes a durable boundary with its own purpose, rules, responsibilities, workflow, materials, or quality standards
|
|
- Work Guidance must reflect the current standards of the project or user instructions; if there are no specific standards or instructions yet, leave it empty
|
|
- Verification must reflect an existing check; if no verification framework exists yet, leave it empty and update it when one exists
|
|
|
|
Default section order:
|
|
- Purpose
|
|
- Ownership
|
|
- Local Contracts
|
|
- Work Guidance
|
|
- Verification
|
|
- Child DOX Index
|
|
|
|
## Style
|
|
|
|
- Keep docs concise, current, and operational
|
|
- Document stable contracts, not diary entries
|
|
- Put broad rules in parent docs and concrete details in child docs
|
|
- Prefer direct bullets with explicit names
|
|
- Do not duplicate rules across many files unless each scope needs a local version
|
|
- Delete stale notes instead of explaining history
|
|
- Trim obvious statements, repeated rules, misplaced detail, and warnings for risks that no longer exist
|
|
|
|
## Closeout
|
|
|
|
1. Re-check changed paths against the DOX chain
|
|
2. Update nearest owning docs and any affected parents or children
|
|
3. Refresh every affected Child DOX Index
|
|
4. Remove stale or contradictory text
|
|
5. Run existing verification when relevant
|
|
6. Report any docs intentionally left unchanged and why
|
|
|
|
## User Preferences
|
|
|
|
When the user requests a durable behavior change, record it here or in the relevant child AGENTS.md
|
|
|
|
- Never commit, push, or comment on the forge autonomously — explicit authorization each time.
|
|
- Development targets what the maintainer runs (latest Xcode/Swift, macOS 26.5+); never pin toolchain versions in CI or scripts.
|
|
|
|
## Child DOX Index
|
|
|
|
| Path | Scope |
|
|
| --- | --- |
|
|
| `Museion/AGENTS.md` | App target — SwiftUI app shell, assets, entitlements |
|
|
| `MuseionTests/AGENTS.md` | Swift Testing unit suite (hosted in the app) |
|
|
| `MuseionUITests/` | XCUITest smoke test — single file, no child doc yet |
|
|
| `docs/AGENTS.md` | Durable documentation — ADRs and their conventions |
|
|
| `ref/writing skills/AGENTS.md` | Bundled writing-skill set — the G3a payload seeded into the museion profile |
|
|
| `CONTEXT.md` | Binding project glossary — shared vocabulary for app, mentor, and docs |
|
|
|
|
## Agent skills
|
|
|
|
### Issue tracker
|
|
|
|
Issues live in Gitea Issues on git.babylondreams.de (this repo), worked via the `tea` CLI. See `docs/agents/issue-tracker.md`.
|
|
|
|
### Triage labels
|
|
|
|
Default five canonical roles, label string = role name. See `docs/agents/triage-labels.md`.
|
|
|
|
### Domain docs
|
|
|
|
Single-context: `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
|
|
|
|
<!-- gitnexus:start -->
|
|
# GitNexus — Code Intelligence
|
|
|
|
This project is indexed by GitNexus as **museion** (1308 symbols, 2519 relationships, 39 execution flows).
|
|
|
|
> Index stale? Run `node .gitnexus/run.cjs analyze --index-only` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? Bootstrap with `npx`, `bunx`, or `pnpm dlx` — e.g. `bunx gitnexus@latest analyze` (npm 11 npx crash; #1939).
|
|
|
|
## Always Do
|
|
|
|
- **MUST run impact before editing.** Use `impact({target: "symbolName", direction: "upstream"})` or `node .gitnexus/run.cjs impact "symbolName" --direction upstream --repo .`; report callers, processes, and risk. Never substitute grep for graph analysis.
|
|
- **MUST analyze graph changes before committing.** Use `detect_changes({scope: "all"})` (MCP) or `node .gitnexus/run.cjs detect-changes --scope all --repo .` (CLI fallback). `partial: true` or `truncated: true` is not a clean check — a zero means unseen, not unaffected; re-run it. For regression review: `detect_changes({scope: "compare", base_ref: "main"})` or `node .gitnexus/run.cjs detect-changes --scope compare --base-ref "main" --repo .`.
|
|
- MUST warn on HIGH/CRITICAL `risk` pre-edit; never use `riskSharedAxes` to waive a HIGH/CRITICAL `risk` warning. Compare File/symbol: MCP File omits axes; Graph-RAG expands File.
|
|
- **MUST treat `risk: UNKNOWN` as unresolved, not as low.** An empty caller set is not evidence the symbol is unused — it can also mean the callers are not resolvable by the index (plain-object property access, dynamic dispatch, cross-language calls). `impact` pairs `UNKNOWN` with a `riskNote` saying so. Confirm with a text search before treating the symbol as safe to change or delete; do not proceed on the strength of a zero.
|
|
- **MUST use `query({search_query: "concept"})` for concepts/flows, `context({name: "symbolName"})` for a named symbol, or `impact` for blast radius, on read-only callers, dependencies, imports, or execution flow.** Graph first; text search only for empty/`UNKNOWN`/literals.
|
|
- For security review, `explain({target: "fileOrSymbol"})` lists taint findings (source→sink flows; needs `analyze --pdg`).
|
|
|
|
## Never Do
|
|
|
|
- NEVER edit a function, class, or method before MCP/CLI impact analysis.
|
|
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis, and never read `UNKNOWN` as an all-clear — it means the walk could not answer, which is the one verdict that requires confirming by other means.
|
|
- NEVER rename symbols with find-and-replace — use `rename` which understands the call graph.
|
|
- NEVER commit before MCP/CLI graph change analysis.
|
|
|
|
## Resources
|
|
|
|
| Resource | Use for |
|
|
| --- | --- |
|
|
| `gitnexus://repo/museion/context` | Codebase overview, check index freshness |
|
|
| `gitnexus://repo/museion/clusters` | All functional areas |
|
|
| `gitnexus://repo/museion/processes` | All execution flows |
|
|
| `gitnexus://repo/museion/process/{name}` | Step-by-step execution trace |
|
|
|
|
## CLI
|
|
|
|
| Task | Read this skill file |
|
|
| --- | --- |
|
|
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus-exploring/SKILL.md` |
|
|
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus-impact-analysis/SKILL.md` |
|
|
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus-debugging/SKILL.md` |
|
|
| Rename / extract / split / refactor | `.claude/skills/gitnexus-refactoring/SKILL.md` |
|
|
| Tools, resources, schema reference | `.claude/skills/gitnexus-guide/SKILL.md` |
|
|
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus-cli/SKILL.md` |
|
|
|
|
<!-- gitnexus:end -->
|
|
|
|
## Session Logs
|
|
|
|
Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Full history: [`docs/devlog/INDEX.md`](docs/devlog/INDEX.md). The 10 most recent:
|
|
|
|
<!-- write-log: window-start -->
|
|
| Date | Log |
|
|
|------|-----|
|
|
| 2026-10-06 | [20261006-issue76-apex-html-reading_log.md](docs/devlog/20261006-issue76-apex-html-reading_log.md) |
|
|
| 2026-10-05 | [20261005-issue71-reading-toggle_log.md](docs/devlog/20261005-issue71-reading-toggle_log.md) |
|
|
| 2026-10-03 | [20261003-issue19-editor-core_log.md](docs/devlog/20261003-issue19-editor-core_log.md) |
|
|
| 2026-10-03 | [20261003-issue18-post-lifecycle_log.md](docs/devlog/20261003-issue18-post-lifecycle_log.md) |
|
|
| 2026-10-01 | [20261001-issue17-home-posts-list_log.md](docs/devlog/20261001-issue17-home-posts-list_log.md) |
|
|
| 2026-10-01 | [20261001-issue55-verdict-substrate-adr-0010_log.md](docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md) |
|
|
| 2026-09-25 | [20260925-issue50-profile-backup-s2-6_log.md](docs/devlog/20260925-issue50-profile-backup-s2-6_log.md) |
|
|
| 2026-09-16 | [20260916-issue14-acp-bridge-s2-2_log.md](docs/devlog/20260916-issue14-acp-bridge-s2-2_log.md) |
|
|
| 2026-09-05 | [20260905-issue48-provisioning-failure-alert-retry-ux_log.md](docs/devlog/20260905-issue48-provisioning-failure-alert-retry-ux_log.md) |
|
|
| 2026-09-03 | [20260903-issue42-engine-gate-s2-1_log.md](docs/devlog/20260903-issue42-engine-gate-s2-1_log.md) |
|
|
<!-- write-log: window-end -->
|