Skip to content

feat(skill): night-mode — reusable autonomous-overnight orchestration protocol - #858

Merged
artyhoo merged 1 commit into
stagingfrom
feat/night-mode-skill
Jul 2, 2026
Merged

feat(skill): night-mode — reusable autonomous-overnight orchestration protocol#858
artyhoo merged 1 commit into
stagingfrom
feat/night-mode-skill

Conversation

@artyhoo

@artyhoo artyhoo commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

New project skill /night-mode (.claude/skills/night-mode/SKILL.md) — the reusable protocol for running a task FULLY AUTONOMOUSLY (overnight / unattended) as an orchestrator, so it does not have to be re-explained each time. Codifies:

  • Role roster + tiers: Executor = Sonnet · Reviewer TOP-DOWN + Reviewer BOTTOM-UP = Opus · Planner = Opus · Fable available for the genuinely-hardest reasoning. (Per-session tier bans, e.g. "no Fable this run", are stated by the operator at launch — NOT baked into the protocol.)
  • The loop: execute → dual-review (both altitudes) → fix → converge (max ~4 iters, else BLOCKED-and-continue) → planner reconcile; then a whole-work final pass over the entire diff + plan + a completeness-critic.
  • Autonomy/fork policy: technical forks resolved autonomously with rationale; genuine owner forks logged to <plan>.decisions.md, never silently decided.
  • Quota/overnight resilience: 429 → ScheduleWakeup backoff → resume; survive the reset window; durable per-increment commits.
  • Diff-visibility rule (an empirically-verified harness fact): the Executor commits every increment so reviewer agents can read it via the shared .git; isolation:"worktree" hides uncommitted state.
  • Verification discipline ("how to verify correctly"): empirical over inferred (test harness claims, don't assert them); file:line not memory (T3); non-vacuous paired-negatives (T15); verify-against-source before ship; adversarial review.

Origin: operator asked to save the autonomous night-run pattern as a standing protocol. It is the unattended-overnight specialization of the global orchestrator skill's Queue mode + Superpowers subagent-driven-development (SSOT #64, ADOPT) — no new dependency. Principle 11 F1 treats a new SKILL.md as a capability artifact, so the commit carries a Prior-art: prior-art-evaluations.md#64 trailer (ADAPT of the coordinator + dual-reviewer loop for overnight).

CI: passes principle 09 (Authoritative-for header), 14 (skill-drift / no broken refs / frontmatter), 15 (paired-negative block ## Without this skill + ## With this skill). Full test:principles green (32 files / 275 tests).

§1.7 Forward-check applied

Complies with .claude/rules/doc-authority-hierarchy.md §2-§3 — the skill carries an Authoritative-for header (.claude/skills/night-mode/SKILL.md:8) and is covered by principle 09's dynamic REQUIRED_PATH_PATTERNS for skills/*/SKILL.md. Complies with packages/core/principles/15-skill-paired-negative.test.ts — carries the required paired-negative block (.claude/skills/night-mode/SKILL.md ## Without this skill / ## With this skill, each ≥40 chars, differing). Complies with .claude/rules/language-discipline.md — internal machinery is English-only; bilingual only in the frontmatter trigger match-data. Complies with .claude/rules/no-paid-llm-in-ci.md — a skill is a markdown protocol read by a session, no CI-billed call. Principle 11 F1 classifies a new SKILL.md as a capability artifact, so the introducing commit carries Prior-art: prior-art-evaluations.md#64 (Superpowers subagent-driven-development, ADOPT) — verified green by the pre-push test:principles (principle 11 F1/F3 pass).

§1.7 Backward-check applied

Additive artefact — no existing rule/principle/skill is superseded. The skill REFERENCES the global orchestrator skill's Queue mode rather than duplicating it (build-first-reuse: own-stack specialization, not a parallel implementation). The verification-discipline section dogfoods the very lesson that produced it — the diff-visibility claim was inferred, challenged, then proven by a live isolation:"worktree" probe (.claude/skills/night-mode/SKILL.md §"Diff visibility"), so the skill's §"Verification discipline" item 1 ("empirical over inferred") is self-applied. New skill added to principle 15's git-aware scope → carries the block (not grandfathered).

… protocol

Codifies the fully-autonomous overnight orchestration pattern so it is not re-explained each run: Executor(Sonnet) + 2 Opus reviewers (top-down + bottom-up) + Opus planner; execute -> dual-review -> converge -> planner loop; whole-work final pass; autonomy/fork policy (technical auto-resolve, owner forks logged); quota/backoff resilience; the verified diff-visibility rule (executor commits so reviewers read via shared .git); and a verification discipline (empirical over inferred; file:line; non-vacuous paired-negatives). Fable available for the hardest reasoning; per-session tier bans are operator overrides at launch, not baked in. Not a capability-code commit (markdown skill). Passes principles 09/14/15.

Prior-art: prior-art-evaluations.md#64 (Superpowers subagent-driven-development, ADOPT — night-mode ADAPTs the coordinator + implementer + dual-reviewer subagent loop for unattended overnight execution; own-stack specialization of the orchestrator Queue mode, zero new dependency).
@artyhoo
artyhoo merged commit 35c0b41 into staging Jul 2, 2026
31 checks passed
artyhoo added a commit that referenced this pull request Jul 3, 2026
…capability-reuse-auditor (#863)

Ships **source-before-shape** — an edit-time discipline catching two recurring AI-laziness failures at authoring time, closing a recursive-self-application gap in the project's own operating rules.

Origin (2026-07-02, operator-confirmed cross-session recurrence = promotion trigger):
1. BFR-reinvention — PR #858 shipped a night-mode SKILL.md re-describing the loop SSOT #64 owns; its trailer said "ADAPT #64" while the body re-described it, and it passed principle 11 F1 (which checks trailer presence, not reuse substance). #consult-as-trailer-not-input.
2. scope-from-memory — a launch prompt scoped from recall, not the spec (D1 → B). #claim-from-memory-not-source.

Mechanism (judgment → injection, not a gate):
- Layer A: .claude/rules/source-before-shape.md carries globs/inject markers → the existing inject-matching-rule.sh surfaces the reminder at edit-time (.claude/skills/**, agents/**, .claude/orchestrator-prompts/**). REUSE, zero new engine. Honestly disclosed once-per-session limitation (best-effort first-touch nudge).
- Layer B: agents/capability-reuse-auditor.md — AI-agnostic overlap + trailer↔body auditor (no-paid-llm), doing the semantic pass F1 cannot.

SSOT #196 (ADAPT, records the 6-item BFR-consult); principle 09 REQUIRED_HEADER_DOCS +2; install.sh SHIPPED_DOCS +1 + regenerated byte-identical baselines; AGENTS.md rule-index +1; self-reflection research-patch.

Independently reviewed (3-lens Workflow: 2 approve + 1 adversarial revise applied). Verified: principles green, byte-identical 8/8, injection dogfooded live. Candidate T-trap #consult-as-trailer-not-input surfaced-not-applied to ai-laziness-traps.md (dedicated rule home instead).

§1.7: Forward+backward in source-before-shape.md §6 — complies with no-paid-llm-in-ci.md §1, build-first-reuse-default.md §4, phase-research-coverage.md §1.11, doc-authority-hierarchy.md §2-§3; registered at packages/core/principles/09-doc-authority-hierarchy.ts:54; self-applies (SSOT #196 consult drove the shape, not memory).

Prior-art: prior-art-evaluations.md#196 (source-before-shape mechanism — ADAPT: REUSE inject-matching-rule.sh channel + BUILD the AI-agnostic capability-reuse-auditor; dedup-first ADOPT-VOCABULARY; code-clone tools REJECT on T16 problem-class miss; Superpowers writing-skills REFERENCE).
artyhoo added a commit that referenced this pull request Aug 10, 2026
…provenance repair (principle-11 F1 staging red) (#1375)

## Summary

Two concerns, one invited scope: (1) NEW project skill `.claude/skills/reviewer/SKILL.md` — the interactive review-session protocol, until now living only in the operator's personal `~/.claude/commands/reviewer.md` where repo machinery cannot see or update it (the #1374 severity-contract change had to be hand-patched into it the same day — the incident this closes; in-repo, a project skill takes precedence over the same-named personal command per the documented skill-over-command rule). (2) SSOT entry #249 — provenance repair for `.claude/rules/effort-worthiness.md`: principle 11 F1 is red on staging because the #1374 squash rebuilt the introducing commit from a PR body that omitted the `Prior-art:` line (the #1094#1097 class); the verbatim-path SSOT match fixes F1 for every subsequent PR.

## Changes

- NEW `.claude/skills/reviewer/SKILL.md`: three modes + verification-vs-synthesis economy split adapted 1:1 from the operator command; verdict grammar bound to `reviewer-discipline.md` §6 (Failure-scenario, ESCALATED, notes lane, zero-finding legitimacy); explicit subordination to the cold agents it does not replace and an explicit not-a-registry-role note (seat-lifecycle.md §1 three-roles cut respected — no seat-lifecycle edit).
- `.claude/skills/arch/SKILL.md:91`: stale «pending as of 2026-08-10» claim about the operator's global `/reviewer` resolved (hand-apply done same day; in-repo invocations now load the project skill).
- `docs/meta-factory/prior-art-evaluations.md`: entry #249 (REFERENCE) — registers the §8 item-5 per-family consult (Conventional Comments, Google eng-practices, Bezos Type-1/2, CBR, WIP limits, ADR/spec-kit/Kiro) already folded into the rule's §4, and records the detector-disagreement root cause (pr-body-prior-art's diff detector calls new rule-markdown non-capability while F1 counts it) with a widening trigger.
- Deliberately NOT changed: `setup.d/10-skills.sh` — consumer delivery of the reviewer skill is routed to advisor-pattern §8 item 9 (consumer-delivery stage with its own review), with an env+ tier recommendation (pairs with arch/pipeline at that profile).

## Prior-art consult

Prior-art: skipped — project-internal interactive-review skill adapting the operator's own global /reviewer command into the repo; subordinates to reviewer-discipline.md §6 (severity contract SSOT) and to the cold agents it does not replace; no new capability, no packages/ code

- [x] PR range is non-capability (one new skill markdown + one SSOT row + one line edit; zero `packages/` files, zero dependency changes); the trailer line above is carried in the PR body so it survives the squash into the introducing commit (the exact #1094#1097 / #1374 lesson this PR also repairs).
- [x] SSOT touch: entry #249 appended (append-only register; capability-commit-author write access per the ownership table).
- [x] Cold `agents/capability-reuse-auditor.md` pass run before handoff (source-before-shape Layer B): verdict THIN-ADAPT → GO, 12-candidate overlap set, trailer↔body consistent per clause; its one notes-lane finding (sibling §6 digest cross-pointer) applied in-branch.

## Test plan

- [x] §1.7-свод lands in squash-body (`gh pr merge --squash --body "$(gh pr view <N> --json body -q .body)"`)
- [x] `npm run --prefix packages/core test:principles` — 41 files green locally after #249 (principle 11 F1 was the one red: 14/14 after; principles 09/14/15 cover the new skill dynamically, 46/46)
- [x] `bash scripts/check-skill-drift.sh` — PASS (0 errors); doc-authority hook smoke on the new file — exit 0
- [x] Pre-push full substance sweep green at push time
- [x] Manual smoke: `.claude/skills/reviewer/SKILL.md` paired-negative sections present (`## Without this skill` / `## With this skill`); frontmatter description carries concrete RU+EN triggers per skill-description-quality.md §2

## Provenance

n/a — dialog-invited repo-skill addition + CI-red repair; no stage kickoff, no dispatch substrate.

## Review findings

Cold capability-reuse-audit (agents/capability-reuse-auditor.md, dialogue-blind on the just-authored file + intended trailer): verdict THIN-ADAPT, overall GO. Overlap set = 12 candidates (SSOT #64/#231/#236/#249 + aif-review family; skills/agents siblings; upstream Superpowers requesting-code-review + SDD). Key clears: the PR #858 class does not recur (the SDD executor/dual-reviewer loop is not re-described; spawning subagents without approval is forbidden by the skill's Hard bounds); subordination lines verified per file:line for all four owners named in the header. One notes-lane finding, fixed same round per the §6 contract: the repo now holds two §6 digests (this skill + agents/reviewer-discipline.md) — a cross-pointer with a drift rule was added to the skill's See also. Coverage honestly partial (headers-only for the non-overlapping skill/agent tail; effort-worthiness.md body unread by the auditor).

## Fidelity verdict

FIDELITY: skipped — dialog-invited non-stage PR (repo-skill addition + staging F1 repair); no kickoff/spec basis to audit against; cold reuse-audit GO recorded under Review findings.

## Parked questions

- Consumer tier for the reviewer skill: recommendation env+ (contour surface, pairs with arch/pipeline in setup.d/10-skills.sh:120-122); decision + consumer-generic rewording (the skill's Origin references the operator's home path) belong to advisor-pattern §8 item 9 — recorded in the memory card as an item-9 input.
- SSOT #249's «Trigger to revisit» carries the detector-widening trigger: a second squash-trailer F1 incident → widen pr-body-prior-art's detector to F1's artifact classes (rule/skill/agent markdown).

## §1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)

### §1.7 Forward-check applied

New skill checked against every active layer: channel selection per rule-enforcement-channel-selection.md — on-demand skill load at the review-ask trigger, not always-on (description triggers per skill-description-quality.md §2, RU+EN); doc-authority header present with subordination lines (principle 09 dynamic skill enumerator green, packages/core/principles/09-doc-authority-hierarchy.test.ts); paired-negative sections present per packages/core/principles/15-skill-paired-negative.test.ts:50; provenance per principle 11 F1 — the `Prior-art:` trailer lives in this PR body (squash-safe) AND the artifact has SSOT keyword coverage, while the F1 red this PR repairs is closed by the verbatim path in docs/meta-factory/prior-art-evaluations.md entry #249; language-discipline — repo artifact in English; seat-lifecycle NOT extended — the three-roles cut at .claude/rules/seat-lifecycle.md:42 is respected by an explicit not-a-registry-role subordination line instead of a paths: edit; source-before-shape §1 — SSOT + .claude/skills/ + agents/ grepped before the body was written, and Layer B (agents/capability-reuse-auditor.md) run before handoff with verdict THIN-ADAPT/GO.

### §1.7 Backward-check applied

Class = artifacts carrying the interactive-reviewer protocol or a §6 severity-contract digest. Surfaces enumerated (grep over .claude/skills/**, agents/**, setup.d/, plus the out-of-repo command): ~/.claude/commands/reviewer.md — out-of-repo sibling, hand-patched to §6 grammar 2026-08-10, now shadowed in-repo by this skill (skill-over-command precedence), SWEPT-CLEAN; agents/reviewer-discipline.md:37 — sibling run-moment §6 digest, GAP-FOUND (no cross-link between the two digests) → FIXED this PR (See-also drift rule in .claude/skills/reviewer/SKILL.md); .claude/skills/arch/SKILL.md:91 — stale «pending» claim about the global command, GAP-FOUND → FIXED this PR; .claude/rules/reviewer-discipline.md:56 — the operating SSOT itself, untouched by design (both digests subordinate to it); packages/core/templates/shared/skill-context/aif-review/SKILL.md + aif-orchestrator-discipline — shipped consumer surfaces, deliberately DEFERRED to advisor-pattern §8 item 9 (never a silent copy; ownership-table read-only for sessions); setup.d/10-skills.sh:108-127 — the delivery manifest, deliberately untouched, tier decision recorded as an item-9 input. No other surface in the class (agents/fidelity-auditor.md + agents/review-sidecar.md carry the cold-protocol grammar shipped by #1374, different altitude, already current).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants