Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/add-atd-workflow-facades.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@fission-ai/openspec": minor
---

### Features

- **ATD workflow façades** — four new workflows complete the five-step ATD journey started by `atd-triage`: `atd-continue` (skill `atd-change-continue`, `/opsx:atd-continue`), `atd-apply` (`atd-change-apply`, `/opsx:atd-apply`), `atd-verify` (`atd-change-verify`, `/opsx:atd-verify`), and `atd-close` (`atd-change-close`, `/opsx:atd-close`). Each is a thin façade composed from the corresponding generic workflow's shared instruction-body builder, adding ATD-only schema validation (`atd-sdlc` / `atd-sdlc-lite`; other schemas are directed to the generic workflow), journey naming, and step policy. `atd-close` hard-gates on `openspec instructions apply --json` reporting `state: "all_done"` — no incomplete-work override — and retains the archive workflow's delta-spec sync assessment; it never performs publication or Jira closure itself.
- **Core profile recomposed** — the default install is now the ATD journey: `atd-triage`, `atd-continue`, `atd-apply`, `atd-verify`, `atd-close`, plus `explore` and `update`. Generic `propose`, `continue`, `apply`, `verify`, `sync`, and `archive` leave the core profile but remain fully available through the custom profile (`openspec config profile`). Existing installs converge via `openspec update`'s standard profile-drift sync.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,26 @@ opencode.json

# Cursor
.cursor/
.agent/skills/openspec-apply-change/SKILL.md
.agent/skills/openspec-archive-change/SKILL.md
.agent/skills/openspec-explore/SKILL.md
.agent/skills/openspec-propose/SKILL.md
.agent/skills/openspec-sync-specs/SKILL.md
.agent/skills/openspec-update-change/SKILL.md
.agent/workflows/opsx-apply.md
.agent/workflows/opsx-archive.md
.agent/workflows/opsx-explore.md
.agent/workflows/opsx-propose.md
.agent/workflows/opsx-sync.md
.agent/workflows/opsx-update.md
.lavish/atd-sdlc-feasibility-review.html
.lavish/atd-sdlc-plan.html
.tokensave/branch-meta.json
.tokensave/config.json
.tokensave/tokensave.db
.tokensave/tokensave.db-shm
.tokensave/tokensave.db-wal
TRASH/docs-publishing-spec/spec.md
TRASH/telemetry-spec/spec.md
TRASH-FILES.md
.agent/
60 changes: 60 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ATD-OpenSpec

## What this project is

ATD's fork of [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec) (forked at v1.6.0). OpenSpec is a spec-driven development CLI: work is organized into **changes**, each change walks a **schema** (a DAG of artifacts — proposal, specs, design, tasks, …), and AI agents execute the workflow through generated **skills** and **slash commands**.

The fork adds an ATD-specific SDLC on top of the unmodified engine. **Fork policy: additive only** — new schemas, new workflow templates, new docs, additive registry entries. Core engine code (artifact-graph, resolver, CLI behavior) is never modified, so upstream syncs stay cheap.

## The goal

One workflow every ATD developer follows from **Jira ticket to documented, standards-conformant code**, across all four stacks (Python, Spring Boot, Oracle EBS PL/SQL, Angular):

1. **Triage** — classify a ticket as low-risk (lite) or full via a risk-based eligibility table; uncertainty always routes full.
2. **Ticket intake** — pull Jira + linked Confluence via the Atlassian MCP, gate on a completeness checklist, grill the developer one question at a time when data is missing, write clarified requirements back to Jira (confirmed, idempotent).
3. **Analysis** — code is the source of truth; every claim cites commit SHA + file:line; affected stacks named.
4. **Specs / Design / Solution doc** — every requirement traces to an acceptance-criterion ID; the enterprise solution document exists *before* implementation.
5. **Apply** — fetch the mapped coding standards per stack from the external `atd-standards` store, implement, then a mandatory final task group: standards conformance, solution-doc reconciliation, publication (Confluence/repo/both), idempotent Jira closure.
6. **Escalation** — lite changes escalate one-way to full when wider impact surfaces (never downgrade).

## Structure

