К основному содержанию
скилл CX Codex

ns-autonomous — скилл для Claude Code: автономное выполнение задач

Скилл ns-autonomous для Claude Code, Codex, Cursor, Copilot и Gemini CLI, который берёт локальный план или произвольный текст и выполняет его автономно в изолированном worktree.

Apache-2.0 152 установок обновлён 2026-10-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add nextstage-brasil/skills --skill ns-autonomous -a claude-code
Открыть на GitHub

Что делает ns-autonomous

ns-autonomous работает на Claude Code, Codex, Cursor, GitHub Copilot и Gemini CLI. В оба режима — самостоятельный запуск и фаза 2 скилла ns-execution-gitlab-issue — встроен один и тот же движок: планирование глубины задачи, протокол сомнений и мультиагентная диспетчеризация.

Перед любым редактированием кода скилл создаёт изолированный worktree .worktrees/{version_san}/ с веткой work/{version_san}. Писать на основной ветке или на базовой он не будет — если создать worktree не удалось, выполнение прерывается. При двух и более рабочих единицах каждую отдаёт отдельному субагенту через ns-coder; параллельный запуск — только между единицами без зависимостей в DAG и с непересекающимися файлами. Одна единица выполняется в текущей сессии.

Внутренний цикл ревью работает через ns-reviewer и ns-judge: код считается принятым только при статусе Approved. Деструктивные сомнения в автономном режиме останавливают выполнение и выносятся в чат; в режиме фазы 2 — возвращаются вызывающему скиллу. Зависимости: ns-harness, ns-reviewer, ns-judge версии 1.5.

Какие задачи решает

  • Выполнить локальный план автономно без GitLab-issue
  • Распределить многошаговую задачу между параллельными субагентами
  • Изолировать все изменения в отдельном worktree, не трогая основную ветку
  • Прогнать цикл ревью и judge-закрытие внутри одной сессии
  • Запустить фазу 2 из ns-execution-gitlab-issue как движок выполнения

Примеры запросов агенту

  • Запусти ns-autonomous на основе plan.md и выполни всё автономно
  • Прочитай этот текст задачи и реализуй его через ns-autonomous в изолированной ветке
  • Используй ns-autonomous как движок фазы 2 для текущего GitLab-issue

Как установить ns-autonomous

1Через Skills CLI (Vercel)

npx skills add nextstage-brasil/skills --skill ns-autonomous -a claude-code

2Вручную: положить файлы

~/.claude/skills/ns-autonomous/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/ns-autonomous/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о ns-autonomous

Как установить ns-autonomous в Claude Code?

Выполните npx skills add nextstage-brasil/skills --skill ns-autonomous -a claude-code, затем скилл будет доступен по пути ~/.claude/skills/ns-autonomous/SKILL.md.

Что делает ns-autonomous?

Скилл берёт локальный план или произвольный текст и выполняет его автономно: создаёт изолированный worktree, при необходимости распределяет задачи между субагентами, прогоняет ревью через ns-reviewer и закрывает сессию через ns-judge.

Чем ns-autonomous отличается от ns-coder и когда его не нужно запускать напрямую?

ns-coder предназначен для одношаговых правок; ns-autonomous берёт на себя планирование и многоагентное выполнение. Если задача приходит из GitLab-issue, запускать ns-autonomous напрямую не следует — он должен стартовать только как фаза 2 скилла ns-execution-gitlab-issue.

Исходный текст

SKILL.md · Apache-2.0
---
name: ns-autonomous
description: (NS) Autonomous execution engine — plans depth, resolves doubts from docs/specs, multi-agent work in an isolated worktree. Use for a local/pasted plan or "run this autonomously" without GitLab. Also Phase 2 under ns-execution-gitlab-issue (do not run standalone then). Not for single-step edits (ns-coder) or GitLab issues directly (ns-execution-gitlab-issue).
license: Apache-2.0
metadata:
  author: nextstage-brasil
  version: "1.5"
depends:
  - ns-harness
  - ns-reviewer
  - ns-judge
---

# Code Autonomous

