Skip to content
Agentmart
Submit a tool

enable-octane-swoole

Aplicar quando o usuário pedir migração de projeto Laravel existente em PHP-FPM para Octane com Swoole, mantendo compose, env e dados intactos.

Skill by coringawc

IndexedMIT
Write a review

Chalk Labs

Need help deploying enable-octane-swoole?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/coringawc-enable-octane-swoole

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Aplicar quando o usuário pedir migração de projeto Laravel existente em PHP-FPM para Octane com Swoole, mantendo compose, env e dados intactos.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/enable-octane-swoole

What's inside

Skill name
enable-octane-swoole
Description
Aplicar quando o usuário pedir migração de projeto Laravel existente em PHP-FPM para Octane com Swoole, mantendo compose, env e dados intactos.
License
MIT
Metadata
author: coringawc · version: 2.0.0
Instructions
154 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (3)

  • SKILL.md
  • migration-steps.md · rules/
  • rollback.md · rules/

SKILL.md (first lines)

# Enable Octane Swoole (Migração Opt-in)

## Consistency First

Esta skill é **só para projetos EXISTENTES em PHP-FPM** (`docker-stack-fpm` aplicada). Para projetos novos, rode `init-project` com perfil Octane direto. Não usar em greenfield.

A migração troca a base image (`php:8.4-fpm-bookworm` → `phpswoole/swoole:php8.4`), o comando do `app` (FPM → `octane:start`), o `proxy_pass` do Nginx (`fastcgi_pass:9000` → `proxy_pass:8000`), o healthcheck, e adiciona env vars Octane. Dados, migrations e código de aplicação não são tocados.

Branch git de backup e `.bak` em arquivos sobrescritos são obrigatórios. Compose customizado (sem header de geração do kit) **não** é sobrescrito automaticamente — gera diff para edição manual.

## Quick Reference

- Detecção: aborta se já é Octane (idempotente) ou se não é FPM canônico.
- Backup: branch `octane-migration-YYYYMMDD-HHMMSS` + `.bak` nos arquivos sobrescritos.
- Templates origem: `docker-stack-octane-swoole/templates/`.
- Pacote Composer: `laravel/octane` + `php artisan octane:install --server=swoole`.
- Middleware: `Laravel\Octane\Middleware\InvokeCachedRoutes` em `bootstrap/app.php`.
- Env vars adicionadas: `OCTANE_SERVER=swoole`, `OCTANE_HTTPS=true`, `OCTANE_MAX_REQUESTS=500`, `OCTANE_WATCH=false`.
- CI: ajustar `ci.yml` para refletir nova base (Node/PHP iguais; só muda o ext-swoole no `setup-php`).
- Revisão obrigatória contra `docker-stack-octane-swoole/rules/octane-safety-checklist.md` antes de subir produção.

## Workflow

- [ ] Detectar estado atual:

```bash
if grep -qE '^OCTANE_SERVER=swoole' .env 2>/dev/null; then
  echo "Projeto já em Octane Swoole. Nada a fazer."
  exit 0
fi

if ! grep -qE 'fastcgi_pass' docker/nginx/default.conf 2>/dev/null; then
  echo "ERRO: docker/nginx/default.conf não tem fastcgi_pass. Esta skill só migra de docker-stack-fpm."
  exit 1
fi
```

- [ ] Confirmar working tree limpa e criar branch de backup:

```bash
git diff --quiet || { echo "ERRO: working tree sujo. Commit/stash antes."; exit 1; }
BRANCH="octane-migration-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
```

- [ ] Backup `.bak` dos arquivos a sobrescrever e aplicação dos templates Octane (`Dockerfile`, `nginx-default.conf`, `octane-entrypoint.sh`, sed no `docker-compose.yml`): procedimento completo em `rules/migration-steps.md`. A skill aborta com diff e exige merge manual se `docker-compose.yml` perdeu o header `# generated by docker-stack-fpm`.

- [ ] Instalar Octane:

```bash
vendor/bin/sail composer require laravel/octane
vendor/bin/sail artisan octane:install --server=swoole --no-interaction
```

- [ ] Registrar middleware em `bootstrap/app.php`:

```php
// dentro de ->withMiddleware(function (Middleware $middleware) {
$middleware->prepend(\Laravel\Octane\Middleware\InvokeCachedRoutes::class);
```

- [ ] Append idempotente das env vars Octane:

```bash
set_env_entry() {
  local ENV_FILE="$1" ENTRY="$2" KEY_NAME="${ENTRY%%=*}"
  if grep -q "^${KEY_NAME}=" "$ENV_FILE"; then
    sed -i "s|^${KEY_NAME}=.*|${ENTRY}|" "$ENV_FILE"
  else
    echo "$ENTRY" >> "$ENV_FILE"
  fi
}

for ENTRY in "OCTANE_SERVER=swoole" "OCTANE_HTTPS=true" "OCTANE_MAX_REQUESTS=500" "OCTANE_WATCH=false"; do
  for ENV_FILE in .env .env.example; do
    [[ -f "$ENV_FILE" ]] && set_env_entry "$ENV_FILE" "$ENTRY"
  done
done
```

- [ ] Atualizar CI para refletir a nova base:

```bash
if [[ -f .github/workflows/ci.yml ]]; then
  grep -q "extensions:" .github/workflows/ci.yml && \
    sed -i "s/extensions: \(.*\)/extensions: \1, swoole/" .github/workflows/ci.yml
  python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" && echo "CI YAML válido."
fi
```

- [ ] Gerar relatório de packages para revisão:

```bash
vendor/bin/sail composer show --installed --format=text > octane-packages-report.txt
echo ""
echo "=== REVISÃO MANUAL OBRIGATÓRIA ==="
echo "Compare octane-packages-report.txt contra:"
echo "  .agents/skills/docker-stack-octane-swoole/rules/octane-safety-checklist.md"
echo "Procure singletons, static state e container leaks. Não suba sem revisar."
```

- [ ] Rebuild e smoke test:

```bash
vendor/bin/sail down
vendor/bin/sail build --no-cache app
vendor/bin/sail up -d
sleep 5
curl -fsSk https://localhost/ >/dev/null && echo "OK: Octane respondeu" || { echo "FAIL: ver logs"; vendor/bin/sail logs app | tail -50; }
```

- [ ] Rollback (se necessário): seguir `rules/rollback.md` (rollback rápido descartando branch ou rollback dentro da branch preservando histórico).

## Anti-Patterns

| Racionalização | Realidade |
| --- | --- |
| "Rodo em projeto greenfield." | Use `init-project` + `docker-stack-octane-swoole` direto. Esta skill é para projetos com estado em produção. |
| "Pulo o backup; está tudo no git." | Working tree sujo, `.env` não versionado, dados de dev locais — todos sumem sem `.bak`. Backup é obrigatório. |

From CoringaWc/ai-first-kit, MIT.

More from CoringaWc/ai-first-kit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 26, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
2.0.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from coringawc

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get enable-octane-swoole running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying enable-octane-swoole?

CallGet help
Cite this page

enable-octane-swoole skill. Agent Mart. https://agentmart.dev/skills/coringawc-enable-octane-swoole (last updated 2026-10-24)