Skip to content

Commit ab8eb37

Browse files
authored
Merge pull request #29 from StrangeDaysTech/feat/eliminate-scripts
feat: eliminate legacy scripts, add validate --staged and devtrail new
2 parents 19c2a7b + d7f6c1d commit ab8eb37

24 files changed

Lines changed: 796 additions & 1446 deletions

CLAUDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is the DevTrail project repository. It contains two main components:
44

5-
- **Framework** (`dist/`): documentation templates, governance policies, agent directives, and scripts
5+
- **Framework** (`dist/`): documentation templates, governance policies, and agent directives
66
- **CLI** (`cli/`): the `devtrail` Rust binary that manages the framework in user projects
77

88
## Project Structure
@@ -12,7 +12,7 @@ devtrail/
1212
├── cli/ # Rust CLI source code
1313
│ ├── src/
1414
│ │ ├── main.rs # Entry point, command routing
15-
│ │ ├── commands/ # Subcommands: init, update, remove, status, repair, validate, compliance, metrics, analyze, audit, explore, about
15+
│ │ ├── commands/ # Subcommands: init, update, remove, status, repair, validate, new, compliance, metrics, analyze, audit, explore, about
1616
│ │ ├── tui/ # Terminal UI for `explore` (ratatui + crossterm)
1717
│ │ ├── analysis_engine.rs # Code complexity analysis (arborist-metrics)
1818
│ │ ├── config.rs # DevTrailConfig, Checksums, ComplexityConfig
@@ -176,7 +176,8 @@ Users can now run `devtrail update-framework` to get the new version.
176176
| `devtrail remove [--full]` | Remove DevTrail from project |
177177
| `devtrail status [path]` | Show installation health and doc stats |
178178
| `devtrail repair [path]` | Restore missing directories and framework files |
179-
| `devtrail validate [path]` | Validate documents for compliance and correctness |
179+
| `devtrail validate [path] [--staged]` | Validate documents for compliance and correctness |
180+
| `devtrail new [path] [-t type] [--title]` | Create a new DevTrail document from a template |
180181
| `devtrail compliance [path]` | Check regulatory compliance (EU AI Act, ISO 42001, NIST) |
181182
| `devtrail metrics [path]` | Show governance metrics and documentation statistics |
182183
| `devtrail analyze [path]` | Analyze code complexity (cognitive + cyclomatic metrics) |
@@ -198,7 +199,7 @@ cargo build --no-default-features # Without TUI
198199
### Test
199200

200201
```bash
201-
cargo test # All 111 tests
202+
cargo test # All 121 tests
202203
```
203204

204205
### Feature Flags

CONTRIBUTING.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ Code contributions should:
8989

