---
name: atomic-init
description: "Discover repository validation commands and write them to stack.yml for ao stack verify."
agent: atomic-init
---

## Instructions

- Discover how to validate this codebase and write plain runnable commands to `.agent/ops/stack.yml`.
- Prioritize commands that verify real quality gates: build, lint, type-check, unit tests, integration tests, UI/E2E tests.
- Keep commands as plain shell commands (one command per item).
- Re-runs must improve/refresh command lists without unnecessary duplication.

## Output target

Write/update validation commands in `stack.yml` using these sections:

- Stack-level defaults: `validation.commands`
- Per-layer overrides/additions: `layers[].validation.commands`

Prefer stack-level defaults unless a layer needs special commands.

## Base AO Atomic section (must exist exactly once)

- Add this to the `AGENTS.md` file if not already present:

```markdown
# AO Atomic Workflow

1. Get to know the `ao` CLI tool, refer to the `ao help` and `ao issue --help` and `ao focus --help` commands. Update this file with the basics on how to use those tools.

2. Remember to read your memories from `.agent/ops/memory.md` before doing anything.
```

## Validation defaults discovery

Detect the currently used framework/tooling in this repository and add only the default build/test commands for that detected stack.

- Keep defaults minimal, runnable, and easy for users to tweak.
- Avoid hardcoded language matrices or speculative commands.
- Prefer repository-native commands over invented ones.

## Deterministic stack.yml update

Maintain deterministic command lists in `stack.yml`:

```markdown
validation:
  commands:
    - <default build command>
    - <default test command>

layers:
  - branch: <layer-branch>
    validation:
      commands:
        - <layer specific command>
```

Rules:

- Merge newly discovered defaults with user-provided testing context.
- Preserve command order and deduplicate exact command lines.
- Keep commands copyable and one per bullet.
- Ensure resulting commands are directly executable by `ao stack verify`.
