elspais 0.9.1__tar.gz

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.
Files changed (92) hide show
  1. elspais-0.9.1/.gitignore +76 -0
  2. elspais-0.9.1/CHANGELOG.md +74 -0
  3. elspais-0.9.1/LICENSE +21 -0
  4. elspais-0.9.1/PKG-INFO +393 -0
  5. elspais-0.9.1/README.md +354 -0
  6. elspais-0.9.1/docs/configuration.md +438 -0
  7. elspais-0.9.1/docs/multi-repo.md +251 -0
  8. elspais-0.9.1/docs/patterns.md +260 -0
  9. elspais-0.9.1/docs/rules.md +419 -0
  10. elspais-0.9.1/pyproject.toml +100 -0
  11. elspais-0.9.1/src/elspais/__init__.py +36 -0
  12. elspais-0.9.1/src/elspais/__main__.py +8 -0
  13. elspais-0.9.1/src/elspais/cli.py +525 -0
  14. elspais-0.9.1/src/elspais/commands/__init__.py +12 -0
  15. elspais-0.9.1/src/elspais/commands/analyze.py +218 -0
  16. elspais-0.9.1/src/elspais/commands/config_cmd.py +501 -0
  17. elspais-0.9.1/src/elspais/commands/edit.py +522 -0
  18. elspais-0.9.1/src/elspais/commands/hash_cmd.py +174 -0
  19. elspais-0.9.1/src/elspais/commands/index.py +166 -0
  20. elspais-0.9.1/src/elspais/commands/init.py +177 -0
  21. elspais-0.9.1/src/elspais/commands/rules_cmd.py +120 -0
  22. elspais-0.9.1/src/elspais/commands/trace.py +208 -0
  23. elspais-0.9.1/src/elspais/commands/validate.py +388 -0
  24. elspais-0.9.1/src/elspais/config/__init__.py +13 -0
  25. elspais-0.9.1/src/elspais/config/defaults.py +173 -0
  26. elspais-0.9.1/src/elspais/config/loader.py +494 -0
  27. elspais-0.9.1/src/elspais/core/__init__.py +21 -0
  28. elspais-0.9.1/src/elspais/core/content_rules.py +170 -0
  29. elspais-0.9.1/src/elspais/core/hasher.py +143 -0
  30. elspais-0.9.1/src/elspais/core/models.py +318 -0
  31. elspais-0.9.1/src/elspais/core/parser.py +596 -0
  32. elspais-0.9.1/src/elspais/core/patterns.py +390 -0
  33. elspais-0.9.1/src/elspais/core/rules.py +514 -0
  34. elspais-0.9.1/src/elspais/mcp/__init__.py +42 -0
  35. elspais-0.9.1/src/elspais/mcp/__main__.py +6 -0
  36. elspais-0.9.1/src/elspais/mcp/context.py +171 -0
  37. elspais-0.9.1/src/elspais/mcp/serializers.py +112 -0
  38. elspais-0.9.1/src/elspais/mcp/server.py +339 -0
  39. elspais-0.9.1/src/elspais/testing/__init__.py +27 -0
  40. elspais-0.9.1/src/elspais/testing/config.py +48 -0
  41. elspais-0.9.1/src/elspais/testing/mapper.py +163 -0
  42. elspais-0.9.1/src/elspais/testing/result_parser.py +289 -0
  43. elspais-0.9.1/src/elspais/testing/scanner.py +206 -0
  44. elspais-0.9.1/tests/conftest.py +148 -0
  45. elspais-0.9.1/tests/fixtures/assertions/.elspais.toml +32 -0
  46. elspais-0.9.1/tests/fixtures/assertions/spec/dev-impl.md +29 -0
  47. elspais-0.9.1/tests/fixtures/assertions/spec/prd-sample.md +28 -0
  48. elspais-0.9.1/tests/fixtures/associated-repo/.elspais.toml +45 -0
  49. elspais-0.9.1/tests/fixtures/associated-repo/spec/dev-sponsor.md +37 -0
  50. elspais-0.9.1/tests/fixtures/associated-repo/spec/prd-sponsor.md +33 -0
  51. elspais-0.9.1/tests/fixtures/fda-style/.elspais.toml +37 -0
  52. elspais-0.9.1/tests/fixtures/fda-style/spec/dev-impl.md +31 -0
  53. elspais-0.9.1/tests/fixtures/fda-style/spec/prd-core.md +31 -0
  54. elspais-0.9.1/tests/fixtures/hht-like/.elspais.toml +74 -0
  55. elspais-0.9.1/tests/fixtures/hht-like/database/schema.sql +73 -0
  56. elspais-0.9.1/tests/fixtures/hht-like/spec/INDEX.md +30 -0
  57. elspais-0.9.1/tests/fixtures/hht-like/spec/dev-impl.md +56 -0
  58. elspais-0.9.1/tests/fixtures/hht-like/spec/ops-deploy.md +39 -0
  59. elspais-0.9.1/tests/fixtures/hht-like/spec/prd-core.md +56 -0
  60. elspais-0.9.1/tests/fixtures/invalid/broken-links/.elspais.toml +24 -0
  61. elspais-0.9.1/tests/fixtures/invalid/broken-links/spec/broken.md +41 -0
  62. elspais-0.9.1/tests/fixtures/invalid/circular-deps/.elspais.toml +23 -0
  63. elspais-0.9.1/tests/fixtures/invalid/circular-deps/spec/circular.md +41 -0
  64. elspais-0.9.1/tests/fixtures/invalid/missing-hash/.elspais.toml +24 -0
  65. elspais-0.9.1/tests/fixtures/invalid/missing-hash/spec/missing.md +38 -0
  66. elspais-0.9.1/tests/fixtures/jira-style/.elspais.toml +30 -0
  67. elspais-0.9.1/tests/fixtures/jira-style/requirements/features.md +55 -0
  68. elspais-0.9.1/tests/fixtures/named-reqs/.elspais.toml +28 -0
  69. elspais-0.9.1/tests/fixtures/named-reqs/spec/features.md +45 -0
  70. elspais-0.9.1/tests/mcp/__init__.py +1 -0
  71. elspais-0.9.1/tests/mcp/test_context.py +118 -0
  72. elspais-0.9.1/tests/mcp/test_serializers.py +141 -0
  73. elspais-0.9.1/tests/test_config.py +756 -0
  74. elspais-0.9.1/tests/test_content_rules.py +312 -0
  75. elspais-0.9.1/tests/test_doc_sync.py +203 -0
  76. elspais-0.9.1/tests/test_edit.py +632 -0
  77. elspais-0.9.1/tests/test_hash_bugs.py +549 -0
  78. elspais-0.9.1/tests/test_hasher.py +265 -0
  79. elspais-0.9.1/tests/test_models.py +206 -0
  80. elspais-0.9.1/tests/test_parser.py +1005 -0
  81. elspais-0.9.1/tests/test_parser_resilience.py +390 -0
  82. elspais-0.9.1/tests/test_patterns.py +192 -0
  83. elspais-0.9.1/tests/test_rules.py +253 -0
  84. elspais-0.9.1/tests/test_validate_json.py +242 -0
  85. elspais-0.9.1/tests/testing/__init__.py +1 -0
  86. elspais-0.9.1/tests/testing/fixtures/junit_results.xml +18 -0
  87. elspais-0.9.1/tests/testing/fixtures/pytest_results.json +34 -0
  88. elspais-0.9.1/tests/testing/fixtures/sample_test.py +38 -0
  89. elspais-0.9.1/tests/testing/test_config.py +64 -0
  90. elspais-0.9.1/tests/testing/test_mapper.py +118 -0
  91. elspais-0.9.1/tests/testing/test_result_parser.py +137 -0
  92. elspais-0.9.1/tests/testing/test_scanner.py +114 -0