```
schemas/ Workflow schemas (resolved built-in → user-global → project-local)
├── spec-driven/ Upstream default (untouched)
├── atd-sdlc/ Full ATD pipeline: ticket → analysis → (specs, design) → solution-doc → tasks
└── atd-sdlc-lite/ Lite pipeline for low-risk corrections: ticket → analysis → tasks
src/
├── core/artifact-graph/ Schema engine: resolver, graph, state, instruction assembly (DO NOT fork-modify)
├── core/templates/workflows/ One module per workflow skill/command (atd-triage.ts is the ATD pattern)
├── core/shared/ skill-generation.ts (registries), tool-detection.ts (SKILL_NAMES/COMMAND_IDS)
├── core/profiles.ts CORE_WORKFLOWS / ALL_WORKFLOWS
└── core/profile-sync-drift.ts WORKFLOW_TO_SKILL_DIR
skills/ COMMITTED generated artifacts (skills.sh distribution) — regenerate,
never hand-edit (.claude/ is local per-machine config, gitignored)
docs/atd/ ATD rollout collateral: config template, standards-store conventions,
lite-eligibility table, adoption track, bootstrap
openspec/changes/ In-flight OpenSpec changes (the fork dogfoods itself):
add-atd-sdlc-schema (implemented), add-atd-sdlc-lite-triage (implemented),
add-atd-docs-site (proposed), add-atd-workflow-facades (proposed)
test/ Vitest suite (~2,090 tests)
```

External: the `atd-standards` OpenSpec store (separate repo, registered per machine) holds the four standards specs. Stack mapping: python → python-service-standards, spring-boot → spring-boot-standards, oracle-ebs → oracle-ebs-plsql-standards, angular → angular-standards.

## Commands

```bash
node build.js # build dist/
./node_modules/.bin/vitest run # full test suite (pnpm test)
node scripts/generate-skillssh.mjs # regenerate committed skills/ from templates
node bin/openspec.js <cmd> # run the repo's own CLI
```

## Rules for agents working here

- **Work through OpenSpec.** Changes to fork behavior get a change under `openspec/changes/` first (proposal → specs → design → tasks → apply). Don't patch schemas or workflows ad hoc.
- **Adding a workflow touches every enumerating surface** — template module + `skill-templates.ts` export + both registries in `skill-generation.ts` + `ALL_WORKFLOWS`/`CORE_WORKFLOWS` + `WORKFLOW_TO_SKILL_DIR` + `SKILL_NAMES`/`COMMAND_IDS` in `tool-detection.ts` + regenerated `skills/` and `.claude/` artifacts + test count bumps. Missing one is the known bug class here.
- **Parity tests are contracts.** Shared instruction blocks between `atd-sdlc` and `atd-sdlc-lite` must match byte-for-byte; every deployed template must contain the `STORE_SELECTION_GUIDANCE` block; committed `skills/` must match generator output.
- **Schema instructions are the product.** Anti-slop rules are deliberate: omit inapplicable sections, no boilerplate, diagrams only when the flow is non-trivial, uncertainty routes to the heavier path.
- **Never ship references to unpackaged files** — npm `files` includes `dist`, `bin`, `schemas` only; `docs/` does not ship, so schema/skill instructions must embed what they need.
63 changes: 63 additions & 0 deletions docs/atd/adoption-track.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ATD adoption track

Changes in the ATD fork's adoption sequence, their status, and pilot metrics.

## Shipped / in flight

1. **add-atd-sdlc-schema** — the `atd-sdlc` built-in schema (this repo).
2. **add-atd-sdlc-lite-triage** — `atd-sdlc-lite` schema plus `atd-change-triage`
entry-point skill (companion change).

## Prerequisite: establish-atd-standards-store (separately owned)

Owned outside this repository by the stack leads. Pilot wave 1 is **blocked**
until every acceptance check passes.

A **placeholder store** exists at `~/git/ATD-AI/atd-standards` (local; no
approved ATD remote yet): `angular-standards` is seeded from the internal
`atd-angular` skill; the other three specs are strict-valid placeholders
awaiting stack-lead content.

- [x] Standalone `atd-standards` repository exists (local placeholder; remote pending).
- [x] All four mapped specs present and strict-valid:
`python-service-standards`, `spring-boot-standards`,
`oracle-ebs-plsql-standards`, `angular-standards`
(angular seeded with real content; the other three are placeholders).
- [ ] Stack-lead owners named per spec; CODEOWNERS enforces review.
Owners: python — TBD; spring-boot — TBD; oracle-ebs — TBD; angular — TBD.
- [ ] Registration/bootstrap instructions verified on a clean machine.
- [x] A pilot machine passes `openspec store doctor atd-standards` and
successfully fetches every mapped spec
(`openspec show <spec-id> --type spec --store atd-standards`).

## Follow-up changes (to be proposed)

1. **atlassian-integration-hardening** — idempotency helpers for managed
sections and closure comments, retry/error guidance, data governance for
what may be written to Jira/Confluence.
2. **telemetry-opt-in-default** — flip fork telemetry to opt-in for internal
distribution.
3. **internal-package-identity** — `@atd/openspec` rename and internal release
pipeline: changesets, pack checks, registry auth, workflow guards.
4. **standards-ci-enforcement** — promote recurring pilot deviation classes
into deterministic CI checks (lint rules, custom analyzers). Sourced from
pilot metrics below.

