Spawn the resolved Architect team to investigate one technical topic — architecture, code quality, performance, refactoring, optionally a feature lead — then write the overview. Repo audit is /tech.audit.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Spec.Tech?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ivan-ii-tech-digital-spec-tech)
---
name: spec.tech
description: Spawn the resolved Architect team to investigate one technical topic — architecture, code quality, performance, refactoring, optionally a feature lead — then write the overview. Repo audit is /tech.audit.
disable-model-invocation: true
argument-hint: "[<topic>] [<CHANGE_DIR>]"
---
## Investigation Topic
```text
$ARGUMENTS
```
You are the **Team Lead (Orchestrator)** for this technical investigation. You manage the Architect agents the team resolver lists, who each investigate the codebase from a different angle and write their final files; you write the overview.
This skill is **tied to a feature workflow**: it needs a `<CHANGE_DIR>` (a change folder from a prior `/spec.specify` run, ak-spec) and may run an `architect-feature` lead for external research when the topic needs it.
This skill ships in ak-spec, but its team files and shared plumbing live in ak-team, next to `/tech.audit`'s. Kit files below are relative to the ak-team plugin root `<AK_TEAM>` = `$(cd "$(dirname "$(command -v ak-resolve-team)")/.." && pwd)` (command not found → stop and tell the user to enable `ak-team@agent-kit`): `teams/architect-team/base.md` (shared pattern), `teams/<workflow>/team.json` (default teams), `runtimes/`. Invoke the `spawn-team-with-command-model` skill before the first spawn.
## Setup
1. **Pick the workflow**. A path with no topic (`/spec.tech <CHANGE_DIR>`, as `/spec.specify` names the next step): the topic is the feature its `1-requirements/scope.md` names (else the `description:` in its `.change.yaml`), a new feature to be built. Use `spec-tech-feature` (an `architect-feature` lead runs first, then the other architects) when the topic involves:
- Investigating a **new feature** to be built (e.g., "how to add real-time notifications")
- Evaluating a **third-party service/library** (e.g., "using a hosted search service")
- Exploring a **major architectural change** (e.g., "migrating from REST to GraphQL")
- Any topic where **external research + internal codebase analysis** are both needed
Otherwise use `spec-tech` (purely internal topics, e.g. "investigate performance issues", "find dead code", "review error handling").
2. **Resolve the change folder**: a path in $ARGUMENTS → `ak-resolve-change-dir "<path>" --json`; no path on a change branch → `ak-resolve-change-dir --json` (ak-spec) → `CHANGE_DIR` (absolute) and `CHANGE_WORKTREE`. On error, or no path off a change branch, stop and tell the user to pass `<CHANGE_DIR>`. Warn if `<CHANGE_DIR>/1-requirements/` is missing; when `1-requirements/scope.md` and the stories exist, the architects read them as the spec. Output goes to `<CHANGE_DIR>/3-technical/`.
3. **Create the output directory**: `mkdir -p <CHANGE_DIR>/3-technical`
4. **Resolve the team**: `ak-resolve-team <workflow> --project <repo root> --worktree <CHANGE_WORKTREE> > <scratchpad>/team.resolved.json` (the session scratchpad; not committed). Show its stderr summary line (and any partial-config warning) to the user. A non-zero exit: relay every error line and stop — nothing is spawned. Every seat count, seat name, phase, output path and model below comes from this file; the project changes the team in `.agent-kit/config.json` under `teams.<workflow>`.
5. **Size the topic** before anything is spawned, with the ak-spec sizing rule (`${CLAUDE_PLUGIN_ROOT}/skills/implementation-from-spec/SKILL.md` §Size the work): run its single-goal test, then state the tier in one line so the user can override it. `spec-tech-feature` always keeps every seat. `spec-tech` keeps the roster at standard or large; at small it runs small mode, which pairs areas: `architect-perf` into `architect-infra`, `architect-refactoring` into `architect-quality`. For each pair whose two seats are both in the roster, note the partner's `roleFile` and `outputs`. Then resolve again with these flags added, and overwrite `<scratchpad>/team.resolved.json`:
- `--set <partner>.enabled=false`;
- `--set '<host>.outputs=<JSON list: the host's outputs, then the partner's>'`.
The host's prompt lists the partner's `roleFile` as its paired role file (Composing-Prompt Pattern), so one agent writes both area files.
## Execution Rules
Follow the **Shared Execution Rules** from base.md. Investigate-specific:
- **Agent file output location** — each agent writes its `outputs` (and any folded seat's `outputs`) under `<CHANGE_DIR>/` using ABSOLUTE paths. The orchestrator writes only `3-technical/00-overview.md`.
- **No cross-review here** — `/spec.align` (ak-spec) reconciles these files against the spec next. Stop each agent once its file is validated.
- The `lead: true` agent (`architect-feature` in `spec-tech-feature`) runs in the first phase and has final say on feature feasibility.
## Escalation Rules
- Technical disputes between architects → the lead agent (if the roster has one) has final say on feature/integration feasibility; otherwise majority consensus
- Disagreements on severity or priority → orchestrator makes final call in the overview
- Any assumption about a requirement, scope edge, UX choice, data rule or priority that the sources do not answer → `clarify-first` skill: agents send their questions to the orchestrator, the orchestrator asks the user in one batch, answers go to `<CHANGE_DIR>/clarifications.md`; work that does not depend on the answer continues
## Agent Output Validation
Follow the **Shared Agent Output Validation (core)** from base.md. No additional skill-specific checks.
## Composing an Architect Prompt
Follow the **Shared Composing-Prompt Pattern** from base.md, with the file paths from each agent's entry in `team.resolved.json`. Substitutions:
- `{MISSION_VERB}` → `investigating`
- `{TOPIC}` → the investigation topic from `$ARGUMENTS` (or a distilled summary)
- `{OUTPUT_LOCATION}` → `<CHANGE_DIR>/` + each of the agent's `outputs` (and folded `outputs`), absolute
The lead agent's prompt also lists the other agents in the roster (seat name + `roleFile`) so its "Tasks for Other Architects" match them.
When the lead agent ran in an earlier phase, append to each later agent's prompt — **paths only, NOT inline content**:
```
## Research Context from Lead Architect
Read this file before starting your investigation — it contains the topic summary, recommended approach, codebase impact, and risk list:
<CHANGE_DIR>/<lead agent's output>
## Your Specific Tasks
[Insert this agent's tasks (and its folded seats' tasks), copied verbatim from the "Tasks for Other Architects" section of the lead's brief — typically 3–6 bullet points naming exact files and questions to investigate]
```
The orchestrator reads only the "Tasks for Other Architects" section of the lead's file and inlines each agent's list. The research brief stays in the file; each agent Reads it.
## Dispatch, phase by phase
For each phase in `phases` (ascending), spawn every agent whose `phase` matches **in parallel** (one message), per `spawn-team-with-command-model`: the call its `spawn` picks (`runtimes/claude.md`; the kit default is `subagent`, so no `name`), its `model` passed explicitly, Codex seats through Orca per `runtimes/codex.md`. A phase completes on each agent's final message; validate and stop each one before the next phase starts. Shape of one Claude call:
```
Agent({
name: "<agent>", // teammate seats only
description: "Architect: <seat> investigation",
model: "<model from team.resolved.json>",
prompt: [compose per Shared Composing-Prompt Pattern; append the lead's research context in later phases]
})
```
## Overview & Save Report
Validate each agent's file(s) per base.md §Shared Agent Output Validation (headings + Summary). **Do not copy or rewrite the area files.**
### Write `00-overview.md`
Build it from each file's `## Summary` (and the lead's §Recommended Approach when present); read a finding only to settle a severity, an implementation-order dependency, a conflict or a decision's rejected alternatives.
```markdown
# Technical Investigation: [topic]
> **Date**: [current date]
> **Team**: [the agents in team.resolved.json, with folded seats]
> **Trigger**: `/spec.tech [original query]`
## Executive Summary
[2-3 sentences: what was investigated, key findings count, overall health assessment]
## Findings Summary
| # | Finding | Severity | Architect | Area |
| --- | ------- | ------------------------ | -------------- | ------------------------ |
| 1 | [title] | critical/high/medium/low | [who found it] | [seat / output file] |
| ... | ... | ... | ... | ... |
## Disagreements
[Conflicting recommendations between area files, with both perspectives noted — omit when none]
## Decisions
[Only binding calls: two parts built independently could choose incompatibly, the answer is not obvious, and it is a real trade-off. One bullet each: the decision, its source file, then `Rejected: <alternative> — <why>` for every alternative the lead's brief or an area file's `Rejected` line weighed (`Rejected: none recorded` when none names one). A decision that adds a package carries the lead's new-package check. The reasons stay in the source files.]
### Deferred
[Every other library, provider, pattern or data-model choice, one line each with its recommendation; the implementer settles it]
## Implementation Order
1. [First item — and what it unblocks]
## Top 10 Recommendations (Prioritized)
1. [Most impactful recommendation]
2. ...
## Open Questions
[Every open item and Needs Validation entry from the area files and the lead's file, with its decider. Items for the user go into `clarifications.md` in the same commit.]
## Potential Next Steps
- [ ] [Actionable items that could become feature tasks or issues]
```
### Topic routing (which file each architect writes what into)
Findings can cross category lines; with the default seats, route them to avoid duplication:
- Technology decisions, API contracts, migration notes → `architecture-infrastructure.md`
- Auth/authz, input validation, security-pass results → `code-quality-security.md`
- Protected-field exposure per role (privacy) → `privacy.md`
- Query benchmarks, cache strategy, perf budgets → `performance-scalability.md`
- Component/shared-logic reuse, type consolidation → `refactoring-reuse.md`
## Workflow mode
If the user opted into workflows ("use a workflow"), run the gather engine instead of the dispatch and overview steps. Workflow mode runs only the `spec-tech` workflow: when step 1 picked `spec-tech-feature`, say in one line that its `architect-feature` research lead cannot run inside the gather engine, and use the normal dispatch path. Otherwise: resolve the team with `--via-workflow` added and without small mode (the engine has no paired-role-file slot; Codex seats cannot run inside a Workflow script and the resolver refuses them), then `Workflow({ scriptPath: "<AK_TEAM>/workflows/investigation-gather-engine.js", args: { mode: "investigate", target: "<CHANGE_DIR>", team: <contents of team.resolved.json> } })`. Cleanup still runs; the workflow cannot ask, so afterwards the lead batches open questions per `clarify-first`.
## Cleanup
Follow the **Shared Cleanup Pattern** from base.md with `<OUTPUT_DIR>` = `<CHANGE_DIR>/3-technical/`, then `git -C <CHANGE_WORKTREE> add <CHANGE_DIR>/3-technical <CHANGE_DIR>/clarifications.md` (the latter only when present) and commit `docs(<slug>): tech investigation`.
**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 = tech investigation written, Next step = `/spec.align <CHANGE_DIR>`.
Final message: "Investigation complete. Report saved to `<CHANGE_DIR>/3-technical/`. [N] findings across [X] files. Team cleaned up."
Unless invoked from a pipeline phase, stop and name the next command (`/spec.align <CHANGE_DIR>`); run it only on the user's go. Stop also for a pending `clarify-first` batch.