# moovaio/sdd-toolkit architecture

> Architecture diagram of the GitHub repository moovaio/sdd-toolkit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moovaio/sdd-toolkit
- Repository: https://github.com/moovaio/sdd-toolkit

## Overview

#### Purpose and Distribution Model
`sdd-toolkit` is a Node-based installer/updater that standardizes Moova’s Spec-Driven Development assets across target repositories. It distributes versioned, managed AI-agent instructions while preserving consumer-owned OpenSpec scaffolding and unsupported ticket integrations. Package entry behavior is implemented in `bin/init.js`; reusable source assets live under `template/`.

#### CLI Entry Point and Lifecycle
The executable supports `init` and `update` operations from a consumer repository. `init` resolves selected agent tools and ticket system, installs managed files, creates tool-facing links, writes `.sdd-toolkit.json`, and copies the OpenSpec scaffold only if absent. `update` reads that manifest and refreshes managed assets, optionally as a dry run.
- `bin/init.js`
- `template/scaffold/openspec/config.yaml`

#### Managed Asset Source of Truth
The template’s `ai-specs` tree is the canonical payload copied into the consumer repo’s committed `ai-specs/` directory. These files are intentionally replaceable on update; agent-specific directories such as `.claude/` are symlink projections to avoid duplicated content. The installer’s agent-tool mapping determines which categories each tool receives.
- `template/ai-specs/agents/spec-reviewer.md`
- `template/ai-specs/commands/implement.md`
- `template/ai-specs/skills/`

#### OpenSpec Workflow Stages
The toolkit packages four OpenSpec-oriented skills representing the core change lifecycle: explore an existing system, propose a change, apply an approved change, then archive it. Slash-command wrappers expose corresponding `/opsx:*` workflows. These instructions require the externally installed OpenSpec CLI rather than implementing OpenSpec itself.
- `template/ai-specs/skills/openspec-explore/SKILL.md`
- `template/ai-specs/skills/openspec-propose/SKILL.md`
- `template/ai-specs/commands/opsx/`

#### Ticket-to-Implementation Boundary
Ticket handling converts an idea into a grounded ticket draft and drives implementation from ticket context through branch, OpenSpec, review, and code steps. Ticket-system profiles separate provider-specific retrieval conventions from common command behavior. Jira and Trello are native choices; unknown systems receive an editable fallback that update must not overwrite.
- `template/ai-specs/commands/ticket.md`
- `template/ai-specs/tickets/jira/ticket-system.md`
- `template/ai-specs/tickets/_unsupported/ticket-system.md`

#### Review and Governance
An independent spec reviewer agent provides adversarial review of OpenSpec changes, forming a quality gate around the proposal/application workflow. Command and skill markdown are prompt-level control planes consumed by configured agent tooling, not application runtime code.
- `template/ai-specs/agents/spec-reviewer.md`
- `template/ai-specs/commands/implement.md`

#### Runtime and External Dependencies
Runtime is Node.js 18+ invoked through `npx`, including GitHub-hosted package execution. Consumer environments must install `@fission-ai/openspec`; ticket systems are represented as instruction templates and may require external Jira/Trello access configured by the consuming agent environment. No server, database, or web application runtime is present.
- `package.json`
- `bin/init.js`