@@ -0,0 +1,76 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ *.manifest
29
+ *.spec
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Unit test / coverage reports
36
+ htmlcov/
37
+ .tox/
38
+ .nox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ *.py,cover
46
+ .hypothesis/
47
+ .pytest_cache/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Environments
54
+ .env
55
+ .venv
56
+ env/
57
+ venv/
58
+ ENV/
59
+ env.bak/
60
+ venv.bak/
61
+
62
+ # IDE
63
+ .idea/
64
+ .vscode/
65
+ *.swp
66
+ *.swo
67
+ *~
68
+
69
+ # mypy
70
+ .mypy_cache/
71
+ .dmypy.json
72
+ dmypy.json
73
+
74
+ # OS
75
+ .DS_Store
76
+ Thumbs.db
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ All notable changes to elspais will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.9.1] - 2026-01-03
11
+
12
+ ### Changed
13
+ - Updated CLAUDE.md with complete architecture documentation
14
+ - Added testing/, mcp/, and content_rules modules to CLAUDE.md
15
+ - Added ParseResult API design pattern documentation
16
+ - Added Workflow section with contribution guidelines
17
+ - Updated Python version reference from 3.8+ to 3.9+
18
+
19
+ ## [0.9.0] - 2026-01-03
20
+
21
+ ### Added
22
+ - Test mapping and coverage functionality (`elspais.testing` module)
23
+ - `TestScanner`: Scans test files for requirement references
24
+ - `ResultParser`: Parses JUnit XML and pytest JSON test results
25
+ - `TestMapper`: Orchestrates scanning and result mapping
26
+ - Parser resilience with `ParseResult` API and warning system
27
+ - Parser now returns `ParseResult` containing both requirements and warnings
28
+ - Non-fatal issues generate warnings instead of failing parsing
29
+
30
+ ## [0.2.1] - 2025-12-28
31
+
32
+ ### Changed
33
+ - Renamed "sponsor" to "associated" throughout the codebase
34
+ - Config: `[sponsor]` → `[associated]`, `[patterns.sponsor]` → `[patterns.associated]`
35
+ - CLI: `--sponsor-prefix` → `--associated-prefix`, `--type sponsor` → `--type associated`
36
+ - ID template: `{sponsor}` → `{associated}`
37
+ - Made the tool generic by removing standards-specific references
38
+ - Updated documentation to use neutral terminology
39
+
40
+ ## [0.2.0] - 2025-12-28
41
+
42
+ ### Added
43
+ - Multi-directory spec support: `spec = ["spec", "spec/roadmap"]`
44
+ - Generic `get_directories()` function for any config key
45
+ - Recursive directory scanning for code directories
46
+ - `get_code_directories()` convenience function with auto-recursion
47
+ - `ignore` config for excluding directories (node_modules, .git, etc.)
48
+ - Configurable `no_reference_values` for Implements field (-, null, none, N/A)
49
+ - `parse_directories()` method for parsing multiple spec directories
50
+ - `skip_files` config support across all commands
51
+
52
+ ### Fixed
53
+ - Body extraction now matches hht-diary behavior (includes Rationale/Acceptance)
54
+ - Hash calculation strips trailing whitespace for consistency
55
+ - skip_files config now properly passed to parser in all commands
56
+
57
+ ## [0.1.0] - 2025-12-27
58
+
59
+ ### Added
60
+ - Initial release of elspais requirements validation tools
61
+ - Configurable requirement ID patterns (REQ-p00001, PRD-00001, PROJ-123, etc.)
62
+ - Configurable validation rules with hierarchy enforcement
63
+ - TOML-based per-repository configuration (.elspais.toml)
64
+ - CLI commands: validate, trace, hash, index, analyze, init
65
+ - Multi-repository support (core/associated model)
66
+ - Traceability matrix generation (Markdown, HTML, CSV)
67
+ - Hash-based change detection for requirements
68
+ - Zero external dependencies (Python 3.8+ standard library only)
69
+ - Core requirement parsing and validation
70
+ - Pattern matching for multiple ID formats
71
+ - Rule engine for hierarchy validation
72
+ - Configuration system with sensible defaults
73
+ - Test fixtures for multiple requirement formats
74
+ - Comprehensive documentation
elspais-0.9.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Anspar
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.
elspais-0.9.1/PKG-INFO ADDED
@@ -0,0 +1,393 @@
1
+ Metadata-Version: 2.1
2
+ Name: elspais
3
+ Version: 0.9.1
4
+ Summary: Requirements validation and traceability tools - L-Space connects all libraries
5
+ Home-page: https://github.com/anspar/elspais
6
+ Author: Anspar
7
+ Author-email: dev@anspar.io
8
+ License: MIT
9
+ Project-URL: Documentation, https://github.com/anspar/elspais#readme
10
+ Project-URL: Repository, https://github.com/anspar/elspais
11
+ Project-URL: Issues, https://github.com/anspar/elspais/issues
12
+ Project-URL: Changelog, https://github.com/anspar/elspais/blob/main/CHANGELOG.md
13
+ Keywords: documentation,requirements,specifications,traceability,validation
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Software Development :: Documentation
25
+ Classifier: Topic :: Software Development :: Quality Assurance
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.9
28
+ Provides-Extra: binary
29
+ Requires-Dist: pyinstaller>=6.0; extra == 'binary'
30
+ Provides-Extra: dev
31
+ Requires-Dist: black>=23.0; extra == 'dev'
32
+ Requires-Dist: mypy>=1.0; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
34
+ Requires-Dist: pytest>=7.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
36
+ Provides-Extra: mcp
37
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # elspais
41
+
42
+ > "L-Space is the ultimate library, connecting all libraries everywhere through the sheer weight of accumulated knowledge."
43
+ > — Terry Pratchett
44
+
45
+ **elspais** is a requirements validation and traceability tool that helps teams manage formal requirements across single or multiple repositories. It supports configurable ID patterns, validation rules, and generates traceability matrices.
46
+
47
+ ## Features
48
+
49
+ - **Zero Dependencies**: Core CLI uses only Python 3.9+ standard library
50
+ - **Configurable ID Patterns**: Support for `REQ-p00001`, `PRD-00001`, `PROJ-123`, named requirements, and custom formats
51
+ - **Validation Rules**: Enforce requirement hierarchies (PRD → OPS → DEV) with configurable constraints
52
+ - **Multi-Repository**: Link requirements across core and associated repositories
53
+ - **Traceability Matrices**: Generate Markdown, HTML, or CSV output
54
+ - **Hash-Based Change Detection**: Track requirement changes with SHA-256 hashes
55
+ - **Content Rules**: Define semantic validation guidelines for AI agents
56
+ - **MCP Server**: Integrate with AI assistants via Model Context Protocol
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ pip install elspais
62
+ ```
63
+
64
+ Or install from source:
65
+
66
+ ```bash
67
+ git clone https://github.com/anspar/elspais.git
68
+ cd elspais
69
+ pip install -e .
70
+ ```
71
+
72
+ ## Quick Start
73
+
74
+ ### Initialize a Repository
75
+
76
+ ```bash
77
+ # Create .elspais.toml with default configuration
78
+ elspais init
79
+
80
+ # Or specify repository type
81
+ elspais init --type core # Core repository
82
+ elspais init --type associated --associated-prefix CAL # Associated repo
83
+ ```
84
+
85
+ ### Validate Requirements
86
+
87
+ ```bash
88
+ # Validate all requirements in spec/ directory
89
+ elspais validate
90
+
91
+ # Verbose output
92
+ elspais validate -v
93
+
94
+ # Validate with auto-fix for fixable issues
95
+ elspais validate --fix
96
+ ```
97
+
98
+ ### Generate Traceability Matrix
99
+
100
+ ```bash
101
+ # Generate both Markdown and HTML
102
+ elspais trace
103
+
104
+ # Generate specific format
105
+ elspais trace --format html
106
+ elspais trace --format csv
107
+
108
+ # Custom output location
109
+ elspais trace --output docs/traceability.html
110
+ ```
111
+
112
+ ### Manage Requirement Hashes
113
+
114
+ ```bash
115
+ # Verify all hashes match content
116
+ elspais hash verify
117
+
118
+ # Update all hashes
119
+ elspais hash update
120
+
121
+ # Update specific requirement
122
+ elspais hash update REQ-d00027
123
+ ```
124
+
125
+ ### Analyze Requirements
126
+
127
+ ```bash
128
+ # Show requirement hierarchy tree
129
+ elspais analyze hierarchy
130
+
131
+ # Find orphaned requirements
132
+ elspais analyze orphans
133
+
134
+ # Implementation coverage report
135
+ elspais analyze coverage
136
+ ```
137
+
138
+ ## Configuration
139
+
140
+ Create `.elspais.toml` in your repository root:
141
+
142
+ ```toml
143
+ [project]
144
+ name = "my-project"
145
+ type = "core" # "core" | "associated"
146
+
147
+ [directories]
148
+ spec = "spec"
149
+ docs = "docs"
150
+ code = ["src", "apps", "packages"]
151
+
152
+ [patterns]
153
+ id_template = "{prefix}-{type}{id}"
154
+ prefix = "REQ"
155
+
156
+ [patterns.types]
157
+ prd = { id = "p", name = "Product Requirement", level = 1 }
158
+ ops = { id = "o", name = "Operations Requirement", level = 2 }
159
+ dev = { id = "d", name = "Development Requirement", level = 3 }
160
+
161
+ [patterns.id_format]
162
+ style = "numeric"
163
+ digits = 5
164
+ leading_zeros = true
165
+
166
+ [rules.hierarchy]
167
+ allowed_implements = [
168
+ "dev -> ops, prd",
169
+ "ops -> prd",
170
+ "prd -> prd",
171
+ ]
172
+ allow_circular = false
173
+ allow_orphans = false
174
+
175
+ [rules.format]
176
+ require_hash = true
177
+ require_assertions = true
178
+ allowed_statuses = ["Active", "Draft", "Deprecated", "Superseded"]
179
+ ```
180
+
181
+ See [docs/configuration.md](docs/configuration.md) for full reference.
182
+
183
+ ## Requirement Format
184
+
185
+ elspais expects requirements in Markdown format:
186
+
187
+ ```markdown
188
+ ### REQ-d00001: Requirement Title
189
+
190
+ **Level**: Dev | **Implements**: p00001 | **Status**: Active
191
+
192
+ The system SHALL provide user authentication.
193
+
194
+ **Rationale**: Security requires identity verification.
195
+
196
+ **Acceptance Criteria**:
197
+ - Users can log in with email/password
198
+ - Session expires after 30 minutes of inactivity
199
+
200
+ *End* *Requirement Title* | **Hash**: a1b2c3d4
201
+ ---
202
+ ```
203
+
204
+ ## ID Pattern Examples
205
+
206
+ elspais supports multiple ID formats:
207
+
208
+ | Pattern | Example | Configuration |
209
+ |---------|---------|---------------|
210
+ | HHT Default | `REQ-p00001` | `id_template = "{prefix}-{type}{id}"` |
211
+ | Type-Prefix | `PRD-00001` | `id_template = "{type}-{id}"` |
212
+ | Jira-Like | `PROJ-123` | `id_template = "{prefix}-{id}"` |
213
+ | Named | `REQ-UserAuth` | `style = "named"` |
214
+ | Associated | `REQ-CAL-d00001` | `associated.enabled = true` |
215
+
216
+ See [docs/patterns.md](docs/patterns.md) for details.
217
+
218
+ ## Multi-Repository Support
219
+
220
+ For associated repositories that reference a core repository:
221
+
222
+ ```toml
223
+ [project]
224
+ type = "associated"
225
+
226
+ [associated]
227
+ prefix = "CAL"
228
+
229
+ [core]
230
+ path = "../core-repo"
231
+ ```
232
+
233
+ Validate with core linking:
234
+
235
+ ```bash
236
+ elspais validate --core-repo ../core-repo
237
+ ```
238
+
239
+ ## Content Rules
240
+
241
+ Content rules are markdown files that provide semantic validation guidance for AI agents authoring requirements:
242
+
243
+ ```bash
244
+ # Configure content rules
245
+ elspais config add rules.content_rules "spec/AI-AGENT.md"
246
+
247
+ # List configured rules
248
+ elspais rules list
249
+
250
+ # View a specific rule
251
+ elspais rules show AI-AGENT.md
252
+ ```
253
+
254
+ Content rule files can include YAML frontmatter for metadata:
255
+
256
+ ```markdown
257
+ ---
258
+ title: AI Agent Guidelines
259
+ type: guidance
260
+ applies_to: [requirements, assertions]
261
+ ---
262
+
263
+ # AI Agent Guidelines
264
+
265
+ - Use SHALL for normative statements
266
+ - One assertion per obligation
267
+ - No duplication across levels
268
+ ```
269
+
270
+ ## MCP Server (AI Integration)
271
+
272
+ elspais includes an MCP (Model Context Protocol) server for AI assistant integration:
273
+
274
+ ```bash
275
+ # Install with MCP support
276
+ pip install elspais[mcp]
277
+
278
+ # Start MCP server
279
+ elspais mcp serve
280
+ ```
281
+
282
+ Configure in Claude Desktop (`claude_desktop_config.json`):
283
+
284
+ ```json
285
+ {
286
+ "mcpServers": {
287
+ "elspais": {
288
+ "command": "elspais",
289
+ "args": ["mcp", "serve"],
290
+ "cwd": "/path/to/your/project"
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ ### MCP Resources
297
+
298
+ | Resource | Description |
299
+ |----------|-------------|
300
+ | `requirements://all` | List all requirements |
301
+ | `requirements://{id}` | Get requirement details |
302
+ | `requirements://level/{level}` | Filter by PRD/OPS/DEV |
303
+ | `content-rules://list` | List content rules |
304
+ | `content-rules://{file}` | Get content rule content |
305
+ | `config://current` | Current configuration |
306
+
307
+ ### MCP Tools
308
+
309
+ | Tool | Description |
310
+ |------|-------------|
311
+ | `validate` | Run validation rules |
312
+ | `parse_requirement` | Parse requirement text |
313
+ | `search` | Search requirements |
314
+ | `get_requirement` | Get requirement details |
315
+ | `analyze` | Analyze hierarchy/orphans/coverage |
316
+
317
+ ## CLI Reference
318
+
319
+ ```
320
+ elspais [OPTIONS] COMMAND [ARGS]
321
+
322
+ Options:
323
+ --config PATH Path to config file
324
+ --spec-dir PATH Override spec directory
325
+ -v, --verbose Verbose output
326
+ -q, --quiet Suppress non-error output
327
+ --version Show version
328
+ --help Show help
329
+
330
+ Commands:
331
+ validate Validate requirements format, links, hashes
332
+ trace Generate traceability matrix
333
+ hash Manage requirement hashes (verify, update)
334
+ index Validate or regenerate INDEX.md
335
+ analyze Analyze requirement hierarchy
336
+ edit Edit requirements in-place (status, implements, move)
337
+ config View and modify configuration
338
+ rules View and manage content rules
339
+ mcp MCP server commands (requires elspais[mcp])
340
+ version Show version and check for updates
341
+ init Create .elspais.toml configuration
342
+ ```
343
+
344
+ ## Development
345
+
346
+ ```bash
347
+ # Clone and install in development mode
348
+ git clone https://github.com/anspar/elspais.git
349
+ cd elspais
350
+ pip install -e ".[dev]"
351
+
352
+ # Run tests
353
+ pytest
354
+
355
+ # Run with coverage
356
+ pytest --cov=elspais
357
+
358
+ # Type checking
359
+ mypy src/elspais
360
+
361
+ # Linting
362
+ ruff check src/elspais
363
+ black --check src/elspais
364
+ ```
365
+
366
+ ## Version Pinning
367
+
368
+ For reproducible builds, pin the version in your project:
369
+
370
+ ```bash
371
+ # .github/versions.env
372
+ ELSPAIS_VERSION=0.1.0
373
+ ```
374
+
375
+ ```yaml
376
+ # GitHub Actions
377
+ - name: Install elspais
378
+ run: pip install elspais==${{ env.ELSPAIS_VERSION }}
379
+ ```
380
+
381
+ ## License
382
+
383
+ MIT License - see [LICENSE](LICENSE) for details.
384
+
385
+ ## Contributing
386
+
387
+ Contributions welcome! Please read the contributing guidelines before submitting PRs.
388
+
389
+ ## Links
390
+
391
+ - [Documentation](https://github.com/anspar/elspais#readme)
392
+ - [Issue Tracker](https://github.com/anspar/elspais/issues)
393
+ - [Changelog](CHANGELOG.md)