Skip to content
Merged
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: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ When creating or modifying jobs in this repository, you MUST understand which ty
- NEVER edit the installed copies in `.deepwork/jobs/` directly
- After editing, run `deepwork install --platform claude` to sync

### 2. Library Jobs (`library_jobs/`)
### 2. Library Jobs (`library/jobs/`)

**What they are**: Example or reusable jobs that any repository is welcome to use, but are NOT auto-installed. Users must explicitly copy or import these into their projects.

**Location**: `library_jobs/[job_name]/`
**Location**: `library/jobs/[job_name]/`

**Examples** (potential):
- Competitive research workflows
Expand All @@ -34,7 +34,7 @@ When creating or modifying jobs in this repository, you MUST understand which ty
- Release management

**Editing rules**:
- Edit directly in `library_jobs/[job_name]/`
- Edit directly in `library/jobs/[job_name]/`
- These are templates/examples for users to adopt
- Should be well-documented and self-contained

Expand Down Expand Up @@ -77,7 +77,7 @@ deepwork/
├── src/deepwork/standard_jobs/ # Standard jobs (source of truth)
│ ├── deepwork_jobs/
│ └── deepwork_rules/
├── library_jobs/ # Library/example jobs
├── library/jobs/ # Library/example jobs
│ └── [example_job]/
└── .deepwork/jobs/ # Installed standard jobs + bespoke jobs
├── deepwork_jobs/ # ← Installed copy, NOT source of truth
Expand Down
6 changes: 3 additions & 3 deletions claude.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ deepwork/
│ │ └── deepwork_rules/
│ ├── schemas/ # Job definition schemas
│ └── utils/ # Utilities (fs, git, yaml, validation)
├── library_jobs/ # Reusable example jobs (not auto-installed)
├── library/jobs/ # Reusable example jobs (not auto-installed)
├── tests/ # Test suite
├── doc/ # Documentation
└── doc/architecture.md # Detailed architecture document
Expand Down Expand Up @@ -191,7 +191,7 @@ my-project/
| Type | Location | Purpose |
|------|----------|---------|
| **Standard Jobs** | `src/deepwork/standard_jobs/` | Framework core, auto-installed to users |
| **Library Jobs** | `library_jobs/` | Reusable examples users can adopt |
| **Library Jobs** | `library/jobs/` | Reusable examples users can adopt |
| **Bespoke Jobs** | `.deepwork/jobs/` (if not in standard_jobs) | This repo's internal workflows only |

### Editing Standard Jobs
Expand All @@ -218,7 +218,7 @@ Instead, follow this workflow:
### How to Identify Job Types

- **Standard jobs**: Exist in `src/deepwork/standard_jobs/` (currently: `deepwork_jobs`, `deepwork_rules`)
- **Library jobs**: Exist in `library_jobs/`
- **Library jobs**: Exist in `library/jobs/`
- **Bespoke jobs**: Exist ONLY in `.deepwork/jobs/` with no corresponding standard_jobs entry

**When creating a new job, always clarify which type it should be.** If uncertain, ask the user.
Expand Down
2 changes: 1 addition & 1 deletion job_library/README.md → library/jobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The job library provides:
Each job in this library follows the same structure as the `.deepwork/jobs` subfolders in your local project:

