Skip to content

Commit 7ac468e

Browse files
committed
Refactor code structure and remove redundant changes for improved clarity and maintainability. Wish this kit was together to where I can dog-food it on itself. Soon...
1 parent c54a786 commit 7ac468e

File tree

166 files changed

+6428
-2202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+6428
-2202
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!--
2+
generated-by: [email protected]
3+
source-ddd-kit: latest
4+
resolved-uids:
5+
- auth-service.ts@sha256:...
6+
- user-model.ts@sha256:...
7+
action-run-id: manual-run
8+
managed-block: begin
9+
-->
10+
11+
# Implementation Notes for integration.test.task.001
12+
13+
<!-- dddctl-managed:start:key=auth-service.ts -->
14+
15+
## Guidance from auth-service.ts
16+
17+
> Summary: Opinionated Express 5 guide for Node 20 services.
18+
19+
## When to use
20+
21+
Use Express 5 for building REST APIs in Node.js.
22+
23+
## Pre-reqs
24+
25+
- Node 20
26+
- TypeScript
27+
28+
## Install / Setup
29+
30+
npm install express
31+
32+
## Code patterns
33+
34+
Use middleware for validation.
35+
36+
<!-- dddctl-managed:end:key=auth-service.ts -->
37+
38+
<!-- dddctl-managed:start:key=user-model.ts -->
39+
40+
## Guidance from user-model.ts
41+
42+
> Summary: Opinionated Express 5 guide for Node 20 services.
43+
44+
## When to use
45+
46+
Use Express 5 for building REST APIs in Node.js.
47+
48+
## Pre-reqs
49+
50+
- Node 20
51+
- TypeScript
52+
53+
## Install / Setup
54+
55+
npm install express
56+
57+
## Code patterns
58+
59+
Use middleware for validation.
60+
61+
<!-- dddctl-managed:end:key=user-model.ts -->

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
'@typescript-eslint/strict-boolean-expressions': 'error',
4141
'@typescript-eslint/no-confusing-void-expression': 'error',
4242
'@typescript-eslint/prefer-readonly': 'error',
43-
'@typescript-eslint/prefer-readonly-parameter-types': 'off', // Too strict for current codebase
43+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
4444

4545
'import/no-unresolved': 'error',
4646
// 'import/no-cycle': 'error',
@@ -57,7 +57,7 @@ module.exports = {
5757
],
5858

