@techierathore/techieflow 1.0.0

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 (151) hide show
  1. package/.claude/commands/TechieFlow/agents/analyst.md +97 -0
  2. package/.claude/commands/TechieFlow/agents/architect.md +84 -0
  3. package/.claude/commands/TechieFlow/agents/flow-master.md +217 -0
  4. package/.claude/commands/TechieFlow/agents/verifier.md +72 -0
  5. package/.claude/commands/TechieFlow/tasks/_metrics-emit-gate.md +138 -0
  6. package/.claude/commands/TechieFlow/tasks/_smoke-test-policy.md +98 -0
  7. package/.claude/commands/TechieFlow/tasks/_status-update-gate.md +78 -0
  8. package/.claude/commands/TechieFlow/tasks/_yolo-mode.md +77 -0
  9. package/.claude/commands/TechieFlow/tasks/advanced-elicitation.md +117 -0
  10. package/.claude/commands/TechieFlow/tasks/amend-docs.md +149 -0
  11. package/.claude/commands/TechieFlow/tasks/author-brd.md +79 -0
  12. package/.claude/commands/TechieFlow/tasks/build-phase.md +231 -0
  13. package/.claude/commands/TechieFlow/tasks/create-deep-research-prompt.md +278 -0
  14. package/.claude/commands/TechieFlow/tasks/create-doc.md +101 -0
  15. package/.claude/commands/TechieFlow/tasks/day1-brownfield.md +507 -0
  16. package/.claude/commands/TechieFlow/tasks/day1-greenfield.md +224 -0
  17. package/.claude/commands/TechieFlow/tasks/devguide.md +224 -0
  18. package/.claude/commands/TechieFlow/tasks/document-project.md +343 -0
  19. package/.claude/commands/TechieFlow/tasks/execute-checklist.md +86 -0
  20. package/.claude/commands/TechieFlow/tasks/facilitate-brainstorming-session.md +136 -0
  21. package/.claude/commands/TechieFlow/tasks/fix-issues.md +134 -0
  22. package/.claude/commands/TechieFlow/tasks/generate-html.md +115 -0
  23. package/.claude/commands/TechieFlow/tasks/handoff-phase.md +126 -0
  24. package/.claude/commands/TechieFlow/tasks/index-docs.md +173 -0
  25. package/.claude/commands/TechieFlow/tasks/kb-mode-interaction.md +75 -0
  26. package/.claude/commands/TechieFlow/tasks/log-miss.md +160 -0
  27. package/.claude/commands/TechieFlow/tasks/metrics-report.md +143 -0
  28. package/.claude/commands/TechieFlow/tasks/mockups.md +122 -0
  29. package/.claude/commands/TechieFlow/tasks/productguide.md +105 -0
  30. package/.claude/commands/TechieFlow/tasks/refresh-status.md +135 -0
  31. package/.claude/commands/TechieFlow/tasks/render-workflow-docs.md +117 -0
  32. package/.claude/commands/TechieFlow/tasks/shard-doc.md +185 -0
  33. package/.claude/commands/TechieFlow/tasks/split-brd.md +131 -0
  34. package/.claude/commands/TechieFlow/tasks/triage-issues.md +157 -0
  35. package/.claude/commands/TechieFlow/tasks/verify-phase.md +579 -0
  36. package/.claude/commands/generate-html.md +124 -0
  37. package/.codex/config.toml +46 -0
  38. package/.codex/hooks.json +63 -0
  39. package/.codex/rules/techieflow.rules +8 -0
  40. package/.opencode/command/generate-html.md +129 -0
  41. package/.opencode/plugin/techieflow.js +350 -0
  42. package/.tfcore/TOKEN-GUIDE.md +59 -0
  43. package/.tfcore/agents/analyst.md +97 -0
  44. package/.tfcore/agents/architect.md +84 -0
  45. package/.tfcore/agents/flow-master.md +217 -0
  46. package/.tfcore/agents/verifier.md +72 -0
  47. package/.tfcore/checklists/architect-checklist.md +438 -0
  48. package/.tfcore/core-config.yaml +47 -0
  49. package/.tfcore/data/brainstorming-techniques.md +36 -0
  50. package/.tfcore/data/elicitation-methods.md +154 -0
  51. package/.tfcore/data/techieflow-kb.md +807 -0
  52. package/.tfcore/data/technical-preferences.md +3 -0
  53. package/.tfcore/enhanced-ide-development-workflow.md +248 -0
  54. package/.tfcore/hooks/block-git.sh +301 -0
  55. package/.tfcore/hooks/codex-adapter.py +248 -0
  56. package/.tfcore/hooks/guard-artifacts.sh +101 -0
  57. package/.tfcore/hooks/guard-status-html.sh +102 -0
  58. package/.tfcore/hooks/guard-status.sh +124 -0
  59. package/.tfcore/hooks/guard-verify.sh +108 -0
  60. package/.tfcore/hooks/metrics-session.sh +129 -0
  61. package/.tfcore/hooks/session-pointer.sh +52 -0
  62. package/.tfcore/hooks/sweep-artifacts.sh +198 -0
  63. package/.tfcore/install-manifest.yaml +231 -0
  64. package/.tfcore/routing.yaml +105 -0
  65. package/.tfcore/tasks/_metrics-emit-gate.md +138 -0
  66. package/.tfcore/tasks/_smoke-test-policy.md +98 -0
  67. package/.tfcore/tasks/_status-update-gate.md +78 -0
  68. package/.tfcore/tasks/_yolo-mode.md +77 -0
  69. package/.tfcore/tasks/advanced-elicitation.md +117 -0
  70. package/.tfcore/tasks/amend-docs.md +149 -0
  71. package/.tfcore/tasks/author-brd.md +79 -0
  72. package/.tfcore/tasks/build-phase.md +231 -0
  73. package/.tfcore/tasks/create-deep-research-prompt.md +278 -0
  74. package/.tfcore/tasks/create-doc.md +101 -0
  75. package/.tfcore/tasks/day1-brownfield.md +507 -0
  76. package/.tfcore/tasks/day1-greenfield.md +224 -0
  77. package/.tfcore/tasks/devguide.md +224 -0
  78. package/.tfcore/tasks/document-project.md +343 -0
  79. package/.tfcore/tasks/execute-checklist.md +86 -0
  80. package/.tfcore/tasks/facilitate-brainstorming-session.md +136 -0
  81. package/.tfcore/tasks/fix-issues.md +134 -0
  82. package/.tfcore/tasks/generate-html.md +115 -0
  83. package/.tfcore/tasks/handoff-phase.md +126 -0
  84. package/.tfcore/tasks/index-docs.md +173 -0
  85. package/.tfcore/tasks/kb-mode-interaction.md +75 -0
  86. package/.tfcore/tasks/log-miss.md +160 -0
  87. package/.tfcore/tasks/metrics-report.md +143 -0
  88. package/.tfcore/tasks/mockups.md +122 -0
  89. package/.tfcore/tasks/productguide.md +105 -0
  90. package/.tfcore/tasks/refresh-status.md +135 -0
  91. package/.tfcore/tasks/render-workflow-docs.md +117 -0
  92. package/.tfcore/tasks/shard-doc.md +185 -0
  93. package/.tfcore/tasks/split-brd.md +131 -0
  94. package/.tfcore/tasks/triage-issues.md +157 -0
  95. package/.tfcore/tasks/verify-phase.md +579 -0
  96. package/.tfcore/telemetry/SCHEMA.md +678 -0
  97. package/.tfcore/telemetry/install-metrics.sh +390 -0
  98. package/.tfcore/telemetry/pre-commit +94 -0
  99. package/.tfcore/telemetry/tf-metrics.sh +1415 -0
  100. package/.tfcore/templates/architecture-tmpl.yaml +650 -0
  101. package/.tfcore/templates/brainstorming-output-tmpl.yaml +156 -0
  102. package/.tfcore/templates/brownfield-architecture-tmpl.yaml +476 -0
  103. package/.tfcore/templates/competitor-analysis-tmpl.yaml +306 -0
  104. package/.tfcore/templates/front-end-architecture-tmpl.yaml +218 -0
  105. package/.tfcore/templates/fullstack-architecture-tmpl.yaml +823 -0
  106. package/.tfcore/templates/market-research-tmpl.yaml +252 -0
  107. package/.tfcore/templates/project-brief-tmpl.yaml +221 -0
  108. package/.tfcore/templates/v4custom/app-agents-md-tmpl.md +61 -0
  109. package/.tfcore/templates/v4custom/app-architecture-tmpl.md +127 -0
  110. package/.tfcore/templates/v4custom/app-brd-tmpl.md +204 -0
  111. package/.tfcore/templates/v4custom/app-checklist-tmpl.md +90 -0
  112. package/.tfcore/templates/v4custom/app-claude-md-tmpl.md +33 -0
  113. package/.tfcore/templates/v4custom/app-devguide-tmpl.md +167 -0
  114. package/.tfcore/templates/v4custom/app-editorconfig-tmpl.editorconfig +44 -0
  115. package/.tfcore/templates/v4custom/app-library-feedback-tmpl.md +31 -0
  116. package/.tfcore/templates/v4custom/app-productguide-tmpl.md +54 -0
  117. package/.tfcore/templates/v4custom/app-project-status-tmpl.md +98 -0
  118. package/.tfcore/templates/v4custom/app-uidesign-tmpl.md +48 -0
  119. package/.tfcore/templates/v4custom/app-usageguide-tmpl.md +67 -0
  120. package/.tfcore/templates/v4custom/build-invocation-ladder.md +190 -0
  121. package/.tfcore/templates/v4custom/html-render-shell.md +502 -0
  122. package/.tfcore/templates/v4custom/metrics-report-template.md +273 -0
  123. package/.tfcore/templates/v4custom/opencode-operating-contract.md +56 -0
  124. package/.tfcore/user-guide.md +633 -0
  125. package/.tfcore/utils/techieflow-doc-template.md +325 -0
  126. package/.tfcore/utils/tf-assets.sh +310 -0
  127. package/.tfcore/utils/tf-codex-bind.py +196 -0
  128. package/.tfcore/utils/tf-codex-telemetry.py +60 -0
  129. package/.tfcore/utils/tf-emit.sh +1075 -0
  130. package/.tfcore/utils/tf-gitignore-audit.sh +281 -0
  131. package/.tfcore/utils/tf-goal.sh +421 -0
  132. package/.tfcore/utils/tf-harness.sh +160 -0
  133. package/.tfcore/utils/tf-mockup-parity.mjs +555 -0
  134. package/.tfcore/utils/tf-mockup-parity.sh +65 -0
  135. package/.tfcore/utils/tf-opencode-audit.py +126 -0
  136. package/.tfcore/utils/tf-perf.sh +241 -0
  137. package/.tfcore/utils/tf-render-html.py +715 -0
  138. package/.tfcore/utils/tf-render-html.sh +28 -0
  139. package/.tfcore/utils/tf-routing-bind.sh +216 -0
  140. package/.tfcore/utils/tf-routing.sh +247 -0
  141. package/.tfcore/utils/tf-yolo.sh +119 -0
  142. package/.tfcore/working-in-the-brownfield.md +606 -0
  143. package/LICENSE +201 -0
  144. package/README.md +1212 -0
  145. package/WORKFLOW.html +1986 -0
  146. package/docs/TechieFlow-Installation.md +299 -0
  147. package/opencode.jsonc +929 -0
  148. package/package.json +60 -0
  149. package/scripts/install.mjs +992 -0
  150. package/scripts/test-install.mjs +505 -0
  151. package/scripts/validate.mjs +155 -0
