# TAS Kit

TAS Kit - Turbo Agentic SDLC toolkit for modern AI-first software teams.

---

## Purpose

TAS Kit helps software development teams:
- **Standardize SDLC process** with clear artifacts (PRD, SAD, ADR, Feature, Feature-Technical)
- **Optimize token usage** through Context Layer — invest in design phase, save in code phase
- **Support multiple workflows**: from solo developer to full team with PE/SE/DSE roles
- **Automate** with Hybrid and Autonomous agents operating 24/7

> **Kit v3 — Feature-only flow:** Epic and User Story were removed. Feature is now the single TAS work unit — one complete business flow that may span multiple stacks (`app` | `web` | `service` | `integration`). Per-stack technical breakdown lives in `Feature-{NNN}-Technical.md`. See [Migration](#migration-from-v1v2-epicstory-flow) at the bottom.

---

## Design Philosophy

### Spec-Driven Development
All code starts from spec. Each Feature owns a paired `Feature-{NNN}.md` (business AC) and `Feature-{NNN}-Technical.md` (global: Context Diagram, Data Flow, API Spec, ERD; per-stack: Logic Flow, File Changes, Config, Unit Tests, Tasks). Each implementation session only needs to read CLAUDE.md + the two Feature files — no need to reload PRD/SAD/ADR.

### Human-Led, AI-Powered
- **Human-led**: Architecture decisions, design approval, code review
- **AI-assisted**: Draft creation, implementation per spec, test execution, bug detection

### Dual Mode Operation
- **Hybrid Mode**: Developer and AI work together in session
- **Autonomous Mode**: AI automatically develops 24/7, reports results when done

### Lightweight & Context-Aware
- Each skill < 3KB, total kit < 50KB
- Context Layer: invest tokens in design phase to save many times in code phase
- When coding: MUST start new session (don't reuse old session that loaded PRD/SAD to avoid Window Context bloat)

### Role-Based & Template-Driven
- 3 roles: PE (Product Engineer), SE (Software Engineer), DSE (DevOps Engineer)
- Separate templates for PRD, SAD, ADR, Feature, Feature-Technical per team standards
- Flow configurable via `tas.yaml` file

### Azure DevOps Compatible
- Markdown output compatible with Azure DevOps Wiki
- Mermaid diagrams don't use `()` characters (avoid conflict with ADO syntax)

---

## SDLC Workflow

:::mermaid
graph TD
    subgraph Phase1["Phase 1: Discovery"]
        BRD["/tas-brd"]
        PRD["/tas-prd"]
        SAD["/tas-sad"]
        ADR["/tas-adr"]
        DESIGN["/tas-design-uiux"]
        DESIGNSPEC["/tas-design-spec"]
        BRD -->|Product Engineer| BRD_ARTIFACT["BRD.md"]
        BRD_ARTIFACT -->|Product Engineer| PRD
        PRD -->|Product Engineer| PRD_ARTIFACT["PRD.md"]
        PRD_ARTIFACT -->|Software Engineer| SAD
        PRD_ARTIFACT -->|Software Engineer| ADR
        SAD --> SAD_ARTIFACT["SAD.md"]
        ADR --> ADR_ARTIFACT["ADR-XXX.md"]
        PRD_ARTIFACT -->|Product Engineer| DESIGN
        DESIGN --> DESIGN_ARTIFACT["design-uiux.md + docs/ui/*.html"]
        DESIGN_ARTIFACT -->|Product Engineer| DESIGNSPEC
        DESIGNSPEC --> DESIGNSPEC_ARTIFACT["design-spec.md"]
    end

    subgraph Phase2["Phase 2: Planning"]
        FEATURE["/tas-feature"]
        PLAN["/tas-plan"]
        MASTERPLAN["/tas-master-plan"]
        PRD_ARTIFACT -->|Product Engineer| FEATURE
        FEATURE --> FEATURE_ARTIFACT["Feature-XXX/"]
        SAD_ARTIFACT --> PLAN
        DESIGN_ARTIFACT --> FEATURE
        FEATURE_ARTIFACT -->|Software Engineer| PLAN
        PLAN --> TECH_ARTIFACT["Feature-XXX-Technical.md"]
        PRD_ARTIFACT -->|Tech Lead| MASTERPLAN
        SAD_ARTIFACT --> MASTERPLAN
        FEATURE_ARTIFACT -->|All Features created| MASTERPLAN
        MASTERPLAN --> MP_ARTIFACT["docs/master-plan.md"]
    end

    subgraph Phase3["Phase 3: Implementation"]
        ORCHESTRATE["/tas-orchestrate"]
        DEV["/tas-dev"]
        DEBUG["/tas-debug"]
        FIX["/tas-fix"]
        APItest["/tas-apitest"]
        E2E["/tas-e2e"]
        FUNCTEST_WEB["/tas-functest-web"]
        FUNCTEST_MOBILE["/tas-functest-mobile"]
        E2E_WEB["/tas-e2e-web"]
        E2E_MOBILE["/tas-e2e-mobile"]
        BUG["/tas-bug"]
        REVIEWPR["/tas-review-pr"]
        FUNctest["/tas-functest"]
        MP_ARTIFACT -->|Autonomous| ORCHESTRATE
        TECH_ARTIFACT -->|Hybrid| DEV
        ORCHESTRATE --> CODE["Source Code"]
        DEV --> CODE
        CODE -->|Build fails| DEBUG
        DEBUG --> CODE
        CODE -->|Bug found| FIX
        FIX --> CODE
        CODE -->|PR created| REVIEWPR
        REVIEWPR --> REVIEW_ARTIFACT["PR Comments + Vote"]
        TECH_ARTIFACT -->|Software Engineer| APItest
        APItest --> APITEST_ARTIFACT["API Testing Script"]
        FEATURE_ARTIFACT -->|Product Engineer| CHECKLIST["/tas-TestChecklist"]
        CHECKLIST --> TESTCHECKLIST_ARTIFACT["TestChecklist.md"]
        TESTCHECKLIST_ARTIFACT -->|Product Engineer| FUNctest
        FUNctest --> FUNCTEST_ARTIFACT["Func-Test-Spec.md"]
        FUNCTEST_ARTIFACT -->|Product Engineer| E2E
        E2E --> E2E_ARTIFACT["E2E Test Scenarios"]
        FUNCTEST_ARTIFACT -->|Software Engineer| FUNCTEST_WEB
        FUNCTEST_WEB --> FUNCTEST_WEB_ARTIFACT["Functional Test Web Script"]
        FUNCTEST_ARTIFACT -->|Software Engineer| FUNCTEST_MOBILE
        FUNCTEST_MOBILE --> FUNCTEST_MOBILE_ARTIFACT["Functional Test Mobile Script"]
        FUNCTEST_ARTIFACT -->|Product Engineer| E2E_WEB
        E2E_WEB --> E2E_WEB_ARTIFACT["E2E Web Test Script"]
        FUNCTEST_ARTIFACT -->|Product Engineer| E2E_MOBILE
        E2E_MOBILE --> E2E_MOBILE_ARTIFACT["E2E Mobile Test Script"]
        CODE -->|Bug found| BUG
        BUG --> BUG_ARTIFACT["Bug Report"]
    end

    subgraph Phase4["Phase 4: Quality & Deploy"]
        SECURITY["/tas-security"]
        PIPELINE["Pipeline / CLI"]
        CODE -->|DevOps Engineer| SECURITY
        SECURITY --> SECURITY_ARTIFACT["Security Report"]
        APITEST_ARTIFACT -->|Product Engineer| PIPELINE
        FUNCTEST_WEB_ARTIFACT --> PIPELINE
        FUNCTEST_MOBILE_ARTIFACT --> PIPELINE
        E2E_WEB_ARTIFACT --> PIPELINE
        E2E_MOBILE_ARTIFACT --> PIPELINE
        PIPELINE --> TEST_REPORT["Test Report"]
        SECURITY_ARTIFACT -->|DevOps Engineer| DEPLOY["Production"]
        TEST_REPORT --> DEPLOY
    end

    STATUS["/tas-status"] -.->|Track| PRD_ARTIFACT
    STATUS -.->|Track| SAD_ARTIFACT
    STATUS -.->|Track| FEATURE_ARTIFACT
    STATUS -.->|Track| TECH_ARTIFACT
    STATUS -.->|Track| DEPLOY

    style BRD_ARTIFACT fill:#e1f5ff
    style PRD_ARTIFACT fill:#e1f5ff
    style SAD_ARTIFACT fill:#fff4e1
    style DESIGN_ARTIFACT fill:#f3e5f5
    style FEATURE_ARTIFACT fill:#e8f5e9
    style TECH_ARTIFACT fill:#e8f5e9
    style MP_ARTIFACT fill:#e8f5e9
    style CODE fill:#f3e5f5
    style TEST_REPORT fill:#c8e6c9
    style DEPLOY fill:#c8e6c9
:::

### Phase Summary

| Phase | Role | Commands | Artifacts |
|-------|------|----------|-----------|
| **Phase 1: Discovery** | PE, SE | `/tas-brd`, `/tas-prd`, `/tas-sad`, `/tas-adr`, `/tas-design-uiux`, `/tas-design-spec` | BRD.md, PRD.md, SAD.md, ADR-XXX.md, design-uiux.md, design-spec.md |
| **Phase 2: Planning** | PE, SE | `/tas-feature`, `/tas-plan`, `/tas-functest`, `/tas-master-plan` | Feature-XXX/, Feature-XXX-Technical.md, Func-Test-Spec.md, docs/master-plan.md |
| **Phase 3: Implementation** | PE, SE, AI | `/tas-orchestrate`, `/tas-dev`, `/tas-debug`, `/tas-fix`, `/tas-apitest`, `/tas-e2e`, `/tas-functest-web`, `/tas-functest-mobile`, `/tas-e2e-web`, `/tas-e2e-mobile`, `/tas-bug`, `/tas-review-pr` | Source Code, API Testing Script, E2E Test Scenarios, Functional Test Scripts, Bug Report, PR Review Comments |
| **Phase 4: Quality & Deploy** | PE, DSE | `/tas-security`, Pipeline/CLI | Security Report, Test Report, Production |

### Phase Details

#### Phase 1: Discovery
- **PE**: Create BRD with `/tas-brd` — business objectives (BO), measurable business requirements (BR), business rules (BRU), actors (AT), scope first
- **PE**: Create PRD with `/tas-prd` (consumes BRD.md). For UI projects (Stage 02, optional): `/tas-design-uiux` (Screen Inventory + Design Brief → Claude Design HTML), then `/tas-design-spec` (extract tokens/components from the HTML)
- **SE**: Create SAD with `/tas-sad`, create ADR with `/tas-adr`

#### Phase 2: Planning
- **PE**: Create Feature with `/tas-feature` — one Feature per business requirement (may span multiple stacks), AC in Given/When/Then
- **SE**: Generate `Feature-XXX-Technical.md` with `/tas-plan` — global sections (Context Diagram, Data Flow, API Spec, ERD) + per-stack sections (Logic Flow, File Changes, Config, Unit Tests, Tasks)
- **PE/SE**: Create Func-Test-Spec with `/tas-functest`
- **Tech Lead**: After all Features are created, run `/tas-master-plan` — reads PRD FR list + SAD, scans Feature files to resolve dependencies, generates `docs/master-plan.md` with detailed strategy + machine-readable execution tracks

#### Phase 3: Implementation
- **AI (Autonomous)**: Run `/tas-orchestrate` — executes master plan by spawning `software-engineer` agents per Feature in track order; supports resume and 24/7 unattended mode
- **SE (Hybrid)**: Implement with `/tas-dev` (consumes Feature + Feature-Technical), fix with `/tas-fix`
- **SE (Autonomous)**: `/tas-dev --autonomous=true` or set `autonomy_mode: full` in `tas.yaml` — auto-runs `/tas-plan` if no Technical file exists, implements without interruption, auto-marks Done when review passes; use for Features with clear scope where SE trusts full AI execution
- **SE**: When build/runtime errors occur, run `/tas-debug` — full build-debug loop until resolved
- **SE**: Create API Testing Script with `/tas-apitest`
- **PE**: Create E2E Test Scenarios with `/tas-e2e` (chains multiple Features into a flow)
- **SE**: Create Functional Test Scripts with `/tas-functest-web`, `/tas-functest-mobile`
- **PE**: Create E2E Test Scripts with `/tas-e2e-web`, `/tas-e2e-mobile`
- **PE**: Create Bug Report with `/tas-bug`
- **SE**: Review PR with `/tas-review-pr` — auto-detects ADO/GitHub, posts inline comments + approve/request-changes vote

#### Phase 4: Quality & Deploy
- **DSE**: Security Review with `/tas-security`
- **PE**: Run Pipeline/CLI to execute Automation Tests
- **DSE**: Deploy to Production

---

## Quick Start

```bash
npx @torus-engineering/tas-kit install
```

### Options

```bash
npx @torus-engineering/tas-kit install --directory /path/to/my-project
npx @torus-engineering/tas-kit install --yes    # skip confirmation prompts
```

---

## Important Setup

### CLAUDE.md

Most important configuration file — Claude reads this file first in every session.

**Structure:**
```markdown
# Project Name

## Tech Stack
- Backend: .NET / Node.js / Python
- Frontend: React / Next.js
- Database: PostgreSQL / MySQL
- Infrastructure: AWS / Azure

## Conventions
- Coding standards
- Architecture patterns
- Testing requirements
```

### tas.yaml

Controls TAS Kit flow per project.

**Structure:**
```yaml
project:
  name: "My Project"
  team: "Team Name"

azure_devops:
  enabled: true
  organization: "org"
  project: "project"

flow:
  mode: "greenfield"  # or "brownfield"
  use_tdd: true
  auto_review: true
```

### project-status.yaml

Project status index — automatically updated after each artifact change.

**Structure:**
```yaml
last_updated: 2025-01-15

artifacts:
  prd:
    file: docs/prd.md
    status: Approved
    version: "1.0"

features:
  Feature-001:
    path: docs/features/PROJ-Feature-001-checkout/
    title: "Checkout flow"
    stack: web
    status: In Development
    plan_status: completed
```

### .env

Environment variables for Azure DevOps integration.

```bash
AZURE_DEVOPS_PAT=your_pat_here
AZURE_DEVOPS_ORG=your_org
AZURE_DEVOPS_PROJECT=your_project
```

---

## What gets installed

```
.claude/
  commands/   slash commands (/tas-*, /ado-*)
  skills/     auto-invoked skills
  agents/     specialized subagents
.tas/
  templates/  Markdown templates (PRD, SAD, ADR, Feature, Feature-Technical, Bug...)
  rules/      Coding standards + workflow rules (code-review, feature-done, security...)
  tools/      ADO integration script (tas-ado.py)
CLAUDE.md     Project context template (edit this for your project)
tas.yaml      Flow configuration template (edit this for your project)
.env.example  Environment variable template
```

---

## Commands Reference

| Command | Description | Role |
|---------|-------------|------|
| `/tas-init` | Initialize TAS for new project | All |
| `/tas-status` | Display current project status | All |
| `/tas-brd` | Create/update Business Requirements Document (BO, BR, BRU, actors, entities, scope) | PE |
| `/tas-prd` | Create/update Product Requirements Document (consumes BRD.md) | PE |
| `/tas-sad` | Create/update Solution Architecture Document | SE |
| `/tas-adr` | Create Architecture Decision Record | SE |
| `/tas-design-uiux` | Create/update UI/UX Design (Screen Inventory + Design Brief for Claude Design) — optional Stage 02 | PE |
| `/tas-design-spec` | Create/update Design Spec (tokens/components extracted from Generated Screens) — optional Stage 02 | PE |
| `/tas-feature` | Create/update Feature (single TAS work unit, per stack) | PE |
| `/tas-plan` | Generate `Feature-XXX-Technical.md` (Context, Logic, Data, ERD, Files, Config) | SE |
| `/tas-TestChecklist` | Generate Test Checklist (high-level test design, ≥90% coverage gate) | PE |
| `/tas-functest` | Create Functional Test Spec (anchored on AC, input: TestChecklist) | SE |
| `/tas-master-plan` | Read PRD + SAD + Feature files → generate `docs/master-plan.md` (strategy + execution tracks) | Tech Lead |
| `/tas-spec` | Lightweight spec (solo / prototype) | SE |
| `/tas-orchestrate` | Execute master plan — spawn agents per Feature autonomously, supports resume | AI |
| `/tas-dev` | Implement Feature per Technical Plan. `--autonomous=true` or `autonomy_mode: full` in `tas.yaml` → auto-plan + implement + review end-to-end | AI |
| `/tas-debug` | Debug and resolve build/runtime/functional errors — full build-debug loop | SE |
| `/tas-fix` | Quick fix without full Feature flow | SE |
| `/tas-apitest` | Create API Testing Script automatically | SE |
| `/tas-e2e` | Create E2E Test Scenarios | PE |
| `/tas-functest-web` | Create Functional Test Script for Web | SE |
| `/tas-functest-mobile` | Create Functional Test Script for Mobile | SE |
| `/tas-e2e-web` | Create E2E Test Script for Web | PE |
| `/tas-e2e-mobile` | Create E2E Test Script for Mobile | PE |
| `/tas-bug` | Create Bug Report | PE |
| `/tas-review` | Code Review with checklist | SE |
| `/tas-review-pr` | Review PR — fetch diff, run agents, post inline comments + vote (ADO/GitHub) | SE |
| `/tas-brainstorm` | Brainstorm solutions | All |
| `/tas-security` | Security Review | DSE |
| `/ado-*` | Azure DevOps integration | All |

---

## Requirements

- Node.js 18+
- [Claude Code](https://claude.ai/code)

---

## Migration from v1/v2 (Epic/Story flow)

Kit v3 drops Epic and User Story. The single TAS work unit is Feature.

**What was removed:**
- Slash commands: `/tas-epic`, `/tas-story`
- Templates: `Epic.md`, `Story.md`
- Rule: `story-done.md` (replaced by `feature-done.md`)
- Nested `epics.{ID}.features.{ID}.stories.{ID}` schema in `project-status.yaml` (now flat `features.{ID}` map)
- ADO `epic` and `story` types in `/ado-*` commands and `tas-ado.py` (legacy work items pulled via `/ado-get` are saved as local `feature-*.md`)

**What was added:**
- New template `Feature-Technical.md` — generated by `/tas-plan` next to Feature file (`Feature-{NNN}-{slug}-Technical.md`). Has global sections (Context Diagram, Data Flow, API Spec, ERD) + per-stack sections (Logic Flow, File Changes, Config, Unit Tests, Tasks — one section per stack the Feature touches).
- Test ID convention anchored on AC: `{PROJECT}_F{FEATURE}_AC{N}_{TYPE}_{NUMBER}_{MODIFIER}`
- E2E ID drops Epic segment: `{PROJECT}_E2E_{NNN}_{MODIFIER}` (single-stack) or `{PROJECT}_XSTACK_E2E_{NNN}_{MODIFIER}` (cross-stack)

**How to migrate an existing project (manual, ~30 min for ~20 Features):**
1. Move directories: `docs/epics/{*}/Feature-{NNN}-{slug}/` → `docs/features/{CODE}-Feature-{NNN}-{slug}/`. Re-number Features globally if you want a flat sequence.
2. For each Feature directory:
   - Pick the existing Feature .md as the new business spec; delete the parent Epic .md.
   - Convert AC from checkbox style to Given/When/Then.
   - If Stories had Technical Plan content inline, lift it into a new `Feature-{NNN}-Technical.md` using `.tas/templates/Feature-Technical.md` (fill only the stack sections that apply). Then delete the Story files.
3. Rewrite `project-status.yaml`: drop `epics:` block, build a flat `features:` map (see `.tas/project-status-example.yaml`).
4. Rename test IDs: `{PROJ}_E{EPIC}_F{FEAT}_S{STORY}_*` → `{PROJ}_F{FEAT}_AC{N}_*` (regex find/replace per file).
5. On ADO: there's no API change required — TAS Features map to ADO `Feature` work items directly. Keep existing Epic/Story items as-is or close them; new TAS work uses `/ado-create feature ...` only.

> No automated `tas-migrate` command is shipped — the migration is mechanical and per-project. Run `/tas-status` after to verify.

---

## Changelog

### v2.2.0 — Artifact Governance v1.1 alignment

- BRD: split `BO` / `BR`, add Actors (`AT-NNN`), `BRU` scope + source.
- PRD: Product Goal `PG-NNN` (refs BR); personas from BRD.Actor.
- Stage 02 (optional, `ui_ux_stage`): `/tas-design` → `/tas-design-uiux` + `/tas-design-spec`.
- Feature: ACs tagged `(FR-NNN, BRU-NNN)`; Actor folded into User Flow.
- Feature-Technical: new `UI Binding` section.
- New `coverage-auditor` agent — runs the completeness/no-orphan gate before each approval.

### v2.1.0 — BRD, Master Plan, Orchestrate, Debug, Review PR

> **⚠️ Breaking change — Feature-first workflow**
>
> All work units are **Features**, stored under `docs/features/`. Every SE must start from a Feature file — no ad-hoc coding sessions.
>
> **Existing ADO User Stories pulled via `/ado-get`:** you can run `/tas-plan` + `/tas-dev` on those work items as-is — they behave as Features. No migration needed for in-flight work.
>
> **New tickets:** always create as Features with `/tas-feature` (or `/tas-master-plan` for full project planning) before running `/tas-plan` and `/tas-dev`. Do not create stories or epics — Feature is the only TAS work unit.

- Add `/tas-brd` — PE creates Business Requirements Document (BO, measurable BR, BRU, actors, scope/constraints) before PRD; `/tas-prd` consumes BRD.md for tighter business-to-product alignment
- Add `/tas-master-plan` — Tech Lead command that reads PRD FR list + SAD + Feature files, resolves dependencies, and generates `docs/master-plan.md` with detailed construction strategy and machine-readable execution tracks (YAML embedded)
- Add `/tas-orchestrate` — executes master plan by spawning `software-engineer` agents per Feature in stage/track order; supports resume and fully autonomous 24/7 mode
- `/tas-dev` gains autonomous mode: `--autonomous=true` flag or `autonomy_mode: full` in `tas.yaml` — auto-invokes `/tas-plan` when no Technical file exists, implements without interruption, auto-marks Done if review passes with no Critical/High findings; audit trail written to Feature `## Autonomous Decisions Log`
- Add `/tas-debug` — runs full build-debug loops to resolve build/runtime/functional errors; complements `/tas-fix` for post-implementation failures
- Add `/tas-review-pr` — auto-detects ADO or GitHub, fetches PR diff, runs parallel review agents, posts inline comments with approve/request-changes vote

### v2.0.0 — Feature-only flow + Feature-Technical template
- Remove Epic and User Story. Feature is the only TAS work unit — one complete business flow, may span multiple stacks.
- Add `Feature-Technical.md` template generated by `/tas-plan` — global sections (Context Diagram, Data Flow, API Spec, ERD, Affect to SAD?, Architecture Decisions) + per-stack sections (Logic Flow, File Changes, Config, Unit Test Cases, Tasks) — fill only stacks the Feature touches.
- `/tas-feature` infers stacks automatically from PRD + SAD — no manual stack annotation required.
- Test ID convention: `{PROJECT}_F{FEATURE}_AC{N}_{TYPE}_{NUMBER}_{MODIFIER}` to anchor tests on business AC.
- Updated project-status.yaml tracking to include Feature-Technical plan_status (pending/completed).
- E2E ID simplified: `{PROJECT}_E2E_{NNN}_{MODIFIER}` (single-stack) or `{PROJECT}_XSTACK_E2E_{NNN}_{MODIFIER}` (cross-stack).

### v1.14.0
- Support 4 Agentic Coding Platforms: Claude Code, Cursor, Codex, Antigravity
- Compress kit size — refactor commands, skills, rules to only include what's truly necessary
- Remove legacy agent and skill files

### v1.11.x
- Drop Claude Code branding from kit artifacts
- Set real Azure DevOps project_id in config
- Translate all documentation to English
