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,60 @@
1
+ # TYREX - {{PROJECT_NAME}}
2
+
3
+ > This is a living document. Update it as the project evolves.
4
+ > Every pattern discovered, every hurdle solved, every decision made should be documented here.
5
+ > AI agents read this before every interaction - invest in it, it pays back exponentially.
6
+
7
+ ## Project Overview
8
+
9
+ <!-- 2-3 sentences about the project -->
10
+
11
+ ## Tech Stack
12
+
13
+ <!-- List your stack -->
14
+ - Language:
15
+ - Framework:
16
+ - Database:
17
+ - Deploy:
18
+ - CI:
19
+
20
+ ## Architecture
21
+
22
+ <!-- Concise description. ASCII diagram if needed. -->
23
+
24
+ ## Project Patterns
25
+
26
+ <!-- Document patterns as they emerge -->
27
+ <!-- Example: -->
28
+ <!-- - Services: app/services/*_service.rb - single responsibility, < 100 lines -->
29
+ <!-- - Tests: spec mirrors app structure, factory_bot for fixtures -->
30
+
31
+ ## Environment Variables
32
+
33
+ | Variable | Description | Required |
34
+ |----------|-------------|----------|
35
+ | | | |
36
+
37
+ ## Known Hurdles
38
+
39
+ <!-- Document problems and their solutions as you discover them -->
40
+ <!-- Example: -->
41
+ <!-- - Yahoo Finance blocks HTTParty -> Use headless Chromium with crumb auth -->
42
+
43
+ ## Architecture Decisions
44
+
45
+ | Date | Decision | Rationale |
46
+ |------|----------|-----------|
47
+ | | | |
48
+
49
+ ## CI/CD
50
+
51
+ <!-- How CI runs, what it checks -->
52
+
53
+ ## Post-Implementation Checklist
54
+
55
+ - [ ] Tests passing
56
+ - [ ] Lint clean
57
+ - [ ] Security scan clean
58
+ - [ ] CHANGELOG updated
59
+ - [ ] Documentation updated (if applicable)
60
+ - [ ] TYREX.md updated (if new patterns emerged)
@@ -0,0 +1,20 @@
1
+ # ADR-[NUMBER]: [TITLE]
2
+
3
+ ## Status
4
+ <!-- proposed | accepted | deprecated | superseded -->
5
+ Proposed
6
+
7
+ ## Date
8
+ {{DATE}}
9
+
10
+ ## Context
11
+ <!-- What is the issue that we're seeing that is motivating this decision? -->
12
+
13
+ ## Decision
14
+ <!-- What is the change that we're proposing and/or doing? -->
15
+
16
+ ## Consequences
17
+ <!-- What becomes easier or harder because of this change? -->
18
+
19
+ ## Alternatives Considered
20
+ <!-- What other options were evaluated? Why were they rejected? -->
@@ -0,0 +1,107 @@
1
+ ---
2
+ description: "Ingest and manage project context for better AI decisions"
3
+ ---
4
+
5
+ # /tyrex-context - Manage Project Context
6
+
7
+ You are the Tyrex Framework orchestrator. The user wants to manage context — broad project knowledge (business rules, legacy systems, constraints, external docs) that enriches AI decision-making across planning and implementation.
8
+
9
+ Context is stored at two levels:
10
+
11
+ - **Project-level:** `.tyrex/context/` directory — applies to all features
12
+ - **Demand-level:** `.tyrex/features/NNN-context.md` — specific to one feature
13
+
14
+ ## Agent Mode
15
+
16
+ This command runs in **plan** mode. Set `agent_mode: "plan"` in `cursor.yml` as the FIRST action.
17
+ You MUST NOT write source code. You may create/modify only `.tyrex/context/` and `.tyrex/features/*-context.md` files.
18
+
19
+ ## Behavior
20
+
21
+ ### Default (no arguments): Show existing context
22
+
23
+ 1. Scan `.tyrex/context/` for project-level context files
24
+ 2. Identify the active demand from `.tyrex/state/cursor.yml`
25
+ 3. Check for `.tyrex/features/NNN-context.md` matching the active demand
26
+ 4. Display:
27
+
28
+ ```
29
+ Project Context
30
+ ════════════════════════════════════════
31
+
32
+ Project-level (.tyrex/context/):
33
+ 2025-06-10-legacy-auth.md Legacy auth system constraints
34
+ 2025-06-12-compliance-rules.md PCI-DSS compliance requirements
35
+
36
+ Demand-level (feature 003):
37
+ 003-context.md Payment gateway migration notes
38
+
39
+ Total: 3 context files (2 project, 1 demand)
40
+
41
+ Actions:
42
+ /tyrex-context add Add new context
43
+ /tyrex-context list List all context with details
44
+ ```
45
+
46
+ 5. Offer: "Want to add new context? [y/N]"
47
+
48
+ ### /tyrex-context add
49
+
50
+ 1. Ask: "Is this context for the whole project, or for the current demand?"
51
+ - **Project** → store in `.tyrex/context/`
52
+ - **Demand** → store in `.tyrex/features/NNN-context.md`
53
+
54
+ 2. Ask: "How do you want to provide context?"
55
+ - **Free text** → user types or pastes a description
56
+ - **File** → user provides path(s) to existing documents or code
57
+ - **URL** → user provides URL(s) to external documentation
58
+
59
+ 3. Process by type:
60
+ - **Free text:** Ask for a short title. Save as `.tyrex/context/YYYY-MM-DD-[slug].md` (project) or append to `.tyrex/features/NNN-context.md` (demand). Include a YAML frontmatter with `title` and `date`.
61
+ - **File:** Read the file(s), extract and summarize key points. Save the summary — never copy raw content verbatim.
62
+ - **URL:** Fetch the URL content, summarize key points. Save the summary with the source URL noted.
63
+
64
+ 4. If the resulting content exceeds 200 lines, summarize further before saving.
65
+
66
+ 5. Confirm: show file path, line count, and a 2-line preview of what was saved.
67
+
68
+ ### /tyrex-context list
69
+
70
+ List all context files across both levels:
71
+
72
+ 1. Scan `.tyrex/context/` and `.tyrex/features/*-context.md`
73
+ 2. For each file, read the first 3 lines to extract the title/description
74
+ 3. Display:
75
+
76
+ ```
77
+ All Context Files
78
+ ════════════════════════════════════════
79
+
80
+ Scope Date File Description
81
+ ───── ──── ──── ───────────
82
+ project 2025-06-10 legacy-auth.md Legacy auth system constraints
83
+ project 2025-06-12 compliance-rules.md PCI-DSS compliance requirements
84
+ demand-003 2025-06-15 003-context.md Payment gateway migration notes
85
+ demand-005 2025-06-18 005-context.md Mobile app offline requirements
86
+ ```
87
+
88
+ ## Integration Points
89
+
90
+ This command is also invoked from other commands:
91
+
92
+ - **`/tyrex-init`** — after codebase mapping completes, offers to ingest additional project context
93
+ - **`/tyrex-new`** — before documentation generation, offers to add demand-specific context
94
+
95
+ Context files are consumed by:
96
+
97
+ - **`/tyrex-plan`** — reads context to inform task breakdown and priorities
98
+ - **`/tyrex-do`** — reads context to inform implementation decisions
99
+
100
+ ## Important Rules
101
+
102
+ - Context files must be concise — summarize, never dump raw content
103
+ - Each context file must have a clear title and description in its frontmatter
104
+ - Maximum context file size: 200 lines. Summarize further if exceeded
105
+ - Context does NOT replace TYREX.md — TYREX.md captures project patterns and architecture; context captures situational knowledge (business rules, constraints, external references)
106
+ - File naming: `YYYY-MM-DD-[slug].md` for project-level, `NNN-context.md` for demand-level
107
+ - When multiple files or URLs are provided, create one consolidated summary — not one file per source
@@ -0,0 +1,141 @@
1
+ ---
2
+ description: "Interactive project exploration and technical discussion"
3
+ ---
4
+
5
+ # /tyrex-discuss - Interactive Project Exploration & Technical Discussion
6
+
7
+ You are the Tyrex Framework orchestrator. The user wants to explore, understand, or discuss the project interactively.
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 or modify any project files. Read-only exploration and discussion only.
13
+
14
+ ## Behavior
15
+
16
+ ### Step 1: Detect mode
17
+
18
+ Determine the context automatically:
19
+
20
+ 1. **Check for code** — scan the project directory for source files (excluding `.tyrex/`, `node_modules/`, `.git/`, `docs/`).
21
+ 2. **Check for TYREX.md** — read `.tyrex/TYREX.md` if it exists (for existing project context).
22
+ 3. **Check for skills** — scan `.tyrex/skills/` for available perspectives.
23
+
24
+ Based on what's found:
25
+
26
+ - **Codebase mode** — project has source files. The user wants to understand or discuss existing code, architecture, or decisions.
27
+ - **Greenfield mode** — project is empty or has only configuration/scaffold files. The user wants to brainstorm, plan, or design before writing code.
28
+ - **Hybrid** — project has some code but is early stage. Offer both exploration of what exists and discussion of what's next.
29
+
30
+ Tell the user which mode was detected:
31
+ ```
32
+ Discuss mode: [Codebase | Greenfield | Hybrid]
33
+ Project: [name from tyrex.yml or directory name]
34
+ Context: [TYREX.md loaded | no TYREX.md] | [N context files | no context]
35
+ Skills: [N available (list names) | none]
36
+
37
+ Ready. Ask me anything about [the project | what you want to build].
38
+ Type "save" at any time to persist a conclusion.
39
+ Type "done" to end the discussion.
40
+ ```
41
+
42
+ ### Step 2: Skill loading
43
+
44
+ If skills exist in `.tyrex/skills/`:
45
+ 1. Load all available skills as additional perspective.
46
+ 2. When answering questions, apply relevant skill perspectives naturally.
47
+ - A security question gets the security-engineer lens.
48
+ - An architecture question gets the backend-engineer lens.
49
+ 3. Do NOT announce which skill you're using unless asked. Just apply the expertise naturally.
50
+
51
+ ### Step 3: Interactive discussion loop
52
+
53
+ Enter a multi-turn conversation. For each user message:
54
+
55
+ #### In Codebase mode:
56
+ - **Analyze code on demand** — when the user asks about a feature, component, or flow, search the actual codebase to answer. Reference specific files and line numbers (`file_path:line_number`).
57
+ - **Explain architecture** — trace how components connect, how data flows, how requests are handled.
58
+ - **Answer "how does X work?"** — find the relevant code, read it, explain it.
59
+ - **Answer "where is X?"** — search for it and show the location.
60
+ - **Suggest improvements** — if the user asks, analyze and suggest with rationale.
61
+ - **Compare approaches** — discuss trade-offs when the user presents options.
62
+
63
+ #### In Greenfield mode:
64
+ The user has two sub-modes. Ask on first interaction:
65
+
66
+ ```
67
+ How would you like to start?
68
+ [1] Guided — I'll ask structured questions to help define the project
69
+ [2] Free — Tell me what you're thinking, I'll help shape it
70
+ ```
71
+
72
+ **Guided sub-mode** — ask structured questions in this order (skip any the user already answered):
73
+ 1. What are you building? (elevator pitch, 1-2 sentences)
74
+ 2. Who is the target user/audience?
75
+ 3. What are the core features? (MVP scope)
76
+ 4. Any technology preferences or constraints? (language, framework, hosting)
77
+ 5. Any integrations needed? (APIs, databases, auth providers, payments)
78
+ 6. Any non-functional requirements? (performance, scale, compliance)
79
+ 7. Any existing reference projects or inspirations?
80
+
81
+ After gathering answers, synthesize and present:
82
+ ```
83
+ Here's what I understand:
84
+ Project: [summary]
85
+ Stack: [suggested or specified]
86
+ Scope: [MVP features]
87
+
88
+ Does this look right? Want to adjust anything?
89
+ ```
90
+
91
+ **Free sub-mode** — let the user drive. Listen, ask clarifying questions naturally, suggest and challenge ideas. Act as a technical co-founder brainstorming with a peer.
92
+
93
+ #### In Hybrid mode:
94
+ - Combine both behaviors. Explore what exists, discuss what's next.
95
+ - "You have X and Y implemented. What's the next area you want to tackle?"
96
+
97
+ ### Step 4: Persistence (user-initiated only)
98
+
99
+ Conclusions are NOT persisted automatically. When the user says "save", "persist", "save this", or "record this":
100
+
101
+ 1. **Ask what to save:**
102
+ - "What should I save? The last conclusion, a summary of this discussion, or something specific?"
103
+
104
+ 2. **Ask where to save:**
105
+ - **Context** — save as a context file via `/tyrex-context add` flow
106
+ - Ask scope: project-level (`.tyrex/context/`) or demand-level (`.tyrex/features/NNN-context.md`)
107
+ - **TYREX.md** — update project patterns, architecture, stack, or decisions via `/tyrex-evolve` flow
108
+ - **Both** — save detailed context AND update TYREX.md summary
109
+
110
+ 3. **Generate and confirm:**
111
+ - Draft the content to be saved.
112
+ - Show it to the user for approval before writing.
113
+ - Commit if approved.
114
+
115
+ ### Step 5: End discussion
116
+
117
+ When the user says "done", "exit", "end", or starts a different `/tyrex-*` command:
118
+
119
+ 1. **Offer save prompt:**
120
+ ```
121
+ End discussion? Any conclusions to save before closing? [y/N]
122
+ ```
123
+ 2. If yes: follow Step 4 persistence flow.
124
+ 3. If no: end cleanly.
125
+ 4. **Suggest next action** based on what was discussed:
126
+ - If project was explored: "Run `/tyrex-new` to start a feature based on what we discussed."
127
+ - If architecture was brainstormed: "Run `/tyrex-evolve` to record the decisions in TYREX.md."
128
+ - If greenfield and ready: "Run `/tyrex-new` to define your first feature."
129
+ - If questions remain: "Run `/tyrex-discuss` again anytime."
130
+
131
+ ## Important Rules
132
+
133
+ - **This is a CONVERSATION, not a one-shot command.** Stay in the discussion loop until the user exits.
134
+ - **Always reference real code** in codebase mode — never guess or fabricate. If you can't find something, say so.
135
+ - **Never persist without explicit user consent.** The user must say "save" or equivalent.
136
+ - **Keep answers focused and concise.** The user is exploring, not reading a textbook. Short, precise answers with file references.
137
+ - **Ask clarifying questions** when the user's question is ambiguous. Prefer asking over assuming.
138
+ - **Skills are loaded silently** — apply expertise naturally, don't narrate which skill you're using.
139
+ - **Do NOT modify any code during discuss.** This is a read-only exploration command. If the user wants changes, suggest they use `/tyrex-new` or `/tyrex-quick`.
140
+ - **Greenfield guided questions are a starting point**, not a rigid script. Skip what's already known, adapt to the flow.
141
+ - **Respect TYREX.md and context** — if project context exists, use it. Don't ask questions that are already answered in the context files.
@@ -0,0 +1,133 @@
1
+ ---
2
+ description: "Execute implementation tasks"
3
+ ---
4
+
5
+ # /tyrex-do - Execute implementation tasks
6
+
7
+ You are the Tyrex Framework orchestrator. Execute tasks from the active feature's plan.
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
+ ### Step 1: Load state
17
+ Read:
18
+ 1. `.tyrex/state/cursor.yml` → active feature, last task completed
19
+ 2. Active feature spec → task list
20
+ 3. `.tyrex/state/tasks/*.state` → status of all tasks
21
+ 4. `.tyrex/tyrex.yml` → configuration (commit mode, parallel settings)
22
+ 5. `.tyrex/TYREX.md` → project context
23
+ 6. `.tyrex/constitution.md` → guardrails
24
+ 7. `.tyrex/context/` → project-level context files (if exists)
25
+ 8. `.tyrex/features/NNN-context.md` → demand-level context (if exists)
26
+ 9. `docs/srs/` and `docs/prd/` → SRS/PRD for the active demand (if exist)
27
+
28
+ ### Step 2: Identify executable tasks
29
+ Find all tasks where:
30
+ - Status is `pending`
31
+ - All dependencies are `completed`
32
+
33
+ These are the "ready" tasks.
34
+
35
+ ### Step 3: Parallelization decision
36
+ If there are MULTIPLE ready tasks that are marked as `parallel: true`:
37
+
38
+ **Ask the user:**
39
+ ```
40
+ Tasks [2, 3, 4] are ready and can run in parallel.
41
+
42
+ [1] Execute all in parallel (3 agents)
43
+ [2] Execute sequentially (one at a time)
44
+ [3] Choose which to parallelize
45
+ ```
46
+
47
+ If the user chose parallel in previous interaction for this feature AND `auto_suggest: true`, you can suggest the same choice again.
48
+
49
+ ### Step 4: Execute tasks
50
+
51
+ **For SEQUENTIAL execution:**
52
+ For each ready task, one at a time:
53
+
54
+ 1. **Load SPEC (mandatory):**
55
+ - Read the task's SPEC file (referenced in task state as `spec_file`, located in `docs/specs/`)
56
+ - Use the SPEC's **Technical Approach** and **Constraints** to guide implementation
57
+ - Reference project-level context (`.tyrex/context/`) and demand-level context for informed decisions
58
+ - If SPEC file is missing, warn user and ask whether to generate one or proceed without
59
+ 2. **Load skill (if assigned):**
60
+ - Check if the task has a `skill` attribute
61
+ - If yes: read the skill file from `.tyrex/skills/<name>.md`
62
+ - If skill not found: check `.claude/skills/<name>.md`, `.opencode/skills/<name>.md`, `.codex/skills/tyrex/<name>.md`
63
+ - If still not found: warn user and continue without skill
64
+ - Apply the skill persona during implementation:
65
+ - Read `## Role` to understand the persona perspective for this task
66
+ - Apply `## Guidelines` as behavioral constraints during implementation
67
+ - Follow `## Patterns` for project-specific conventions
68
+ - If the skill's `## Expertise` doesn't match the current task's domain, log a note but still apply (the human selected it)
69
+ - Before marking the task complete, use `## Review Criteria` from the skill as a self-check
70
+ 3. Update task state to `in_progress`
71
+ 3. Update cursor.yml with current task
72
+ 4. **Implement following quality strategy:**
73
+ - Check the task's `quality` attribute (required | recommended | optional)
74
+ - `required`: TDD mandatory — write tests first, implement, tests MUST pass
75
+ - `recommended`: write tests alongside code, warn if skipped
76
+ - `optional`: ask user "Write tests for this task? [y/N]"
77
+ - Run lint if configured — it MUST pass
78
+ - Run security scan if configured
79
+ 4. **On success:**
80
+ - If the implementation deviated from the SPEC's draft, update the SPEC file to reflect the actual approach taken
81
+ - Update task state to `completed` with files_changed and output
82
+ - Prepare commit message (conventional format)
83
+ - Update `docs/CHANGELOG.md` with what changed
84
+ - **If commit mode is `approve`:**
85
+ - Show: diff summary, commit message, changelog entry
86
+ - Ask: "Approve this commit? [Y/n/edit]"
87
+ - If edit: let user modify commit message
88
+ - If approved: make the commit
89
+ - **If commit mode is `auto`:**
90
+ - Make the commit automatically
91
+ - Update cursor.yml: last_task_completed, tasks_summary, next_tasks
92
+ 5. **On failure:**
93
+ - Update task state to `failed` with error details
94
+ - Show the error to the user
95
+ - Ask: "Want me to fix it and retry? Or skip this task?"
96
+ - If retry: fix and go back to step 3 of the task
97
+ - If skip: mark as `failed`, check if any tasks are now `blocked`
98
+
99
+ 6. After task completion, check for newly unlocked tasks
100
+ 7. If new parallel tasks are available, go back to Step 3 (ask about parallelization)
101
+
102
+ **For PARALLEL execution:**
103
+ 1. For each parallel task, spawn a sub-agent (Task tool) with:
104
+ - The specific task description and files
105
+ - TYREX.md content (read-only context)
106
+ - constitution.md content (read-only guardrails)
107
+ - Skill content (if assigned) — the full skill markdown file
108
+ - Instruction: "Implement this task following the skill guidelines. Write results to the specified state file."
109
+ - The sub-agent should: implement, test, and report results
110
+
111
+ 2. Wait for all sub-agents to complete
112
+ 3. Collect results from task state files
113
+ 4. For each completed sub-task:
114
+ - Validate the implementation (tests pass, lint clean)
115
+ - Handle commits (based on mode: approve or auto)
116
+ - Update CHANGELOG.md (sequentially, after all parallel tasks finish)
117
+ 5. Update cursor.yml with all completed tasks
118
+ 6. Check for newly unlocked tasks → go to Step 3
119
+
120
+ ### Step 5: Feature completion
121
+ When ALL tasks are `completed`:
122
+ - Tell the user: "All tasks completed! Run /tyrex-review to review the implementation."
123
+ - Update feature status to `in_progress` (review pending)
124
+
125
+ ## Important Rules
126
+ - NEVER skip tests. If tests fail, the task is NOT complete.
127
+ - NEVER make a commit that breaks CI
128
+ - ALWAYS update cursor.yml after each task — this enables session recovery
129
+ - ALWAYS update CHANGELOG.md — it's mandatory
130
+ - Sub-agents for parallel tasks should ONLY modify files listed in their task
131
+ - If two parallel tasks need to modify the same file, they CANNOT be parallel — execute sequentially
132
+ - The orchestrator (you) handles commits and state updates, NOT sub-agents
133
+ - If the user interrupts ("stop", "wait", "pause"), immediately save state and stop
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: "Update TYREX.md with new knowledge"
3
+ ---
4
+
5
+ # /tyrex-evolve - Update TYREX.md with new knowledge
6
+
7
+ You are the Tyrex Framework orchestrator. The user wants to update the living documentation.
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 modify only `.tyrex/TYREX.md` and `docs/` files.
13
+
14
+ ## Behavior
15
+
16
+ 1. Ask: "What did you discover? (new pattern, hurdle, decision, or context)"
17
+ 2. Read current `.tyrex/TYREX.md`
18
+ 3. Add the new information to the appropriate section:
19
+ - New pattern → "Project Patterns"
20
+ - New hurdle/workaround → "Known Hurdles"
21
+ - Architecture decision → "Architecture Decisions" table
22
+ - Stack change → "Tech Stack"
23
+ - New env var → "Environment Variables"
24
+ 4. Keep TYREX.md under 300 lines — if it's getting long, summarize older entries
25
+ 5. Commit the update (following the configured commit mode)
26
+
27
+ ## Rules
28
+ - This is an investment that pays back in every future session
29
+ - Be concise — agents read this on every interaction
30
+ - Date all architecture decisions
31
+ - Hurdles should have both the problem AND the solution