tyrex-framework 0.1.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.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +274 -0
  3. package/bin/tyrex.js +445 -0
  4. package/package.json +33 -0
  5. package/templates/AGENTS.md +74 -0
  6. package/templates/CHANGELOG.md +11 -0
  7. package/templates/CLAUDE.md +74 -0
  8. package/templates/TYREX.md +60 -0
  9. package/templates/adr.md +20 -0
  10. package/templates/commands/unified/tyrex-context.md +107 -0
  11. package/templates/commands/unified/tyrex-discuss.md +141 -0
  12. package/templates/commands/unified/tyrex-do.md +133 -0
  13. package/templates/commands/unified/tyrex-evolve.md +31 -0
  14. package/templates/commands/unified/tyrex-handoff.md +215 -0
  15. package/templates/commands/unified/tyrex-help.md +293 -0
  16. package/templates/commands/unified/tyrex-init.md +134 -0
  17. package/templates/commands/unified/tyrex-new.md +156 -0
  18. package/templates/commands/unified/tyrex-openapi.md +168 -0
  19. package/templates/commands/unified/tyrex-plan.md +152 -0
  20. package/templates/commands/unified/tyrex-quick.md +31 -0
  21. package/templates/commands/unified/tyrex-readme.md +154 -0
  22. package/templates/commands/unified/tyrex-resume.md +75 -0
  23. package/templates/commands/unified/tyrex-review.md +157 -0
  24. package/templates/commands/unified/tyrex-settings.md +67 -0
  25. package/templates/commands/unified/tyrex-skills.md +150 -0
  26. package/templates/commands/unified/tyrex-status.md +158 -0
  27. package/templates/commands/unified/tyrex-wiki.md +116 -0
  28. package/templates/constitution.md +60 -0
  29. package/templates/cursor.yml +29 -0
  30. package/templates/feature.md +40 -0
  31. package/templates/prd.md +30 -0
  32. package/templates/review-checklist.md +37 -0
  33. package/templates/rfc.md +19 -0
  34. package/templates/roadmap.yml +16 -0
  35. package/templates/skill.md +16 -0
  36. package/templates/spec.md +33 -0
  37. package/templates/srs.md +27 -0
  38. package/templates/tyrex.yml +54 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tyrex Framework Contributors
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,274 @@
1
+ # Tyrex Framework
2
+
3
+ **Human-driven, AI-accelerated pair programming.**
4
+
5
+ Tyrex is a workflow orchestrator for AI coding agents. It scaffolds structured commands into your project so that AI agents (Claude Code, OpenCode, Cursor, Codex) follow a disciplined development process: TDD, atomic commits, documentation-first, and shared memory across sessions.
6
+
7
+ ```
8
+ npx tyrex-framework
9
+ ```
10
+
11
+ Zero dependencies. One CLI. Works with any AI coding agent.
12
+
13
+ ---
14
+
15
+ ## Why Tyrex?
16
+
17
+ AI coding agents are powerful but chaotic. Without structure, they skip tests, make sprawling commits, forget context between sessions, and ignore your project's patterns.
18
+
19
+ Tyrex fixes this by giving agents a workflow:
20
+
21
+ - **Structured commands** (`/tyrex-new`, `/tyrex-plan`, `/tyrex-do`, `/tyrex-review`) enforce a disciplined development cycle
22
+ - **Shared memory** (`TYREX.md`, context files, skills) persists knowledge across sessions and agents
23
+ - **Guardrails** (`constitution.md`) define inviolable rules the agent must follow
24
+ - **Session recovery** (`cursor.yml`) lets you resume exactly where you left off
25
+ - **Parallelization** — independent tasks run concurrently with sub-agents
26
+ - **Documentation-first** — SPEC, SRS, PRD, ADRs are generated before code
27
+
28
+ ## How It Works
29
+
30
+ Tyrex doesn't run your AI agent. It installs **markdown command files** into the directories your agent already reads. When you type `/tyrex-new` in Claude Code (or any supported agent), the agent reads the command definition and follows the structured workflow.
31
+
32
+ ```
33
+ You (human) AI Agent Tyrex
34
+ | | |
35
+ |--- /tyrex-new ---->| |
36
+ | |--- reads .md ---->|
37
+ | |<-- workflow ------|
38
+ |<-- follows flow ---| |
39
+ |--- approves ------>| |
40
+ | |--- executes ----->|
41
+ ```
42
+
43
+ **The human decides WHAT and WHY. The AI decides HOW.**
44
+
45
+ ## Quick Start
46
+
47
+ ### 1. Install
48
+
49
+ **Option A – npx (recommended)**
50
+
51
+ ```bash
52
+ # In your project directory
53
+ npx tyrex-framework
54
+ ```
55
+
56
+ **Option B – npm Git/HTTP install (no registry release needed)**
57
+
58
+ ```bash
59
+ npm install git+https://github.com/tyrex-framework/tyrex.git
60
+ npx tyrex-framework
61
+ ```
62
+
63
+ The interactive installer asks:
64
+ 1. Which AI agent? (Claude Code, OpenCode, Cursor, Codex, or all)
65
+ 2. Local or global install?
66
+ 3. Configuration (commit mode, branch mode, documentation level)
67
+
68
+ ### 2. Initialize
69
+
70
+ Open your AI agent and run:
71
+
72
+ ```
73
+ /tyrex-init
74
+ ```
75
+
76
+ This maps your codebase, detects your stack, runs a security audit, and generates `TYREX.md` (your project's living context document).
77
+
78
+ For **new/empty projects**, Tyrex creates a minimal structure and suggests `/tyrex-discuss` to brainstorm before building.
79
+
80
+ ### 3. Start building
81
+
82
+ ```
83
+ /tyrex-discuss # Explore the project or brainstorm architecture
84
+ /tyrex-new # Define a new feature
85
+ /tyrex-plan # Break it into tasks with dependencies
86
+ /tyrex-do # Implement with TDD, commits, and docs
87
+ /tyrex-review # Review, finalize docs, ship
88
+ ```
89
+
90
+ ## Commands
91
+
92
+ ### Workflow
93
+
94
+ | Command | Purpose |
95
+ |---------|---------|
96
+ | `/tyrex-init` | Map codebase, configure project, generate TYREX.md |
97
+ | `/tyrex-discuss` | Explore project interactively, brainstorm architecture |
98
+ | `/tyrex-new` | Start a new feature (requirements, docs, skills, branch) |
99
+ | `/tyrex-plan` | Plan tasks with dependencies, parallelism, and SPEC per task |
100
+ | `/tyrex-do` | Execute tasks (TDD, skill-aware, parallel sub-agents) |
101
+ | `/tyrex-review` | Review implementation, finalize docs, evolve TYREX.md |
102
+
103
+ ### Shortcuts
104
+
105
+ | Command | Purpose |
106
+ |---------|---------|
107
+ | `/tyrex-quick` | Fast task without full ceremony (bug fixes, tweaks) |
108
+ | `/tyrex-handoff` | Autopilot: chains new -> plan -> do -> review |
109
+
110
+ ### Management
111
+
112
+ | Command | Purpose |
113
+ |---------|---------|
114
+ | `/tyrex-status` | Dashboard: features, roadmap, health, docs coverage |
115
+ | `/tyrex-resume` | Resume from last session (fast recovery via cursor.yml) |
116
+ | `/tyrex-settings` | View/modify configuration |
117
+ | `/tyrex-evolve` | Record new patterns or decisions in TYREX.md |
118
+
119
+ ### Skills & Documentation
120
+
121
+ | Command | Purpose |
122
+ |---------|---------|
123
+ | `/tyrex-skills` | Manage reusable AI personas (create, list, sync) |
124
+ | `/tyrex-context` | Ingest project context (text, files, URLs) |
125
+ | `/tyrex-readme` | Generate/update README.md |
126
+ | `/tyrex-openapi` | Generate OpenAPI docs from code |
127
+ | `/tyrex-wiki` | Generate/update project wiki |
128
+ | `/tyrex-help` | Command reference and contextual suggestions |
129
+
130
+ ## Typical Workflow
131
+
132
+ ```
133
+ /tyrex-init --> /tyrex-discuss --> /tyrex-new --> /tyrex-plan --> /tyrex-do --> /tyrex-review
134
+ (optional) ^ |
135
+ '--- fix tasks ------------'
136
+ ```
137
+
138
+ **Greenfield project:**
139
+ ```
140
+ /tyrex-init --> /tyrex-discuss (brainstorm) --> /tyrex-new --> ...
141
+ ```
142
+
143
+ **Quick fix:**
144
+ ```
145
+ /tyrex-quick (skip spec/plan, just fix and commit)
146
+ ```
147
+
148
+ ## Key Concepts
149
+
150
+ ### TYREX.md — Living Project Context
151
+
152
+ Every project gets a `TYREX.md` that captures your stack, architecture, patterns, known hurdles, and decisions. AI agents read this before every interaction, so they understand your project without re-analyzing the codebase.
153
+
154
+ ### Constitution — Inviolable Rules
155
+
156
+ `constitution.md` defines rules the AI must always follow: TDD, no hardcoded secrets, small commits, CHANGELOG updates. The human writes the constitution. The AI obeys it.
157
+
158
+ ### Skills — Reusable AI Personas
159
+
160
+ Skills are markdown files that give agents specialized perspectives:
161
+
162
+ ```markdown
163
+ # Skill: Backend Engineer
164
+ ## Role
165
+ Senior backend engineer focused on API design and data integrity.
166
+ ## Expertise
167
+ REST APIs, database design, authentication, performance optimization.
168
+ ## Guidelines
169
+ - Always validate input at the boundary
170
+ - Use repository pattern for data access
171
+ - ...
172
+ ```
173
+
174
+ Skills are auto-suggested during `/tyrex-new` and loaded during `/tyrex-do` for specialized implementation quality.
175
+
176
+ ### Roadmap — Forward Visibility
177
+
178
+ `.tyrex/roadmap.yml` tracks planned, in-progress, and completed features. The `/tyrex-status` command shows what's done, what's active, and what's next. `/tyrex-new` checks the roadmap before asking for a new demand.
179
+
180
+ ### Documentation Layers
181
+
182
+ | Document | Scope | When |
183
+ |----------|-------|------|
184
+ | **SPEC** | Per task | Generated during `/tyrex-plan` (mandatory) |
185
+ | **SRS** | Per feature | Generated during `/tyrex-new` (suggested) |
186
+ | **PRD** | Per feature | Provided or generated during `/tyrex-new` (suggested) |
187
+ | **ADR** | Per decision | Generated when architecture choices arise |
188
+ | **Context** | Project or feature | Ingested via `/tyrex-context` at any time |
189
+
190
+ ## Supported Agents
191
+
192
+ | Agent | Commands Directory | Rules File |
193
+ |-------|-------------------|------------|
194
+ | Claude Code | `.claude/commands/` | `CLAUDE.md` |
195
+ | OpenCode | `.opencode/commands/` | `AGENTS.md` |
196
+ | Cursor | `.cursor/rules/tyrex/` | `CLAUDE.md` |
197
+ | Codex | `.codex/skills/tyrex/` | `CLAUDE.md` |
198
+
199
+ All agents receive the same 18 command definitions from a single source of truth (`templates/commands/unified/`).
200
+
201
+ ## Project Structure
202
+
203
+ After installation, your project gets:
204
+
205
+ ```
206
+ your-project/
207
+ .tyrex/
208
+ tyrex.yml # Configuration
209
+ TYREX.md # Living project context
210
+ constitution.md # Inviolable guardrails
211
+ roadmap.yml # Feature roadmap and backlog
212
+ state/
213
+ cursor.yml # Session pointer (fast recovery)
214
+ tasks/ # Individual task states
215
+ features/ # Feature specs
216
+ skills/ # Reusable AI personas
217
+ context/ # Project context files
218
+ templates/ # Document templates (SPEC, SRS, PRD, ADR, etc.)
219
+ map/ # Codebase analysis results
220
+ docs/
221
+ CHANGELOG.md # Mandatory changelog
222
+ adrs/ # Architecture Decision Records
223
+ specs/ # Task specifications
224
+ srs/ # Software Requirements Specifications
225
+ prd/ # Product Requirements Documents
226
+ wiki/ # Project wiki pages
227
+ rfcs/ # Technical proposals
228
+ diagrams/ # Flow diagrams
229
+ ```
230
+
231
+ ## CLI Options
232
+
233
+ ```bash
234
+ npx tyrex-framework # Interactive setup
235
+ npx tyrex-framework --claude --local # Claude Code, current project
236
+ npx tyrex-framework --all --local # All agents, current project
237
+ npx tyrex-framework --all --local -d # All agents, default config
238
+ npx tyrex-framework --all --global # All agents, home directory
239
+ npx tyrex-framework --uninstall --claude # Remove Claude commands
240
+ npx tyrex-framework --force # Re-install, overwrite core files
241
+ ```
242
+
243
+ | Flag | Description |
244
+ |------|-------------|
245
+ | `--claude` | Install for Claude Code |
246
+ | `--opencode` | Install for OpenCode |
247
+ | `--cursor` | Install for Cursor |
248
+ | `--codex` | Install for Codex |
249
+ | `--all` | Install for all agents |
250
+ | `--local`, `-l` | Install in current directory |
251
+ | `--global`, `-g` | Install in home directory |
252
+ | `--defaults`, `-d` | Skip config questions, use defaults |
253
+ | `--force`, `-f` | Overwrite core files on re-install |
254
+ | `--uninstall` | Remove agent commands |
255
+
256
+ ## Core Rules
257
+
258
+ 1. **Human decides WHAT and WHY. AI decides HOW.** Never invert this.
259
+ 2. **TDD is mandatory.** Write tests alongside or before code.
260
+ 3. **Every commit passes CI.** No broken commits.
261
+ 4. **CHANGELOG is mandatory.** Updated on every change.
262
+ 5. **Small commits.** One task = one atomic, revertible commit.
263
+ 6. **Ask, don't assume.** When in doubt, ask the human.
264
+ 7. **Simplicity wins.** Propose the simplest solution first.
265
+ 8. **Documentation first.** When configured, generate docs before code.
266
+
267
+ ## Requirements
268
+
269
+ - Node.js >= 18.0.0
270
+ - An AI coding agent (Claude Code, OpenCode, Cursor, or Codex)
271
+
272
+ ## License
273
+
274
+ MIT