Harness-aware execution engine: planning depth, doubt resolution, multi-agent dispatch, review gate — standalone pipeline or caller's Phase 2 engine.

## Workflow mode (mandatory)

Fixed workflow — named skill handoffs or harness bridges (`../../ns-harness/references/subagent-dispatch.md` spawn gate). Review gate: `../ns-reviewer/references/review-gate-workflow.md`. **MUST** `reviewer-agent` when available (else `ns-reviewer`); then `ns-judge` in-session only if `Code Review: Approved`. No Task persona substitutes. **≥2** units → **MUST** `coder-agent` per unit (`ns-coder`); **1** unit → follow `ns-coder` in A (worktree) — **MUST NOT** extra spawn. C2 / single-unit workers = implement only; **no** per-unit review — parent owns REV at closure.

## Isolation invariant (non-negotiable)

Skill **never** writes application code on main product checkout; **never** commits `main`/`master`/base/`SOURCE_BRANCH` unless human explicitly said work in place this run.

- Standalone + Engine: isolated `WORK_BRANCH` + `WORKTREE_ROOT` before any implementation edit.
- Worktree creation fails, or CWD/branch still main checkout / base → **stop**. No "continue on main to unlock plan".
- Sandbox restrictions (`Operation not permitted`, `.cursor/` paths) **not** permission to violate invariant.

## Session boot

See `../../ns-harness/references/session-boot.md`. **Complete Session boot (blocking)** there before any other step in this skill.

### After session boot — Engine and Standalone

**Engine mode:** caller may have already completed Session boot in Phase 0 — re-read `session-boot.md` only if context is missing.
**Standalone:** you own Session boot before step 1 of the standalone pipeline.

## Routing (read first)

Entry priority table: `../../ns-harness/references/code-skill-routing.md`. Standalone triggers: `references/entry-triggers.md`.

1. **Origin is a GitLab issue** (`ISSUE_URL` or issue reference) → entry priority **1** — follow `ns-execution-gitlab-issue` end to end; this skill only runs as its Phase 2 engine (**Engine mode** below). Do not run the standalone pipeline, do not touch GitLab state, do not create a worktree.
2. **Standalone autonomous** (local plan file, pasted text/plan, ad-hoc "implement this autonomously" without an issue) → entry priority **3** — run the **standalone pipeline**: own worktree, own state, own review loop.

See `references/routing.md` for Engine-mode I/O and anti-cycle rules with `ns-execution-gitlab-issue`.

## Engine mode (invoked by `ns-execution-gitlab-issue`)

Inputs (already resolved by the caller — this skill never creates them): issue payload, `WORKTREE_ROOT`, `WORK_BRANCH`, `SOURCE_BRANCH`.

1. **Planning-depth self-decision** — evaluate the issue payload and decide single work unit vs. light `requirements.md` + `tasks/task-NNN-*.md` + `execution-plan.md` under `docs/versions/{version_san}/sdd/`. See `references/planning-decision.md`.
2. **Doubt protocol** — self-ask, docs-first lookup, self-answer non-destructive doubts, escalate destructive ones as a structured event to the caller instead of mutating GitLab state; pause dependent units until resumed. See `references/doubt-resolution.md`.
3. **Multi-agent dispatch** — parse work units. **1 unit:** follow `ns-coder` in this session inside `WORKTREE_ROOT` (defer review to caller / standalone step 5). **≥2 units:** **MUST** dispatch `coder-agent` when available (else `ns-coder`) per unit; parallel only across units with no DAG edge and disjoint file scopes; sequential otherwise. Workers implement only — **no** per-unit `reviewer-agent`. See `references/multi-agent-dispatch.md` and `../../ns-harness/references/subagent-dispatch.md`.
4. **Checkpoint commits** — one commit per completed sequential unit or per completed parallel batch, inside the worktree; the caller squashes at delivery.
5. **Fix-loop entry point** — when re-invoked after `Rejected`, run **one** coder call on the whole map **verbatim** (no unit-count split, no “or units”). Skip units already done.
6. **Return to caller**: unit statuses, files changed, any open destructive doubt, and (first invocation only) a plan-based `estimate_seconds` hint — the caller applies `set_issue_estimate` only when the issue estimate is empty and the value is ≥ 60 (see `../ns-execution-gitlab-issue/references/time-tracking.md`).

