agentleFS
wesleysimpliciowesleysimplicio/PiAPI-Skills/AGENTS.md

PiAPI-Skills

AGENTS.md6 starsChanged 7 months agoMITView on GitHub

Master instruction file lido por Claude Code, Codex CLI, GitHub Copilot, Hermes Agent (Nous Research), OpenClaw, Cursor, Aider e qualquer outro agent que respeite o padrão AGENTS.md. É o contrato entre humano e IA neste repositório. Mudou algo aqui? Reflete em CLAUDE.md e .github/copilot-instructions.md (mantém os três alinhados ou usa symlink). Este arquivo dá ao agent tudo que ele precisa saber pra entregar uma task sem perguntar: stack, comandos, fluxo de trabalho, padrões, proibições, skills disponíveis e atalhos. Lê ele…

  • Reads credentials
  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 1 is common, 1 is distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test runner unit: dotnet (sugestão: Vitest, Jest, pytest, xUnit)

    line 20
  2. Very specific:

    Test runner E2E: Playwright (config em playwright.config.ts)

    line 21
  3. Distinctive:

    Pergunta apenas em ambiguidade real: do pedido. Não pergunta pra confirmar trabalho de execução.

    line 218
  4. Very specific:

    Before coding, read this file, PRD.md, PROGRESS.md when it exists, README.md, project manifests, tests, and the relevant source folders.

    line 230
  5. Very specific:

    Stop only when the requested work is complete, validation is documented, and GOAL_RESULT.md reflects the outcome.

    line 232
  6. Common:

    Do not rewrite unrelated architecture, fake successful validation, expose secrets, or push without explicit operator instruction for the …

    line 233
  7. Very specific:

    Use o repo canonico https://github.com/wesleysimplicio/yool-tuple-hamt.

    line 236

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Master instruction file lido por Claude Code, Codex CLI, GitHub Copilot, Hermes Agent (Nous Research), OpenClaw, Cursor, Aider e qualquer outro agent que respeite o padrão AGENTS.md. É o contrato entre humano e IA neste repositório.

Mudou algo aqui? Reflete em CLAUDE.md e .github/copilot-instructions.md (mantém os três alinhados ou usa symlink).

Este arquivo dá ao agent tudo que ele precisa saber pra entregar uma task sem perguntar: stack, comandos, fluxo de trabalho, padrões, proibições, skills disponíveis e atalhos. Lê ele inteiro antes de escrever a primeira linha de código.


Stack

dotnet (placeholder — substitui pela stack real do projeto, ex: Node.js 20 + TypeScript + Next.js 14 + Playwright + Vitest).

Detalhes completos:

  • Linguagem principal: dotnet
  • Framework web/API: dotnet
  • Banco de dados: dotnet
  • Test runner unit: dotnet (sugestão: Vitest, Jest, pytest, xUnit)
  • Test runner E2E: Playwright (config em playwright.config.ts)
  • Linter/formatter: dotnet (sugestão: ESLint + Prettier, Ruff, dotnet format)
  • CI/CD: GitHub Actions (ver .github/workflows/)
  • Deploy: dotnet (Vercel/Netlify/Docker/Azure/AWS — ver .specs/workflow/RELEASE.md)

Antes de adicionar dependência nova: pergunta ao usuário. Sem exceção.


Comandos importantes

# instalação / provisionamento
bash install.sh --yes                                  # instala venv + shim + skills em todos os hosts
bash install.sh --yes --agents claude,codex            # apenas hosts escolhidos
bash install.sh --uninstall                            # remove venv, shim e skills

# uso da CLI (após install)
export PIAPI_API_KEY="..."                             # obrigatório
piapi-cli --help                                       # lista subcomandos
piapi-cli models                                       # mostra catálogo
piapi-cli imagine "prompt" --wait                      # Midjourney imagine + aguarda terminal
piapi-cli flux --model flux-schnell --prompt "..."     # Flux txt2img
piapi-cli kling --task-type txt2video --prompt "..."   # Kling vídeo
piapi-cli suno --prompt "..."                          # Suno música
piapi-cli faceswap --target ... --source ...           # Faceswap (target_index 0-based)
piapi-cli llm --model claude-3-5-sonnet --prompt "..." # LLM gateway OpenAI-compat
piapi-cli submit --model X --task-type Y --input '{}'  # envelope genérico
piapi-cli result <task_id>                             # buscar resultado
piapi-cli wait <task_id> --timeout 600                 # esperar terminal
piapi-cli verify-webhook --secret X --received Y       # constant-time compare

# qualidade local (sem deps extras além do venv do install)
ruff check cli/                                        # lint
ruff format --check cli/                               # format check
python -m py_compile cli/cli.py                        # smoke compile
shellcheck install.sh cli/piapi-cli                    # shell lint
mypy cli/cli.py                                        # type-check (escopo: cli.py)

