dino-spec 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +243 -0
- package/bin/dino.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +114 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/active.d.ts +5 -0
- package/dist/commands/active.d.ts.map +1 -0
- package/dist/commands/active.js +85 -0
- package/dist/commands/active.js.map +1 -0
- package/dist/commands/archive.d.ts +9 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +77 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +91 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +12 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +169 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/skill.d.ts +17 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +143 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/status.d.ts +9 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +96 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +9 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +64 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/view.d.ts +5 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +177 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/core/config.d.ts +51 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +58 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/skills/index.d.ts +7 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/skills/index.js +6 -0
- package/dist/core/skills/index.js.map +1 -0
- package/dist/core/skills/loader.d.ts +34 -0
- package/dist/core/skills/loader.d.ts.map +1 -0
- package/dist/core/skills/loader.js +110 -0
- package/dist/core/skills/loader.js.map +1 -0
- package/dist/core/skills/registry.d.ts +31 -0
- package/dist/core/skills/registry.d.ts.map +1 -0
- package/dist/core/skills/registry.js +150 -0
- package/dist/core/skills/registry.js.map +1 -0
- package/dist/core/skills/types.d.ts +33 -0
- package/dist/core/skills/types.d.ts.map +1 -0
- package/dist/core/skills/types.js +5 -0
- package/dist/core/skills/types.js.map +1 -0
- package/dist/core/templates/dna-template.d.ts +5 -0
- package/dist/core/templates/dna-template.d.ts.map +1 -0
- package/dist/core/templates/dna-template.js +52 -0
- package/dist/core/templates/dna-template.js.map +1 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.d.ts.map +1 -0
- package/dist/core/templates/index.js +8 -0
- package/dist/core/templates/index.js.map +1 -0
- package/dist/core/templates/rules-template.d.ts +5 -0
- package/dist/core/templates/rules-template.d.ts.map +1 -0
- package/dist/core/templates/rules-template.js +71 -0
- package/dist/core/templates/rules-template.js.map +1 -0
- package/dist/core/templates/skill-template.d.ts +5 -0
- package/dist/core/templates/skill-template.d.ts.map +1 -0
- package/dist/core/templates/skill-template.js +63 -0
- package/dist/core/templates/skill-template.js.map +1 -0
- package/dist/core/templates/slash-commands.d.ts +5 -0
- package/dist/core/templates/slash-commands.d.ts.map +1 -0
- package/dist/core/templates/slash-commands.js +753 -0
- package/dist/core/templates/slash-commands.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/ascii-art.d.ts +38 -0
- package/dist/utils/ascii-art.d.ts.map +1 -0
- package/dist/utils/ascii-art.js +66 -0
- package/dist/utils/ascii-art.js.map +1 -0
- package/dist/utils/file-system.d.ts +67 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +177 -0
- package/dist/utils/file-system.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 keenu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# dino-spec
|
|
2
|
+
|
|
3
|
+
> Spec-driven development workflow for Claude Code with dinosaur-themed phases
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
__
|
|
7
|
+
(_ \
|
|
8
|
+
.-^^^ /
|
|
9
|
+
/ /
|
|
10
|
+
<__|-|__|
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**dino-spec** is a CLI tool that brings structured, specification-driven development to [Claude Code](https://claude.ai/code). It guides you through a dinosaur-themed workflow: from discovering requirements to hunting down implementation tasks.
|
|
14
|
+
|
|
15
|
+
## Why dino-spec?
|
|
16
|
+
|
|
17
|
+
When working with AI coding assistants, projects often suffer from:
|
|
18
|
+
|
|
19
|
+
- **Context loss** - AI forgets what you're building mid-conversation
|
|
20
|
+
- **Scope creep** - Features expand without clear boundaries
|
|
21
|
+
- **Unstructured iteration** - No clear progression from idea to implementation
|
|
22
|
+
- **Lost specifications** - Requirements scattered across conversations
|
|
23
|
+
|
|
24
|
+
**dino-spec** solves these problems by:
|
|
25
|
+
|
|
26
|
+
- Persisting specifications in `.dino/` files that survive context resets
|
|
27
|
+
- Enforcing a structured workflow with clear phase transitions
|
|
28
|
+
- Breaking work into small, trackable tasks (max 8-10 per phase)
|
|
29
|
+
- Integrating directly with Claude Code via slash commands
|
|
30
|
+
|
|
31
|
+
## Who is this for?
|
|
32
|
+
|
|
33
|
+
- **Developers using Claude Code** who want structured AI-assisted development
|
|
34
|
+
- **Teams** who need reproducible specification workflows
|
|
35
|
+
- **Solo developers** building complex features incrementally
|
|
36
|
+
- **Anyone** tired of re-explaining context to AI assistants
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
### From npm (recommended)
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g dino-spec
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From GitHub
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/xullul/dino-spec.git
|
|
50
|
+
cd dino-spec
|
|
51
|
+
pnpm install
|
|
52
|
+
pnpm build
|
|
53
|
+
npm link
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick Start
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Initialize in your project
|
|
60
|
+
cd your-project
|
|
61
|
+
dino init
|
|
62
|
+
|
|
63
|
+
# Open Claude Code and run:
|
|
64
|
+
# /dino.discover add user authentication
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## The Dinosaur Workflow
|
|
68
|
+
|
|
69
|
+
Each phase builds on the previous, ensuring nothing is lost:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
discover → scout → clarify → nest → hatch → hunt → fossil
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Phase | Command | Purpose |
|
|
76
|
+
|-------|---------|---------|
|
|
77
|
+
| **Discover** | `/dino.discover` | Capture requirements and create specification |
|
|
78
|
+
| **Scout** | `/dino.scout` | Research codebase and technical options |
|
|
79
|
+
| **Clarify** | `/dino.clarify` | Resolve ambiguities with targeted questions |
|
|
80
|
+
| **Nest** | `/dino.nest` | Create implementation plan (Plan Mode) |
|
|
81
|
+
| **Hatch** | `/dino.hatch` | Break plan into phased tasks |
|
|
82
|
+
| **Hunt** | `/dino.hunt` | Implement tasks with progress tracking |
|
|
83
|
+
| **Fossil** | `/dino.fossil` | Archive completed specification |
|
|
84
|
+
|
|
85
|
+
Optional: `/dino.next` suggests follow-up features based on completed work.
|
|
86
|
+
|
|
87
|
+
## CLI Commands
|
|
88
|
+
|
|
89
|
+
These commands work **without AI** - saving tokens and providing instant feedback:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
dino init # Initialize dino-spec in your project
|
|
93
|
+
dino status [spec] # Show current spec progress
|
|
94
|
+
dino list # List all specifications
|
|
95
|
+
dino view # Interactive dashboard
|
|
96
|
+
dino active [spec] # Show or set active specification
|
|
97
|
+
dino archive <spec> # Archive completed specification
|
|
98
|
+
dino update # Update configuration files
|
|
99
|
+
|
|
100
|
+
# Skill management
|
|
101
|
+
dino skill list # List installed skills
|
|
102
|
+
dino skill create # Create custom skill
|
|
103
|
+
dino skill install # Install from registry
|
|
104
|
+
dino skill remove # Remove a skill
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Project Structure
|
|
108
|
+
|
|
109
|
+
After `dino init`, your project will have:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
your-project/
|
|
113
|
+
├── .claude/
|
|
114
|
+
│ ├── commands/dino/ # Slash commands for Claude Code
|
|
115
|
+
│ │ ├── discover.md
|
|
116
|
+
│ │ ├── scout.md
|
|
117
|
+
│ │ ├── clarify.md
|
|
118
|
+
│ │ ├── nest.md
|
|
119
|
+
│ │ ├── hatch.md
|
|
120
|
+
│ │ ├── hunt.md
|
|
121
|
+
│ │ ├── fossil.md
|
|
122
|
+
│ │ └── ...
|
|
123
|
+
│ ├── skills/dino-workflow/
|
|
124
|
+
│ │ └── SKILL.md # Workflow skill definition
|
|
125
|
+
│ └── rules/dino/
|
|
126
|
+
│ └── workflow.md # Workflow rules
|
|
127
|
+
└── .dino/
|
|
128
|
+
├── active.json # Current active specification
|
|
129
|
+
├── dna.md # Project conventions
|
|
130
|
+
├── specs/ # Active specifications
|
|
131
|
+
└── archive/ # Completed specifications
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Specification Files
|
|
135
|
+
|
|
136
|
+
Each specification contains:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
.dino/specs/{spec-id}/
|
|
140
|
+
├── spec.md # Requirements and success criteria
|
|
141
|
+
├── research.md # Technical research from scout phase
|
|
142
|
+
├── plan.md # Implementation plan from nest phase
|
|
143
|
+
└── tasks.md # Phased task checklist from hatch phase
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Key Features
|
|
147
|
+
|
|
148
|
+
### Context Preservation
|
|
149
|
+
All state is stored in files. When context resets, Claude Code reads `.dino/active.json` and resumes from where you left off.
|
|
150
|
+
|
|
151
|
+
### Plan Mode Integration
|
|
152
|
+
Complex phases (`/dino.nest`, `/dino.hatch`) automatically trigger Claude Code's Plan Mode for careful deliberation.
|
|
153
|
+
|
|
154
|
+
### Task Tracking
|
|
155
|
+
Tasks use a simple checkbox format with progress bars:
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
- [ ] T001 Implement user model
|
|
159
|
+
- [ ] T002 [P] Add validation (parallelizable)
|
|
160
|
+
- [x] T003 Create database schema (completed)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Skill System
|
|
164
|
+
Extend functionality with custom skills:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
dino skill create my-linter
|
|
168
|
+
# Edit .claude/skills/my-linter/SKILL.md
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Example Workflow
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# 1. Initialize
|
|
175
|
+
dino init
|
|
176
|
+
|
|
177
|
+
# 2. In Claude Code, start a specification
|
|
178
|
+
/dino.discover add dark mode toggle to settings
|
|
179
|
+
|
|
180
|
+
# 3. Claude creates spec.md with requirements
|
|
181
|
+
|
|
182
|
+
# 4. Research the codebase
|
|
183
|
+
/dino.scout
|
|
184
|
+
|
|
185
|
+
# 5. Clarify any ambiguities
|
|
186
|
+
/dino.clarify
|
|
187
|
+
|
|
188
|
+
# 6. Create implementation plan (enters Plan Mode)
|
|
189
|
+
/dino.nest
|
|
190
|
+
|
|
191
|
+
# 7. Break into tasks
|
|
192
|
+
/dino.hatch
|
|
193
|
+
|
|
194
|
+
# 8. Implement with progress tracking
|
|
195
|
+
/dino.hunt
|
|
196
|
+
|
|
197
|
+
# 9. Archive when complete
|
|
198
|
+
/dino.fossil
|
|
199
|
+
|
|
200
|
+
# Check progress anytime
|
|
201
|
+
dino status
|
|
202
|
+
dino view
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Configuration
|
|
206
|
+
|
|
207
|
+
### Project DNA
|
|
208
|
+
|
|
209
|
+
Edit `.dino/dna.md` to define project conventions:
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
# Project DNA
|
|
213
|
+
|
|
214
|
+
## Tech Stack
|
|
215
|
+
- Framework: React
|
|
216
|
+
- Language: TypeScript
|
|
217
|
+
- Testing: Vitest
|
|
218
|
+
|
|
219
|
+
## Conventions
|
|
220
|
+
- Use functional components
|
|
221
|
+
- Prefer composition over inheritance
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Requirements
|
|
225
|
+
|
|
226
|
+
- Node.js >= 20.0.0
|
|
227
|
+
- Claude Code CLI
|
|
228
|
+
|
|
229
|
+
## Contributing
|
|
230
|
+
|
|
231
|
+
Contributions welcome! Please read the contribution guidelines before submitting PRs.
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT
|
|
236
|
+
|
|
237
|
+
## Acknowledgments
|
|
238
|
+
|
|
239
|
+
Inspired by [spec-kit](https://github.com/spec-kit/spec-kit) and [OpenSpec](https://github.com/openspec/openspec) - combining structured workflows with token-efficient CLI tools.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
Built for developers who believe AI coding should be structured, reproducible, and context-aware.
|
package/bin/dino.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { VERSION } from '../core/config.js';
|
|
5
|
+
import { getDinoHeader } from '../utils/ascii-art.js';
|
|
6
|
+
import { initCommand } from '../commands/init.js';
|
|
7
|
+
import { statusCommand } from '../commands/status.js';
|
|
8
|
+
import { listCommand } from '../commands/list.js';
|
|
9
|
+
import { viewCommand } from '../commands/view.js';
|
|
10
|
+
import { archiveCommand } from '../commands/archive.js';
|
|
11
|
+
import { updateCommand } from '../commands/update.js';
|
|
12
|
+
import { activeCommand } from '../commands/active.js';
|
|
13
|
+
import { skillListCommand, skillInstallCommand, skillRemoveCommand, skillCreateCommand } from '../commands/skill.js';
|
|
14
|
+
const program = new Command();
|
|
15
|
+
program
|
|
16
|
+
.name('dino')
|
|
17
|
+
.description('Claude Code workflow system with dinosaur-themed specification phases')
|
|
18
|
+
.version(VERSION, '-v, --version', 'Show version number')
|
|
19
|
+
.addHelpText('beforeAll', getDinoHeader('Spec-Driven Development for Claude Code', VERSION))
|
|
20
|
+
.option('--no-color', 'Disable colored output');
|
|
21
|
+
// Global preAction hook for color handling
|
|
22
|
+
program.hook('preAction', (thisCommand) => {
|
|
23
|
+
if (thisCommand.opts().color === false) {
|
|
24
|
+
chalk.level = 0;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
// Init command
|
|
28
|
+
program
|
|
29
|
+
.command('init [path]')
|
|
30
|
+
.description('Initialize dino-spec in your project')
|
|
31
|
+
.option('-f, --force', 'Overwrite existing configuration')
|
|
32
|
+
.action(async (targetPath = '.', options) => {
|
|
33
|
+
await initCommand(targetPath, options);
|
|
34
|
+
});
|
|
35
|
+
// Status command
|
|
36
|
+
program
|
|
37
|
+
.command('status [spec]')
|
|
38
|
+
.description('Show current specification status and progress')
|
|
39
|
+
.option('--json', 'Output as JSON')
|
|
40
|
+
.action(async (specName, options) => {
|
|
41
|
+
await statusCommand(specName, options);
|
|
42
|
+
});
|
|
43
|
+
// List command
|
|
44
|
+
program
|
|
45
|
+
.command('list')
|
|
46
|
+
.description('List all specifications')
|
|
47
|
+
.option('--specs', 'List only specs')
|
|
48
|
+
.option('--skills', 'List only skills')
|
|
49
|
+
.option('--archived', 'Include archived specs')
|
|
50
|
+
.option('--json', 'Output as JSON')
|
|
51
|
+
.action(async (options) => {
|
|
52
|
+
await listCommand(options);
|
|
53
|
+
});
|
|
54
|
+
// View command (dashboard)
|
|
55
|
+
program
|
|
56
|
+
.command('view')
|
|
57
|
+
.description('Interactive dashboard view')
|
|
58
|
+
.action(async () => {
|
|
59
|
+
await viewCommand();
|
|
60
|
+
});
|
|
61
|
+
// Archive command
|
|
62
|
+
program
|
|
63
|
+
.command('archive <spec>')
|
|
64
|
+
.description('Archive a completed specification')
|
|
65
|
+
.option('-y, --yes', 'Skip confirmation')
|
|
66
|
+
.action(async (specName, options) => {
|
|
67
|
+
await archiveCommand(specName, options);
|
|
68
|
+
});
|
|
69
|
+
// Update command
|
|
70
|
+
program
|
|
71
|
+
.command('update')
|
|
72
|
+
.description('Update dino-spec configuration files')
|
|
73
|
+
.option('-f, --force', 'Force overwrite existing files')
|
|
74
|
+
.action(async (options) => {
|
|
75
|
+
await updateCommand(options);
|
|
76
|
+
});
|
|
77
|
+
// Skill subcommand
|
|
78
|
+
const skillCmd = program
|
|
79
|
+
.command('skill')
|
|
80
|
+
.description('Manage skills');
|
|
81
|
+
skillCmd
|
|
82
|
+
.command('list')
|
|
83
|
+
.description('List all installed skills')
|
|
84
|
+
.action(async () => {
|
|
85
|
+
await skillListCommand();
|
|
86
|
+
});
|
|
87
|
+
skillCmd
|
|
88
|
+
.command('install <name>')
|
|
89
|
+
.description('Install a skill from registry or create placeholder')
|
|
90
|
+
.action(async (name) => {
|
|
91
|
+
await skillInstallCommand(name);
|
|
92
|
+
});
|
|
93
|
+
skillCmd
|
|
94
|
+
.command('remove <name>')
|
|
95
|
+
.description('Remove an installed skill')
|
|
96
|
+
.action(async (name) => {
|
|
97
|
+
await skillRemoveCommand(name);
|
|
98
|
+
});
|
|
99
|
+
skillCmd
|
|
100
|
+
.command('create <name>')
|
|
101
|
+
.description('Create a new custom skill')
|
|
102
|
+
.action(async (name) => {
|
|
103
|
+
await skillCreateCommand(name);
|
|
104
|
+
});
|
|
105
|
+
// Active command
|
|
106
|
+
program
|
|
107
|
+
.command('active [spec]')
|
|
108
|
+
.description('Set or show the active specification')
|
|
109
|
+
.action(async (specName) => {
|
|
110
|
+
await activeCommand(specName);
|
|
111
|
+
});
|
|
112
|
+
// Parse and execute
|
|
113
|
+
program.parse();
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,W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,CAAC;KACxB,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,KAAK,EAAE,QAAiB,EAAE,EAAE;IAClC,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC;AAEL,oBAAoB;AACpB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../src/commands/active.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FpE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { FileSystem } from '../utils/file-system.js';
|
|
4
|
+
import { DINO_DIR_NAME, DINO_DIRS, FILES } from '../core/config.js';
|
|
5
|
+
/**
|
|
6
|
+
* Set or show the active specification
|
|
7
|
+
*/
|
|
8
|
+
export async function activeCommand(specName) {
|
|
9
|
+
const dinoDir = join(process.cwd(), DINO_DIR_NAME);
|
|
10
|
+
// Check if dino is initialized
|
|
11
|
+
if (!await FileSystem.exists(dinoDir)) {
|
|
12
|
+
console.log(chalk.yellow('\nNo .dino directory found.'));
|
|
13
|
+
console.log(chalk.dim('Run "dino init" to initialize dino-spec in this project.\n'));
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const activePath = join(dinoDir, FILES.active);
|
|
17
|
+
const specsDir = join(dinoDir, DINO_DIRS.specs);
|
|
18
|
+
// Show current active spec if no argument
|
|
19
|
+
if (!specName) {
|
|
20
|
+
const active = await FileSystem.readJsonSafe(activePath);
|
|
21
|
+
if (!active?.id) {
|
|
22
|
+
console.log(chalk.yellow('\nNo active specification.'));
|
|
23
|
+
console.log(chalk.dim('Run "/dino.discover" to create a new specification.\n'));
|
|
24
|
+
// Show available specs
|
|
25
|
+
const specs = await FileSystem.listDirectory(specsDir);
|
|
26
|
+
const validSpecs = [];
|
|
27
|
+
for (const s of specs) {
|
|
28
|
+
if (await FileSystem.isDirectory(join(specsDir, s))) {
|
|
29
|
+
validSpecs.push(s);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (validSpecs.length > 0) {
|
|
33
|
+
console.log(chalk.dim('Available specifications:'));
|
|
34
|
+
for (const s of validSpecs) {
|
|
35
|
+
console.log(chalk.dim(` - ${s}`));
|
|
36
|
+
}
|
|
37
|
+
console.log(chalk.dim('\nRun "dino active <spec-id>" to set as active.\n'));
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Show active spec details
|
|
42
|
+
console.log(chalk.bold('\nActive Specification'));
|
|
43
|
+
console.log(chalk.dim('─'.repeat(30)));
|
|
44
|
+
console.log(` ID: ${chalk.cyan(active.id)}`);
|
|
45
|
+
console.log(` Phase: ${active.phase ?? 'unknown'}`);
|
|
46
|
+
console.log('');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// Set active spec
|
|
50
|
+
const specDir = join(specsDir, specName);
|
|
51
|
+
if (!await FileSystem.exists(specDir)) {
|
|
52
|
+
console.log(chalk.red(`\nSpecification "${specName}" not found.\n`));
|
|
53
|
+
// Show available specs
|
|
54
|
+
const specs = await FileSystem.listDirectory(specsDir);
|
|
55
|
+
const validSpecs = [];
|
|
56
|
+
for (const s of specs) {
|
|
57
|
+
if (await FileSystem.isDirectory(join(specsDir, s))) {
|
|
58
|
+
validSpecs.push(s);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (validSpecs.length > 0) {
|
|
62
|
+
console.log(chalk.dim('Available specifications:'));
|
|
63
|
+
for (const s of validSpecs) {
|
|
64
|
+
console.log(chalk.dim(` - ${s}`));
|
|
65
|
+
}
|
|
66
|
+
console.log('');
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Read current phase from spec
|
|
71
|
+
const specPath = join(specDir, FILES.spec);
|
|
72
|
+
const specContent = await FileSystem.readFileSafe(specPath);
|
|
73
|
+
const phaseMatch = specContent?.match(/Phase:\s*(\w+)/i);
|
|
74
|
+
const phase = phaseMatch?.[1] ?? 'discover';
|
|
75
|
+
// Update active.json
|
|
76
|
+
const active = {
|
|
77
|
+
id: specName,
|
|
78
|
+
phase,
|
|
79
|
+
updatedAt: new Date().toISOString(),
|
|
80
|
+
};
|
|
81
|
+
await FileSystem.writeJson(activePath, active);
|
|
82
|
+
console.log(chalk.green(`\n✓ Set active specification: ${specName}`));
|
|
83
|
+
console.log(chalk.dim(` Phase: ${phase}\n`));
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=active.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active.js","sourceRoot":"","sources":["../../src/commands/active.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AASpE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAiB;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC,CAAC;IAEnD,+BAA+B;IAC/B,IAAI,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC,CAAC;QACrF,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,KA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KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;IACT,CAAC;IAED,+BAA+B;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC;IAE5C,qBAAqB;IACrB,MAAM,MAAM,GAAe;QACzB,EAAE,EAAE,QAAQ;QACZ,KAAK;QACL,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;IAEF,MAAM,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAE/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/commands/archive.ts"],"names":[],"mappings":"AAYA,UAAU,cAAc;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAkF7F"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { FileSystem } from '../utils/file-system.js';
|
|
4
|
+
import { DINO_DIR_NAME, DINO_DIRS, FILES } from '../core/config.js';
|
|
5
|
+
import { getDinoArt } from '../utils/ascii-art.js';
|
|
6
|
+
/**
|
|
7
|
+
* Archive a completed specification
|
|
8
|
+
*/
|
|
9
|
+
export async function archiveCommand(specName, options) {
|
|
10
|
+
const dinoDir = join(process.cwd(), DINO_DIR_NAME);
|
|
11
|
+
// Check if dino is initialized
|
|
12
|
+
if (!await FileSystem.exists(dinoDir)) {
|
|
13
|
+
console.log(chalk.yellow('\nNo .dino directory found.'));
|
|
14
|
+
console.log(chalk.dim('Run "dino init" to initialize dino-spec in this project.\n'));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const specsDir = join(dinoDir, DINO_DIRS.specs);
|
|
18
|
+
const archiveDir = join(dinoDir, DINO_DIRS.archive);
|
|
19
|
+
const specDir = join(specsDir, specName);
|
|
20
|
+
const archiveTarget = join(archiveDir, specName);
|
|
21
|
+
// Check if spec exists
|
|
22
|
+
if (!await FileSystem.exists(specDir)) {
|
|
23
|
+
console.log(chalk.red(`\nSpecification "${specName}" not found.\n`));
|
|
24
|
+
// Show available specs
|
|
25
|
+
const specs = await FileSystem.listDirectory(specsDir);
|
|
26
|
+
if (specs.length > 0) {
|
|
27
|
+
console.log(chalk.dim('Available specifications:'));
|
|
28
|
+
for (const s of specs) {
|
|
29
|
+
if (await FileSystem.isDirectory(join(specsDir, s))) {
|
|
30
|
+
console.log(chalk.dim(` - ${s}`));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
console.log('');
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Check if already archived
|
|
38
|
+
if (await FileSystem.exists(archiveTarget)) {
|
|
39
|
+
console.log(chalk.yellow(`\nSpecification "${specName}" is already archived.\n`));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Read spec for confirmation
|
|
43
|
+
const specPath = join(specDir, FILES.spec);
|
|
44
|
+
const specContent = await FileSystem.readFileSafe(specPath);
|
|
45
|
+
const titleMatch = specContent?.match(/^#\s+(.+)$/m);
|
|
46
|
+
const title = titleMatch?.[1] ?? specName;
|
|
47
|
+
if (!options.yes) {
|
|
48
|
+
console.log(chalk.yellow(`\nArchiving specification: ${title}`));
|
|
49
|
+
console.log(chalk.dim(`ID: ${specName}`));
|
|
50
|
+
console.log(chalk.dim('\nThis will move the specification to the archive folder.'));
|
|
51
|
+
console.log(chalk.dim('Use -y or --yes to skip this confirmation.\n'));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Move to archive
|
|
55
|
+
await FileSystem.move(specDir, archiveTarget);
|
|
56
|
+
// Update active.json if this was the active spec
|
|
57
|
+
const activePath = join(dinoDir, FILES.active);
|
|
58
|
+
const active = await FileSystem.readJsonSafe(activePath);
|
|
59
|
+
if (active?.id === specName) {
|
|
60
|
+
await FileSystem.writeJson(activePath, {
|
|
61
|
+
id: null,
|
|
62
|
+
phase: null,
|
|
63
|
+
archivedAt: new Date().toISOString(),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// Add completion timestamp to archived spec
|
|
67
|
+
const archivedSpecPath = join(archiveTarget, FILES.spec);
|
|
68
|
+
const archivedContent = await FileSystem.readFileSafe(archivedSpecPath);
|
|
69
|
+
if (archivedContent) {
|
|
70
|
+
const updatedContent = archivedContent.replace(/Status:\s*\w+/, `Status: archived`) + `\n\nArchived: ${new Date().toISOString().split('T')[0]}\n`;
|
|
71
|
+
await FileSystem.writeFile(archivedSpecPath, updatedContent);
|
|
72
|
+
}
|
|
73
|
+
console.log(getDinoArt('green'));
|
|
74
|
+
console.log(chalk.green(` Archived: ${title}`));
|
|
75
|
+
console.log(chalk.dim(` Location: .dino/archive/${specName}\n`));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.js","s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