## Pilot metrics

Captured per pilot wave (wave 1: one Python or Angular repo → Spring Boot →
Oracle EBS → org-wide):

| Metric | Source |
|--------|--------|
| Clarification count per ticket | grilling Q/A trace in ticket.md |
| Artifact rework | change history |
| Standards deviations (by class) | conformance tasks in tasks.md |
| Documentation completion | published solution.md per closed ticket |
| External-write failures | Jira/Confluence task outcomes |
| Cycle time | ticket → archive |
| Lite/full selection rate | triage.md records (lite-triage change) |
| Lite→full escalation rate | triage.md escalation entries |

Recurring standards-deviation classes and missing-documentation findings feed
**standards-ci-enforcement**.
40 changes: 40 additions & 0 deletions docs/atd/bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ATD developer bootstrap (draft)

One-time machine setup for the ATD OpenSpec workflow. **Draft** — package name
and registry finalize when the `internal-package-identity` change lands.

## Steps

1. **Internal npm configuration** — point the ATD scope at the internal
registry (exact scope/registry TBD by internal-package-identity):

```bash
npm config set @atd:registry <internal-registry-url>
```

2. **Install the CLI**:

```bash
npm install -g @atd/openspec # placeholder name until package-identity lands
```

3. **Register the standards store**:

```bash
git clone <atd-standards remote> ~/atd-standards
openspec store register ~/atd-standards
openspec store doctor atd-standards
```

4. **Verify the Atlassian MCP** is configured in your agent tool (Claude Code,
Cursor, …) and can read a Jira issue. The ticket artifact falls back to
pasted content when the MCP is unavailable, but write-back and closure
comments require it.

5. **Health check**:

```bash
openspec doctor
```

See `bootstrap.sh` for the scripted skeleton of the same steps.
31 changes: 31 additions & 0 deletions docs/atd/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# ATD developer bootstrap — DRAFT SKELETON.
# Finalized when the internal-package-identity change lands (package name,
# registry URL, and store remote are placeholders).
set -euo pipefail

REGISTRY_URL="${ATD_NPM_REGISTRY:?set ATD_NPM_REGISTRY to the internal registry URL}"
STANDARDS_REMOTE="${ATD_STANDARDS_REMOTE:?set ATD_STANDARDS_REMOTE to the atd-standards git remote}"
STANDARDS_DIR="${ATD_STANDARDS_DIR:-$HOME/atd-standards}"

echo "==> Configuring internal npm registry"
npm config set @atd:registry "$REGISTRY_URL"

echo "==> Installing OpenSpec CLI"
npm install -g @atd/openspec # placeholder until package-identity lands

echo "==> Registering atd-standards store"
if [ ! -d "$STANDARDS_DIR" ]; then
git clone "$STANDARDS_REMOTE" "$STANDARDS_DIR"
else
git -C "$STANDARDS_DIR" pull --ff-only
fi
openspec store register "$STANDARDS_DIR"
openspec store doctor atd-standards

echo "==> Atlassian MCP: verify manually in your agent tool (read a Jira issue)."

echo "==> Health check"
openspec doctor

echo "Bootstrap complete."
37 changes: 37 additions & 0 deletions docs/atd/config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ATD per-repo openspec/config.yaml template
# Copy to <repo>/openspec/config.yaml and edit the stack block + rules for your repo.

schema: atd-sdlc

# Reference the shared standards store (register once per machine:
# openspec store register <path-to-atd-standards-clone>)
references:
- atd-standards

# Free-text project context injected into every artifact instruction.
# Keep ONE stack block (delete the others) and fill in your repo's specifics.
context: |
Stack: python # one of: python | spring-boot | oracle-ebs | angular
Service: <service name and one-line purpose>
Domain notes: <business domain, key entities, gotchas>
Team conventions: <anything the standards spec does not cover>

# Per-artifact rules. Keys MUST be artifact IDs of the atd-sdlc schema
# (ticket, analysis, specs, design, solution-doc, tasks) — unknown keys are
# warned and never injected. There is no "apply" or "docs" key.
rules:
# Documentation destination rides the tasks rules and lands in the generated
# publication tasks. Pick one form:
tasks:
- "Documentation destination: repo"
# - "Documentation destination: confluence — space <SPACE>, parent page <PAGE-ID>"
# - "Documentation destination: both — repo docs/ plus Confluence space <SPACE>, parent <PAGE-ID>"

# Optional: name code-index/code-graph tooling the agent should prefer over
# raw file reads during analysis.
# analysis:
# - "Prefer the tokensave MCP tools for symbol lookup and call-path tracing"

# Optional: disable the confirmed Jira write-back for this repo.
# ticket:
# - "Jira write-back is disabled for this repository"
65 changes: 65 additions & 0 deletions docs/atd/lite-eligibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Lite eligibility decision table

`atd-change-triage` evaluates every condition below. **Lite applies only when
ALL conditions pass. Any failure or uncertainty routes to the full `atd-sdlc`
schema.**

| # | Condition |
|---|-----------|
| 1 | Single repository and single component |
| 2 | Small, localized file impact |
| 3 | Restores existing intended behavior (no new behavior) |
| 4 | Existing acceptance criteria, specification, or test already defines the behavior |
| 5 | No API contract change |
| 6 | No database/schema/data migration |
| 7 | No authentication, authorization, security, privacy, or compliance impact |
| 8 | No cross-service integration behavior change |
| 9 | No new dependency |
| 10 | No deployment or infrastructure change |
| 11 | Straightforward automated regression test exists or is easy to add |
| 12 | Trivial rollback |
| 13 | No new functional or technical documentation needed (localized corrections to existing docs stay lite-eligible) |

Note on condition 13: "new documentation" means a new solution document or
durable doc set. Localized corrections to existing documentation remain
lite-eligible only while they do not reveal a full-workflow impact.

## Risk, never line count

Classification is risk-based. A one-line change is NOT automatically lite.
One-liners that always route full:

- **Authorization conditions** — a flipped `&&`/`||` in an access check.
- **SQL predicates** — a changed `WHERE` clause.
- **Financial calculations** — rounding, rates, totals.

## Bounded preflight (mandatory before recommending lite)

Conditions 1, 2, 4, 5–11 cannot be reliably determined from Jira text alone.
Before classifying, inspect the codebase — scoped to the ticket, lighter than
a full `analysis.md`, only enough to classify safely:

- Locate the owning component.
- Inspect the relevant entry points and call path.
- Identify existing tests or specifications covering the behavior.
- Check for API contract, data, security, dependency, integration, and
deployment impact.

Anything not verifiable from the ticket or the inspected code is **uncertain**
and routes full.

## Monotonic override policy

- Triage recommends **lite** → developer may choose lite or strengthen to full.
- Triage recommends **full** → full is mandatory. A downgrade request is
declined, quoting the failed or uncertain conditions.
- After creation, escalation is one-way: lite → full only (see the lite
schema's analysis and apply instructions). Full → lite is never supported
once planning artifacts exist.

## Audit trail

Every triage decision is recorded in a `triage.md` sidecar in the change
directory: the recommendation, each condition's evaluation, and the confirmed
choice. Escalations append their trigger and schema transition. Pilot metrics
(lite/full selection rate, escalation rate) are sourced from these records.
53 changes: 53 additions & 0 deletions docs/atd/standards-store.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# atd-standards store conventions

The `atd-standards` store is a standalone OpenSpec root (its own repository)
holding ATD's coding standards as specs. Every ATD repo references it via
`references: [atd-standards]` in `openspec/config.yaml`.

## Stack → spec mapping (explicit, exhaustive)

| Stack | Standards spec |
|-------|----------------|
| `python` | `python-service-standards` |
| `spring-boot` | `spring-boot-standards` |
| `oracle-ebs` | `oracle-ebs-plsql-standards` |
| `angular` | `angular-standards` |

The `atd-sdlc` schema uses this mapping in two places:

- **Apply time** — before implementing any task, the agent fetches the spec
mapped to each stack listed in `analysis.md` and conforms to it.
- **Tasks** — the mandatory final task group contains one conformance task per
affected stack, naming the mapped spec.

## Registering the store

```bash
git clone <atd-standards remote> ~/atd-standards
openspec store register ~/atd-standards
```

With the store registered and the repo's config declaring
`references: [atd-standards]`, generated instructions carry an index of the
standards specs (one-line summaries plus fetch recipes). If the store is not
registered, instruction generation degrades to a warning diagnostic — it does
not fail — but apply-time standards consultation is impossible, so
registration is part of developer bootstrap.

## Updating standards

Standards are specs; changes to them go through the store's own OpenSpec
workflow (propose → review → sync). One edit propagates to every ATD repo on
the next instruction generation — no fork release, no per-repo copying.
Stack leads own their spec (see CODEOWNERS in the store repository).

Propagation reads YOUR LOCAL CLONE: refresh it to pick up upstream edits —
`git -C ~/atd-standards pull --ff-only` (the bootstrap script does this on
re-run). A stale clone silently serves stale standards.

## Adding a new stack

1. Add `<stack>-standards` spec to the store.
2. Extend the explicit mapping in the `atd-sdlc` schema's `analysis`, `tasks`,
and `apply` instructions (fork change required — the mapping is deliberately
explicit, never inferred).
2 changes: 2 additions & 0 deletions openspec/changes/add-atd-docs-site/.openspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-07-22
Loading