Skip to content

CAS Execution Sequence

sequenceDiagram
    participant Agent as Code Agent
    participant SDD Skills as SDD Framework
    participant CAS Skills as CAS Skills
    participant Repo as Codebase / PR
    participant CI as CI Pipeline
    participant Loader as Rules Context Loader
    participant Align as Alignment Engine
    participant CAS as CAS Knowledge (AEM/AID/ADR)

    Agent->>SDD Skills: Start Specification (speckit, superpower)
    Agent->>CAS Skills: Request guidance (patterns, contracts)
    CAS Skills-->>Agent: Suggestions / guardrails

    SDD Skills->>Repo: Generate spec, plan, tasks, tests, execute implementation
    Agent->>Repo: Commit code
    Agent->>Repo: Open Pull Request

    Repo->>CI: Trigger pipeline

    CI->>CI: Extract signals / patterns from code
    CI->>CI: Extract Deterministic Capabilities
    CI->>Loader: Load rule_context
    Loader-->>CI: rule_context

    CI->>Align: Run alignment (AEM vs AID + rules)
    Align->>CAS: Read AEM, AID, ADRs
    Align-->>CI: Alignment Findings

    CI-->>Repo: Post Audit Report (PR comment)

    CI->>CAS: Generate architecture_work
    CAS->>CAS: Update ADR / Patterns

    Agent->>Repo: Apply refactor (based on findings)

    Repo->>CI: Re-run pipeline (optional loop)

    CI-->>Repo: Final validation

    Agent->>Repo: Merge (stabilize)

See Also