Skip to content
Back to skills

Spec.Align

BSecurity

Spawn the alignment leads (seats from the project's resolved team config; default a BA lead + an Architect lead) to negotiate between BA/UX research and technical investigation — resolve feasibility gaps, defer features, adjust requirements, and produce an alignment document referencing the original artifacts.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgogit

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned December 3, 2026

npx -y skills add ivan-ii-tech-digital/agent-kit --skill spec.align --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spec.Align?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spec.Align
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/ivan-ii-tech-digital-spec-align/badge)](https://www.skillsdirectory.com/skills/ivan-ii-tech-digital-spec-align)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: spec.align
description: Spawn the alignment leads (seats from the project's resolved team config; default a BA lead + an Architect lead) to negotiate between BA/UX research and technical investigation — resolve feasibility gaps, defer features, adjust requirements, and produce an alignment document referencing the original artifacts.
argument-hint: <docs/changes/<slug>/ (optional)>
disable-model-invocation: true
model: opus
---

## Input

```text
$ARGUMENTS
```

You are the **Team Lead (Orchestrator)** for this alignment negotiation. The team is whatever roster `ak-resolve-team spec-align` returns: senior seats that review each other's team outputs and negotiate until requirements and technical feasibility are aligned.

Never name a seat, an agent count or a model in your own flow decisions: the resolved roster is the only source. "The roster" means `<scratchpad>/team.resolved.json` (the session scratchpad; not committed).

## Setup

1. **Do NOT pre-read role files.** Each agent reads its own role and instruction files at the paths in its prompt.
2. **Resolve the change folder:** `ak-resolve-change-dir "<path from $ARGUMENTS, if any>" --json` → `CHANGE_DIR` (absolute), `CHANGE_SLUG` and `CHANGE_WORKTREE`. On error, stop and report it.
   - Verify `<CHANGE_DIR>` has files in `1-requirements/` and `2-design/`, and at least one `.md` file in `3-technical/` (`ls <CHANGE_DIR>/3-technical/*.md`). If any is missing, warn the user that /spec.specify or /spec.tech has not run. The leads read the artifacts; you do not.
3. **Create the working directory:** `mkdir -p <CHANGE_DIR>/4-alignment/reviews`.
4. **Resolve the team:** `ak-resolve-team spec-align --team "${CLAUDE_PLUGIN_ROOT}/teams/spec-align/team.json" --project <CHANGE_WORKTREE>` (plus any `--set` from `$ARGUMENTS`); save standard output to `<scratchpad>/team.resolved.json`; print its summary line and any `team config partial` warning. Non-zero exit → print every error, spawn nothing, stop. Command not found → tell the user to enable `ak-team@agent-kit` and stop.

## Execution Rules

- Pipeline steps are pre-authorized: run every phase without pausing. Pause only for a `clarify-first` batch or an escalation below.
- Agents write only under `<CHANGE_DIR>/4-alignment/`, only the files the roster assigns them.
- **Alignment files reference originals, never duplicate content** — relative paths link back to `1-requirements/`, `2-design/` and `3-technical/` files.
- **Do NOT create empty directories.**
- Validate files by headings (`grep -n '^#'`); read a section only when you act on it.

## Escalation Rules

- Each topic → the seat whose roster `authority` covers it (kit default: `requirements` → ba-lead, `feasibility` → architect-lead). Requirement scope → the lead seat.
- Seats still disagree after one negotiation round → a `clarify-first` question to the user (both positions, a recommended answer) and an open question in the output.
- Agent output failures → §Agent Output Validation.
- **User challenge:** when every lead independently concludes the user's stated direction should change, never decide it. Surface it as: **You said** / **The leads recommend** / **Why** / **What we might be missing** / **If we're wrong, the cost is** — and "Your original direction stands unless you choose otherwise."
- Any assumption the sources do not answer → `clarify-first`: agents send questions to you, you ask the user in one batch, answers go to `<CHANGE_DIR>/clarifications.md`.

## Spawning

Spawn every agent the roster lists for a phase, in parallel, as the `spawn-team-with-command-model` skill says (invoke it first). A Codex seat's brief file is `<CHANGE_DIR>/brief-<seat>.md`; after its `worker_done`, `git -C <CHANGE_WORKTREE> status`: any file outside the seat's outputs fails the seat.

Prompt (paths only):

```
Read <each readFirst path, in order>, <the roster's role file path>, then <the roster's instruction file path>, and follow it.
CHANGE_DIR=<CHANGE_DIR>. Work only under <CHANGE_WORKTREE>; use absolute paths.
Write only these files: <owned outputs>. Questions go to the orchestrator (clarify-first).
<Phase 0 only: the blind-round line of §Blind first round, step 1>
Your final message is your report (≤15 lines) — do not also SendMessage it:
  Done. Output at <path>. <key flag, or 'no surprises'>.
  <verdict and required actions, if any>
  FRICTION: <up to three lines | none>
```

## Blind first round

Read `<AK_TEAM>/references/blind-first-round.md` (`<AK_TEAM>` = `$(cd "$(dirname "$(command -v ak-resolve-team)")/.." && pwd)`, the ak-team plugin root) and follow it. Here the items are the feature and each `US-n`, the command's own round is Phase 1 (one negotiation), and the dissent lines go to `alignment.md` `## Dissent`.

## Phase 0: Independent Review (parallel, blind)

Spawn every phase-0 agent of the roster under §Blind first round (steps 1–3). Clarification answers that land during the phase: append them to `clarifications.md` and `SendMessage` every running agent the path before its final message; a review already delivered is amended, not redone.

Wait for every phase-0 final message; validate each review file by headings. Folded outputs (a disabled seat's outputs moved to another seat) are produced by the host agent one after another, after its own.

## Phase 1: Negotiation (1 round)

1. **Share reviews (paths only).** Send each agent the paths of every other agent's review: "Cross-review. Read `<path>`. Message its author directly about any feature where your assessments differ. Features you agree on need no discussion."
2. **Monitor** agreements, disagreements and new discoveries; agents message each other directly. Relay for Codex seats.
3. **Close the round** when every agent has answered the others' positions once: ask each for its final position per contested item, one line each (`US-1: <position>`), and write them to `<scratchpad>/final-positions.md` under each seat's name. An item whose lines differ is unresolved, whatever the chat said. A contested item is one whose first positions differ or that the chat contested.
4. **Resolve the rest** per §Escalation Rules.

## Phase 2: Assembly (the lead seat, last)

Send the lead-seat agent: "Write `<CHANGE_DIR>/4-alignment/alignment.md` from every review and the agreed round, filling `${CLAUDE_PLUGIN_ROOT}/templates/4-alignment/alignment.md` (always, including `approved-as-is`); carry the feasibility authority's verdicts into it (the review files are deleted at cleanup). Fill `## Dissent` from `<first-positions path>`, `<final-positions path>` and `clarifications.md` (§Blind first round, step 5), naming who decided each item." Give both scratchpad paths absolute. Use the absolute templates path. One feature per change folder.

`TaskStop` every other roster agent now. When the lead's final message arrives, check `alignment.md` headings against the template and read its Status, Summary and Open Questions sections only; then `TaskStop` the lead.

## Agent Output Validation

After every final message: format (headings as the instruction file requires), role constraint (the agent stayed within its authority), substance (no empty or placeholder content). On failure, send the still-running agent specific feedback (respawn from the roster only if it is gone); one retry per agent per phase, then the user gets the failed output and what was expected.

## Phase 3: Cleanup & Report

1. `rm -rf <CHANGE_DIR>/4-alignment/reviews` and the two scratchpad position files; delete any `<CHANGE_DIR>/brief-<seat>.md` and any agent-written file outside `<CHANGE_DIR>/4-alignment/`.
2. `TaskStop` every roster agent still running, by the task id returned at spawn; stop every Codex worker; stop every process this run started and name the ports checked.
3. `git -C <CHANGE_WORKTREE> add <CHANGE_DIR> && git -C <CHANGE_WORKTREE> commit -m "docs(<slug>): alignment"` (the whole folder, as `/spec.specify` does; `reviews/` is gone after step 1).
4. **Plan check.** Run `ak-check-tasks <CHANGE_DIR>` (ak-spec, no model tokens). Its findings go into the message below verbatim; fix none of them yourself: the user decides.
5. **Save state.** Steps 1–4 of `<AK_DISCIPLINE>/skills/ak-save/SKILL.md` (`<AK_DISCIPLINE>` = `$(cd "$(dirname "$(command -v ak-state)")/.." && pwd)`), step 1 as `cd <CHANGE_WORKTREE> && ak-state save`: Where it stopped = alignment committed, Next step = `/spec.implement <CHANGE_DIR>`.
6. Tell the user: "Alignment complete. Report saved to `<CHANGE_DIR>/4-alignment/alignment.md`. Status: [approved-as-is / approved-with-changes / deferred / blocked]. [Q] open questions for user. Plan check: <its findings | no finding>." `/spec.implement` offers `/spec.challenge` once it has written `tasks.md`. When another pipeline skill invoked this one, return to it; otherwise stop and name the next command (`/spec.implement <CHANGE_DIR>`), run only on the user's go. Stop also for a pending `clarify-first` batch.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.