# git/PR
git checkout -b feat/<slug>
gh pr create --fill                                    # template de PR
gh run watch                                           # acompanha CI do branch

Não há npm, pnpm, dotnet, Playwright, Jest, Vitest neste repo — é Python 3.10+ single-file. CI valida em Ubuntu/macOS × Python 3.10/3.11/3.12 (.github/workflows/ci.yml).


Workflow loop OBRIGATÓRIO

Toda task técnica passa por esses passos. Não pula etapa.

  1. Ler task — abre arquivo em .specs/sprints/sprint-XX/<task-id>.task.md. Lê contexto + acceptance criteria + test plan + DoD.
  2. Planejar — escreve plano interno curto: o que muda, quais arquivos, como verificar, efeitos colaterais. Se task ambígua → pergunta antes de codar.
  3. Carregar contexto — lê .specs/architecture/PATTERNS.md + ADRs relevantes em .specs/architecture/ADR-*.md. Verifica skills aplicáveis em .skills/.
  4. Editar — aplica edits cirúrgicos. Só toca o que a task pede. Sem refactor extra, sem renomeação, sem comentário a mais.
  5. Lint — npm run lint. Vermelho = corrige antes de seguir.
  6. Unit — npm test. Vermelho = corrige antes de seguir. Coverage do diff >= 80%.
  7. E2E — npx playwright test. Captura screenshot/trace/video. Vermelho = corrige.
  8. Fix loop — se qualquer etapa falhou: volta ao passo 4. Repete até verde.
  9. Commit — Conventional Commits (feat:, fix:, chore:, docs:, refactor:, test:). Mensagem em inglês. Body explica why, não what.
  10. PR — gh pr create. Preenche template inteiro: link da task, evidências (screenshots Playwright), checklist DoD marcado.

Definition of Done

PR só faz merge quando todos os itens abaixo estão marcados:

  • Unit tests passam (npm test verde)
  • Lint passa (npm run lint verde)
  • E2E Playwright passa com evidência anexada (screenshot, trace ou video em playwright-report/)
  • Coverage do diff >= 80%
  • Acceptance Criteria da task: todos os checkboxes marcados
  • PR template preenchido (link task + descrição + evidências)
  • Conventional commit no merge
  • ADR criado em .specs/architecture/ se mudou decisão arquitetural
  • Changelog atualizado se release-relevant
  • Sem warning novo no console
  • Sem console.log / print / Debug.WriteLine deixado pra trás
  • Sem TODO sem dono e sem prazo

CI bloqueia merge se DoD falhar (.github/workflows/dod.yml).


Padrões de código

Padrões completos em .specs/architecture/PATTERNS.md. Resumo:

  • Naming, estrutura de pastas, criação de endpoint/componente/teste, tratamento de erro, logging, validação — tudo lá.
  • Decisões irreversíveis viram ADR em .specs/architecture/ADR-XXX-*.md (template em .specs/architecture/ADR-template.md).
  • Antes de escrever código novo: lê PATTERNS.md da seção relevante. Não inventa estilo próprio.

Onde encontrar contexto

PerguntaOnde olha
Por que esse produto existe?.specs/product/VISION.md
Quem é o usuário?.specs/product/PERSONAS.md
Quais entidades de negócio?.specs/product/DOMAIN.md
Como o sistema é desenhado?.specs/architecture/DESIGN.md
Como escrever código aqui?.specs/architecture/PATTERNS.md
Por que decidimos X?.specs/architecture/ADR-*.md
Como faço PR/branch/release?.specs/workflow/WORKFLOW.md, RELEASE.md, CONTRIBUTING.md
O que tá no backlog?.specs/sprints/BACKLOG.md
Sprint atual?.specs/sprints/sprint-XX/SPRINT.md
Tasks abertas?.specs/sprints/sprint-XX/*.task.md
Skills/capacidades reutilizáveis?.skills/README.md + .skills/*/SKILL.md

Proibido

Lista negra. Nada aqui é negociável.

  • Pular testes — sem unit/E2E = sem merge.
  • Mockar pra fazer passar — mock só pra isolar dependência externa real (HTTP, DB), nunca pra esconder falha.
  • Commit com vermelho — lint/test falhando = não commita. Hook .claude/hooks/pre-commit.sh bloqueia.
  • Ignorar ADR — decisão registrada em ADR é lei. Reverter/mudar ADR exige novo ADR ("Supersedes ADR-XXX").
  • Adicionar dependência sem perguntar — toda nova dep (npm install, dotnet add, etc.) passa por confirmação humana.
  • Editar arquivo não lido — lê antes de editar. Sempre.
  • Refactor escondido em PR de feature — refactor = PR separado.
  • Force push em main/master — bloqueado por hook e por settings do repo.
  • Commitar segredo — .env, token, key, senha → nunca. Usa .gitignore + secrets manager.
  • Reformatar arquivo inteiro num PR pequeno — diff polui review.

Skills disponíveis

Skills moram em .skills/<nome>/SKILL.md e são capacidades reutilizáveis que o agent invoca quando o trigger casa. Lista atual:

  • playwright-e2e — como escrever teste Playwright neste projeto. Trigger: nova feature de UI ou fluxo end-to-end. Cobre fixtures, page objects, evidências (trace/screenshot/video) e padrões de assert.
  • conventional-commits — regras de commit (feat:, fix:, chore:, docs:, refactor:, test:, perf:, style:, ci:, build:). Trigger: hora de commitar. Inclui exemplos, breaking changes (!/BREAKING CHANGE:) e scope.
  • _template — base pra criar skill nova. Copia, renomeia pasta, preenche frontmatter (name, description, trigger, steps, dod).

Detalhes completos: .skills/README.md.


Comandos especiais

Criar nova ADR

# encontra proximo numero
ls .specs/architecture/ADR-*.md | tail -1
# copia template
cp .specs/architecture/ADR-template.md .specs/architecture/ADR-XXX-<slug>.md
# edita: Status, Contexto, Decisao, Consequencias, Alternativas
# commita junto com a feature que motivou a decisao

Abrir PR

git push -u origin $(git branch --show-current)
gh pr create --fill        # usa template padrao (.github/PULL_REQUEST_TEMPLATE.md)
gh pr view --web           # abre no browser pra revisar
gh run watch               # acompanha CI

Criar task nova

cp .specs/sprints/task-template.md .specs/sprints/sprint-XX/<id>-<slug>.task.md
# preenche: Contexto, Acceptance Criteria, Out of scope, Test plan, DoD, Pegadinhas, Links
# adiciona linha em .specs/sprints/BACKLOG.md

Criar skill nova

cp -R .skills/_template .skills/<nome-da-skill>
# edita SKILL.md: name, description, trigger, steps, padroes, DoD
# referencia em .skills/README.md

Rodar checklist DoD localmente antes de PR

npm run lint && npm test -- --coverage && npx playwright test
# se tudo verde -> git commit && git push && gh pr create --fill

Notas finais pro agent

  • Idioma: respostas/docs em pt-BR, código (vars/funções/classes) em inglês, commits em inglês.
  • Sem emoji em código. README/slides ok.
  • Sem resumo no final de uma resposta. Entrega o trabalho e finaliza.
  • Sem estimativa de tempo (não tem como prever, não promete).
  • Pergunta apenas em ambiguidade real do pedido. Não pergunta pra confirmar trabalho de execução.
  • Paralelo é o padrão — research + read + review independentes rodam simultâneos.
  • Hooks do .claude/hooks/ rodam automaticamente: post-edit faz lint/format, pre-commit bloqueia commit vermelho.
<!-- codex-long-running-agent-overlay:start -->

Universal Long-Running Agent Overlay

This section complements the repository-specific guidance already in this file. If anything here conflicts with the repo-specific rules above, the repo-specific rules win.

  • PRD.md is the task source of truth for long-running sessions.
  • PROGRESS.md is the persistent checkpoint log.
  • GOAL_RESULT.md is the final execution report.
  • Before coding, read this file, PRD.md, PROGRESS.md when it exists, README.md, project manifests, tests, and the relevant source folders.
  • Work in small checkpoints, run the smallest relevant validation after each meaningful change, update PROGRESS.md, and continue until complete or genuinely blocked.
  • Stop only when the requested work is complete, validation is documented, and GOAL_RESULT.md reflects the outcome.
  • Do not rewrite unrelated architecture, fake successful validation, expose secrets, or push without explicit operator instruction for the active session.
<!-- codex-long-running-agent-overlay:end -->

Use o repo canonico https://github.com/wesleysimplicio/yool-tuple-hamt. Leia antes de editar: YOOL_TUPLE_HAMT.md, kernel/yool_tuple_kernel.py, guardrails/cpu_throttle.py, guardrails/disk_gc.py, examples/python/receipts.py e scripts/build_hamt.py.

Ao receber "Implement X": decomponha em grafo Hilbert-indexed, crie tuple raiz, use batch_spawn(depth, branching, compression_threshold) para 1.000.000+ subagents sem enumerar, execute work ativo com spawn_agent, roteie por out/in/rd, route_packet e scan_index, aplique hookwall, compress_token e prune_idle, e use LaneWorkerPool respeitando YOOL_TUPLE_* env vars.

Execute: python kernel/yool_tuple_kernel.py

Responda SEMPRE exatamente neste formato (sem varia??es): [Tuple Space Snapshot] [Active Agents/Subagents] [Total Agents/Subagents] [Pr?ximo Yool a executar] [Resultado parcial]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.