9090
- **Git**
9191
- **A text editor** (VS Code recommended)
92-
- **Bash** (for Linux/Mac validation scripts)
93-
- **PowerShell** (for Windows validation scripts)
9492
- **Rust toolchain** (for CLI development — install via [rustup.rs](https://rustup.rs/))
9593
- **Node.js 20+** (optional, for markdownlint)
9694

@@ -108,7 +106,7 @@ Code contributions should:
108106

109107
3. **Install the pre-commit hook**
110108
```bash
111-
cp dist/scripts/pre-commit-docs.sh .git/hooks/pre-commit
109+
echo 'devtrail validate --staged' > .git/hooks/pre-commit
112110
chmod +x .git/hooks/pre-commit
113111
```
114112

@@ -127,11 +125,7 @@ Code contributions should:
127125

128126
6. **Make your changes and validate**
129127
```bash
130-
# Linux/Mac
131-
bash dist/scripts/pre-commit-docs.sh
132-
133-
# Windows
134-
.\dist\scripts\validate-docs.ps1
128+
devtrail validate
135129
```
136130

137131
---
@@ -140,7 +134,7 @@ Code contributions should:
140134

141135
### Before Submitting
142136

143-
- [ ] Run validation scripts successfully
137+
- [ ] Run `devtrail validate` successfully
144138
- [ ] Update documentation if needed
145139
- [ ] Add yourself to CONTRIBUTORS.md (if applicable)
146140
- [ ] Write a clear PR description
@@ -184,7 +178,7 @@ Why is this change needed?
184178
How were these changes tested?
185179

186180
## Checklist
187-
- [ ] Validation scripts pass
181+
- [ ] `devtrail validate` passes
188182
- [ ] Documentation updated
189183
- [ ] No sensitive information included
190184
```
@@ -257,8 +251,7 @@ If you're proposing a new document type:
257251
- `dist/dist-templates/directives/` (distribution templates)
258252

259253
4. **Update validation**
260-
- `dist/scripts/pre-commit-docs.sh`
261-
- `dist/scripts/validate-docs.ps1`
254+
- Add the new type to the CLI validation logic (`cli/src/commands/validate.rs`)
262255
- `dist/.github/workflows/docs-validation.yml`
263256

264257
5. **Document the change**

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ DevTrail uses independent version tags for each component:
146146

147147
| Component | Tag prefix | Example | Includes |
148148
|-----------|-----------|---------|----------|
149-
| Framework | `fw-` | `fw-4.0.0` | Templates (12 types), governance, directives, scripts |
149+
| Framework | `fw-` | `fw-4.0.0` | Templates (12 types), governance, directives |
150150
| CLI | `cli-` | `cli-2.1.0` | The `devtrail` binary |
151151

152152
Check installed versions with `devtrail status` or `devtrail about`.
@@ -184,7 +184,7 @@ unzip devtrail-fw-*.zip -d your-project/
184184
cd your-project
185185

186186
# Commit
187-
git add .devtrail/ DEVTRAIL.md scripts/
187+
git add .devtrail/ DEVTRAIL.md
188188
git commit -m "chore: adopt DevTrail"
189189
```
190190

@@ -319,18 +319,15 @@ concerns:
319319

320320
```bash
321321
# Install the pre-commit hook
322-
cp scripts/pre-commit-docs.sh .git/hooks/pre-commit
322+
echo 'devtrail validate --staged' > .git/hooks/pre-commit
323323
chmod +x .git/hooks/pre-commit
324324
```
325325

326326
### Manual Validation
327327

328328
```bash
329-
# Linux/Mac
330-
bash scripts/pre-commit-docs.sh
331-
332-
# Windows PowerShell
333-
.\scripts\validate-docs.ps1
329+
# Cross-platform (any OS with devtrail installed)
330+
devtrail validate
334331
```
335332

336333
### GitHub Actions
@@ -380,22 +377,21 @@ DevTrail includes skills for AI agents that enable **active documentation creati
380377
/devtrail-adr
381378
```
382379

383-
### Shell Scripts (Manual Use)
380+
### CLI Commands (Manual Use)
384381

385-
For users who prefer command-line or use agents without skill support:
382+
For users who prefer the command line or use agents without skill support:
386383

387384
```bash
388385
# Interactive document creation
389-
./scripts/devtrail-new.sh
386+
devtrail new
390387

391388
# Create specific type directly
392-
./scripts/devtrail-new.sh ailog
389+
devtrail new --doc-type ailog
393390

394391
# Check documentation status
395-
./scripts/devtrail-status.sh
392+
devtrail status
396393
```
397394

398-
399395
### Agent Reporting
400396

401397
AI agents report documentation status at the end of each task:
@@ -449,11 +445,11 @@ All skill implementations are **functionally identical**—only the format diffe
449445

450446
### Operating Systems
451447

452-
| OS | Validation Script |
453-
|----|-------------------|
454-
| Linux | `scripts/pre-commit-docs.sh` |
455-
| macOS | `scripts/pre-commit-docs.sh` |
456-
| Windows | `scripts/validate-docs.ps1` |
448+
| OS | Validation |
449+
|----|------------|
450+
| Linux | `devtrail validate` |
451+
| macOS | `devtrail validate` |
452+
| Windows | `devtrail validate` |
457453

458454
### CI/CD Platforms
459455

cli/src/commands/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn run(path: &str) -> Result<()> {
7070
println!(" 2. Check DEVTRAIL.md for governance rules");
7171
println!(
7272
" 3. Run {} to validate your setup",
73-
"bash scripts/pre-commit-docs.sh".cyan()
73+
"devtrail validate".cyan()
7474
);
7575
println!(
7676
" 4. Commit: {}",

cli/src/commands/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod compliance;
77
pub mod explore;
88
pub mod init;
99
pub mod metrics;
10+
pub mod new;
1011
pub mod remove;
1112
pub mod repair;
1213
pub mod status;

0 commit comments

Comments
 (0)