@@ -0,0 +1,124 @@
1
+ # /generate-html Task
2
+
3
+ > Claude Code note: this command file embeds `.tfcore/tasks/generate-html.md` VERBATIM — regenerate
4
+ > it whenever that task changes; do not edit the embedded body here. It is also the copy
5
+ > `update-framework.sh` pushes to every app's `.claude/commands/`, so drift here ships everywhere.
6
+
7
+ When this command is used, execute the following task:
8
+
9
+
10
+ # generate-html
11
+
12
+ Convert one or more **human-readable** markdown files to self-contained HTML using the shared shell. Use this when you need to render documents that `*render-workflow-docs` does not cover (the UsageGuide, the DevGuide, library-feedback docs, ad-hoc design notes, legacy/archived docs). Note: suffixed doc variants like `-v2` are banned by the collision policy (day1-brownfield §1.6) — superseded docs live unmodified in `docs/OldDocs/`.
13
+
14
+ **NEVER render the checklist to HTML.** The `*-Checklist.md` (and its Requirements Status table) is an **AI-agent working document** — agents read it in markdown. An HTML mirror just burns tokens and drifts from the source. If asked to render a `*-Checklist.md`, decline and explain it's an agent doc; if a stale `*-Checklist.html` exists from before this rule, the user may delete it.
15
+
16
+ ## Why this exists
17
+
18
+ `*render-workflow-docs` only renders the three canonical files (`{App}-BRD.md`, `{App}-Architecture.md`, `PROJECT-STATUS.md`). When the user has additional or versioned docs, this task accepts explicit paths.
19
+
20
+ ## Invocation forms
21
+
22
+ ```
23
+ *generate-html @path/to/file.md
24
+ *generate-html @path/to/file1.md @path/to/file2.md @path/to/file3.md
25
+ *generate-html @docs/SomeFolder/
26
+ ```
27
+
28
+ (Or via the slash-command wrapper: `/TechieFlow:tasks:generate-html @path/to/file.md` in Claude Code; `/techieflow:tasks:generate-html path/to/file.md` in OpenCode. **The `@` sigil is Claude Code's file-mention; under OpenCode type the plain path WITHOUT `@`** — an `@file` in an OpenCode prompt inlines the entire file into context, wasting tokens. This task accepts both forms and treats them identically.)
29
+
30
+ Note: the `@` prefix is Claude Code's file-mention sigil. OpenCode treats a leading `@` as file-content-inclusion, so pass plain paths there.
31
+
32
+ - **Single file:** convert that one MD to a sibling HTML.
33
+ - **Multiple files:** convert each. List separated by spaces. Each becomes a sibling HTML.
34
+ - **Directory:** convert every `*.md` directly inside that directory. **Non-recursive** — do not descend into subdirectories. If the user wants subdirectories included, they can pass each subdir as another argument.
35
+
36
+ If no arguments are passed, HALT and tell the user: `Usage: *generate-html @<path-to-md-or-dir> [@<more-paths>]`.
37
+
38
+ ## Inputs
39
+
40
+ - One or more `@`-prefixed paths (the `@` is Claude Code's file-mention sigil; strip it when resolving the actual path).
41
+ - Paths may be absolute or relative to project root.
42
+
43
+ ## SEQUENTIAL Execution
44
+
45
+ ### 1. Resolve the input set
46
+
47
+ For each argument:
48
+ - Strip leading `@`.
49
+ - If the path ends with `/` or is a directory: use the Read tool to read each `*.md` directly under that directory (non-recursive, no subdirs).
50
+ - Otherwise: treat as a single file path.
51
+ - Skip any path that doesn't exist; emit a one-line note for each skip and continue with the rest. Do not HALT unless ZERO paths resolve.
52
+
53
+ If ZERO paths resolve, HALT with: `No markdown files found at the given paths. Check the paths and retry.`
54
+
55
+ Echo a one-line summary: `Rendering N markdown file(s): file1.md, file2.md, ...`.
56
+
57
+ ### 2. For each MD, build the HTML
58
+
59
+ **Run the renderer. Do NOT hand-author HTML.**
60
+
61
+ ```bash
62
+ bash .tfcore/utils/tf-render-html.sh docs/{AppName}-BRD.md PROJECT-STATUS.md
63
+ ```
64
+
65
+ It takes one or more `.md` paths, writes a sibling `.html` for each, and implements `html-render-shell.md` in full — §1 slugs (with dedupe), §2 CSS, §3 skeleton + flash-free theme script, §4 heading anchors *and* hand-written `<a id="…"></a>` anchors preserved verbatim, §5 mermaid toolbar wrapper, §5.5 label self-check, §6 escaped code blocks, §6b agent-note strip, §7 JS, §8 inline + sidebar TOC (sidebar only above 6 H2s). It reads the CSS and JS **out of the spec file at render time**, so the output cannot drift from the spec.
66
+
67
+ Hand-authoring the HTML through the Write tool is no longer the path: it cost 75–80k output tokens per phase for documents whose content barely changed, produced non-reproducible output, and risked silent truncation on large files (TfLens TF-003, 2026-08-27). Reserve it for the case where the renderer genuinely cannot express something — and report that as a framework defect rather than hand-rolling around it.
68
+
69
+ **Read the output.** The renderer prints one line per file (size, H2 count, sidebar yes/no, diagram count, notes stripped) and warns on `⚠ mermaid §5.5` for an unquoted flowchart label or a reserved `end` node id. Those warnings are about the **source `.md`** — fix the diagram in the markdown and re-render; never edit the generated HTML.
70
+
71
+ **It refuses to render a checklist** (`*-Checklist.md`, exit 2) — that ban is now mechanical, not just prose.
72
+
73
+ Read `.tfcore/templates/v4custom/html-render-shell.md` when you need to understand or change the shell; it remains the specification. You do not need to read it just to render.
74
+
75
+ For each MD file:
76
+
77
+ 1. **Read** the source MD content.
78
+ 2. **Extract title** from the first `#` heading; if none, derive from the filename (humanize: replace `-` and `_` with spaces, title-case).
79
+ 3. **Build the heading list** (every `##`, `###`, `####`): for each, compute the slug per shell §1, attach an `id` to the heading, and decorate with the anchor link `<a class="anchor-link" href="#{slug}">#</a>`. Dedupe slugs by appending `-2`, `-3`, ... when a slug already exists in the doc.
80
+ 4. **Decide TOC mode:**
81
+ - If H2 count > 6: render with sidebar TOC (no `no-toc` class).
82
+ - Otherwise: render with `no-toc` class on `.layout` and omit the `<nav class="side">` block.
83
+ - **Always** render the inline `.toc-inline` block at the top of `<main>` when H2 count ≥ 2.
84
+ 5. **If the MD source already contains a `## Table of Contents` section**, replace it inline with the inline `.toc-inline` HTML block (don't double-render). Use the same slugs you assigned in step 3 so links work.
85
+ 6. **Convert body markdown** to HTML:
86
+ - Paragraphs, bold/italic, links, lists, tables, blockquotes — standard markdown → HTML.
87
+ - Code fences: `` ```mermaid `` → §5 `<div class="diagram">` wrapper with toolbar buttons; any other code fence → §6 `<pre><code class="language-{lang}">{escaped}</code></pre>`.
88
+ - Inline code: `<code>...</code>`.
89
+ - HTML comments in source (`<!-- ... -->`): pass through.
90
+ - **Agent-facing authoring notes NEVER render as visible text.** The doc templates carry drafting-agent instructions (the "Depth mandate", "Mermaid mandate", "read before drafting" notes, how-to-use-this-template guidance) as HTML comments, which pass through invisibly. If the source MD still carries such a note as a **visible** blockquote or paragraph — text addressed to the drafting/authoring AGENT rather than to the document's human reader (typical in docs generated from pre-2026-07 templates) — **OMIT it from the rendered HTML** and, if you are also allowed to edit the MD, convert it to an HTML comment there. List every such omission in the output summary. Reader-facing blockquotes (a DevGuide's verification-status banner or Purpose note, a UsageGuide's test-user rules, etc.) stay.
91
+ 7. **Assemble** using the §3 skeleton, with §2 CSS inlined verbatim in `<head>`, and §7 JS inlined verbatim at end of `<body>`. The mermaid + svg-pan-zoom CDN scripts go just before the JS.
92
+ 8. **Write** the output to `{same-dir}/{basename}.html` (replace `.md` with `.html`). If the file already exists, overwrite.
93
+
94
+ ### 3. Validate (mental review — no shell-out)
95
+
96
+ Per shell §9 checklist, for each rendered file confirm:
97
+ - CSS palette and JS pasted verbatim.
98
+ - Every TOC entry's `href` matches an existing heading `id`.
99
+ - Every mermaid fence wrapped in `.diagram` with all 6 toolbar buttons.
100
+ - Sidebar present iff H2 count > 6.
101
+ - No external resource references except the two CDN scripts.
102
+
103
+ **Mermaid validity pass (do this for EVERY diagram — it is the #1 reported bug).** Apply the shell §5.5 self-check to each mermaid block before emitting it:
104
+ - Each node/edge/subgraph label that contains anything other than letters, digits, and spaces (i.e. has `(` `)` `/` `&` `:` `,` `[` `]` `{` `}` `#` `@` `<` `>` `|` `"` etc.) MUST be wrapped in double quotes, with the quotes INSIDE the shape brackets (`API["ASP.NET API (v2)"]`, `DB[("SQL Server")]`).
105
+ - No node id is a reserved word (lowercase `end`).
106
+ - If you find a bare label in the source MD, **fix it in the emitted HTML** (quote it) rather than copying through a diagram you know will throw "Syntax error" in the browser. Note any such fix in the output summary so the author can also fix the MD source.
107
+
108
+ Do NOT shell out to an HTML validator. Do NOT `wc -c` the files. Do NOT `du`.
109
+
110
+ ### 4. Output summary
111
+
112
+ Print one line per rendered file: the absolute output path. End with: `Open each in a browser to confirm Mermaid renders correctly and copy buttons / diagram toolbars work.`
113
+
114
+ ## Output Checklist
115
+
116
+ - [ ] Every input MD has a sibling HTML produced
117
+ - [ ] Each HTML is self-contained (no broken local refs)
118
+ - [ ] Sidebar TOC present only when H2 count > 6
119
+ - [ ] Inline TOC present when H2 count ≥ 2
120
+ - [ ] Every heading has an id matching the TOC link
121
+ - [ ] Mermaid diagrams have working toolbar (zoom, fit, 1:1, fullscreen, popout)
122
+ - [ ] Mermaid validity pass done (shell §5.5): every non-trivial label double-quoted, no `end` node ids, bare labels fixed not emitted
123
+ - [ ] No agent-facing authoring note (Depth/Mermaid mandate, template how-to) rendered as visible text — leaked ones omitted and reported
124
+ - [ ] Copy buttons present on every `<pre>` (added by JS, no need to inject manually)
@@ -0,0 +1,46 @@
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"
@@ -0,0 +1,63 @@
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
+ }
@@ -0,0 +1,8 @@
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
+
@@ -0,0 +1,129 @@
1
+ ---
2
+ description: Convert one or more human-readable markdown files (or a non-recursive directory) to self-contained HTML using the shared render shell.
3
+ ---
4
+
5
+ # /generate-html Task
6
+
7
+ > OpenCode note: this command file embeds `.tfcore/tasks/generate-html.md` VERBATIM — regenerate
8
+ > it whenever that task changes; do not edit the embedded body here. In OpenCode, pass PLAIN
9
+ > paths (no leading `@`) — an `@file` in an OpenCode prompt inlines the entire file into context.
10
+ > The task body below accepts both forms and strips a stray `@` when resolving.
11
+
12
+ When this command is used, execute the following task:
13
+
14
+
15
+ # generate-html
16
+
17
+ Convert one or more **human-readable** markdown files to self-contained HTML using the shared shell. Use this when you need to render documents that `*render-workflow-docs` does not cover (the UsageGuide, the DevGuide, library-feedback docs, ad-hoc design notes, legacy/archived docs). Note: suffixed doc variants like `-v2` are banned by the collision policy (day1-brownfield §1.6) — superseded docs live unmodified in `docs/OldDocs/`.
18
+
19
+ **NEVER render the checklist to HTML.** The `*-Checklist.md` (and its Requirements Status table) is an **AI-agent working document** — agents read it in markdown. An HTML mirror just burns tokens and drifts from the source. If asked to render a `*-Checklist.md`, decline and explain it's an agent doc; if a stale `*-Checklist.html` exists from before this rule, the user may delete it.
20
+
21
+ ## Why this exists
22
+
23
+ `*render-workflow-docs` only renders the three canonical files (`{App}-BRD.md`, `{App}-Architecture.md`, `PROJECT-STATUS.md`). When the user has additional or versioned docs, this task accepts explicit paths.
24
+
25
+ ## Invocation forms
26
+
27
+ ```
28
+ *generate-html @path/to/file.md
29
+ *generate-html @path/to/file1.md @path/to/file2.md @path/to/file3.md
30
+ *generate-html @docs/SomeFolder/
31
+ ```
32
+
33
+ (Or via the slash-command wrapper: `/TechieFlow:tasks:generate-html @path/to/file.md` in Claude Code; `/techieflow:tasks:generate-html path/to/file.md` in OpenCode. **The `@` sigil is Claude Code's file-mention; under OpenCode type the plain path WITHOUT `@`** — an `@file` in an OpenCode prompt inlines the entire file into context, wasting tokens. This task accepts both forms and treats them identically.)
34
+
35
+ Note: the `@` prefix is Claude Code's file-mention sigil. OpenCode treats a leading `@` as file-content-inclusion, so pass plain paths there.
36
+
37
+ - **Single file:** convert that one MD to a sibling HTML.
38
+ - **Multiple files:** convert each. List separated by spaces. Each becomes a sibling HTML.
39
+ - **Directory:** convert every `*.md` directly inside that directory. **Non-recursive** — do not descend into subdirectories. If the user wants subdirectories included, they can pass each subdir as another argument.
40
+
41
+ If no arguments are passed, HALT and tell the user: `Usage: *generate-html @<path-to-md-or-dir> [@<more-paths>]`.
42
+
43
+ ## Inputs
44
+
45
+ - One or more `@`-prefixed paths (the `@` is Claude Code's file-mention sigil; strip it when resolving the actual path).
46
+ - Paths may be absolute or relative to project root.
47
+
48
+ ## SEQUENTIAL Execution
49
+
50
+ ### 1. Resolve the input set
51
+
52
+ For each argument:
53
+ - Strip leading `@`.
54
+ - If the path ends with `/` or is a directory: use the Read tool to read each `*.md` directly under that directory (non-recursive, no subdirs).
55
+ - Otherwise: treat as a single file path.
56
+ - Skip any path that doesn't exist; emit a one-line note for each skip and continue with the rest. Do not HALT unless ZERO paths resolve.
57
+
58
+ If ZERO paths resolve, HALT with: `No markdown files found at the given paths. Check the paths and retry.`
59
+
60
+ Echo a one-line summary: `Rendering N markdown file(s): file1.md, file2.md, ...`.
61
+
62
+ ### 2. For each MD, build the HTML
63
+
64
+ **Run the renderer. Do NOT hand-author HTML.**
65
+
66
+ ```bash
67
+ bash .tfcore/utils/tf-render-html.sh docs/{AppName}-BRD.md PROJECT-STATUS.md
68
+ ```
69
+
70
+ It takes one or more `.md` paths, writes a sibling `.html` for each, and implements `html-render-shell.md` in full — §1 slugs (with dedupe), §2 CSS, §3 skeleton + flash-free theme script, §4 heading anchors *and* hand-written `<a id="…"></a>` anchors preserved verbatim, §5 mermaid toolbar wrapper, §5.5 label self-check, §6 escaped code blocks, §6b agent-note strip, §7 JS, §8 inline + sidebar TOC (sidebar only above 6 H2s). It reads the CSS and JS **out of the spec file at render time**, so the output cannot drift from the spec.
71
+
72
+ Hand-authoring the HTML through the Write tool is no longer the path: it cost 75–80k output tokens per phase for documents whose content barely changed, produced non-reproducible output, and risked silent truncation on large files (TfLens TF-003, 2026-08-27). Reserve it for the case where the renderer genuinely cannot express something — and report that as a framework defect rather than hand-rolling around it.
73
+
74
+ **Read the output.** The renderer prints one line per file (size, H2 count, sidebar yes/no, diagram count, notes stripped) and warns on `⚠ mermaid §5.5` for an unquoted flowchart label or a reserved `end` node id. Those warnings are about the **source `.md`** — fix the diagram in the markdown and re-render; never edit the generated HTML.
75
+
76
+ **It refuses to render a checklist** (`*-Checklist.md`, exit 2) — that ban is now mechanical, not just prose.
77
+
78
+ Read `.tfcore/templates/v4custom/html-render-shell.md` when you need to understand or change the shell; it remains the specification. You do not need to read it just to render.
79
+
80
+ For each MD file:
81
+
82
+ 1. **Read** the source MD content.
83
+ 2. **Extract title** from the first `#` heading; if none, derive from the filename (humanize: replace `-` and `_` with spaces, title-case).
84
+ 3. **Build the heading list** (every `##`, `###`, `####`): for each, compute the slug per shell §1, attach an `id` to the heading, and decorate with the anchor link `<a class="anchor-link" href="#{slug}">#</a>`. Dedupe slugs by appending `-2`, `-3`, ... when a slug already exists in the doc.
85
+ 4. **Decide TOC mode:**
86
+ - If H2 count > 6: render with sidebar TOC (no `no-toc` class).
87
+ - Otherwise: render with `no-toc` class on `.layout` and omit the `<nav class="side">` block.
88
+ - **Always** render the inline `.toc-inline` block at the top of `<main>` when H2 count ≥ 2.
89
+ 5. **If the MD source already contains a `## Table of Contents` section**, replace it inline with the inline `.toc-inline` HTML block (don't double-render). Use the same slugs you assigned in step 3 so links work.
90
+ 6. **Convert body markdown** to HTML:
91
+ - Paragraphs, bold/italic, links, lists, tables, blockquotes — standard markdown → HTML.
92
+ - Code fences: `` ```mermaid `` → §5 `<div class="diagram">` wrapper with toolbar buttons; any other code fence → §6 `<pre><code class="language-{lang}">{escaped}</code></pre>`.
93
+ - Inline code: `<code>...</code>`.
94
+ - HTML comments in source (`<!-- ... -->`): pass through.
95
+ - **Agent-facing authoring notes NEVER render as visible text.** The doc templates carry drafting-agent instructions (the "Depth mandate", "Mermaid mandate", "read before drafting" notes, how-to-use-this-template guidance) as HTML comments, which pass through invisibly. If the source MD still carries such a note as a **visible** blockquote or paragraph — text addressed to the drafting/authoring AGENT rather than to the document's human reader (typical in docs generated from pre-2026-07 templates) — **OMIT it from the rendered HTML** and, if you are also allowed to edit the MD, convert it to an HTML comment there. List every such omission in the output summary. Reader-facing blockquotes (a DevGuide's verification-status banner or Purpose note, a UsageGuide's test-user rules, etc.) stay.
96
+ 7. **Assemble** using the §3 skeleton, with §2 CSS inlined verbatim in `<head>`, and §7 JS inlined verbatim at end of `<body>`. The mermaid + svg-pan-zoom CDN scripts go just before the JS.
97
+ 8. **Write** the output to `{same-dir}/{basename}.html` (replace `.md` with `.html`). If the file already exists, overwrite.
98
+
99
+ ### 3. Validate (mental review — no shell-out)
100
+
101
+ Per shell §9 checklist, for each rendered file confirm:
102
+ - CSS palette and JS pasted verbatim.
103
+ - Every TOC entry's `href` matches an existing heading `id`.
104
+ - Every mermaid fence wrapped in `.diagram` with all 6 toolbar buttons.
105
+ - Sidebar present iff H2 count > 6.
106
+ - No external resource references except the two CDN scripts.
107
+
108
+ **Mermaid validity pass (do this for EVERY diagram — it is the #1 reported bug).** Apply the shell §5.5 self-check to each mermaid block before emitting it:
109
+ - Each node/edge/subgraph label that contains anything other than letters, digits, and spaces (i.e. has `(` `)` `/` `&` `:` `,` `[` `]` `{` `}` `#` `@` `<` `>` `|` `"` etc.) MUST be wrapped in double quotes, with the quotes INSIDE the shape brackets (`API["ASP.NET API (v2)"]`, `DB[("SQL Server")]`).
110
+ - No node id is a reserved word (lowercase `end`).
111
+ - If you find a bare label in the source MD, **fix it in the emitted HTML** (quote it) rather than copying through a diagram you know will throw "Syntax error" in the browser. Note any such fix in the output summary so the author can also fix the MD source.
112
+
113
+ Do NOT shell out to an HTML validator. Do NOT `wc -c` the files. Do NOT `du`.
114
+
115
+ ### 4. Output summary
116
+
117
+ Print one line per rendered file: the absolute output path. End with: `Open each in a browser to confirm Mermaid renders correctly and copy buttons / diagram toolbars work.`
118
+
119
+ ## Output Checklist
120
+
121
+ - [ ] Every input MD has a sibling HTML produced
122
+ - [ ] Each HTML is self-contained (no broken local refs)
123
+ - [ ] Sidebar TOC present only when H2 count > 6
124
+ - [ ] Inline TOC present when H2 count ≥ 2
125
+ - [ ] Every heading has an id matching the TOC link
126
+ - [ ] Mermaid diagrams have working toolbar (zoom, fit, 1:1, fullscreen, popout)
127
+ - [ ] Mermaid validity pass done (shell §5.5): every non-trivial label double-quoted, no `end` node ids, bare labels fixed not emitted
128
+ - [ ] No agent-facing authoring note (Depth/Mermaid mandate, template how-to) rendered as visible text — leaked ones omitted and reported
129
+ - [ ] Copy buttons present on every `<pre>` (added by JS, no need to inject manually)