@techierathore/techieflow 1.0.2 → 1.0.4

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 (204) hide show
  1. package/.claude/commands/TechieFlow/agents/analyst.md +5 -13
  2. package/.claude/commands/TechieFlow/agents/architect.md +1 -16
  3. package/.claude/commands/TechieFlow/agents/flow-master.md +42 -215
  4. package/.claude/commands/TechieFlow/agents/verifier.md +24 -64
  5. package/.claude/commands/TechieFlow/tasks/_metrics-emit-gate.md +24 -117
  6. package/.claude/commands/TechieFlow/tasks/_owner-language.md +26 -0
  7. package/.claude/commands/TechieFlow/tasks/_smoke-test-policy.md +20 -84
  8. package/.claude/commands/TechieFlow/tasks/_status-update-gate.md +10 -74
  9. package/.claude/commands/TechieFlow/tasks/_yolo-mode.md +20 -58
  10. package/.claude/commands/TechieFlow/tasks/amend-docs.md +21 -143
  11. package/.claude/commands/TechieFlow/tasks/build-phase.md +14 -224
  12. package/.claude/commands/TechieFlow/tasks/create-deep-research-prompt.md +4 -0
  13. package/.claude/commands/TechieFlow/tasks/create-doc.md +4 -0
  14. package/.claude/commands/TechieFlow/tasks/create-project-brief.md +22 -0
  15. package/.claude/commands/TechieFlow/tasks/day1-brownfield.md +31 -505
  16. package/.claude/commands/TechieFlow/tasks/day1-greenfield.md +28 -213
  17. package/.claude/commands/TechieFlow/tasks/deploy-checklist.md +19 -0
  18. package/.claude/commands/TechieFlow/tasks/devguide.md +10 -219
  19. package/.claude/commands/TechieFlow/tasks/facilitate-brainstorming-session.md +4 -0
  20. package/.claude/commands/TechieFlow/tasks/fix-issues.md +10 -129
  21. package/.claude/commands/TechieFlow/tasks/generate-html.md +5 -1
  22. package/.claude/commands/TechieFlow/tasks/handoff-phase.md +18 -16
  23. package/.claude/commands/TechieFlow/tasks/log-miss.md +19 -158
  24. package/.claude/commands/TechieFlow/tasks/metrics-report.md +3 -1
  25. package/.claude/commands/TechieFlow/tasks/mockups.md +12 -117
  26. package/.claude/commands/TechieFlow/tasks/refresh-status.md +9 -130
  27. package/.claude/commands/TechieFlow/tasks/split-brd.md +10 -126
  28. package/.claude/commands/TechieFlow/tasks/triage-and-fix.md +14 -0
  29. package/.claude/commands/TechieFlow/tasks/triage-issues.md +11 -152
  30. package/.claude/commands/TechieFlow/tasks/verify-phase.md +36 -572
  31. package/.opencode/plugin/techieflow.js +40 -13
  32. package/.tfcore/agents/analyst.md +5 -13
  33. package/.tfcore/agents/architect.md +1 -16
  34. package/.tfcore/agents/flow-master.md +42 -215
  35. package/.tfcore/agents/verifier.md +24 -64
  36. package/.tfcore/core-config.yaml +10 -0
  37. package/.tfcore/hooks/block-git.sh +4 -4
  38. package/.tfcore/hooks/guard-artifacts.sh +2 -2
  39. package/.tfcore/hooks/guard-build.sh +76 -0
  40. package/.tfcore/hooks/guard-db.sh +90 -0
  41. package/.tfcore/hooks/guard-metrics.sh +68 -0
  42. package/.tfcore/hooks/guard-status-html.sh +116 -71
  43. package/.tfcore/hooks/guard-status.sh +43 -16
  44. package/.tfcore/hooks/guard-verify-deps.sh +124 -0
  45. package/.tfcore/hooks/guard-verify.sh +70 -48
  46. package/.tfcore/hooks/sweep-artifacts.sh +2 -2
  47. package/.tfcore/install-manifest.yaml +0 -18
  48. package/.tfcore/routing.yaml +86 -14
  49. package/.tfcore/standards/coding-standards-core.md +61 -0
  50. package/.tfcore/standards/coding-standards-dotnet.md +93 -0
  51. package/.tfcore/tasks/_metrics-emit-gate.md +24 -117
  52. package/.tfcore/tasks/_owner-language.md +26 -0
  53. package/.tfcore/tasks/_smoke-test-policy.md +20 -84
  54. package/.tfcore/tasks/_status-update-gate.md +10 -74
  55. package/.tfcore/tasks/_yolo-mode.md +20 -58
  56. package/.tfcore/tasks/amend-docs.md +21 -143
  57. package/.tfcore/tasks/build-phase.md +14 -224
  58. package/.tfcore/tasks/create-deep-research-prompt.md +4 -0
  59. package/.tfcore/tasks/create-doc.md +4 -0
  60. package/.tfcore/tasks/create-project-brief.md +22 -0
  61. package/.tfcore/tasks/day1-brownfield.md +31 -505
  62. package/.tfcore/tasks/day1-greenfield.md +28 -213
  63. package/.tfcore/tasks/deploy-checklist.md +19 -0
  64. package/.tfcore/tasks/devguide.md +10 -219
  65. package/.tfcore/tasks/facilitate-brainstorming-session.md +4 -0
  66. package/.tfcore/tasks/fix-issues.md +10 -129
  67. package/.tfcore/tasks/generate-html.md +5 -1
  68. package/.tfcore/tasks/handoff-phase.md +18 -16
  69. package/.tfcore/tasks/log-miss.md +19 -158
  70. package/.tfcore/tasks/metrics-report.md +3 -1
  71. package/.tfcore/tasks/mockups.md +12 -117
  72. package/.tfcore/tasks/refresh-status.md +9 -130
  73. package/.tfcore/tasks/split-brd.md +10 -126
  74. package/.tfcore/tasks/triage-and-fix.md +14 -0
  75. package/.tfcore/tasks/triage-issues.md +11 -152
  76. package/.tfcore/tasks/verify-phase.md +36 -572
  77. package/.tfcore/telemetry/SCHEMA.md +100 -8
  78. package/.tfcore/telemetry/tf-metrics.sh +564 -32
  79. package/.tfcore/templates/stack-defaults/dotnet.md +35 -0
  80. package/.tfcore/templates/stack-questions.md +77 -0
  81. package/.tfcore/templates/v4custom/app-agents-md-tmpl.md +3 -4
  82. package/.tfcore/templates/v4custom/app-architecture-tmpl.md +107 -115
  83. package/.tfcore/templates/v4custom/app-brd-tmpl.md +108 -184
  84. package/.tfcore/templates/v4custom/app-brief-tmpl.md +65 -0
  85. package/.tfcore/templates/v4custom/app-checklist-tmpl.md +48 -73
  86. package/.tfcore/templates/v4custom/app-claude-md-tmpl.md +1 -1
  87. package/.tfcore/templates/v4custom/app-coding-standards-tmpl.md +52 -0
  88. package/.tfcore/templates/v4custom/app-decision-request-tmpl.md +85 -0
  89. package/.tfcore/templates/v4custom/app-deployment-checklist-tmpl.md +86 -0
  90. package/.tfcore/templates/v4custom/app-devguide-tmpl.md +69 -146
  91. package/.tfcore/templates/v4custom/app-library-feedback-tmpl.md +86 -31
  92. package/.tfcore/templates/v4custom/app-phases-tmpl.md +35 -0
  93. package/.tfcore/templates/v4custom/app-productguide-tmpl.md +38 -35
  94. package/.tfcore/templates/v4custom/app-project-status-tmpl.md +63 -73
  95. package/.tfcore/templates/v4custom/app-uidesign-tmpl.md +62 -37
  96. package/.tfcore/templates/v4custom/app-usageguide-tmpl.md +69 -54
  97. package/.tfcore/templates/v4custom/build-invocation-ladder.md +17 -180
  98. package/.tfcore/templates/v4custom/build-subagent-prompt.md +17 -0
  99. package/.tfcore/templates/v4custom/html-render-shell.md +1 -1
  100. package/.tfcore/templates/v4custom/metrics-report-template.md +2 -2
  101. package/.tfcore/user-guide.md +0 -23
  102. package/.tfcore/utils/__pycache__/tf-brd-status.cpython-312.pyc +0 -0
  103. package/.tfcore/utils/__pycache__/tf-checklist-edit.cpython-312.pyc +0 -0
  104. package/.tfcore/utils/__pycache__/tf-codex-bind.cpython-312.pyc +0 -0
  105. package/.tfcore/utils/__pycache__/tf-codex-telemetry.cpython-312.pyc +0 -0
  106. package/.tfcore/utils/__pycache__/tf-day1-files.cpython-312.pyc +0 -0
  107. package/.tfcore/utils/__pycache__/tf-devguide-list.cpython-312.pyc +0 -0
  108. package/.tfcore/utils/__pycache__/tf-doc-check.cpython-312.pyc +0 -0
  109. package/.tfcore/utils/__pycache__/tf-log-miss.cpython-312.pyc +0 -0
  110. package/.tfcore/utils/__pycache__/tf-misses-md.cpython-312.pyc +0 -0
  111. package/.tfcore/utils/__pycache__/tf-mockups-locate.cpython-312.pyc +0 -0
  112. package/.tfcore/utils/__pycache__/tf-opencode-audit.cpython-312.pyc +0 -0
  113. package/.tfcore/utils/__pycache__/tf-perf-grade.cpython-312.pyc +0 -0
  114. package/.tfcore/utils/__pycache__/tf-render-html.cpython-312.pyc +0 -0
  115. package/.tfcore/utils/__pycache__/tf-split-brd.cpython-312.pyc +0 -0
  116. package/.tfcore/utils/__pycache__/tf-status-facts.cpython-312.pyc +0 -0
  117. package/.tfcore/utils/__pycache__/tf-triage.cpython-312.pyc +0 -0
  118. package/.tfcore/utils/__pycache__/tf-verify-list.cpython-312.pyc +0 -0
  119. package/.tfcore/utils/__pycache__/tf-verify-verdict.cpython-312.pyc +0 -0
  120. package/.tfcore/utils/tf-brd-status.py +176 -0
  121. package/.tfcore/utils/tf-brd-status.sh +19 -0
  122. package/.tfcore/utils/tf-build-list.py +211 -0
  123. package/.tfcore/utils/tf-build-list.sh +21 -0
  124. package/.tfcore/utils/tf-build.sh +143 -0
  125. package/.tfcore/utils/tf-cdp-relay.ps1 +64 -0
  126. package/.tfcore/utils/tf-checklist-edit.py +133 -0
  127. package/.tfcore/utils/tf-day1-files.py +208 -0
  128. package/.tfcore/utils/tf-day1-files.sh +20 -0
  129. package/.tfcore/utils/tf-devguide-list.py +249 -0
  130. package/.tfcore/utils/tf-devguide-list.sh +18 -0
  131. package/.tfcore/utils/tf-doc-check.py +1369 -0
  132. package/.tfcore/utils/tf-doc-check.sh +29 -0
  133. package/.tfcore/utils/tf-emit.sh +545 -18
  134. package/.tfcore/utils/tf-fix-close.sh +115 -0
  135. package/.tfcore/utils/tf-gitignore-audit.sh +50 -3
  136. package/.tfcore/utils/tf-goal.sh +284 -66
  137. package/.tfcore/utils/tf-harness.sh +4 -9
  138. package/.tfcore/utils/tf-log-miss.py +197 -0
  139. package/.tfcore/utils/tf-log-miss.sh +14 -0
  140. package/.tfcore/utils/tf-misses-md.py +208 -0
  141. package/.tfcore/utils/tf-misses-md.sh +14 -0
  142. package/.tfcore/utils/tf-mockups-locate.py +66 -0
  143. package/.tfcore/utils/tf-mockups-locate.sh +18 -0
  144. package/.tfcore/utils/tf-model-pick.sh +475 -0
  145. package/.tfcore/utils/tf-opencode-audit.py +23 -7
  146. package/.tfcore/utils/tf-perf-grade.py +97 -0
  147. package/.tfcore/utils/tf-perf-grade.sh +12 -0
  148. package/.tfcore/utils/tf-phase.sh +92 -0
  149. package/.tfcore/utils/tf-render-html.py +20 -0
  150. package/.tfcore/utils/tf-routing-bind.sh +97 -6
  151. package/.tfcore/utils/tf-routing.sh +13 -7
  152. package/.tfcore/utils/tf-selfcheck.sh +323 -0
  153. package/.tfcore/utils/tf-split-brd.py +309 -0
  154. package/.tfcore/utils/tf-split-brd.sh +22 -0
  155. package/.tfcore/utils/tf-status-evidence.sh +68 -0
  156. package/.tfcore/utils/tf-status-facts.py +358 -0
  157. package/.tfcore/utils/tf-status-facts.sh +20 -0
  158. package/.tfcore/utils/tf-triage.py +243 -0
  159. package/.tfcore/utils/tf-triage.sh +16 -0
  160. package/.tfcore/utils/tf-verify-boot.sh +250 -0
  161. package/.tfcore/utils/tf-verify-emit.sh +110 -0
  162. package/.tfcore/utils/tf-verify-env.sh +88 -0
  163. package/.tfcore/utils/tf-verify-list.py +270 -0
  164. package/.tfcore/utils/tf-verify-list.sh +13 -0
  165. package/.tfcore/utils/tf-verify-screens.mjs +355 -0
  166. package/.tfcore/utils/tf-verify-screens.sh +31 -0
  167. package/.tfcore/utils/tf-verify-tests.sh +166 -0
  168. package/.tfcore/utils/tf-verify-verdict.py +292 -0
  169. package/.tfcore/utils/tf-verify-verdict.sh +15 -0
  170. package/.tfcore/utils/tf-yolo.sh +59 -0
  171. package/README.md +120 -1145
  172. package/docs/TechieFlow-Installation.md +1 -5
  173. package/opencode.jsonc +37 -33
  174. package/package.json +1 -5
  175. package/scripts/install.mjs +56 -46
  176. package/.claude/commands/TechieFlow/tasks/advanced-elicitation.md +0 -117
  177. package/.claude/commands/TechieFlow/tasks/author-brd.md +0 -79
  178. package/.claude/commands/TechieFlow/tasks/document-project.md +0 -343
  179. package/.claude/commands/TechieFlow/tasks/execute-checklist.md +0 -86
  180. package/.claude/commands/TechieFlow/tasks/index-docs.md +0 -173
  181. package/.claude/commands/TechieFlow/tasks/kb-mode-interaction.md +0 -75
  182. package/.claude/commands/TechieFlow/tasks/shard-doc.md +0 -185
  183. package/.codex/config.toml +0 -46
  184. package/.codex/hooks.json +0 -63
  185. package/.codex/rules/techieflow.rules +0 -8
  186. package/.tfcore/hooks/codex-adapter.py +0 -248
  187. package/.tfcore/tasks/advanced-elicitation.md +0 -117
  188. package/.tfcore/tasks/author-brd.md +0 -79
  189. package/.tfcore/tasks/document-project.md +0 -343
  190. package/.tfcore/tasks/execute-checklist.md +0 -86
  191. package/.tfcore/tasks/index-docs.md +0 -173
  192. package/.tfcore/tasks/kb-mode-interaction.md +0 -75
  193. package/.tfcore/tasks/shard-doc.md +0 -185
  194. package/.tfcore/templates/architecture-tmpl.yaml +0 -650
  195. package/.tfcore/templates/brownfield-architecture-tmpl.yaml +0 -476
  196. package/.tfcore/templates/competitor-analysis-tmpl.yaml +0 -306
  197. package/.tfcore/templates/front-end-architecture-tmpl.yaml +0 -218
  198. package/.tfcore/templates/fullstack-architecture-tmpl.yaml +0 -823
  199. package/.tfcore/templates/market-research-tmpl.yaml +0 -252
  200. package/.tfcore/templates/project-brief-tmpl.yaml +0 -221
  201. package/.tfcore/utils/techieflow-doc-template.md +0 -325
  202. package/.tfcore/utils/tf-codex-bind.py +0 -196
  203. package/.tfcore/utils/tf-codex-telemetry.py +0 -60
  204. package/WORKFLOW.html +0 -1986