Main entry points: [`bin/init.js`](https://github.com/moovaio/sdd-toolkit/blob/main/bin/init.js) (CLI lifecycle), [`template/ai-specs/commands/ticket.md`](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/ticket.md) (Ticket command), [`template/ai-specs/skills/openspec-explore/SKILL.md`](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/skills/openspec-explore/SKILL.md) (OpenSpec skills), [`template/ai-specs/agents/spec-reviewer.md`](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/agents/spec-reviewer.md) (Spec reviewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_toolkit["sdd-toolkit package"]
  node_cli["CLI lifecycle<br/>Node CLI<br/>[init.js]"]
  node_package["Package runtime<br/>Node 18+ package<br/>[package.json]"]
  node_template["Template assets<br/>managed payload"]
  node_agent["Spec reviewer<br/>agent instruction<br/>[spec-reviewer.md]"]
  node_implement["Implementation command<br/>command instruction<br/>[implement.md]"]
  node_opsx["OpenSpec command wrappers<br/>slash commands<br/>[apply.md]"]
  node_skills["OpenSpec skills<br/>workflow instructions<br/>[SKILL.md]"]
  node_ticket["Ticket command<br/>command instruction<br/>[ticket.md]"]
  node_jira["Jira profile<br/>ticket profile<br/>[ticket-system.md]"]
  node_fallback["Unsupported ticket profile<br/>editable fallback<br/>[ticket-system.md]"]
end

subgraph group_consumer["Consumer repository"]
  node_manifest["Toolkit manifest<br/>installation state"]
  node_managed["Committed ai-specs<br/>managed content"]
  node_links["Agent-tool links<br/>symlink projections"]
  node_scaffold["OpenSpec scaffold<br/>consumer-owned scaffold<br/>[config.yaml]"]
end

subgraph group_external["External dependencies"]
  node_npx{{"npx execution<br/>package runner"}}
  node_openspec{{"OpenSpec CLI<br/>external CLI"}}
  node_providers{{"Jira / Trello access<br/>external services"}}
end

node_npx -->|"invokes"| node_cli
node_package -->|"defines runtime"| node_cli
node_cli -->|"reads source assets"| node_template
node_cli -->|"init/update copies"| node_managed
node_cli -->|"creates selected links"| node_links
node_cli -->|"writes and reads"| node_manifest
node_cli -->|"copies if absent"| node_scaffold
node_template -->|"includes"| node_agent
node_template -->|"includes"| node_implement
node_template -->|"includes"| node_opsx
node_template -->|"includes"| node_skills
node_template -->|"includes"| node_ticket
node_ticket -->|"selects profile"| node_jira
node_ticket -->|"uses when unsupported"| node_fallback
node_ticket -.->|"uses configured access"| node_providers
node_opsx -->|"drives stages"| node_skills
node_skills -->|"requires"| node_openspec
node_agent -->|"reviews proposals and changes"| node_skills
node_implement -->|"passes review gate"| node_agent
node_managed -->|"canonical target"| node_links
node_manifest -.->|"preserves on update"| node_fallback

click node_cli "https://github.com/moovaio/sdd-toolkit/blob/main/bin/init.js"
click node_package "https://github.com/moovaio/sdd-toolkit/blob/main/package.json"
click node_agent "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/agents/spec-reviewer.md"
click node_implement "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/implement.md"
click node_opsx "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/opsx/apply.md"
click node_skills "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/skills/openspec-explore/SKILL.md"
click node_ticket "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/ticket.md"
click node_jira "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/tickets/jira/ticket-system.md"
click node_fallback "https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/tickets/_unsupported/ticket-system.md"
click node_scaffold "https://github.com/moovaio/sdd-toolkit/blob/main/template/scaffold/openspec/config.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_package,node_template,node_agent,node_implement,node_opsx,node_skills,node_ticket,node_jira,node_fallback toneBlue
class node_manifest,node_managed,node_links,node_scaffold toneAmber
class node_npx,node_openspec,node_providers toneMint
```

## Components

### sdd-toolkit package

Node-based installer and versioned instruction source.

- [CLI lifecycle](https://github.com/moovaio/sdd-toolkit/blob/main/bin/init.js): Node CLI · Handles init and update operations. · `bin/init.js`
- [Package runtime](https://github.com/moovaio/sdd-toolkit/blob/main/package.json): Node 18+ package · `package.json`
- **Template assets**: managed payload · Canonical source copied into consumer repositories.
- [Spec reviewer](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/agents/spec-reviewer.md): agent instruction · Independent adversarial review gate for OpenSpec changes. · `template/ai-specs/agents/spec-reviewer.md`
- [Implementation command](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/implement.md): command instruction · `template/ai-specs/commands/implement.md`
- [OpenSpec command wrappers](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/opsx/apply.md): slash commands · Exposes /opsx workflow commands to agent tools. · `template/ai-specs/commands/opsx/apply.md`
- [OpenSpec skills](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/skills/openspec-explore/SKILL.md): workflow instructions · Explore, propose, apply, and archive change stages. · `template/ai-specs/skills/openspec-explore/SKILL.md`
- [Ticket command](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/commands/ticket.md): command instruction · Turns an idea or ticket context into implementation work. · `template/ai-specs/commands/ticket.md`
- [Jira profile](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/tickets/jira/ticket-system.md): ticket profile · Provider-specific ticket retrieval conventions. · `template/ai-specs/tickets/jira/ticket-system.md`
- [Unsupported ticket profile](https://github.com/moovaio/sdd-toolkit/blob/main/template/ai-specs/tickets/_unsupported/ticket-system.md): editable fallback · Consumer-owned fallback that update does not overwrite. · `template/ai-specs/tickets/_unsupported/ticket-system.md`

### Consumer repository

Repository receiving managed SDD assets.

- **Toolkit manifest**: installation state · Records selected tools and ticket system for updates.
- **Committed ai-specs**: managed content · Replaceable instruction payload in the consumer repository.
- **Agent-tool links**: symlink projections · Agent-specific directories point to canonical managed content.
- [OpenSpec scaffold](https://github.com/moovaio/sdd-toolkit/blob/main/template/scaffold/openspec/config.yaml): consumer-owned scaffold · Copied only when absent and preserved thereafter. · `template/scaffold/openspec/config.yaml`

### External dependencies

- **npx execution**: package runner · Runs the toolkit, including GitHub-hosted package execution.
- **OpenSpec CLI**: external CLI · Executes the workflow required by the packaged instructions.
- **Jira / Trello access**: external services · Access is configured by the consuming agent environment.

## Connections

- npx execution → CLI lifecycle: invokes
- Package runtime → CLI lifecycle: defines runtime
- CLI lifecycle → Template assets: reads source assets
- CLI lifecycle → Committed ai-specs: init/update copies
- CLI lifecycle → Agent-tool links: creates selected links
- CLI lifecycle → Toolkit manifest: writes and reads
- CLI lifecycle → OpenSpec scaffold: copies if absent
- Template assets → Spec reviewer: includes
- Template assets → Implementation command: includes
- Template assets → OpenSpec command wrappers: includes
- Template assets → OpenSpec skills: includes
- Template assets → Ticket command: includes
- Ticket command → Jira profile: selects profile
- Ticket command → Unsupported ticket profile: uses when unsupported
- Ticket command → Jira / Trello access: uses configured access
- OpenSpec command wrappers → OpenSpec skills: drives stages
- OpenSpec skills → OpenSpec CLI: requires
- Spec reviewer → OpenSpec skills: reviews proposals and changes
- Implementation command → Spec reviewer: passes review gate
- Committed ai-specs → Agent-tool links: canonical target
- Toolkit manifest → Unsupported ticket profile: preserves on update