5959
// Sorting and ordering rules
60-
'sort-keys': ['warn', 'asc', { caseSensitive: false, natural: true }],
60+
'sort-keys': 'off', // Disabled to avoid conflicts with object properties
6161
'sort-vars': 'error',
6262
'@typescript-eslint/member-ordering': [
6363
'error',

README.md

Lines changed: 103 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ Clone the repository and install dependencies:
3030

3131
```bash
3232
git clone https://github.com/Coderrob/ddd-kit.git
33-
cd document-driven-development
33+
cd ddd-kit
3434
npm install
35+
npm run build
3536
```
3637

37-
Run the toolkit:
38+
Run the CLI:
3839

3940
```bash
40-
npm start
41+
npm run cli -- --help
4142
```
4243

4344
### Running from Source
@@ -46,10 +47,10 @@ Want to live on the edge? Run the latest codebase:
4647

4748
```bash
4849
git clone https://github.com/Coderrob/ddd-kit.git
49-
cd document-driven-development
50+
cd ddd-kit
5051
npm install
5152
npm run build
52-
npm start
53+
npm run cli -- --help
5354
```
5455

5556
⚠️ **Note**: The development version is cutting-edge but may not be production-ready. Use at your own risk!
@@ -60,138 +61,154 @@ npm start
6061

6162
Follow the instructions above to run the toolkit from source. Before contributing, make sure to:
6263

63-
- Read the [Contributing Guide](CONTRIBUTING.md).
6464
- Run `npm test` to ensure your changes meet our quality standards.
65-
- Use `npm run dev` for hot module reloading during development.
65+
- Use `npm run dev` for development with TypeScript compilation.
66+
- Use `npm run build` to compile TypeScript to JavaScript.
6667

67-
To avoid committing files that fail linting, install a pre-commit git hook:
68+
To avoid committing files that fail linting, git hooks are automatically installed:
6869

6970
```bash
70-
npm run githooks-install
71+
npm install # Installs husky pre-commit hooks automatically
7172
```
7273

7374
---
7475

7576
## Command Line Interface (CLI) ⚡
7677

77-
The Document Driven Development Kit comes with a powerful CLI to supercharge your workflow. Here's what you can do:
78+
The Document Driven Development Kit comes with a powerful CLI (`dddctl`) to supercharge your workflow. Here's what you can do:
7879

79-
### `cli`
80+
### CLI Usage
8081

81-
The `cli` command is your gateway to creating and managing specifications.
82+
The CLI provides task management, validation, and development workflow commands.
8283

8384
#### Usage
8485

8586
```bash
8687
npm run cli -- <command> [options]
8788
```
8889

90+
Or if installed globally:
91+
92+
```bash
93+
dddctl <command> [options]
94+
```
95+
8996
#### Commands
9097

91-
- `init`: Kickstart a new specification project.
98+
- `next`: Hydrate the next eligible task for processing.
9299

93100
Example:
94101

95102
```bash
96-
npm run cli -- init my-project
103+
npm run cli -- next
97104
```
98105

99-
- `plan`: Turn your specification into a technical implementation plan.
106+
- `render`: Re-render guidance for a specific task.
100107

101108
Example:
102109

103110
```bash
104-
npm run cli -- plan my-spec.md
111+
npm run cli -- render <task-id>
105112
```
106113

107-
- `tasks`: Break down your specification into actionable tasks.
114+
- `supersede`: Supersede an old UID with a new one.
108115

109116
Example:
110117

111118
```bash
112-
npm run cli -- tasks my-spec.md
119+
npm run cli -- supersede <old-uid> <new-uid>
113120
```
114121

115122
### CLI Commands and Sub-Commands
116123

117124
The Document Driven Development Kit CLI provides the following commands and sub-commands:
118125

119-
#### `todo:list`
126+
#### `todo list`
120127

121128
List all tasks in the TODO.md file.
122129

123130
Example:
124131

125132
```bash
126-
npm run cli -- todo:list
133+
npm run cli -- todo list
127134
```
128135

129-
#### `todo:show`
136+
#### `todo show`
130137

131138
Show details of a specific task by ID.
132139

133140
Example:
134141

135142
```bash
136-
npm run cli -- todo:show --id <task-id>
143+
npm run cli -- todo show <task-id>
137144
```
138145

139-
#### `todo:complete`
146+
#### `todo complete`
140147

141148
Mark a task as complete.
142149

143150
Example:
144151

145152
```bash
146-
npm run cli -- todo:complete --id <task-id> --message "Task completed"
153+
npm run cli -- todo complete <task-id>
147154
```
148155

149-
#### `todo:add`
156+
#### `todo add`
150157

151158
Add a new task from a file.
152159

153160
Example:
154161

155162
```bash
156-
npm run cli -- todo:add --file <file-path>
163+
npm run cli -- todo add <file-path>
157164
```
158165

159-
#### `todo:validate`
166+
#### `validate tasks`
160167

161-
Validate tasks against the schema.
168+
Validate all tasks against the schema.
162169

163170
Example:
164171

165172
```bash
166-
npm run cli -- todo:validate
173+
npm run cli -- validate tasks
167174
```
168175

169-
#### `todo:validate:fix`
176+
#### `validate fix`
170177

171178
Validate tasks and optionally fix issues.
172179

173180
Example:
174181

175182
```bash
176-
npm run cli -- todo:validate:fix --fix --dryRun --summary json
183+
npm run cli -- validate fix
184+
```
185+
186+
#### `ref audit`
187+
188+
Audit references across repository and tasks.
189+
190+
Example:
191+
192+
```bash
193+
npm run cli -- ref audit
177194
```
178195

179196
#### Options
180197

181-
- `--debug`: Get detailed debug output for troubleshooting.
198+
- `-V, --version`: Display the version number.
182199

183200
Example:
184201

185202
```bash
186-
npm run cli -- plan my-spec.md --debug
203+
npm run cli -- --version
187204
```
188205

189-
- `--no-git`: Skip git repository initialization during `init`.
206+
- `-h, --help`: Display help information for any command.
190207

191208
Example:
192209

193210
```bash
194-
npm run cli -- init my-project --no-git
211+
npm run cli -- todo --help
195212
```
196213

197214
For a full list of commands and options, run:
@@ -202,6 +219,56 @@ npm run cli -- --help
202219

203220
---
204221

222+
## Development Scripts 🛠️
223+
224+
The project includes several npm scripts for development and validation:
225+
226+
### Task Validation
227+
228+
- **Quick Validation**: Use the lightweight validation script for faster feedback:
229+
230+
```bash
231+
npm run validate-local
232+
```
233+
234+
This provides the same validation as `npm run cli -- validate tasks` but with simpler output and faster execution.
235+
236+
### Code Quality
237+
238+
- **Linting**: Check and fix code style issues:
239+
240+
```bash
241+
npm run lint # Check for issues
242+
npm run lint:fix # Fix issues automatically
243+
```
244+
245+
- **Formatting**: Format code with Prettier:
246+
247+
```bash
248+
npm run format # Format all files
249+
npm run format:check # Check formatting
250+
```
251+
252+
- **Build**: Compile TypeScript to JavaScript:
253+
254+
```bash
255+
npm run build
256+
```
257+
258+
- **Development**: Run CLI directly from TypeScript source:
259+
260+
```bash
261+
npm run dev # Equivalent to ts-node src/cli.ts
262+
```
263+
264+
- **Testing**: Run the test suite:
265+
266+
```bash
267+
npm test
268+
```
269+
270+
---
271+
205272
## Additional Links 🔗
206273

207274
- [Code](https://github.com/Coderrob/ddd-kit)
@@ -212,4 +279,4 @@ npm run cli -- --help
212279

213280
## License 📜
214281

215-
This project is licensed under the terms of the MIT open source license. See the [LICENSE](LICENSE) file for details.
282+
This project is licensed under the terms of the GPL v3 open source license. See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)