```
job_library/
library/jobs/
├── [job-name]/
│ ├── job.yml # Job definition (name, steps, dependencies)
│ └── steps/
Expand Down
177 changes: 177 additions & 0 deletions library/jobs/spec_driven_development/job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: spec_driven_development
version: "1.0.0"
summary: "Spec-driven development workflow that turns specifications into working implementations through structured planning."
description: |
A comprehensive workflow inspired by GitHub's spec-kit that enables "spec-driven development" -
a methodology where executable specifications generate working implementations rather than
merely guiding them.

This job inverts traditional development: instead of starting with code, you first create
detailed specifications that directly generate implementations. The workflow progresses through
six phases:

1. **Constitution**: Establish project governance principles and development guidelines
2. **Specification**: Define functional requirements focusing on "what" and "why"
3. **Clarification**: Resolve ambiguities before technical planning
4. **Planning**: Create technical implementation strategy and architecture
5. **Task Generation**: Break plans into actionable, ordered development tasks
6. **Implementation**: Execute tasks to deliver the complete feature

The workflow produces all artifacts in a `specs/[feature-name]/` directory structure,
keeping specifications versioned alongside the implementation they generate.

Ideal for:
- New feature development requiring upfront design
- Complex features with multiple stakeholders
- Projects where specification quality directly impacts implementation success
- Teams wanting to capture design decisions for future reference

changelog:
- version: "1.0.0"
changes: "Initial version based on GitHub spec-kit workflow"

steps:
- id: constitution
name: "Establish Constitution"
description: "Creates foundational governance principles and development guidelines for the project. Use when starting a new project or establishing standards."
instructions_file: steps/constitution.md
inputs:
- name: development_priorities
description: "Key priorities like code quality, testing, UX consistency, performance"
outputs:
- file: "[docs_folder]/constitution.md"
dependencies: []
quality_criteria:
- "**Priorities Captured**: Did the agent gather specific development priorities from the user?"
- "**Principles Defined**: Are governance principles clear and actionable?"
- "**Technology Guidance**: Does the constitution include relevant technology stack preferences?"
- "**Quality Standards**: Are quality standards and testing expectations defined?"
- "**File Created**: Has constitution.md been created in the project's documentation folder?"

- id: specify
name: "Create Specification"
description: "Defines functional requirements as user stories without technology choices. Use when starting to design a new feature."
instructions_file: steps/specify.md
inputs:
- name: feature_name
description: "Name of the feature being specified (lowercase, hyphens for spaces)"
- name: feature_description
description: "High-level description of what the feature should do"
- file: "[docs_folder]/constitution.md"
from_step: constitution
outputs:
- file: specs/[feature-name]/spec.md
dependencies:
- constitution
quality_criteria:
- "**User Stories Complete**: Are all user stories written in standard format (As a... I want... So that...)?"
- "**Acceptance Criteria**: Does each story have clear, testable acceptance criteria?"
- "**Non-Functional Requirements**: Are performance, security, and accessibility requirements captured?"
- "**Scope Boundaries**: Is it clear what's in and out of scope?"
- "**Constitution Aligned**: Does the spec respect the governance principles from the constitution?"
- "**Technology Agnostic**: Is the spec free of implementation details and technology choices?"
- "**File Created**: Has spec.md been created in `specs/[feature-name]/`?"

- id: clarify
name: "Clarify Specification"
description: "Resolves ambiguities and gaps in the specification through structured questioning. Use after specification to ensure completeness."
instructions_file: steps/clarify.md
inputs:
- file: specs/[feature-name]/spec.md
from_step: specify
outputs:
- file: specs/[feature-name]/spec.md
dependencies:
- specify
quality_criteria:
- "**Ambiguities Identified**: Were underspecified areas systematically identified?"
- "**Questions Asked**: Did the agent ask structured questions to resolve each ambiguity?"
- "**Answers Documented**: Are clarification answers recorded in the spec document?"
- "**Edge Cases Covered**: Are edge cases and error scenarios now defined?"
- "**Acceptance Checklist**: Is the acceptance criteria checklist complete and validated?"
- "**Spec Updated**: Has spec.md been updated with all clarifications?"

- id: plan
name: "Generate Technical Plan"
description: "Creates technical implementation strategy including architecture and technology choices. Use after specification is clarified."
instructions_file: steps/plan.md
inputs:
- file: specs/[feature-name]/spec.md
from_step: clarify
- file: "[docs_folder]/constitution.md"
from_step: constitution
- file: "[docs_folder]/architecture.md"
description: "Existing project architecture document (if present)"
outputs:
- file: specs/[feature-name]/plan.md
- file: specs/[feature-name]/data-model.md
- file: specs/[feature-name]/api-spec.json
- file: specs/[feature-name]/research.md
- file: "[docs_folder]/architecture.md"
description: "Updated project architecture document"
dependencies:
- clarify
quality_criteria:
- "**Architecture Defined**: Is the high-level architecture clearly described?"
- "**Technology Justified**: Are technology choices explained with rationale?"
- "**Data Model Complete**: Is the data model documented with all entities and relationships?"
- "**API Contracts**: Are API endpoints defined with request/response schemas?"
- "**Research Documented**: Are any research findings or technology evaluations captured?"
- "**Dependencies Listed**: Are external dependencies and their versions specified?"
- "**Constitution Respected**: Does the plan align with governance principles?"
- "**Architecture Doc Updated**: Has the project architecture document been reviewed and updated if needed?"
- "**Files Created**: Have all output files been created in `specs/[feature-name]/`?"

- id: tasks
name: "Generate Task Breakdown"
description: "Converts the implementation plan into actionable, ordered development tasks. Use after plan is validated."
instructions_file: steps/tasks.md
inputs:
- file: specs/[feature-name]/plan.md
from_step: plan
- file: specs/[feature-name]/spec.md
from_step: clarify
- file: "[docs_folder]/architecture.md"
from_step: plan
outputs:
- file: specs/[feature-name]/tasks.md
dependencies:
- plan
quality_criteria:
- "**User Story Organization**: Are tasks organized by user story?"
- "**Dependencies Sequenced**: Are task dependencies correctly ordered?"
- "**Parallel Tasks Marked**: Are parallelizable tasks identified with [P] markers?"
- "**File Paths Specified**: Does each task specify which files it creates/modifies?"
- "**TDD Structure**: Are test tasks included before or alongside implementation tasks?"
- "**Checkpoints Defined**: Are validation checkpoints included between phases?"
- "**Granularity Appropriate**: Are tasks small enough to be completed in one session?"
- "**File Created**: Has tasks.md been created in `specs/[feature-name]/`?"

- id: implement
name: "Execute Implementation"
description: "Generates code and assets by executing the task breakdown. Use when ready to build the feature."
instructions_file: steps/implement.md
inputs:
- file: specs/[feature-name]/tasks.md
from_step: tasks
- file: specs/[feature-name]/plan.md
from_step: plan
- file: specs/[feature-name]/spec.md
from_step: clarify
- file: "[docs_folder]/architecture.md"
from_step: plan
outputs:
- directory: src/
description: "Implementation source files as specified in tasks"
- directory: tests/
description: "Test files as specified in tasks"
dependencies:
- tasks
quality_criteria:
- "**Prerequisites Met**: Were all spec/plan/tasks artifacts validated before starting?"
- "**Task Order Followed**: Were tasks executed in dependency order?"
- "**Tests Written**: Are tests created alongside or before implementation?"
- "**Acceptance Criteria Met**: Does the implementation satisfy all acceptance criteria from spec?"
- "**Code Quality**: Does the code meet the standards defined in the constitution?"
- "**Progress Tracked**: Was progress communicated throughout implementation?"
- "**All Tasks Complete**: Have all tasks in tasks.md been completed?"
51 changes: 51 additions & 0 deletions library/jobs/spec_driven_development/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Spec-Driven Development

A structured workflow for building features through executable specifications rather than ad-hoc coding.

## Overview

This job implements "spec-driven development" - a methodology where detailed specifications directly generate working implementations. Instead of jumping straight to code, you first create specifications that serve as executable blueprints.

The workflow progresses through six steps:

1. **Constitution** - Establish project governance principles, technology standards, and quality guidelines
2. **Specify** - Define functional requirements as user stories with acceptance criteria (what and why, not how)
3. **Clarify** - Resolve ambiguities and gaps through systematic questioning
4. **Plan** - Design architecture, select technologies, define data models and API contracts; update project architecture document
5. **Tasks** - Break the plan into ordered, actionable development tasks
6. **Implement** - Execute tasks to deliver the complete feature

## When to Use

This workflow is ideal for:
- New feature development requiring upfront design
- Complex features with multiple stakeholders
- Projects where specification quality directly impacts implementation success
- Teams wanting to capture design decisions for future reference

## Artifacts Produced

- `[docs_folder]/constitution.md` - Project-wide governance principles (created once)
- `[docs_folder]/architecture.md` - Project architecture document (updated with each feature)
- `specs/[feature-name]/spec.md` - Feature requirements and user stories
- `specs/[feature-name]/plan.md` - Technical architecture and implementation strategy
- `specs/[feature-name]/data-model.md` - Database schema and relationships
- `specs/[feature-name]/api-spec.json` - OpenAPI specification (if applicable)
- `specs/[feature-name]/tasks.md` - Ordered task breakdown with dependencies

## Credits

This job is inspired by [spec-kit](https://github.com/github/spec-kit), GitHub's open-source toolkit for spec-driven development. The workflow structure, step progression, and core concepts are adapted from spec-kit's methodology.

## IMPT: REQUIRED CUSTOMIZATION

When installing this job to a new project, you must customize the following:

### Replace `[docs_folder]`

The placeholder `[docs_folder]` appears throughout this job and must be replaced with your project's actual documentation directory path. This can be done with find / sed commands.

**Examples:**
- If your docs are in `docs/`: replace `[docs_folder]` with `docs`
- If your docs are in `documentation/`: replace `[docs_folder]` with `documentation`
- If your docs are at the root: replace `[docs_folder]/constitution.md` with `constitution.md`
Loading