@@ -1,185 +0,0 @@
1
- # Document Sharding Task
2
-
3
- ## Purpose
4
-
5
- - Split a large document into multiple smaller documents based on level 2 sections
6
- - Create a folder structure to organize the sharded documents
7
- - Maintain all content integrity including code blocks, diagrams, and markdown formatting
8
-
9
- ## Primary Method: Automatic with markdown-tree
10
-
11
- [[LLM: First, check if markdownExploder is set to true in .tfcore/core-config.yaml. If it is, attempt to run the command: `md-tree explode {input file} {output path}`.
12
-
13
- If the command succeeds, inform the user that the document has been sharded successfully and STOP - do not proceed further.
14
-
15
- If the command fails (especially with an error indicating the command is not found or not available), inform the user: "The markdownExploder setting is enabled but the md-tree command is not available. Please either:
16
-
17
- 1. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
18
- 2. Or set markdownExploder to false in .tfcore/core-config.yaml
19
-
20
- **IMPORTANT: STOP HERE - do not proceed with manual sharding until one of the above actions is taken.**"
21
-
22
- If markdownExploder is set to false, inform the user: "The markdownExploder setting is currently false. For better performance and reliability, you should:
23
-
24
- 1. Set markdownExploder to true in .tfcore/core-config.yaml
25
- 2. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
26
-
27
- I will now proceed with the manual sharding process."
28
-
29
- Then proceed with the manual method below ONLY if markdownExploder is false.]]
30
-
31
- ### Installation and Usage
32
-
33
- 1. **Install globally**:
34
-
35
- ```bash
36
- npm install -g @kayvan/markdown-tree-parser
37
- ```
38
-
39
- 2. **Use the explode command**:
40
-
41
- ```bash
42
- # For PRD
43
- md-tree explode docs/prd.md docs/prd
44
-
45
- # For Architecture
46
- md-tree explode docs/architecture.md docs/architecture
47
-
48
- # For any document
49
- md-tree explode [source-document] [destination-folder]
50
- ```
51
-
52
- 3. **What it does**:
53
- - Automatically splits the document by level 2 sections
54
- - Creates properly named files
55
- - Adjusts heading levels appropriately
56
- - Handles all edge cases with code blocks and special markdown
57
-
58
- If the user has @kayvan/markdown-tree-parser installed, use it and skip the manual process below.
59
-
60
- ---
61
-
62
- ## Manual Method (if @kayvan/markdown-tree-parser is not available or user indicated manual method)
63
-
64
- ### Task Instructions
65
-
66
- 1. Identify Document and Target Location
67
-
68
- - Determine which document to shard (user-provided path)
69
- - Create a new folder under `docs/` with the same name as the document (without extension)
70
- - Example: `docs/prd.md` → create folder `docs/prd/`
71
-
72
- 2. Parse and Extract Sections
73
-
74
- CRITICAL AEGNT SHARDING RULES:
75
-
76
- 1. Read the entire document content
77
- 2. Identify all level 2 sections (## headings)
78
- 3. For each level 2 section:
79
- - Extract the section heading and ALL content until the next level 2 section
80
- - Include all subsections, code blocks, diagrams, lists, tables, etc.
81
- - Be extremely careful with:
82
- - Fenced code blocks (```) - ensure you capture the full block including closing backticks and account for potential misleading level 2's that are actually part of a fenced section example
83
- - Mermaid diagrams - preserve the complete diagram syntax
84
- - Nested markdown elements
85
- - Multi-line content that might contain ## inside code blocks
86
-
87
- CRITICAL: Use proper parsing that understands markdown context. A ## inside a code block is NOT a section header.]]
88
-
89
- ### 3. Create Individual Files
90
-
91
- For each extracted section:
92
-
93
- 1. **Generate filename**: Convert the section heading to lowercase-dash-case
94
- - Remove special characters
95
- - Replace spaces with dashes
96
- - Example: "## Tech Stack" → `tech-stack.md`
97
-
98
- 2. **Adjust heading levels**:
99
- - The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
100
- - All subsection levels decrease by 1:
101
-
102
- ```txt
103
- - ### → ##
104
- - #### → ###
105
- - ##### → ####
106
- - etc.
107
- ```
108
-
109
- 3. **Write content**: Save the adjusted content to the new file
110
-
111
- ### 4. Create Index File
112
-
113
- Create an `index.md` file in the sharded folder that:
114
-
115
- 1. Contains the original level 1 heading and any content before the first level 2 section
116
- 2. Lists all the sharded files with links:
117
-
118
- ```markdown
119
- # Original Document Title
120
-
121
- [Original introduction content if any]
122
-
123
- ## Sections
124
-
125
- - [Section Name 1](./section-name-1.md)
126
- - [Section Name 2](./section-name-2.md)
127
- - [Section Name 3](./section-name-3.md)
128
- ...
129
- ```
130
-
131
- ### 5. Preserve Special Content
132
-
133
- 1. **Code blocks**: Must capture complete blocks including:
134
-
135
- ```language
136
- content
137
- ```
138
-
139
- 2. **Mermaid diagrams**: Preserve complete syntax:
140
-
141
- ```mermaid
142
- graph TD
143
- ...
144
- ```
145
-
146
- 3. **Tables**: Maintain proper markdown table formatting
147
-
148
- 4. **Lists**: Preserve indentation and nesting
149
-
150
- 5. **Inline code**: Preserve backticks
151
-
152
- 6. **Links and references**: Keep all markdown links intact
153
-
154
- 7. **Template markup**: If documents contain {{placeholders}} ,preserve exactly
155
-
156
- ### 6. Validation
157
-
158
- After sharding:
159
-
160
- 1. Verify all sections were extracted
161
- 2. Check that no content was lost
162
- 3. Ensure heading levels were properly adjusted
163
- 4. Confirm all files were created successfully
164
-
165
- ### 7. Report Results
166
-
167
- Provide a summary:
168
-
169
- ```text
170
- Document sharded successfully:
171
- - Source: [original document path]
172
- - Destination: docs/[folder-name]/
173
- - Files created: [count]
174
- - Sections:
175
- - section-name-1.md: "Section Title 1"
176
- - section-name-2.md: "Section Title 2"
177
- ...
178
- ```
179
-
180
- ## Important Notes
181
-
182
- - Never modify the actual content, only adjust heading levels
183
- - Preserve ALL formatting, including whitespace where significant
184
- - Handle edge cases like sections with code blocks containing ## symbols
185
- - Ensure the sharding is reversible (could reconstruct the original from shards)
@@ -1,46 +0,0 @@
1
- # TechieFlow Codex adapter. Project-local config loads only after the repository
2
- # is trusted. User authentication, providers, profiles, notifications and OTel
3
- # remain in ~/.codex/config.toml and are never managed by TechieFlow.
4
-
5
- sandbox_mode = "workspace-write"
6
- approval_policy = "on-request"
7
-
8
- [agents]
9
- enabled = true
10
- max_concurrent_threads_per_session = 8
11
-
12
- [agents.flow_master]
13
- description = "TechieFlow orchestrator and workflow router."
14
- config_file = "agents/flow-master.toml"
15
-
16
- [agents.analyst]
17
- description = "Business analysis, discovery, BRDs, and mockups."
18
- config_file = "agents/analyst.toml"
19
-
20
- [agents.architect]
21
- description = "Architecture and technical design specialist."
22
- config_file = "agents/architect.toml"
23
-
24
- [agents.verifier]
25
- description = "Independent requirement verifier and evidence grader."
26
- config_file = "agents/verifier.toml"
27
-
28
- [agents.tf_builder]
29
- description = "Implementation worker for one FN/NFR requirement cluster."
30
- config_file = "agents/tf-builder.toml"
31
-
32
- [agents.tf_test_writer]
33
- description = "Black-box verification-test writer for one requirement cluster."
34
- config_file = "agents/tf-test-writer.toml"
35
-
36
- [agents.tf_explorer]
37
- description = "Read-only codebase explorer for focused evidence gathering."
38
- config_file = "agents/tf-explorer.toml"
39
-
40
- [agents.trblazeui]
41
- description = "TrBlazeUI implementation specialist; available when its persona is deployed."
42
- config_file = "agents/trblazeui.toml"
43
-
44
- [agents.techierag]
45
- description = "TechieRag implementation specialist; available when its persona is deployed."
46
- config_file = "agents/techierag.toml"
package/.codex/hooks.json DELETED
@@ -1,63 +0,0 @@
1
- {
2
- "description": "TechieFlow policy guards and session telemetry for Codex.",
3
- "hooks": {
4
- "PreToolUse": [
5
- {
6
- "matcher": "Bash|Edit|Write|apply_patch",
7
- "hooks": [
8
- {
9
- "type": "command",
10
- "command": "python3 -c 'import pathlib,runpy,sys; root=next(p for p in (pathlib.Path.cwd(), *pathlib.Path.cwd().parents) if (p / \".tfcore\").is_dir()); sys.argv=[\"codex-adapter.py\", sys.argv[1]]; runpy.run_path(str(root / \".tfcore/hooks/codex-adapter.py\"), run_name=\"__main__\")' pre-tool",
11
- "timeout": 15,
12
- "statusMessage": "Checking TechieFlow policy"
13
- }
14
- ]
15
- }
16
- ],
17
- "SessionStart": [
18
- {
19
- "hooks": [
20
- {
21
- "type": "command",
22
- "command": "python3 -c 'import pathlib,runpy,sys; root=next(p for p in (pathlib.Path.cwd(), *pathlib.Path.cwd().parents) if (p / \".tfcore\").is_dir()); sys.argv=[\"codex-adapter.py\", sys.argv[1]]; runpy.run_path(str(root / \".tfcore/hooks/codex-adapter.py\"), run_name=\"__main__\")' session-start",
23
- "timeout": 10
24
- }
25
- ]
26
- }
27
- ],
28
- "UserPromptSubmit": [
29
- {
30
- "hooks": [
31
- {
32
- "type": "command",
33
- "command": "python3 -c 'import pathlib,runpy,sys; root=next(p for p in (pathlib.Path.cwd(), *pathlib.Path.cwd().parents) if (p / \".tfcore\").is_dir()); sys.argv=[\"codex-adapter.py\", sys.argv[1]]; runpy.run_path(str(root / \".tfcore/hooks/codex-adapter.py\"), run_name=\"__main__\")' session-start",
34
- "timeout": 10
35
- }
36
- ]
37
- }
38
- ],
39
- "Stop": [
40
- {
41
- "hooks": [
42
- {
43
- "type": "command",
44
- "command": "python3 -c 'import pathlib,runpy,sys; root=next(p for p in (pathlib.Path.cwd(), *pathlib.Path.cwd().parents) if (p / \".tfcore\").is_dir()); sys.argv=[\"codex-adapter.py\", sys.argv[1]]; runpy.run_path(str(root / \".tfcore/hooks/codex-adapter.py\"), run_name=\"__main__\")' stop",
45
- "timeout": 10,
46
- "statusMessage": "Checking PROJECT-STATUS.html is current"
47
- }
48
- ]
49
- }
50
- ],
51
- "SessionEnd": [
52
- {
53
- "hooks": [
54
- {
55
- "type": "command",
56
- "command": "python3 -c 'import pathlib,runpy,sys; root=next(p for p in (pathlib.Path.cwd(), *pathlib.Path.cwd().parents) if (p / \".tfcore\").is_dir()); sys.argv=[\"codex-adapter.py\", sys.argv[1]]; runpy.run_path(str(root / \".tfcore/hooks/codex-adapter.py\"), run_name=\"__main__\")' session-end",
57
- "timeout": 3
58
- }
59
- ]
60
- }
61
- ]
62
- }
63
- }
@@ -1,8 +0,0 @@
1
- # TechieFlow's owner performs every version-control operation manually.
2
- prefix_rule(
3
- pattern = [["git", "gh"]],
4
- decision = "forbidden",
5
- justification = "TechieFlow agents never run git or gh; inspect working-tree files and framework artifacts instead.",
6
- match = ["git status", "git add .", "gh pr view 1", "gh issue list"],
7
- )
8
-
@@ -1,248 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Translate Codex hooks to TechieFlow's existing guard and telemetry contracts.
3
-
4
- Modes (see .codex/hooks.json):
5
- pre-tool Bash -> block-git.sh + guard-artifacts.sh
6
- Edit/Write/apply_patch -> guard-status.sh + guard-verify.sh
7
- stop guard-status-html.sh (PROJECT-STATUS.html must not be stale)
8
- session-start session pointer + sweep-artifacts.sh (expired run material)
9
- session-start write the .tfcore/.session/codex.json pointer
10
- session-end pointer + session telemetry
11
- """
12
-
13
- from __future__ import annotations
14
-
15
- import json
16
- import os
17
- import pathlib
18
- import re
19
- import subprocess
20
- import sys
21
- from datetime import datetime, timezone
22
-
23
-
24
- def read_event() -> dict:
25
- try:
26
- value = json.load(sys.stdin)
27
- return value if isinstance(value, dict) else {}
28
- except Exception:
29
- return {}
30
-
31
-
32
- def project_root(event: dict) -> pathlib.Path:
33
- start = pathlib.Path(str(event.get("cwd") or os.getcwd())).resolve()
34
- for candidate in (start, *start.parents):
35
- if (candidate / ".tfcore").is_dir():
36
- return candidate
37
- return start
38
-
39
-
40
- def environment(root: pathlib.Path, event: dict) -> dict[str, str]:
41
- env = os.environ.copy()
42
- env.update(
43
- TF_HARNESS="codex",
44
- TF_PROJECT_DIR=str(root),
45
- CLAUDE_PROJECT_DIR=str(root),
46
- TF_SESSION_ID=str(event.get("session_id") or ""),
47
- )
48
- if (root / ".tfcore" / ".session" / "yolo.json").exists():
49
- env["TF_YOLO"] = "1"
50
- return env
51
-
52
-
53
- def deny(reason: str) -> None:
54
- print(json.dumps({
55
- "hookSpecificOutput": {
56
- "hookEventName": "PreToolUse",
57
- "permissionDecision": "deny",
58
- "permissionDecisionReason": reason,
59
- }
60
- }))
61
-
62
-
63
- def run_guard(root: pathlib.Path, event: dict, script: str, payload: dict) -> str | None:
64
- path = root / ".tfcore" / "hooks" / script
65
- if not path.exists():
66
- return None
67
- try:
68
- env = environment(root, event)
69
- if script == "block-git.sh":
70
- # Codex also has an all-git exec-policy rule. Keep the hook's
71
- # compound-command fallback equally strict in YOLO mode.
72
- env["TF_STRICT_GIT"] = "1"
73
- result = subprocess.run(
74
- ["bash", str(path)], input=json.dumps(payload), text=True,
75
- capture_output=True, timeout=10, env=env, check=False,
76
- )
77
- except Exception as exc:
78
- # Policy checks fail closed. Telemetry is handled separately and fails open.
79
- return f"TechieFlow could not execute {script}: {exc}"
80
- if result.returncode == 2:
81
- return result.stderr.strip() or f"Blocked by TechieFlow guard {script}"
82
- if result.returncode not in (0,):
83
- return f"TechieFlow guard {script} failed unexpectedly (exit {result.returncode})."
84
- return None
85
-
86
-
87
- def pre_tool(event: dict) -> None:
88
- root = project_root(event)
89
- tool = str(event.get("tool_name") or "")
90
- raw = event.get("tool_input")
91
- args = raw if isinstance(raw, dict) else {}
92
- scripts: list[str] = []
93
- if tool == "Bash":
94
- payload = {"tool_name": "Bash", "tool_input": {"command": str(args.get("command") or "")}}
95
- scripts = ["block-git.sh", "guard-artifacts.sh"]
96
- elif tool == "apply_patch":
97
- patch = str(args.get("command") or args.get("patch") or "")
98
- # Run the existing guards once per file using actual paths and separated
99
- # added/removed lines. This avoids treating context or removed Verified
100
- # cells as newly introduced content.
101
- headers = list(re.finditer(r"(?m)^\*\*\* (Update|Add|Delete) File: (.+)$", patch))
102
- for index, header in enumerate(headers):
103
- end = headers[index + 1].start() if index + 1 < len(headers) else len(patch)
104
- section = patch[header.end():end]
105
- file_path = header.group(2).strip()
106
- base_name = pathlib.PurePosixPath(file_path.replace("\\", "/")).name.lower()
107
- if header.group(1) == "Delete" and (
108
- base_name == "project-status.md" or base_name.endswith("-checklist.md")
109
- ):
110
- deny(
111
- "TechieFlow protected documents cannot be deleted: "
112
- f"{file_path}. Update their canonical fixed shape instead."
113
- )
114
- return
115
- added = []
116
- removed = []
117
- for line in section.splitlines():
118
- if line.startswith("+") and not line.startswith("+++"):
119
- added.append(line[1:])
120
- elif line.startswith("-") and not line.startswith("---"):
121
- removed.append(line[1:])
122
- payload = {
123
- "hook_event_name": "PreToolUse", "cwd": str(root),
124
- "session_id": event.get("session_id"), "tool_name": "Edit",
125
- "tool_input": {"file_path": file_path,
126
- "old_string": "\n".join(removed),
127
- "new_string": "\n".join(added)},
128
- }
129
- for script in ("guard-status.sh", "guard-verify.sh"):
130
- reason = run_guard(root, event, script, payload)
131
- if reason:
132
- deny(reason)
133
- return
134
- return
135
- elif tool in ("Edit", "Write"):
136
- payload = {"tool_name": tool, "tool_input": args}
137
- scripts = ["guard-status.sh", "guard-verify.sh"]
138
- else:
139
- return
140
- payload.update(hook_event_name="PreToolUse", cwd=str(root), session_id=event.get("session_id"))
141
- for script in scripts:
142
- reason = run_guard(root, event, script, payload)
143
- if reason:
144
- deny(reason)
145
- return
146
-
147
-
148
- def stop(event: dict) -> None:
149
- """Stop hook: refuse to end the turn while PROJECT-STATUS.html is stale.
150
-
151
- Same contract as the Claude Code Stop hook (_status-update-gate.md §8):
152
- guard-status-html.sh exits 2 when the .html is older than the .md or
153
- missing; `stop_hook_active` is passed through so a turn that genuinely
154
- cannot render still terminates instead of looping.
155
- """
156
- root = project_root(event)
157
- payload = {
158
- "hook_event_name": "Stop", "cwd": str(root),
159
- "session_id": event.get("session_id"),
160
- "stop_hook_active": bool(event.get("stop_hook_active")),
161
- }
162
- reason = run_guard(root, event, "guard-status-html.sh", payload)
163
- if reason:
164
- print(json.dumps({"decision": "block", "reason": reason}))
165
-
166
-
167
- def write_pointer(root: pathlib.Path, event: dict) -> None:
168
- session_id = str(event.get("session_id") or "")
169
- if not session_id:
170
- return
171
- target = root / ".tfcore" / ".session" / "codex.json"
172
- try:
173
- target.parent.mkdir(parents=True, exist_ok=True)
174
- target.write_text(json.dumps({
175
- "session_id": session_id,
176
- "transcript_path": event.get("transcript_path"),
177
- "model": event.get("model"),
178
- "ts": datetime.now(timezone.utc).isoformat(),
179
- }) + "\n", encoding="utf-8")
180
- except Exception:
181
- pass
182
-
183
-
184
- def sweep_artifacts(root: pathlib.Path, event: dict) -> None:
185
- """SessionStart analogue of the Claude Code sweep-artifacts.sh hook: delete
186
- run material under tests/.artifacts/ and .verify/ older than the retention
187
- window and any banned repo-root legacy dir. No veto — never raises."""
188
- script = root / ".tfcore" / "hooks" / "sweep-artifacts.sh"
189
- if not script.exists():
190
- return
191
- try:
192
- res = subprocess.run(["bash", str(script)], input=json.dumps(event), text=True,
193
- capture_output=True, timeout=30, env=environment(root, event), check=False)
194
- summary = (res.stdout or "").strip()
195
- if summary:
196
- print(summary) # SessionStart stdout is surfaced into the session
197
- except Exception:
198
- pass
199
-
200
-
201
- def session_end(root: pathlib.Path, event: dict) -> None:
202
- # Transcript format is explicitly not a stable Codex hook interface. Record
203
- # honest session metadata; codex exec --json telemetry is enriched separately.
204
- emit = root / ".tfcore" / "utils" / "tf-emit.sh"
205
- if not emit.exists() or not event.get("session_id"):
206
- return
207
- record = {
208
- "kind": "session",
209
- "session_id": event.get("session_id"),
210
- "model": event.get("model"),
211
- "duration_s": None,
212
- "input_tokens": None,
213
- "output_tokens": None,
214
- "cache_read_tokens": None,
215
- "cache_creation_tokens": None,
216
- "cost_usd": None,
217
- "children_sessions": None,
218
- "harness": "codex",
219
- }
220
- try:
221
- subprocess.run(["bash", str(emit), "sessions"], input=json.dumps(record), text=True,
222
- capture_output=True, timeout=2, env=environment(root, event), check=False)
223
- except Exception:
224
- pass
225
-
226
-
227
- def main() -> int:
228
- event = read_event()
229
- root = project_root(event)
230
- mode = sys.argv[1] if len(sys.argv) > 1 else ""
231
- if mode == "pre-tool":
232
- pre_tool(event)
233
- elif mode == "stop":
234
- stop(event)
235
- elif mode == "session-start":
236
- write_pointer(root, event)
237
- # .codex/hooks.json runs session-start for UserPromptSubmit too; sweep
238
- # only on the real session start so every prompt does not walk the tree.
239
- if str(event.get("hook_event_name") or "").lower() != "userpromptsubmit":
240
- sweep_artifacts(root, event)
241
- elif mode == "session-end":
242
- write_pointer(root, event)
243
- session_end(root, event)
244
- return 0
245
-
246
-
247
- if __name__ == "__main__":
248
- raise SystemExit(main())
@@ -1,117 +0,0 @@
1
- # Advanced Elicitation Task
2
-
3
- ## Purpose
4
-
5
- - Provide optional reflective and brainstorming actions to enhance content quality
6
- - Enable deeper exploration of ideas through structured elicitation techniques
7
- - Support iterative refinement through multiple analytical perspectives
8
- - Usable during template-driven document creation or any chat conversation
9
-
10
- ## Usage Scenarios
11
-
12
- ### Scenario 1: Template Document Creation
13
-
14
- After outputting a section during document creation:
15
-
16
- 1. **Section Review**: Ask user to review the drafted section
17
- 2. **Offer Elicitation**: Present 9 carefully selected elicitation methods
18
- 3. **Simple Selection**: User types a number (0-8) to engage method, or 9 to proceed
19
- 4. **Execute & Loop**: Apply selected method, then re-offer choices until user proceeds
20
-
21
- ### Scenario 2: General Chat Elicitation
22
-
23
- User can request advanced elicitation on any agent output:
24
-
25
- - User says "do advanced elicitation" or similar
26
- - Agent selects 9 relevant methods for the context
27
- - Same simple 0-9 selection process
28
-
29
- ## Task Instructions
30
-
31
- ### 1. Intelligent Method Selection
32
-
33
- **Context Analysis**: Before presenting options, analyze:
34
-
35
- - **Content Type**: Technical specs, user stories, architecture, requirements, etc.
36
- - **Complexity Level**: Simple, moderate, or complex content
37
- - **Stakeholder Needs**: Who will use this information
38
- - **Risk Level**: High-impact decisions vs routine items
39
- - **Creative Potential**: Opportunities for innovation or alternatives
40
-
41
- **Method Selection Strategy**:
42
-
43
- 1. **Always Include Core Methods** (choose 3-4):
44
- - Expand or Contract for Audience
45
- - Critique and Refine
46
- - Identify Potential Risks
47
- - Assess Alignment with Goals
48
-
49
- 2. **Context-Specific Methods** (choose 4-5):
50
- - **Technical Content**: Tree of Thoughts, ReWOO, Meta-Prompting
51
- - **User-Facing Content**: Agile Team Perspective, Stakeholder Roundtable
52
- - **Creative Content**: Innovation Tournament, Escape Room Challenge
53
- - **Strategic Content**: Red Team vs Blue Team, Hindsight Reflection
54
-
55
- 3. **Always Include**: "Proceed / No Further Actions" as option 9
56
-
57
- ### 2. Section Context and Review
58
-
59
- When invoked after outputting a section:
60
-
61
- 1. **Provide Context Summary**: Give a brief 1-2 sentence summary of what the user should look for in the section just presented
62
-
63
- 2. **Explain Visual Elements**: If the section contains diagrams, explain them briefly before offering elicitation options
64
-
65
- 3. **Clarify Scope Options**: If the section contains multiple distinct items, inform the user they can apply elicitation actions to:
66
- - The entire section as a whole
67
- - Individual items within the section (specify which item when selecting an action)
68
-
69
- ### 3. Present Elicitation Options
70
-
71
- **Review Request Process:**
72
-
73
- - Ask the user to review the drafted section
74
- - In the SAME message, inform them they can suggest direct changes OR select an elicitation method
75
- - Present 9 intelligently selected methods (0-8) plus "Proceed" (9)
76
- - Keep descriptions short - just the method name
77
- - Await simple numeric selection
78
-
79
- **Action List Presentation Format:**
80
-
81
- ```text
82
- **Advanced Elicitation Options**
83
- Choose a number (0-8) or 9 to proceed:
84
-
85
- 0. [Method Name]
86
- 1. [Method Name]
87
- 2. [Method Name]
88
- 3. [Method Name]
89
- 4. [Method Name]
90
- 5. [Method Name]
91
- 6. [Method Name]
92
- 7. [Method Name]
93
- 8. [Method Name]
94
- 9. Proceed / No Further Actions
95
- ```
96
-
97
- **Response Handling:**
98
-
99
- - **Numbers 0-8**: Execute the selected method, then re-offer the choice
100
- - **Number 9**: Proceed to next section or continue conversation
101
- - **Direct Feedback**: Apply user's suggested changes and continue
102
-
103
- ### 4. Method Execution Framework
104
-
105
- **Execution Process:**
106
-
107
- 1. **Retrieve Method**: Access the specific elicitation method from the elicitation-methods data file
108
- 2. **Apply Context**: Execute the method from your current role's perspective
109
- 3. **Provide Results**: Deliver insights, critiques, or alternatives relevant to the content
110
- 4. **Re-offer Choice**: Present the same 9 options again until user selects 9 or gives direct feedback
111
-
112
- **Execution Guidelines:**
113
-
114
- - **Be Concise**: Focus on actionable insights, not lengthy explanations
115
- - **Stay Relevant**: Tie all elicitation back to the specific content being analyzed
116
- - **Identify Personas**: For multi-persona methods, clearly identify which viewpoint is speaking
117
- - **Maintain Flow**: Keep the process moving efficiently