## Standalone pipeline (non-GitLab origin)

Same internals as Engine mode, but this skill owns the whole run:

1. Resolve the descriptor — local plan path or pasted text. No MCP calls.
2. Infer `change_kind` (fix/feat), allocate `{version_san}`, create `docs/versions/{version_san}/sdd/` when artifacts needed.
3. **Create its own worktree**: `.worktrees/{version_san}/` + branch `work/{version_san}` from the resolved base branch, following `../../ns-harness/references/worktree-setup.md`. Path is under the **repo root**, never under `.cursor/`. On failure → abort (do not fall back to the main checkout) — see `references/standalone-pipeline.md`.
4. Planning-depth self-decision, doubt protocol (destructive doubt → chat-only gate, no GitLab actions available), multi-agent dispatch — identical logic to Engine mode.
5. **Internal review loop** — `../ns-reviewer/references/review-gate-workflow.md` (exhaustive map → one coder → `delta`; **`Approved` = 10** only): **MUST** `reviewer-agent` when available (else `ns-reviewer`) version-closure **code** mode. **Do not** run `ns-judge` until code `Approved`. Then in-session `../ns-judge/SKILL.md` (`closure`). Product files changed after judge Rejected: code review again then judge again.
6. Report per `review-gate-workflow.md` **Final report** fields plus `{version_san}`, worktree path, commit(s), and follow-ups. No GitLab board, no MR — unless `docs/context/gitlab-sync-config.md` exists and the human explicitly asked for one (out of scope for v1; standalone stays local-only otherwise).

See `references/standalone-pipeline.md` for the full flow.

## Stop and ask the human

| Condition                                                        | Action                                              |
| ------------------------------------------------------------------ | ---------------------------------------------------- |
| Destructive doubt (Engine mode)                                   | Return escalation event to caller — no chat pause here |
| Destructive doubt (standalone)                                    | Stop in chat, ask, resume with the answer as context |
| Worktree conflict for the same `{run_id}` (standalone)             | Stop unless explicit resume                          |
| `git worktree add` failed (permissions/sandbox/path)               | Abort — report path attempted; never fall back to main checkout or `.cursor/` |
| Still on `main`/`master`/base branch when about to edit code       | Abort — isolation missing; do not implement                                   |
| Human explicitly said "do not create a new branch / work in place" | Only then may edit the current branch; still never invent a `.cursor/` path |
| Base branch for standalone worktree unresolved                    | Stop — ask once                                      |
| Review `Blocked` or 3 rounds exhausted                             | Stop, report as blocked — do not fabricate success   |
| Engine mode invoked with a GitLab origin but no worktree/branch given | Stop — this is a caller contract violation, not a doubt |

## Related skills

| Skill                 | Role                                                       |
| ---------------------- | ------------------------------------------------------------ |
| `ns-execution-gitlab-issue` | GitLab flow owner — calls this skill for Phase 2             |
| `ns-coder`           | Implement via in-session (1 unit) or `coder-agent` (≥2 — **MUST** when available) |
| `ns-reviewer`        | Closure code gate via `reviewer-agent` (**MUST** when available) — not per unit |
| `ns-judge`           | Delivery proof in-session after `Code Review: Approved` |
| `ns-harness`    | Artifact layout, worktree mechanics, discovery               |

## References

| File                                | When                                                                |
| ------------------------------------ | --------------------------------------------------------------------- |
| `references/routing.md`              | Issue vs. standalone; Engine-mode I/O and anti-cycle with `ns-execution-gitlab-issue` |
| `references/entry-triggers.md`       | Priority 3 standalone entry phrases |
| `references/planning-decision.md`    | Self-evaluation heuristic: single unit vs. requirements+tasks+plan  |
| `references/doubt-resolution.md`     | Self-ask, docs-first lookup, destructive criteria, escalation shape |
| `references/multi-agent-dispatch.md` | DAG + disjoint-scope parallel rule, subagent prompt, checkpoint commits |
| `references/standalone-pipeline.md`  | Full non-GitLab flow: version alloc, own worktree, review loop      |

