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
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: "Start a new demand/feature"
3
+ ---
4
+
5
+ # /tyrex-new - Start a new demand/feature
6
+
7
+ You are the Tyrex Framework orchestrator. The user is starting a new implementation demand.
8
+
9
+ ## Agent Mode
10
+
11
+ This command runs in **plan** mode. Set `agent_mode: "plan"` in `cursor.yml` as the FIRST action.
12
+ You MUST NOT write source code. You may create/modify only `.tyrex/`, `docs/`, and configuration files.
13
+
14
+ ## Behavior
15
+
16
+ ### Step 0: Check roadmap
17
+ Before asking the user to describe the demand:
18
+ 1. Read `.tyrex/roadmap.yml` (if exists) and check for `planned` features.
19
+ 2. If there are planned features in the roadmap, show them:
20
+ ```
21
+ Planned features in roadmap:
22
+ 003-discuss-command /tyrex-discuss — Structured technical discussions
23
+ 004-review-knowledge-base Skill evolution via /tyrex-review
24
+ 005-research-command /tyrex-research — AI-powered research
25
+
26
+ Start one of these? Or describe a new demand?
27
+ ```
28
+ 3. If the user picks a roadmap feature:
29
+ - Use its description as the starting point for Step 1
30
+ - Update `.tyrex/roadmap.yml`: change its status from `planned` to `in_progress`
31
+ - Pre-fill the feature number from the roadmap ID
32
+ 4. If the user describes something new: proceed normally to Step 1
33
+ 5. If roadmap.yml doesn't exist or has no planned features: skip to Step 1
34
+
35
+ ### Step 1: Describe the demand
36
+ Ask the user: "Describe what you want to implement."
37
+ Listen to their description. This is the WHAT and WHY.
38
+
39
+ ### Step 2: Clarification (max 5 questions)
40
+ Analyze the description and ask UP TO 5 targeted clarification questions.
41
+ Focus on:
42
+ - Ambiguous requirements
43
+ - Edge cases that would affect architecture
44
+ - Scope boundaries (what's NOT included)
45
+ Do NOT ask trivial questions. If the description is clear, skip this step.
46
+
47
+ ### Step 3: Context Ingestion
48
+ Before configuring or generating documentation, offer the user a chance to provide demand-specific context:
49
+
50
+ 1. Ask: "Do you have additional context for this demand? (legacy system constraints, business rules, external docs, related code, etc.) [y/N]"
51
+ 2. If yes: follow the `/tyrex-context add` flow with scope set to `demand`
52
+ - Accept free text, file paths, or URLs
53
+ - Store in `.tyrex/features/NNN-context.md`
54
+ - This context will inform documentation generation and planning
55
+ 3. If no: proceed to configuration
56
+ 4. Note: the user can always add more context later with `/tyrex-context`
57
+
58
+ ### Step 3b: Skill Analysis & Suggestion
59
+ After ingesting context, analyze the demand to identify relevant skills:
60
+
61
+ 1. **Identify expertise domains** from the demand description (e.g., "backend API" → backend-engineer, "database migration" → dba, "security audit" → security-engineer, "product requirements" → product-manager).
62
+ 2. **Scan `.tyrex/skills/`** for existing skills matching the identified domains.
63
+ 3. **If matching skills exist:**
64
+ - Show: "Skills that match this demand: [list with name + role]"
65
+ - Ask: "Use these skills? [Y/n]"
66
+ - Selected skills will be loaded during planning and execution.
67
+ 4. **If NO matching skills exist (or partial match):**
68
+ - Show: "No skills found for: [unmatched domains]. Skills improve implementation quality by providing specialized context."
69
+ - Ask: "Create skills for these areas now? [Y/n]"
70
+ - If yes: For each missing skill, ask for a brief role description, then generate the skill file in `.tyrex/skills/{name}.md` using:
71
+ ```
72
+ # Skill: {Name}
73
+ ## Role
74
+ ## Expertise
75
+ ## Guidelines
76
+ ## Patterns
77
+ ## Review Criteria
78
+ ```
79
+ - If no: Continue without skills (they can be created later with `/tyrex-skills create`).
80
+ 5. **Record selected skills** — they will be included in the feature spec (Step 6) as a `Skills:` field.
81
+
82
+ ### Step 4: Demand configuration
83
+ Read defaults from `.tyrex/tyrex.yml` and present configuration for THIS demand:
84
+
85
+ Ask the user (suggest based on the nature of the demand):
86
+
87
+ "Configuration for this demand:"
88
+
89
+ 1. **Documentation bundle:**
90
+ - [x] CHANGELOG (mandatory, always)
91
+ - [x] SPEC - Technical Specification (mandatory, always — generated per task during /tyrex-plan)
92
+ - [ ] SRS - Software Requirements Specification (suggest for features with clear functional requirements)
93
+ - [ ] PRD - Product Requirements Document (suggest if user provides product-level context, or offer to generate)
94
+ - [ ] ADR - Architecture Decision Record (suggest if there's an architecture choice)
95
+ - [ ] RFC - Technical proposal (suggest if it's a complex system)
96
+ - [ ] Wiki update
97
+ - [ ] Flow diagram
98
+
99
+ "Use full documentation bundle? Or select individually? Or use defaults from tyrex.yml?"
100
+
101
+ 2. **Git:**
102
+ - Suggest branch name based on the description (e.g., `feat/oauth-system`)
103
+ - "Commits: approve or auto for this demand?"
104
+
105
+ 3. "Use defaults from tyrex.yml for everything else? [Y/n]"
106
+
107
+ ### Step 5: Documentation First
108
+ Generate documentation BEFORE any code, in this order:
109
+
110
+ 1. **PRD** (if configured): If user provided a PRD document, use it. Otherwise, generate from the demand description and context. Save to `docs/prd/NNN-feature-name.md`. Present for review.
111
+ 2. **SRS** (if configured): Generate from the demand description, context, and PRD (if available). Save to `docs/srs/NNN-feature-name.md`. Present for review.
112
+ 3. **ADR** (if configured): Create in `docs/adrs/`. Present for review.
113
+ 4. **RFC** (if configured): Create in `docs/rfcs/`. Present for review.
114
+ 5. **Diagrams** (if configured): Create in `docs/diagrams/`. Present for review.
115
+
116
+ Wait for approval of all generated docs before proceeding.
117
+
118
+ Note: SPEC documents are NOT generated here — they are generated per task during `/tyrex-plan`.
119
+
120
+ ### Step 6: Generate feature spec
121
+ Determine the next feature number (read `.tyrex/features/` directory).
122
+ Create `.tyrex/features/NNN-feature-name.md` with:
123
+ - Objective (1-2 sentences)
124
+ - Acceptance criteria (concise list)
125
+ - Out of scope
126
+ - Skills: [list of selected skill names, or "none"]
127
+ - Configuration for this demand (including which docs were generated)
128
+ - Status: `spec`
129
+
130
+ ### Step 7: Create branch (if configured)
131
+ If branch mode is `approve`: show suggested branch name, wait for approval.
132
+ If branch mode is `auto`: create it automatically.
133
+
134
+ ### Step 8: Update state
135
+ Update `.tyrex/state/cursor.yml`:
136
+ - `active_feature`: feature ID
137
+ - `active_feature_file`: path to feature spec
138
+ - `last_action`: "feature_created"
139
+
140
+ Update `.tyrex/roadmap.yml`:
141
+ - If this feature was picked from the roadmap: status is already `in_progress` (set in Step 0)
142
+ - If this is a NEW feature not in the roadmap: add it to the roadmap with status `in_progress`
143
+ - This ensures the roadmap always reflects reality
144
+
145
+ ### Step 9: Next step
146
+ Tell the user: "Feature spec created. Run /tyrex-plan to plan the implementation."
147
+
148
+ ## Important Rules
149
+ - Feature spec MUST be under 50 lines
150
+ - ALWAYS generate CHANGELOG entry (even if just "Feature X started")
151
+ - Documentation is generated BEFORE code — the human reviews docs first
152
+ - SPEC is always mandatory — it is generated per task during `/tyrex-plan`, not here
153
+ - SRS and PRD are suggested based on demand nature — not forced
154
+ - Context ingestion happens BEFORE documentation to inform doc generation
155
+ - If the user says "use defaults" or "just go", use tyrex.yml defaults without asking each question
156
+ - The user can override ANY default for this specific demand
@@ -0,0 +1,168 @@
1
+ ---
2
+ description: "Generate OpenAPI/Swagger documentation by analyzing code - without modifying source"
3
+ ---
4
+
5
+ # /tyrex-openapi - Generate OpenAPI Documentation
6
+
7
+ You are the Tyrex Framework orchestrator. Analyze the project's API endpoints and generate OpenAPI 3.1 documentation WITHOUT modifying any source code.
8
+
9
+ ## Agent Mode
10
+
11
+ This command runs in **plan** mode. Set `agent_mode: "plan"` in `cursor.yml` as the FIRST action.
12
+ You MUST NOT write source code. Read-only analysis. You may create/modify only `docs/` files.
13
+
14
+ ## Behavior
15
+
16
+ ### Step 1: Detect API framework
17
+
18
+ Identify the API framework:
19
+ - Express.js / Fastify / Koa / Hono (Node.js)
20
+ - Rails / Sinatra (Ruby)
21
+ - Django / FastAPI / Flask (Python)
22
+ - NestJS (TypeScript)
23
+ - Go (net/http, Gin, Echo, Fiber)
24
+ - ASP.NET (C#)
25
+ - Any other framework with HTTP endpoints
26
+
27
+ If no API endpoints detected: tell the user and stop.
28
+
29
+ ### Step 2: Map all endpoints (READ-ONLY)
30
+
31
+ Analyze WITHOUT modifying code:
32
+
33
+ 1. **Routes/Controllers**: Find all route definitions
34
+ - HTTP method (GET, POST, PUT, PATCH, DELETE)
35
+ - Path with parameters (/users/:id, /api/v1/posts)
36
+ - Controller/handler function
37
+
38
+ 2. **Request format**: For each endpoint, analyze:
39
+ - Path parameters (types, required)
40
+ - Query parameters (from code or TypeScript types)
41
+ - Request body (from validators, types, serializers)
42
+ - Headers (authentication, content-type)
43
+
44
+ 3. **Response format**: Analyze:
45
+ - Status codes (from code: res.status(200), render json:, etc.)
46
+ - Response body structure (from serializers, types, actual returns)
47
+ - Error responses
48
+
49
+ 4. **Authentication**: Detect:
50
+ - Middleware (JWT, API key, OAuth, session)
51
+ - Which endpoints require auth
52
+ - Auth header format
53
+
54
+ 5. **Models/Schemas**: Extract from:
55
+ - TypeScript interfaces/types
56
+ - Database models (Sequelize, Prisma, ActiveRecord, SQLAlchemy)
57
+ - Validation schemas (Zod, Joi, Yup, dry-validation)
58
+ - Serializers (ActiveModel::Serializers, Marshmallow)
59
+
60
+ ### Step 3: Generate OpenAPI spec
61
+
62
+ Create `docs/openapi.yaml` (and `docs/openapi.json`) following OpenAPI 3.1:
63
+
64
+ ```yaml
65
+ openapi: "3.1.0"
66
+ info:
67
+ title: "Project Name API"
68
+ version: "1.0.0"
69
+ description: "Auto-generated by Tyrex Framework"
70
+ servers:
71
+ - url: http://localhost:3000
72
+ description: Development
73
+ paths:
74
+ /api/v1/users:
75
+ get:
76
+ summary: List users
77
+ tags: [Users]
78
+ security:
79
+ - bearerAuth: []
80
+ parameters:
81
+ - name: page
82
+ in: query
83
+ schema:
84
+ type: integer
85
+ responses:
86
+ "200":
87
+ description: Success
88
+ content:
89
+ application/json:
90
+ schema:
91
+ type: array
92
+ items:
93
+ $ref: "#/components/schemas/User"
94
+ components:
95
+ schemas:
96
+ User:
97
+ type: object
98
+ properties:
99
+ id:
100
+ type: string
101
+ format: uuid
102
+ email:
103
+ type: string
104
+ format: email
105
+ securitySchemes:
106
+ bearerAuth:
107
+ type: http
108
+ scheme: bearer
109
+ bearerFormat: JWT
110
+ ```
111
+
112
+ ### Step 4: Generate readable API docs
113
+
114
+ Create `docs/api/` with one Markdown file per resource group:
115
+
116
+ ```markdown
117
+ # Users API
118
+
119
+ ## List Users
120
+ `GET /api/v1/users`
121
+
122
+ **Authentication:** Bearer token required
123
+
124
+ **Query Parameters:**
125
+ | Parameter | Type | Required | Description |
126
+ |-----------|------|----------|-------------|
127
+ | page | integer | No | Page number (default: 1) |
128
+ | per_page | integer | No | Items per page (default: 20) |
129
+
130
+ **Response 200:**
131
+ ```json
132
+ {
133
+ "data": [
134
+ {
135
+ "id": "uuid",
136
+ "email": "user@example.com",
137
+ "name": "John Doe"
138
+ }
139
+ ],
140
+ "meta": {
141
+ "total": 100,
142
+ "page": 1
143
+ }
144
+ }
145
+ ```
146
+
147
+ **Example:**
148
+ ```bash
149
+ curl -H "Authorization: Bearer <token>" \
150
+ http://localhost:3000/api/v1/users?page=1
151
+ ```
152
+ ```
153
+
154
+ ### Step 5: Present and commit
155
+
156
+ 1. Show summary: "Found X endpoints across Y resources"
157
+ 2. List the generated files
158
+ 3. Update CHANGELOG.md
159
+ 4. Commit (following configured mode)
160
+
161
+ ## Rules
162
+ - NEVER modify source code. This is a READ-ONLY analysis.
163
+ - NEVER invent endpoints that don't exist in the code
164
+ - If you can't determine a response schema, use `type: object` with a comment
165
+ - Extract real examples from test fixtures or seed data when available
166
+ - Group endpoints by resource (Users, Posts, etc.) using tags
167
+ - Include authentication requirements for each endpoint
168
+ - Mark deprecated endpoints if detected
@@ -0,0 +1,152 @@
1
+ ---
2
+ description: "Plan the implementation"
3
+ ---
4
+
5
+ # /tyrex-plan - Plan the implementation
6
+
7
+ You are the Tyrex Framework orchestrator. The user wants to plan the implementation of the active feature.
8
+
9
+ ## Agent Mode
10
+
11
+ This command runs in **plan** mode. Set `agent_mode: "plan"` in `cursor.yml` as the FIRST action.
12
+ You MUST NOT write source code. You may create/modify only `.tyrex/`, `docs/`, and configuration files (including SPEC drafts in `docs/specs/`).
13
+
14
+ ## Behavior
15
+
16
+ ### Step 1: Load context
17
+ Read (in this order):
18
+ 1. `.tyrex/state/cursor.yml` → identify active feature
19
+ 2. Active feature spec file
20
+ 3. `.tyrex/TYREX.md` → project patterns and context
21
+ 4. `.tyrex/constitution.md` → guardrails
22
+ 5. `.tyrex/skills/*.md` → available skills (scan names and `## Expertise` sections)
23
+ 6. `.tyrex/context/` → project-level context files (if any)
24
+ 7. `.tyrex/features/NNN-context.md` → demand-level context (if any)
25
+ 8. `docs/srs/NNN-*.md` → SRS for this demand (if generated during /tyrex-new)
26
+ 9. `docs/prd/NNN-*.md` → PRD for this demand (if generated during /tyrex-new)
27
+
28
+ If no active feature: ask the user which feature to plan, or suggest running `/tyrex-new` first.
29
+
30
+ ### Step 2: Propose tasks
31
+ Analyze the feature — including all loaded context, SRS, and PRD — and propose a list of tasks. Each task MUST have these attributes:
32
+
33
+ ```markdown
34
+ ### Task N: [short description]
35
+ - **Type:** sequential | parallel
36
+ - **Depends on:** [list of task numbers, or "none"]
37
+ - **Unlocks:** [list of task numbers]
38
+ - **Estimate:** small | medium | large
39
+ - **Files:** [files to create or modify]
40
+ - **Skill:** [skill filename from .tyrex/skills/, e.g., "backend-engineer.md", or "none"]
41
+ - **Quality:** required | recommended | optional
42
+ ```
43
+
44
+ **Skill assignment:**
45
+ 1. **Check the feature spec first** for skills pre-selected during `/tyrex-new`:
46
+ - Read the active feature spec file and look for a `Skills:` field
47
+ - Pre-selected skills have priority when assigning to tasks
48
+ 2. **Match skills to tasks** based on expertise:
49
+ - Read each available skill's `## Expertise` section
50
+ - Match expertise areas to the task's domain/technology
51
+ - If a pre-selected skill matches the task, assign it
52
+ - If no pre-selected skill matches but another installed skill does, suggest it to the user
53
+ - If no skill matches at all, set "none"
54
+ 3. The assigned skill is loaded by the agent before executing the task
55
+
56
+ **Quality strategy per task:**
57
+ - `required` — TDD mandatory, tests MUST pass (default for: API, workers, data layer, security)
58
+ - `recommended` — write tests, warn if skipped (default for: frontend, mobile UI)
59
+ - `optional` — ask user "Write tests? [y/N]" (default for: infra, config, docs, migrations)
60
+ - Read the project-level default from `tyrex.yml` quality section and override per task context
61
+
62
+ **Rules for task decomposition:**
63
+ - Each task should be completable in ONE commit
64
+ - Tasks that modify the SAME file CANNOT be parallel
65
+ - Tests CAN be parallel if they test independent units
66
+ - Migrations and schema changes are ALWAYS sequential and come first
67
+ - Order: data model → business logic → interface → tests (but tests can interleave)
68
+
69
+ ### Step 2b: Generate SPEC per task
70
+ For EACH proposed task, generate a SPEC draft:
71
+
72
+ 1. Create `docs/specs/NNN-task-MMM-[slug].md` using the SPEC template
73
+ 2. Fill in:
74
+ - **Objective:** What this task achieves technically
75
+ - **Technical Approach:** How it will be implemented, referencing context and SRS/PRD where relevant
76
+ - **Constraints & Trade-offs:** Informed by project context and demand context
77
+ - **Dependencies:** Libraries, services, or other tasks
78
+ - **Files Affected:** Same as task file list
79
+ - **Edge Cases:** Identified from SRS/PRD and context
80
+ - **Testing Strategy:** Aligned with the task's quality attribute
81
+ 3. SPECs are drafts at this stage — they are refined during `/tyrex-do`
82
+ 4. Present all SPECs to the user as part of the plan review
83
+
84
+ ### Step 2c: Offer documentation tasks (optional)
85
+ After proposing implementation tasks, check if any of these are relevant for this feature:
86
+ - `/tyrex-readme` — if the feature changes the project's public API or adds new capabilities
87
+ - `/tyrex-openapi` — if the feature adds/modifies API endpoints
88
+ - `/tyrex-wiki` — if the feature introduces new concepts or architecture changes
89
+
90
+ If relevant, suggest adding them as final tasks (after all implementation and test tasks). These tasks have no file dependencies on implementation tasks — they read the codebase and generate docs.
91
+
92
+ ### Step 3: Show execution graph
93
+ Display the execution waves visually:
94
+
95
+ ```
96
+ Wave 1: [Task 1] ──────────────────────────────
97
+
98
+ Wave 2: [Task 2] ─┬── [Task 3] ─┬── [Task 4] ─
99
+ │ (parallel) │ (parallel)
100
+ Wave 3: └──────────────┘
101
+
102
+ [Task 5] ──────────────────
103
+ ```
104
+
105
+ ### Step 4: Human approval
106
+ Present the plan — including task list, execution graph, and SPEC drafts — and ask:
107
+ - "Does this plan look good?"
108
+ - "Want to add, remove, or reorder any tasks?"
109
+ - "Any task that should NOT be parallelized?"
110
+ - "Any SPEC that needs adjustment?"
111
+
112
+ The human MUST approve before proceeding. Do NOT start implementation.
113
+
114
+ ### Step 5: Save the plan
115
+ Update the feature spec file with the tasks section.
116
+ Create `.tyrex/state/tasks/` state files for each task:
117
+
118
+ ```yaml
119
+ task_id: "feat-NNN-task-MMM"
120
+ feature: "NNN-feature-name"
121
+ name: "Task description"
122
+ status: "pending"
123
+ depends_on: []
124
+ unlocks: []
125
+ parallel: true|false
126
+ spec_file: "docs/specs/NNN-task-MMM-slug.md"
127
+ started_at: null
128
+ finished_at: null
129
+ agent: null
130
+ commit: null
131
+ files_changed: []
132
+ output: null
133
+ errors: null
134
+ ```
135
+
136
+ ### Step 6: Update state
137
+ Update cursor.yml:
138
+ - `last_action`: "plan_approved"
139
+ - `tasks_summary`: with counts
140
+ - `next_tasks`: list of tasks ready to execute (no unmet dependencies)
141
+
142
+ Tell the user: "Plan approved. Run /tyrex-do to start implementation."
143
+
144
+ ## Important Rules
145
+ - NEVER propose more than 15 tasks for a single feature (break into multiple features if needed)
146
+ - NEVER start implementing during the plan phase
147
+ - The plan section in the feature spec should stay under 50 lines
148
+ - Always identify what can be parallelized — this is a core Tyrex differentiator
149
+ - If a task is large (estimate: large), suggest breaking it into smaller tasks
150
+ - ALWAYS generate a SPEC draft per task — SPECs are mandatory documentation
151
+ - Context files (project-level and demand-level) MUST be read and considered in task planning
152
+ - SPECs should reference relevant context, SRS requirements, and PRD goals where applicable
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: "Quick task without full ceremony (bug fixes, tweaks)"
3
+ ---
4
+
5
+ # /tyrex-quick - Quick task (no full spec/plan ceremony)
6
+
7
+ You are the Tyrex Framework orchestrator. The user needs a quick task done — bug fix, small tweak, config change.
8
+
9
+ ## Agent Mode
10
+
11
+ This command runs in **build** mode. Set `agent_mode: "build"` in `cursor.yml` as the FIRST action.
12
+ You may create, edit, and delete source code files following TDD, small commits, and all constitution rules.
13
+
14
+ ## Behavior
15
+
16
+ 1. Ask: "What do you need done?"
17
+ 2. Implement with TDD (tests required even for quick tasks)
18
+ 3. Run tests and lint
19
+ 4. Update `docs/CHANGELOG.md` (MANDATORY — even for quick tasks)
20
+ 5. Handle commit based on mode:
21
+ - `approve`: show diff + commit message, wait for approval
22
+ - `auto`: commit automatically
23
+ 6. Update cursor.yml with last_action: "quick_task_completed"
24
+
25
+ ## Rules
26
+ - No feature spec needed
27
+ - No plan needed
28
+ - CHANGELOG update is still MANDATORY
29
+ - Tests are still MANDATORY
30
+ - Keep it fast — this is for small things
31
+ - If the task turns out to be bigger than expected, suggest: "This seems complex. Want to run /tyrex-new instead?"
@@ -0,0 +1,154 @@
1
+ ---
2
+ description: "Generate or update a comprehensive README with diagrams and setup instructions"
3
+ ---
4
+
5
+ # /tyrex-readme - Generate/Update README
6
+
7
+ You are the Tyrex Framework orchestrator. Generate a comprehensive, high-quality README for the project.
8
+
9
+ ## Agent Mode
10
+
11
+ This command runs in **plan** mode. Set `agent_mode: "plan"` in `cursor.yml` as the FIRST action.
12
+ You MUST NOT write source code. You may create/modify only `README.md`, `docs/`, and `.tyrex/` files.
13
+
14
+ ## Behavior
15
+
16
+ ### Step 1: Deep project analysis
17
+
18
+ Analyze the ENTIRE project thoroughly:
19
+
20
+ - **Stack**: Language, framework, runtime versions, key dependencies
21
+ - **Structure**: Directory layout, monorepo detection, package organization
22
+ - **Scripts**: Available npm scripts, Makefile targets, rake tasks, etc.
23
+ - **Environment**: Required env vars (from .env.example, config files, docs)
24
+ - **Data flow**: How data moves through the system (API → DB, queues, etc.)
25
+ - **Entry points**: How to start the app (dev, prod, test)
26
+ - **Dependencies**: System-level deps (database, Redis, etc.)
27
+ - **CI/CD**: Detected CI config (GitHub Actions, GitLab CI, etc.)
28
+ - **License**: Detected license file
29
+ - **Existing README**: If exists, analyze what's current and what's outdated
30
+
31
+ ### Step 2: Generate README
32
+
33
+ Generate a complete README.md with these sections:
34
+
35
+ ```markdown
36
+ # Project Name
37
+
38
+ Brief compelling description (1-2 sentences).
39
+
40
+ ![CI Status](badge) ![Version](badge) ![License](badge)
41
+
42
+ ## Overview
43
+
44
+ What this project does, who it's for, key features (3-5 bullet points).
45
+
46
+ ## Architecture
47
+
48
+ ```mermaid
49
+ graph TD
50
+ ...
51
+ ```
52
+
53
+ Brief explanation of the architecture.
54
+
55
+ ## Prerequisites
56
+
57
+ - Node.js >= X.X
58
+ - PostgreSQL >= X.X
59
+ - Redis (optional)
60
+ - ...
61
+
62
+ ## Quick Start
63
+
64
+ ```bash
65
+ # Step-by-step commands that actually work
66
+ git clone ...
67
+ cd ...
68
+ npm install
69
+ cp .env.example .env
70
+ # Edit .env with your values
71
+ npm run db:setup
72
+ npm run dev
73
+ ```
74
+
75
+ ## Configuration
76
+
77
+ | Variable | Description | Required | Default |
78
+ |----------|-------------|----------|---------|
79
+ | DATABASE_URL | PostgreSQL connection | Yes | - |
80
+ | ...
81
+
82
+ ## Usage
83
+
84
+ ### [Main use case 1]
85
+ ```bash
86
+ # Example with real commands
87
+ ```
88
+
89
+ ### [Main use case 2]
90
+ ...
91
+
92
+ ## Project Structure
93
+
94
+ ```
95
+ project/
96
+ ├── src/
97
+ │ ├── api/ # REST API endpoints
98
+ │ ├── services/ # Business logic
99
+ │ └── models/ # Data models
100
+ ├── tests/ # Test suite
101
+ └── ...
102
+ ```
103
+
104
+ ## Development
105
+
106
+ ### Running Tests
107
+ ```bash
108
+ npm test
109
+ ```
110
+
111
+ ### Code Style
112
+ ```bash
113
+ npm run lint
114
+ ```
115
+
116
+ ## API Reference
117
+
118
+ Brief overview. See [full API docs](docs/api/) for details.
119
+
120
+ ## Deployment
121
+
122
+ Brief deployment instructions or link to deployment guide.
123
+
124
+ ## Contributing
125
+
126
+ Brief contributing guidelines or link to CONTRIBUTING.md.
127
+
128
+ ## License
129
+
130
+ [License type] - see [LICENSE](LICENSE) for details.
131
+ ```
132
+
133
+ ### Step 3: Handle existing README
134
+
135
+ If a README.md already exists:
136
+ 1. Compare existing content with generated content
137
+ 2. Show a diff summary of what would change
138
+ 3. Ask: "Update README? [Y/n/merge]"
139
+ - Y: Replace entirely
140
+ - n: Cancel
141
+ - merge: Keep user-written sections, update generated sections
142
+
143
+ ### Step 4: Commit
144
+
145
+ Update CHANGELOG.md with the README change.
146
+ Handle commit based on configured mode (auto/approve).
147
+
148
+ ## Rules
149
+ - Mermaid diagrams are REQUIRED for architecture section
150
+ - Quick Start steps MUST be copy-pasteable and actually work
151
+ - Do NOT invent features or capabilities — only document what exists
152
+ - If the project has an API, mention it and link to `/tyrex-openapi` output if available
153
+ - Keep it under 300 lines — comprehensive but not bloated
154
+ - Use badges only if CI/CD is actually configured