telos-framework 0.9.2 → 0.10.1
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/.claude/commands/telos/init.md +386 -30
- package/lib/installers/platform-adapters.js +216 -0
- package/lib/installers/slash-commands.js +136 -55
- package/lib/sdd/spec-templates.js +82 -46
- package/package.json +1 -1
- package/templates/TELOS_CORE.md +9 -0
- package/templates/commands/init.md +609 -0
- package/templates/commands/quick.md +143 -0
- package/templates/commands/reset.md +96 -0
- package/templates/commands/sdd-context.md +64 -0
- package/templates/commands/sdd-discover.md +59 -0
- package/templates/commands/sdd-generate-tests.md +85 -0
- package/templates/commands/sdd-init.md +46 -0
- package/templates/commands/sdd-validate.md +78 -0
- package/templates/commands/status.md +181 -0
- package/templates/commands/validate.md +190 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Telos Quick Initialization
|
|
2
|
+
|
|
3
|
+
This is the fast-track initialization mode that accepts all AI-proposed specs
|
|
4
|
+
without user review. Use this when you trust the AI analysis and want to get
|
|
5
|
+
started immediately.
|
|
6
|
+
|
|
7
|
+
## The 4-Level Hierarchy
|
|
8
|
+
|
|
9
|
+
| Level | Name | Description |
|
|
10
|
+
| ----- | ---------- | ----------------------------------------------- |
|
|
11
|
+
| L4 | Purpose | Why the project exists + success metrics |
|
|
12
|
+
| L3 | Experience | User journeys, UX requirements, analytics needs |
|
|
13
|
+
| L2 | Contract | API contracts, component interfaces, boundaries |
|
|
14
|
+
| L1 | Function | Individual functions with TDD scenarios |
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
1. **Analyze codebase** silently
|
|
19
|
+
2. **Generate L4 purpose spec** from README/docs
|
|
20
|
+
3. **Show summary** of what was created
|
|
21
|
+
|
|
22
|
+
## Step 1: Silent Analysis
|
|
23
|
+
|
|
24
|
+
Analyze without user interaction:
|
|
25
|
+
|
|
26
|
+
- Read README.md
|
|
27
|
+
- Check package.json / pyproject.toml / Cargo.toml
|
|
28
|
+
- Scan src/ or lib/ directory
|
|
29
|
+
- Detect testing and linting tools
|
|
30
|
+
|
|
31
|
+
## Step 2: Auto-Generate L4 Purpose
|
|
32
|
+
|
|
33
|
+
Generate `telos/specs/L4-purpose/purpose.md` based on analysis:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
<!-- telos-metadata
|
|
37
|
+
id: L4:purpose
|
|
38
|
+
level: 4
|
|
39
|
+
title: [Project Name]
|
|
40
|
+
-->
|
|
41
|
+
|
|
42
|
+
# L4: Purpose
|
|
43
|
+
|
|
44
|
+
## Why This Project Exists
|
|
45
|
+
|
|
46
|
+
[Inferred from README]
|
|
47
|
+
|
|
48
|
+
## Beneficiaries
|
|
49
|
+
|
|
50
|
+
[Inferred from README or package description]
|
|
51
|
+
|
|
52
|
+
## Success Metrics
|
|
53
|
+
|
|
54
|
+
- [Inferred metric 1]
|
|
55
|
+
- [Inferred metric 2]
|
|
56
|
+
- [Inferred metric 3]
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
|
|
60
|
+
- [Any detected constraints]
|
|
61
|
+
|
|
62
|
+
## Technology Stack
|
|
63
|
+
|
|
64
|
+
- **Languages**: [Detected]
|
|
65
|
+
- **Frameworks**: [Detected]
|
|
66
|
+
- **Testing**: [Detected]
|
|
67
|
+
- **Linting**: [Detected]
|
|
68
|
+
|
|
69
|
+
## Initialization
|
|
70
|
+
|
|
71
|
+
- **Date**: [Current date]
|
|
72
|
+
- **Method**: /telos:quick
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Step 3: Display Summary
|
|
76
|
+
|
|
77
|
+
Once complete, show:
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
⚡ **Telos quick initialization complete!**
|
|
82
|
+
|
|
83
|
+
**Your project now has:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
telos/
|
|
87
|
+
├── TELOS.md # Entry point
|
|
88
|
+
├── .telosrc.json # Configuration
|
|
89
|
+
├── index.json # Spec registry
|
|
90
|
+
└── specs/
|
|
91
|
+
├── L4-purpose/
|
|
92
|
+
│ └── purpose.md # [Generated purpose]
|
|
93
|
+
├── L3-experience/ # Ready for user journey specs
|
|
94
|
+
├── L2-contract/ # Ready for API/component specs
|
|
95
|
+
└── L1-function/ # Ready for function specs
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Generated L4 Purpose:**
|
|
99
|
+
|
|
100
|
+
| Field | Value |
|
|
101
|
+
| ------------- | ------------------- |
|
|
102
|
+
| Purpose | [Purpose statement] |
|
|
103
|
+
| Beneficiaries | [Who benefits] |
|
|
104
|
+
| Stack | [Detected tech] |
|
|
105
|
+
|
|
106
|
+
**How Spec-Driven Development works:**
|
|
107
|
+
|
|
108
|
+
1. **Before coding**: Create a spec at the appropriate level
|
|
109
|
+
2. **Write tests**: Generate tests from spec scenarios
|
|
110
|
+
3. **Implement**: Write code with `@telos` annotation
|
|
111
|
+
4. **Validate**: Run `/telos:validate` before commits
|
|
112
|
+
|
|
113
|
+
**Available commands:**
|
|
114
|
+
|
|
115
|
+
- `/telos:validate` - Validate specs, links, tests
|
|
116
|
+
- `/telos:status` - Show current configuration
|
|
117
|
+
- `/telos:sdd-discover` - Generate specs from existing code
|
|
118
|
+
- `/telos:sdd-context` - Load spec context before changes
|
|
119
|
+
|
|
120
|
+
**Next steps:**
|
|
121
|
+
|
|
122
|
+
1. Review `telos/specs/L4-purpose/purpose.md` and refine if needed
|
|
123
|
+
2. For existing code: Run `/telos:sdd-discover` to generate specs
|
|
124
|
+
3. For new features: Create specs before coding
|
|
125
|
+
|
|
126
|
+
**Not satisfied?** Run `/telos:init` for interactive mode with full
|
|
127
|
+
customization.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## When to Use Quick Mode
|
|
132
|
+
|
|
133
|
+
✅ **Use quick mode when:**
|
|
134
|
+
|
|
135
|
+
- Starting a new project with clear conventions
|
|
136
|
+
- The codebase already has comprehensive README
|
|
137
|
+
- You want to iterate quickly and refine later
|
|
138
|
+
|
|
139
|
+
❌ **Use full `/telos:init` when:**
|
|
140
|
+
|
|
141
|
+
- Project has unique or nuanced purpose
|
|
142
|
+
- Strategic direction needs human input
|
|
143
|
+
- Initial setup must be carefully reviewed
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Telos Reset
|
|
2
|
+
|
|
3
|
+
This command removes all existing Telos configuration and allows you to start
|
|
4
|
+
fresh.
|
|
5
|
+
|
|
6
|
+
## What Gets Removed
|
|
7
|
+
|
|
8
|
+
This command will **delete** the following:
|
|
9
|
+
|
|
10
|
+
- `.telos/TELOS.md`
|
|
11
|
+
- `.telos/agents/` directory (all L1-L9 agent files)
|
|
12
|
+
- `logos/orchestrator.js` (if present)
|
|
13
|
+
- Telos sections in `AGENTS.md` and `CLAUDE.md` (if present)
|
|
14
|
+
|
|
15
|
+
## Safety Check
|
|
16
|
+
|
|
17
|
+
Before proceeding, ask the user:
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
⚠️ **Warning: This will delete all Telos configuration files.**
|
|
21
|
+
|
|
22
|
+
**Files to be removed:**
|
|
23
|
+
- `.telos/TELOS.md`
|
|
24
|
+
- `.telos/agents/l1-*.md` through `l9-*.md`
|
|
25
|
+
- `logos/orchestrator.js`
|
|
26
|
+
- Telos references in AGENTS.md / CLAUDE.md
|
|
27
|
+
|
|
28
|
+
**Are you sure you want to reset?** (yes/no)
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
If user responds "no" or anything other than "yes", abort with message: "Reset
|
|
32
|
+
cancelled. Your Telos configuration is unchanged."
|
|
33
|
+
|
|
34
|
+
## Reset Process
|
|
35
|
+
|
|
36
|
+
If user confirms "yes":
|
|
37
|
+
|
|
38
|
+
### Step 1: Remove Files
|
|
39
|
+
|
|
40
|
+
Delete the following files (if they exist):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
rm -rf .telos/TELOS.md
|
|
44
|
+
rm -rf .telos/agents/
|
|
45
|
+
rm -rf logos/orchestrator.js
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 2: Clean Memory Files
|
|
49
|
+
|
|
50
|
+
If `AGENTS.md` exists:
|
|
51
|
+
|
|
52
|
+
- Remove any sections with headers containing "Telos" or "L1-L9"
|
|
53
|
+
- Keep all other content intact
|
|
54
|
+
|
|
55
|
+
If `CLAUDE.md` exists:
|
|
56
|
+
|
|
57
|
+
- Remove any sections referencing Telos
|
|
58
|
+
- Keep all other project-specific content
|
|
59
|
+
|
|
60
|
+
### Step 3: Clean State
|
|
61
|
+
|
|
62
|
+
Remove any initialization state files:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
rm -f .telos-init-state.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Step 4: Confirm Completion
|
|
69
|
+
|
|
70
|
+
Display:
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
✅ **Telos reset complete.**
|
|
74
|
+
|
|
75
|
+
**Removed:**
|
|
76
|
+
- All Telos content and agent files
|
|
77
|
+
- Telos references in AGENTS.md / CLAUDE.md
|
|
78
|
+
- Initialization state
|
|
79
|
+
|
|
80
|
+
**Next steps:**
|
|
81
|
+
- Run `/telos-init` for full interactive setup
|
|
82
|
+
- Run `/telos-quick` for fast auto-generation
|
|
83
|
+
- Run `telos init` (CLI) to reinstall slash commands if needed
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Edge Cases
|
|
87
|
+
|
|
88
|
+
**If no Telos files found:** Display: "No Telos installation detected. Nothing
|
|
89
|
+
to reset."
|
|
90
|
+
|
|
91
|
+
**If only partial installation found:** Remove what exists and notify: "Partial
|
|
92
|
+
Telos installation found. Removed existing files. Run `/telos-init` to complete
|
|
93
|
+
setup."
|
|
94
|
+
|
|
95
|
+
**If git repository has uncommitted Telos files:** Warn: "You have uncommitted
|
|
96
|
+
Telos files. Consider running `git status` before resetting."
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Telos-SDD Context
|
|
2
|
+
|
|
3
|
+
Load recursive context for a spec ID to understand its full lineage.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
When you need to understand a piece of code or make changes, load its context:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx telos context <spec-id>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Example:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx telos context L1:function:src/auth/validation:validateToken
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What Context Includes
|
|
20
|
+
|
|
21
|
+
1. **TELOS.md** - Project entry point (always loaded)
|
|
22
|
+
2. **Lineage** - All ancestor specs from L4 down to target
|
|
23
|
+
3. **Target Spec** - Full content of the requested spec
|
|
24
|
+
4. **Siblings** - Adjacent specs with same parent (metadata only)
|
|
25
|
+
5. **Implementation** - Source file and test file paths
|
|
26
|
+
|
|
27
|
+
## Output Format
|
|
28
|
+
|
|
29
|
+
Default is markdown, suitable for AI consumption:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx telos context L1:function:src/auth:validate --format=markdown
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For JSON output:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx telos context L1:function:src/auth:validate --format=json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## When to Use
|
|
42
|
+
|
|
43
|
+
Use context loading when:
|
|
44
|
+
|
|
45
|
+
1. Before modifying code - understand its purpose
|
|
46
|
+
2. Before creating specs - see the hierarchy
|
|
47
|
+
3. Reviewing code - trace back to requirements
|
|
48
|
+
4. Writing tests - understand scenarios
|
|
49
|
+
|
|
50
|
+
## Example Workflow
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 1. Find the spec for a file
|
|
54
|
+
npx telos coverage
|
|
55
|
+
|
|
56
|
+
# 2. Load context for the spec
|
|
57
|
+
npx telos context L1:function:src/auth/validation
|
|
58
|
+
|
|
59
|
+
# 3. Make changes aligned with purpose
|
|
60
|
+
# (edit code)
|
|
61
|
+
|
|
62
|
+
# 4. Validate changes
|
|
63
|
+
npx telos validate
|
|
64
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Telos-SDD Discover
|
|
2
|
+
|
|
3
|
+
Scan the existing codebase and generate spec structure (brownfield).
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
1. Scans source directories for modules and functions
|
|
8
|
+
2. Detects routes, components, and API endpoints
|
|
9
|
+
3. Proposes a spec hierarchy based on code structure
|
|
10
|
+
4. Generates spec files for review
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Run the discovery command:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx telos discover
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For a dry run (preview without generating files):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx telos discover --dry-run
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Review Process
|
|
27
|
+
|
|
28
|
+
After discovery, review the generated specs:
|
|
29
|
+
|
|
30
|
+
1. **L4:purpose** - Edit to reflect actual project purpose
|
|
31
|
+
2. **L3:experience** - Rename journeys to match your terminology
|
|
32
|
+
3. **L2:contract** - Verify API contracts match implementation
|
|
33
|
+
4. **L1:function** - Add missing scenarios for TDD
|
|
34
|
+
|
|
35
|
+
## Adding Annotations
|
|
36
|
+
|
|
37
|
+
After specs are generated, add @telos annotations to code:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// @telos L1:function:src/auth/validation:validateToken
|
|
41
|
+
export function validateToken(token: string): boolean {
|
|
42
|
+
// implementation
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Validation
|
|
47
|
+
|
|
48
|
+
After adding annotations, validate coverage:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx telos validate
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This checks:
|
|
55
|
+
|
|
56
|
+
- All specs have valid structure
|
|
57
|
+
- All annotations point to existing specs
|
|
58
|
+
- All L1 specs have tests
|
|
59
|
+
- No orphaned code (functions without annotations)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Telos-SDD Generate Tests
|
|
2
|
+
|
|
3
|
+
Generate test skeletons from spec scenarios.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Generate tests for a spec:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx telos spec generate-tests <spec-id>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Example:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx telos spec generate-tests L1:function:src/auth/validation
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Dry Run
|
|
20
|
+
|
|
21
|
+
Preview generated tests without writing files:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx telos spec generate-tests L1:function:src/auth/validation --dry-run
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Test Framework
|
|
28
|
+
|
|
29
|
+
Specify a framework (default: auto-detected):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx telos spec generate-tests L1:function:src/auth/validation --framework=vitest
|
|
33
|
+
npx telos spec generate-tests L1:function:src/auth/validation --framework=jest
|
|
34
|
+
npx telos spec generate-tests L1:function:src/auth/validation --framework=pytest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Scenario Format in Specs
|
|
38
|
+
|
|
39
|
+
Scenarios in your spec should follow this format:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
### Scenario: Valid token
|
|
43
|
+
|
|
44
|
+
- GIVEN a properly signed JWT
|
|
45
|
+
- WHEN validateToken is called
|
|
46
|
+
- THEN return { valid: true }
|
|
47
|
+
|
|
48
|
+
### Scenario: Expired token
|
|
49
|
+
|
|
50
|
+
- GIVEN a JWT with expired `exp` claim
|
|
51
|
+
- WHEN validateToken is called
|
|
52
|
+
- THEN return { valid: false, error: 'TOKEN_EXPIRED' }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Generated Test Format
|
|
56
|
+
|
|
57
|
+
The generator creates:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// @telos-test L1:function:src/auth/validation:validateToken
|
|
61
|
+
describe("validateToken", () => {
|
|
62
|
+
// @telos-scenario L1:function:src/auth/validation:validateToken:valid-token
|
|
63
|
+
it("Valid token", () => {
|
|
64
|
+
// GIVEN a properly signed JWT
|
|
65
|
+
// TODO: Set up test conditions
|
|
66
|
+
|
|
67
|
+
// WHEN validateToken is called
|
|
68
|
+
// TODO: Execute the action
|
|
69
|
+
|
|
70
|
+
// THEN return { valid: true }
|
|
71
|
+
// TODO: Add assertions
|
|
72
|
+
expect(true).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## TDD Workflow
|
|
78
|
+
|
|
79
|
+
1. **Create spec with scenarios**
|
|
80
|
+
2. **Generate test skeletons**: `telos spec generate-tests <spec-id>`
|
|
81
|
+
3. **Run tests** → They fail (Red)
|
|
82
|
+
4. **Implement code** with @telos annotation
|
|
83
|
+
5. **Run tests** → They pass (Green)
|
|
84
|
+
6. **Validate**: `telos validate`
|
|
85
|
+
7. **Commit** (pre-commit hook verifies)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Telos-SDD Initialize
|
|
2
|
+
|
|
3
|
+
Initialize the Spec-Driven Development (SDD) structure for this project.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
1. Creates the telos/specs/ directory hierarchy (L4-L1)
|
|
8
|
+
2. Generates an initial L4:purpose spec from project metadata
|
|
9
|
+
3. Creates TELOS.md entry point
|
|
10
|
+
4. Initializes the spec index
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Run the CLI command to initialize SDD:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx telos spec init
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Then help the user refine their L4:purpose by:
|
|
21
|
+
|
|
22
|
+
1. Reading telos/specs/L4-purpose/purpose.md
|
|
23
|
+
2. Asking clarifying questions about:
|
|
24
|
+
- The ultimate purpose of the project
|
|
25
|
+
- Success metrics (KPIs)
|
|
26
|
+
- Target users
|
|
27
|
+
- Constraints (technical, regulatory, etc.)
|
|
28
|
+
3. Updating the spec with their answers
|
|
29
|
+
|
|
30
|
+
## Spec Level Overview
|
|
31
|
+
|
|
32
|
+
| Level | Name | Description |
|
|
33
|
+
| ----- | ---------- | ----------------------------------------- |
|
|
34
|
+
| L4 | Purpose | Why the project exists + success metrics |
|
|
35
|
+
| L3 | Experience | User journeys, UX requirements, analytics |
|
|
36
|
+
| L2 | Contract | API contracts, component interfaces |
|
|
37
|
+
| L1 | Function | Individual functions with TDD scenarios |
|
|
38
|
+
|
|
39
|
+
## Next Steps
|
|
40
|
+
|
|
41
|
+
After initialization, guide the user to:
|
|
42
|
+
|
|
43
|
+
1. Run `telos discover` to generate specs from existing code
|
|
44
|
+
2. Run `telos spec create 3 <name>` to add user journeys
|
|
45
|
+
3. Add `@telos` annotations to their code
|
|
46
|
+
4. Run `telos validate` to check coverage
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Telos-SDD Validate
|
|
2
|
+
|
|
3
|
+
Validate all specs, code-spec links, tests, and orphaned code.
|
|
4
|
+
|
|
5
|
+
## Full Validation
|
|
6
|
+
|
|
7
|
+
Run complete validation:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx telos validate
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This checks:
|
|
14
|
+
|
|
15
|
+
1. **Specs** - Structure, parent-child integrity, no circular refs
|
|
16
|
+
2. **Links** - All @telos annotations point to existing specs
|
|
17
|
+
3. **Tests** - All L1 specs have @telos-test annotations
|
|
18
|
+
4. **Orphans** - All functions have @telos annotations
|
|
19
|
+
|
|
20
|
+
## Selective Validation
|
|
21
|
+
|
|
22
|
+
Validate specific aspects:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx telos validate --specs # Spec structure only
|
|
26
|
+
npx telos validate --links # Code-spec links only
|
|
27
|
+
npx telos validate --tests # Test coverage only
|
|
28
|
+
npx telos validate --orphans # Orphaned code only
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Exit Codes
|
|
32
|
+
|
|
33
|
+
- `0` - All validations passed
|
|
34
|
+
- `1` - One or more validations failed
|
|
35
|
+
|
|
36
|
+
Use in CI/CD:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
- name: Validate Telos-SDD
|
|
40
|
+
run: npx telos validate
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Fixing Issues
|
|
44
|
+
|
|
45
|
+
### Invalid Annotation
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
✗ src/auth/legacy.ts:12 → L2:auth-legacy:oldValidate (spec deleted)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Fix: Update annotation to point to existing spec, or remove the code.
|
|
52
|
+
|
|
53
|
+
### Missing Tests
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
⚠ L1:function:src/payment:formatCurrency - missing tests
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Fix: Run `telos spec generate-tests L1:function:src/payment` to create test
|
|
60
|
+
skeletons.
|
|
61
|
+
|
|
62
|
+
### Orphaned Code
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
✗ src/utils.ts:45 - helper function has no @telos annotation
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Fix: Add `// @telos L1:function:src/utils:helper` above the function.
|
|
69
|
+
|
|
70
|
+
## Pre-commit Hook
|
|
71
|
+
|
|
72
|
+
Install automatic validation:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx telos hooks install
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This blocks commits that fail validation.
|