## Forbidden

- Review substitutes (`senior-tech-lead-reviewer`, `bugbot`, `security-review`, or any non-`ns-reviewer` code gate) — harness `reviewer-agent` is allowed; see `../ns-reviewer/references/review-gate-workflow.md`
- `ns-judge` before `Code Review: Approved`
- Reporting success without both `Approved`, or explicit **blocked** state
- Skipping re-review after a `Rejected` fix before closure

© nextstage-brasil · Apache-2.0 · nextstage-brasil/skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
conventional-git samber Скилл conventional-git задаёт правила именования веток и коммитов по стандарту Conventional Commits v1.0.0. Помогает поддерживать чистую историю проекта в GitHub и GitLab. CX Codex +1 5 400установок om-followup-issue-from-pr open-mercato Скилл om-followup-issue-from-pr для Claude Code превращает ссылку на PR или комментарий из ревью в задачу трекера. Фиксирует правки после ревью как issue. CX Codex +1 3 700установок greploop greptileai Скилл greploop запускает проверку через Greptile, исправляет замечания бота и пушит код до высшего балла. Помогает довести до идеала PR в GitHub, MR в GitLab или список в Perforce. CX Codex +1 3 100установок orchestrate hyperb1iss Скилл orchestrate для Claude Code координирует параллельных агентов с явными задачами, зависимостями и проверкой результата. Активируется при запросах о совместной работе агентов и распределении задач. CX Codex +1 669установок babysit-pr amElnagdy Скилл babysit-pr для Claude Code и Codex: разбирает ревью-треды ботов на PR или MR, проверяет находки по коду, чинит блокеры, отвечает и закрывает обсуждения. CX Codex +1 584установок magic-cc-codex-worker Wenqing Yu Плагин magic-cc-codex-worker запускает параллельных агентов Codex из Claude Code и разводит их работу по отдельным git worktree. Он пригодится для независимых задач и дополнительной проверки PR. ★ 3 785звёзд репо

Из того же набора20

Весь набор →
ns-requirements-enricher Скилл ns-requirements-enricher собирает бриф по реализации для одной задачи GitLab или вставленного описания: сначала смотрит код проекта, потом задаёт блокирующие вопросы в чате. CX Codex +1 163установок ns-best-practices Скилл ns-best-practices проверяет заголовки безопасности, базовую доступность интерфейса и правила Web Interface Guidelines. Находит уязвимости и готовит отчёт. CX Codex +1 154установок ns-investigator Скилл ns-investigator для Claude Code анализирует стек-трейсы, логи и упавшие тесты, находит корневую причину и предлагает минимальный фикс без реализации. CX Codex +1 153установок ns-frontend-design Скилл ns-frontend-design для Claude Code, Codex, Cursor и других агентов — строит production-интерфейсы с типографикой, иерархией и анимацией. Срабатывает на страницах, компонентах, дашбордах, формах и KPI-аналитике. CX Codex +1 153установок ns-e2e-tests Скилл ns-e2e-tests задаёт структуру Cypress E2E-тестов, команд и сценариев для разных устройств. Нужен при создании и рефакторинге тестов. CX Codex +1 151установок ns-backend-tests Скилл ns-backend-tests для написания и запуска unit- и интеграционных тестов PHPUnit прямо в IDE. Работает только в Docker-контейнере, помогает быстро покрыть тестами новый Laravel-проект или переписать существующие тесты. CX Codex +1 151установок ns-docs-writer Скилл ns-docs-writer для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode, который пишет человекочитаемую документацию проекта: README, руководства в docs/, ранбуки и инструкции для контрибьюторов. CX Codex +1 151установок ns-coder Скилл ns-coder реализует небольшие изменения в коде: исправления, рефакторинг, скрипты и миграции. Он пригодится для разовой задачи вне многоэтапной разработки по SDD. CX Codex +1 151установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой