home / skills / mduongvandinh / skills-java-spring / java-spring-skills

java-spring-skills skill

/java-spring-skills

This skill helps you align Spring Boot implementations with OpenSpec specifications, ensuring spec-driven development from proposal to archive.

npx playbooks add skill mduongvandinh/skills-java-spring --skill java-spring-skills

Review the files below or copy the command above to add this skill to your agents.

Files (49)
SKILL.md
4.2 KB
---
name: spring-openspec
version: 1.0.0
description: |
  Spec-First Development with OpenSpec for Spring Boot.
  Align on specifications before implementation begins.

triggers:
  - "new feature"
  - "spec first"
  - "openspec"
  - "specification"
  - "proposal"
---

# OpenSpec - Spec-Driven Development

## Workflow

```
┌──────────────────────────────────────────────────────────────┐
│                    OPENSPEC WORKFLOW                          │
│                                                               │
│  ┌──────────┐    ┌──────────┐    ┌───────────┐    ┌────────┐│
│  │ PROPOSAL │───→│  REVIEW  │───→│ IMPLEMENT │───→│ARCHIVE ││
│  │          │    │          │    │           │    │        ││
│  │ Draft    │    │ Align    │    │ Code      │    │ Merge  ││
│  │ Specs    │    │ Together │    │ Tasks     │    │ Specs  ││
│  └──────────┘    └──────────┘    └───────────┘    └────────┘│
└──────────────────────────────────────────────────────────────┘
```

## Directory Structure

```
openspec/
├── AGENTS.md           # Instructions for AI assistants
├── specs/              # Authoritative specifications
│   ├── auth/
│   ├── user/
│   └── order/
└── changes/            # Proposed modifications
    └── feature-xxx/
        ├── proposal.md
        ├── tasks.md
        └── spec-delta.md
```

## Commands

| Command | Description |
|---------|-------------|
| `/openspec-proposal <name>` | Create new proposal |
| `/openspec-review` | Review and align |
| `/openspec-implement <name>` | Implement from spec |
| `/openspec-archive <name>` | Archive completed feature |

## Proposal Template

```markdown
# Proposal: Feature Name

## Objective
What we want to achieve.

## Scope
- Item 1
- Item 2

## Out of Scope
- Not included

## Success Criteria
- Criterion 1
- Criterion 2

## Dependencies
- Dependency 1
```

## Spec Template

```markdown
# Feature Specification

## API Endpoint
POST /api/v1/resource
...

## Business Rules
1. Rule 1
2. Rule 2

## Data Model
@Entity...

## Sequence Diagram
Client -> Controller -> Service -> Repository
```

## Reference in Code

```java
/**
 * Service description.
 *
 * @spec openspec/specs/feature/spec-name.md
 */
@Service
public class MyService {
    // Implementation
}
```

Overview

This skill enables spec-first development for Spring Boot projects using the OpenSpec workflow. It helps teams draft, review, implement, and archive authoritative specs before writing code. The skill maps specs to code artifacts and provides commands to create proposals, run reviews, implement features, and archive completed specs.

How this skill works

The skill organizes specifications in an openspec directory with authoritative specs and proposed changes. It provides CLI-like commands to create proposals, trigger reviews, scaffold implementation tasks, and archive merged specs. During implementation the skill links code to spec files via annotations and generates task lists from spec deltas to keep implementation aligned with agreed requirements.

When to use it

  • When you want to align product, design, and engineering before coding begins.
  • For teams adopting contract-first APIs or strict business-rule enforcement.
  • When multiple contributors need a single source of truth for behavior and data models.
  • To reduce rework by capturing success criteria and dependencies before implementation.
  • When implementing complex domain logic that requires clear acceptance criteria.

Best practices

  • Draft concise proposals with objective, scope, out-of-scope, and success criteria.
  • Keep authoritative specs in openspec/specs and changes in openspec/changes until approved.
  • Use spec-delta and tasks files to translate specification changes into implementable work items.
  • Annotate services and controllers with spec references to maintain traceability from code to spec.
  • Run a review step for every proposal to ensure alignment across stakeholders before coding.

Example use cases

  • Designing and approving a new REST endpoint (API contract, business rules, data model) before implementation.
  • Coordinating auth or user management changes across backend, docs, and QA with a single spec.
  • Proposing a breaking change: create a proposal, review with team, produce spec-delta and tasks for incremental migration.
  • Onboarding a new developer: point them to the authoritative spec and change tasks instead of ad-hoc feature notes.
  • Generating implementation tickets from spec-delta files to feed sprint planning or CI pipelines.

FAQ

How are specs linked to code?

Annotate services or controllers with a @spec reference path to the spec file so implementations remain traceable to the authoritative spec.

What commands does the skill expose?

It provides commands to create a proposal, run a review, implement a spec, and archive completed features (e.g., /openspec-proposal, /openspec-review, /openspec-implement, /openspec-archive).

Where should I store proposed changes?

Keep proposed work under openspec/changes/<feature>/<proposal files> until reviewed and merged into openspec/specs for the authoritative version.