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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ out

# Nuxt.js build / generate output
.nuxt
dist

# Build output
dist/

# Gatsby files
.cache/
Expand Down
3 changes: 3 additions & 0 deletions bin/openspec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node

import '../dist/cli/index.js';
22 changes: 22 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node

import { execSync } from 'child_process';
import { existsSync, rmSync } from 'fs';

console.log('🔨 Building OpenSpec...\n');

// Clean dist directory
if (existsSync('dist')) {
console.log('Cleaning dist directory...');
rmSync('dist', { recursive: true, force: true });
}

// Run TypeScript compiler
console.log('Compiling TypeScript...');
try {
execSync('tsc', { stdio: 'inherit' });
console.log('\n✅ Build completed successfully!');
} catch (error) {
console.error('\n❌ Build failed!');
process.exit(1);
}
34 changes: 33 additions & 1 deletion openspec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ patches/
2. **Review** → User reviews and approves the proposal
3. **Implement** → Follow the approved tasks.md
4. **Deploy** → User confirms deployment
5. **Update Specs** → Sync specs/ with new reality
5. **Update Specs** → Sync specs/ with new reality (IF the change affects system capabilities)
6. **Archive** → Move to `changes/archive/YYYY-MM-DD-[name]/`

### 5. Implementing Changes
Expand All @@ -128,6 +128,27 @@ Once a change is deployed:
2. If design.md exists, move proven patterns to `specs/[capability]/design.md`
3. Archive the change directory with date prefix

### 7. Types of Changes That Don't Require Specs

Some changes only affect development infrastructure and don't need specs:
- Initial project setup (package.json, tsconfig.json, etc.)
- Development tooling changes (linters, formatters, build tools)
- CI/CD configuration
- Development dependencies

For these changes:
1. Implement → Deploy → Mark tasks complete → Archive
2. Skip the "Update Specs" step entirely

### What Deserves a Spec?

Ask yourself:
- Is this a system capability that users or other systems interact with?
- Does it have ongoing behavior that needs documentation?
- Would a new developer need to understand this to work with the system?

If NO to all → No spec needed (likely just tooling/infrastructure)

## Understanding Specs vs Code

### Specs Document WHAT and WHY
Expand Down Expand Up @@ -174,6 +195,17 @@ You should:
3. If no → Create change proposal (it's a behavior change)
```

### Infrastructure Setup
```
User: "Initialize TypeScript project"

You should:
1. Create change proposal for TypeScript setup
2. Implement configuration files
3. Mark tasks complete
4. Archive (no specs needed - this is tooling, not a capability)
```

## Summary Workflow

1. **Receive request** → Determine if it needs a change proposal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Tasks

## 1. Project Configuration
- [x] 1.1 Create package.json with project metadata, scripts, and ESM configuration
- [x] 1.2 Configure TypeScript with tsconfig.json for ESM output
- [x] 1.3 Add .gitignore for Node.js/TypeScript projects
- [x] 1.4 Set Node.js engine requirement to >=20.19.0

## 2. Directory Structure
- [x] 2.1 Create src/ directory for source code
- [x] 2.2 Create src/cli/ for CLI commands
- [x] 2.3 Create src/core/ for core OpenSpec logic
- [x] 2.4 Create src/utils/ for shared utilities

## 3. Build Configuration
- [x] 3.1 Create build.js for native TypeScript compilation
- [x] 3.2 Configure development scripts (build, dev)
- [x] 3.3 Set up package entry points with ESM exports
- [x] 3.4 Configure proper file extensions handling for ESM

## 4. Initial Dependencies
- [x] 4.1 Add TypeScript as dev dependency
- [x] 4.2 Add commander for CLI framework
- [x] 4.3 Add @inquirer/prompts for user interaction
- [x] 4.4 Add necessary type definitions
25 changes: 0 additions & 25 deletions openspec/changes/initialize-typescript-project/tasks.md

This file was deleted.

53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "openspec",
"version": "0.0.1",
"description": "AI-native system for spec-driven development",
"keywords": [
"openspec",
"specs",
"cli",
"ai",
"development"
],
"homepage": "https://github.com/tabdilsaidixit/openspec",
"repository": {
"type": "git",
"url": "git+https://github.com/tabdilsaidixit/openspec.git"
},
"license": "MIT",
"author": "OpenSpec Contributors",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"bin": {
"openspec": "./bin/openspec.js"
},
"files": [
"dist",
"bin",
"!dist/**/*.test.js",
"!dist/**/__tests__",
"!dist/**/*.map"
],
"scripts": {
"build": "node build.js",
"dev": "tsc --watch",
"dev:cli": "pnpm build && node bin/openspec.js",
"prepare": "npm run build"
},
"engines": {
"node": ">=20.19.0"
},
"devDependencies": {
"@types/node": "^24.2.0",
"typescript": "^5.9.2"
},
"dependencies": {
"@inquirer/prompts": "^7.8.0",
"commander": "^14.0.0"
}
}
Loading