omniconductor 0.3.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 (118) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +219 -0
  3. package/NOTICE +11 -0
  4. package/README.md +526 -0
  5. package/THIRD_PARTY_NOTICES.md +31 -0
  6. package/TRADEMARKS.md +26 -0
  7. package/VISION.md +106 -0
  8. package/adapters/README.md +121 -0
  9. package/adapters/claude/README.md +102 -0
  10. package/adapters/claude/SUPPORTED-FEATURES.md +66 -0
  11. package/adapters/claude/hookify-templates/.recipe-scoped +9 -0
  12. package/adapters/claude/hookify-templates/README.md +93 -0
  13. package/adapters/claude/hookify-templates/block-completion-claim-without-push.local.md.template +56 -0
  14. package/adapters/claude/hookify-templates/block-direct-push-protected-branch.local.md.template +18 -0
  15. package/adapters/claude/hookify-templates/block-force-push-protected-branch.local.md.template +42 -0
  16. package/adapters/claude/hookify-templates/block-server-secret-in-client.local.md.template +36 -0
  17. package/adapters/claude/hookify-templates/warn-any-type-added.local.md.template +44 -0
  18. package/adapters/claude/hookify-templates/warn-commit-without-pre-commit-review.local.md.template +52 -0
  19. package/adapters/claude/hookify-templates/warn-console-direct.local.md.template +55 -0
  20. package/adapters/claude/hookify-templates/warn-create-table-without-access-control.local.md.template +35 -0
  21. package/adapters/claude/hookify-templates/warn-current-work-without-remaining-tasks.local.md.template +36 -0
  22. package/adapters/claude/hookify-templates/warn-gh-pr-create-without-pre-merge-review.local.md.template +38 -0
  23. package/adapters/claude/hookify-templates/warn-hardcoded-text-without-i18n-key.local.md.template +21 -0
  24. package/adapters/claude/hookify-templates/warn-on-gh-pr-merge.local.md.template +33 -0
  25. package/adapters/claude/hookify-templates/warn-plan-spec-without-remaining-tasks.local.md.template +44 -0
  26. package/adapters/claude/hookify-templates/warn-raw-hex-instead-of-token.local.md.template +21 -0
  27. package/adapters/claude/hookify-templates/warn-security-definer-without-search-path.local.md.template +30 -0
  28. package/adapters/claude/hookify-templates/warn-stop-commit-without-current-work.local.md.template +47 -0
  29. package/adapters/claude/hookify-templates/warn-user-manual-completion.local.md.template +40 -0
  30. package/adapters/claude/transform-spec.md +140 -0
  31. package/adapters/claude/transform.sh +1169 -0
  32. package/adapters/codex/README.md +87 -0
  33. package/adapters/codex/SUPPORTED-FEATURES.md +66 -0
  34. package/adapters/codex/transform-spec.md +90 -0
  35. package/adapters/codex/transform.sh +748 -0
  36. package/adapters/copilot/README.md +88 -0
  37. package/adapters/copilot/SUPPORTED-FEATURES.md +73 -0
  38. package/adapters/copilot/transform-spec.md +111 -0
  39. package/adapters/copilot/transform.sh +757 -0
  40. package/adapters/cursor/README.md +87 -0
  41. package/adapters/cursor/SUPPORTED-FEATURES.md +90 -0
  42. package/adapters/cursor/transform-spec.md +124 -0
  43. package/adapters/cursor/transform.sh +731 -0
  44. package/adapters/gemini/README.md +93 -0
  45. package/adapters/gemini/SUPPORTED-FEATURES.md +80 -0
  46. package/adapters/gemini/transform-spec.md +102 -0
  47. package/adapters/gemini/transform.sh +844 -0
  48. package/adapters/windsurf/README.md +93 -0
  49. package/adapters/windsurf/SUPPORTED-FEATURES.md +67 -0
  50. package/adapters/windsurf/transform-spec.md +99 -0
  51. package/adapters/windsurf/transform.sh +727 -0
  52. package/bin/omniconductor.js +130 -0
  53. package/core/README.md +64 -0
  54. package/core/anti-patterns/README.md +142 -0
  55. package/core/anti-patterns/dynamic-system-prompt.md +113 -0
  56. package/core/anti-patterns/frequent-rule-file-edit.md +83 -0
  57. package/core/anti-patterns/large-file-read-no-range.md +90 -0
  58. package/core/anti-patterns/no-sub-agent-dispatch.md +89 -0
  59. package/core/anti-patterns/single-monolithic-rule-file.md +99 -0
  60. package/core/anti-patterns/skill-eager-load.md +83 -0
  61. package/core/anti-patterns/tool-call-spam.md +93 -0
  62. package/core/docs-templates/CURRENT_WORK.md +64 -0
  63. package/core/docs-templates/INDEX.md +57 -0
  64. package/core/docs-templates/PLANS.md +44 -0
  65. package/core/docs-templates/README.md +40 -0
  66. package/core/docs-templates/REMAINING_TASKS.md +43 -0
  67. package/core/docs-templates/TASKS.md +51 -0
  68. package/core/docs-templates/specs/_example.md +121 -0
  69. package/core/hooks/README.md +62 -0
  70. package/core/hooks/pretool-agent-routing.sh.template +97 -0
  71. package/core/hooks/pretool-commit-current-work-check.sh.template +103 -0
  72. package/core/hooks/pretool-commit-test-coverage-check.sh.template +116 -0
  73. package/core/hooks/pretool-large-file-read-guard.sh.template +117 -0
  74. package/core/hooks/stop-cache-hit-baseline-check.sh.template +133 -0
  75. package/core/hooks/stop-r6-review-check.sh.template +80 -0
  76. package/core/hooks/stop-session-log-check.sh.template +101 -0
  77. package/core/hooks/stop-trajectory-log.sh.template +96 -0
  78. package/core/memory-pattern/EXAMPLES.md +114 -0
  79. package/core/memory-pattern/README.md +133 -0
  80. package/core/recipes/README.md +46 -0
  81. package/core/recipes/auto-mock-data.md +82 -0
  82. package/core/recipes/branch-strategy.md +100 -0
  83. package/core/recipes/coding-conventions.md +123 -0
  84. package/core/recipes/database-discipline.md +65 -0
  85. package/core/recipes/debugging.md +143 -0
  86. package/core/recipes/design-system.md +30 -0
  87. package/core/recipes/i18n.md +118 -0
  88. package/core/recipes/monorepo.md +101 -0
  89. package/core/recipes/self-improvement.md +61 -0
  90. package/core/recipes/tdd.md +128 -0
  91. package/core/recipes/web-mobile-parity.md +87 -0
  92. package/core/reflector/SCHEDULING.md +83 -0
  93. package/core/reflector/prune-lessons.sh +105 -0
  94. package/core/reflector/reflect-brief.md +11 -0
  95. package/core/reflector/reflect.command.md +13 -0
  96. package/core/reflector/run-weekly.sh +54 -0
  97. package/core/reflector/trajectory-log.sh +55 -0
  98. package/core/roles/README.md +61 -0
  99. package/core/roles/builder.md +75 -0
  100. package/core/roles/designer.md +93 -0
  101. package/core/roles/helper.md +70 -0
  102. package/core/roles/planner.md +123 -0
  103. package/core/roles/reflector.md +72 -0
  104. package/core/roles/reviewer.md +104 -0
  105. package/core/roles/scribe.md +89 -0
  106. package/core/universal-rules/README.md +71 -0
  107. package/core/universal-rules/meta-discipline.md +292 -0
  108. package/core/universal-rules/operations.md +162 -0
  109. package/core/universal-rules/quality-gates.md +191 -0
  110. package/core/universal-rules/spec-as-you-go.md +123 -0
  111. package/core/universal-rules/workflow.md +153 -0
  112. package/core/workflow/PHASES.md +134 -0
  113. package/core/workflow/README.md +56 -0
  114. package/docs/MANUAL-INSTALL.md +456 -0
  115. package/package.json +52 -0
  116. package/tools/check-framework-purity.sh +91 -0
  117. package/tools/measure-tokens.sh +169 -0
  118. package/tools/validate-adapter-output.sh +611 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ rule_id: spec-as-you-go
3
+ rule_name: "Same-turn spec update + real-time docs sync"
4
+ severity: ABSOLUTE
5
+ applies_to: ["all-tools"]
6
+ violation_count: 5+
7
+ enforcement:
8
+ - hook: stop-session-log-check
9
+ - llm-self-discipline
10
+ linked_rules:
11
+ - workflow
12
+ - quality-gates
13
+ ---
14
+
15
+ # Spec-as-you-go — Same-Turn Documentation Sync
16
+
17
+ > Bundles W3 (spec update in same turn as code edit) and O1 (real-time docs sync). Documentation drift is the most common rule violation in production; the rule treats it as a code-level concern, not a "will do later" concern.
18
+
19
+ ## 1. The Same-Turn Update Rule (W3)
20
+
21
+ Code change without same-turn doc update is a rule violation, period.
22
+
23
+ ### 1.1 What "same turn" means
24
+
25
+ If the orchestrator (or a delegated role) edits a source file in turn N, the corresponding spec / architecture / decision doc MUST be updated **in the same turn N**, not in a follow-up turn, not in an end-of-session batch, not in tomorrow's commit.
26
+
27
+ ### 1.2 What needs same-turn update — by change type
28
+
29
+ | Code change | Doc to update (same turn) |
30
+ |---|---|
31
+ | New API route / endpoint | spec for that area + frontmatter `api_routes:` list |
32
+ | New page / route | spec for that area + frontmatter `pages:` list |
33
+ | New component (reusable) | spec for that area + frontmatter `components:` list |
34
+ | New service / hook | spec for that area + frontmatter `services:` / `hooks:` list |
35
+ | Behavior change (existing flow) | "Flow" or "Known constraints" section of relevant spec |
36
+ | New DB table / column | DB schema spec section (or dedicated `DATABASE.md`) |
37
+ | New environment variable | env-vars section of relevant spec + onboarding doc |
38
+ | New external service integration | architecture doc + services index |
39
+
40
+ ### 1.3 Why same-turn (not end-of-session)
41
+
42
+ End-of-session batching always loses fidelity. By turn N+5, the orchestrator no longer remembers that turn N also touched a database column. Stop-hook reminders catch some of this post-hoc, but the rule is designed to make Stop-hook unnecessary in the first place.
43
+
44
+ Documented production failure: a multi-file refactor changed 4 service signatures. The session ended without spec update. Days later a different agent edited one of those services, read the stale spec, and reverted to the old signature. The fix took longer than the original refactor.
45
+
46
+ ### 1.4 Where to put a new spec
47
+
48
+ If the area you're touching does not yet have a `docs/specs/<area>.md`, CREATE IT in the same turn. Use `core/docs-templates/specs/_example.md` (shipped by every CONDUCTOR adapter) as the starting point.
49
+
50
+ ---
51
+
52
+ ## 2. Real-Time Docs Sync (O1)
53
+
54
+ When work is committed and pushed, the orchestrator MUST update the following docs in the same turn:
55
+
56
+ - `docs/CURRENT_WORK.md` — session state, what was done, what's next.
57
+ - `docs/REMAINING_TASKS.md` (if it exists) — mark completed tasks, surface new ones.
58
+ - `docs/TASKS.md` (if it exists) — phase-level checklist.
59
+ - The relevant spec(s) per the table in section 1.2.
60
+ - `docs/INDEX.md` (if a new doc was created in this turn).
61
+
62
+ ### 2.1 The "completed task delete" sub-rule
63
+
64
+ When a task in CURRENT_WORK.md or TASKS.md is moved to status `completed`, it should be DELETED in the next session boundary, not left as historical clutter. The session log itself is the historical record. CURRENT_WORK.md is for what is current, not what was done last week. (Full rule: `operations.md` section 2.)
65
+
66
+ ### 2.2 What the orchestrator does NOT update
67
+
68
+ - Session transcripts / chat exports — those are tool-specific and out of scope.
69
+ - External tracker tickets (Jira / Linear / GitHub Issues) — those are explicit user actions, not auto-sync.
70
+ - Generated files (lockfiles, type-gen output) — those self-update via tooling.
71
+
72
+ ---
73
+
74
+ ## 3. Frontmatter convention (CONDUCTOR schema)
75
+
76
+ Spec files use YAML frontmatter so adapter `transform.sh` can route them. The CONDUCTOR-native fields:
77
+
78
+ ```yaml
79
+ ---
80
+ spec_id: <kebab-case-area-name>
81
+ api_routes:
82
+ - "/api/foo"
83
+ - "/api/bar"
84
+ pages:
85
+ - "/foo"
86
+ components:
87
+ - FooCard
88
+ services:
89
+ - getFooById
90
+ hooks:
91
+ - useFooState
92
+ ---
93
+ ```
94
+
95
+ Per-tool transformations:
96
+
97
+ - **Claude Code**: keep as-is in `docs/specs/<area>.md`. Stop-hook checks for stale frontmatter when source files in that area are touched.
98
+ - **Cursor / Copilot / Windsurf**: same file path, frontmatter preserved. Tool-specific scoping (`globs:` / `applyTo:`) added by the relevant adapter when the file lives under `.cursor/rules/` or `.github/instructions/`.
99
+ - **Gemini / Codex**: file is referenced by path inside the single GEMINI.md / codex.md.
100
+
101
+ ---
102
+
103
+ ## 4. Enforcement mechanism matrix
104
+
105
+ | Mechanism | Trigger | Action |
106
+ |---|---|---|
107
+ | `stop-session-log-check` (Claude hook) | Recent commit + stale CURRENT_WORK.md | Block stop, inject reminder |
108
+ | `stop-session-log-check` (Claude hook) | Source files changed > 3 + zero spec files touched | Block stop, inject "spec-as-you-go" reminder |
109
+ | Rule text (other tools) | Same as above | Manual reminder; user catches |
110
+
111
+ For tools without hook support, the orchestrator MUST self-check before declaring a turn complete:
112
+
113
+ 1. Did this turn write to source files? → spec update done?
114
+ 2. Did this turn produce a commit? → CURRENT_WORK.md updated?
115
+ 3. Did this turn complete a task? → status moved to `completed`, scheduled for delete?
116
+
117
+ If any answer is "no", the turn is not complete.
118
+
119
+ ---
120
+
121
+ ## 5. Test coverage sync (cross-link)
122
+
123
+ Test coverage sync (every new feature / changed behavior MUST have a corresponding e2e test added or updated in the same PR) is documented in `quality-gates.md` section 3. This rule and that rule are siblings: spec-as-you-go covers documentation; test coverage sync covers verifiability. Both are ABSOLUTE.
@@ -0,0 +1,153 @@
1
+ ---
2
+ rule_id: workflow
3
+ rule_name: "Plan-first, docs-first, process-first"
4
+ severity: ABSOLUTE
5
+ applies_to: ["all-tools"]
6
+ violation_count: 6+
7
+ enforcement:
8
+ - hook: stop-session-log-check
9
+ - llm-self-discipline
10
+ linked_rules:
11
+ - spec-as-you-go
12
+ - meta-discipline
13
+ ---
14
+
15
+ # Workflow — Plan-First Order
16
+
17
+ > CONDUCTOR universal rule. Bundles W1, W2, W4, W5, W6 into a single source-of-truth that every supported tool inherits via its adapter.
18
+
19
+ ## 1. Plan-First Order (W1)
20
+
21
+ Before writing any non-trivial code or modifying configuration, the orchestrator MUST follow this sequence:
22
+
23
+ ```
24
+ Plan → Architecture → Tasks → Implementation
25
+ ```
26
+
27
+ **Plan** = What the user actually asked for, restated in 1-3 sentences. List of touched files. Open questions surfaced.
28
+
29
+ **Architecture** = How it fits the existing system (data flow, dependency direction, no new layers without justification).
30
+
31
+ **Tasks** = Ordered list with stop conditions. Each task is independently committable.
32
+
33
+ **Implementation** = Code edits + tests + docs sync, in the same turn.
34
+
35
+ ### 1.1 When to write a `.plan.md`
36
+
37
+ | Scope | `.plan.md` required? |
38
+ |---|---|
39
+ | Trivial (rename, copy edit) | No |
40
+ | Simple (1-2 files, established pattern) | No |
41
+ | Medium (3+ files, new behavior) | Yes |
42
+ | Large (cross-cutting, new system) | Yes — and reviewer agent validates before implementation |
43
+
44
+ ### 1.2 Why this rule exists (origin)
45
+
46
+ The originating project counted **6+ violations** of this order during early production work. Each violation produced rework (wrong file touched, missed test, broken dependency). The rule was promoted to ABSOLUTE after the 6th catch.
47
+
48
+ ### 1.3 Pre-implementation checklist (orchestrator self-check)
49
+
50
+ Before any tool call that writes code:
51
+
52
+ - [ ] Plan stated to user (1-3 sentences) or `.plan.md` exists.
53
+ - [ ] Architecture verified against existing patterns (no new layers added unintentionally).
54
+ - [ ] Task list visible (TodoWrite or inline numbered list).
55
+ - [ ] Stop condition for current task is explicit.
56
+
57
+ If any box is unchecked → STOP, complete the missing step, then proceed.
58
+
59
+ ---
60
+
61
+ ## 2. Docs-First for Ad-Hoc Work (W2)
62
+
63
+ Work that arrives outside the active plan (user requests, bug reports, suggestions) MUST be logged in `docs/CURRENT_WORK.md` BEFORE implementation begins, not after.
64
+
65
+ ### 2.1 Decision tree
66
+
67
+ ```
68
+ Is the request part of the active plan?
69
+ ├─ Yes → implement → push → docs sync (in-turn)
70
+ └─ No → docs/CURRENT_WORK.md update FIRST (one-line entry)
71
+ → implement
72
+ → push
73
+ → docs sync (specs + CURRENT_WORK status)
74
+ ```
75
+
76
+ ### 2.2 What goes in CURRENT_WORK.md
77
+
78
+ - One-line description of the new ad-hoc task.
79
+ - Source (user message, error report, observation).
80
+ - Status: `In Progress` / `Blocked` / `Done`.
81
+ - Owner: `orchestrator` / `<role>` / `user`.
82
+
83
+ The point: an outside observer (or the orchestrator at session resume) can see what surfaced today and where it stands without reading the chat history.
84
+
85
+ ---
86
+
87
+ ## 3. The 7-Step Workflow (W4)
88
+
89
+ For any feature / bug / chore that produces a commit, all 7 steps MUST occur in order:
90
+
91
+ 1. **Plan** — restate request, list files.
92
+ 2. **Architecture** — verify fit with existing system.
93
+ 3. **Tasks** — ordered list with stop conditions.
94
+ 4. **Execute** — code edits with same-turn spec updates.
95
+ 5. **Test** — run quality gates (`quality-gates.md`).
96
+ 6. **Push** — commit + push (or PR per branch strategy).
97
+ 7. **Docs** — sync CURRENT_WORK + relevant specs + plans.
98
+
99
+ If a step fails, the workflow does NOT skip to the next step. The orchestrator stops, fixes, then continues. Even if step 6 fails (e.g., CI red), step 7 still updates docs to record the failure.
100
+
101
+ ---
102
+
103
+ ## 4. Process Over Speed (W5)
104
+
105
+ User shortcut phrases ("just do it", "go ahead", "fast", "skip", "quickly") DO NOT grant permission to skip workflow steps. They grant permission to PROCEED at the next decision point — they do not retroactively waive Plan-First or Docs-First.
106
+
107
+ If the user request is ambiguous about scope or destination, the orchestrator MUST consult the ambiguity policy in `meta-discipline.md` (AMB triggers) and ASK rather than guess.
108
+
109
+ ### 4.1 The "discipline over willpower" principle
110
+
111
+ The 6+ violations of W1 happened because the orchestrator interpreted "let's go" as a license to skip the plan. The corrective rule:
112
+
113
+ > **Discipline is a system, not willpower.** When ambiguous, ASK. The system must produce the right behavior even when the operator is tired or rushed.
114
+
115
+ This is not a soft suggestion. The orchestrator that catches itself about to skip a step is REQUIRED to fix course (see W6).
116
+
117
+ ---
118
+
119
+ ## 5. ABSOLUTE Rules Never Skip (W6)
120
+
121
+ No user instruction grants exemption from rules marked `severity: ABSOLUTE` in any universal-rule frontmatter. This includes:
122
+
123
+ - Pre-commit / pre-merge code review (`quality-gates.md`).
124
+ - Spec-as-you-go updates (`spec-as-you-go.md`).
125
+ - Test coverage sync (`quality-gates.md`).
126
+ - Framework originality (`meta-discipline.md`).
127
+ - Plan-first / docs-first / process-over-speed (this file).
128
+
129
+ If the orchestrator realizes mid-turn that an ABSOLUTE rule was skipped, the orchestrator MUST:
130
+
131
+ 1. Stop the current action.
132
+ 2. Surface the violation in the next user-facing message ("I broke W3 — I committed without updating the spec. Fixing now.").
133
+ 3. Repair the gap.
134
+ 4. Continue.
135
+
136
+ Silent recovery (fixing without acknowledging) is WORSE than explicit acknowledgment. The user needs visibility into rule failures so they can intervene if the recovery itself is wrong.
137
+
138
+ ### 5.1 Origin
139
+
140
+ Production case: a PR was merged with the pre-merge code review skipped. The orchestrator told the user it was done, did not mention the skip, and the user caught it manually two days later. The corrective rule made silent skip equally serious as the original violation.
141
+
142
+ ---
143
+
144
+ ## Cross-tool enforcement
145
+
146
+ | Mechanism | Tools that support it natively |
147
+ |---|---|
148
+ | Stop hook (auto-injects reminder when CURRENT_WORK is stale) | Claude Code |
149
+ | PreToolUse hook (blocks invalid sub-agent dispatch) | Claude Code |
150
+ | File-glob rule scoping (`paths:` / `globs:` / `applyTo:`) | Claude Code, Cursor, Copilot, Windsurf (dir-based) |
151
+ | Rule text + LLM self-discipline | All tools |
152
+
153
+ On tools without hook support, this file's text IS the enforcement. The `linked_rules` frontmatter and the cross-references (W6 → meta-discipline.md AMB triggers) keep the chain navigable manually.
@@ -0,0 +1,134 @@
1
+ # PHASES — detailed entry/exit criteria per workflow phase
2
+
3
+ > **Status (P0 foundation): PLACEHOLDER.** This file describes intent and structure. P1 fills each phase section with concrete content sanitized from the reference adopter.
4
+
5
+ ## How to read this file
6
+
7
+ For each of the 6 phases (Plan / Architecture / Tasks / Implementation / Review / Spec), the same template:
8
+
9
+ ```
10
+ ### [Phase name]
11
+
12
+ **Trigger**: what user request or upstream phase entry produces this phase.
13
+ **Owner**: who carries the work (orchestrator / specialized agent persona / human).
14
+ **Inputs**: artifacts that MUST exist before entering.
15
+ **Outputs**: artifacts produced before exit.
16
+ **Entry criteria**: bullet list — all must be true to enter.
17
+ **Exit criteria**: bullet list — all must be true to advance.
18
+ **Anti-patterns**: things people do wrong; how to recognize and recover.
19
+ **Tool-specific notes**: callouts for Claude / Cursor / others where mechanism differs.
20
+ ```
21
+
22
+ ---
23
+
24
+ ## 1. PLAN
25
+
26
+ **Trigger**: medium+ scope request.
27
+
28
+ **Owner**: orchestrator (Claude main session) or human (other tools).
29
+
30
+ **Inputs**: user request, prior context (`docs/CURRENT_WORK.md`).
31
+
32
+ **Outputs**: `.plan.md` describing approach, files affected, risks, stop condition.
33
+
34
+ **Entry criteria** (P1 fill):
35
+ - Request scope assessed (Trivial / Simple / Medium / Large).
36
+ - If Trivial / Simple → SKIP this phase, go to Tasks.
37
+
38
+ **Exit criteria** (P1 fill):
39
+ - `.plan.md` exists with ≥ N sections.
40
+ - Reviewer-eligible (medium → human ack; large → reviewer agent ack).
41
+
42
+ **Anti-patterns** (P1 fill).
43
+
44
+ ---
45
+
46
+ ## 2. ARCHITECTURE
47
+
48
+ **Trigger**: large scope work that affects system-level shape (auth flow, data model, billing).
49
+
50
+ **Owner**: strategist agent (Claude) or human (other tools).
51
+
52
+ **Inputs**: `.plan.md`.
53
+
54
+ **Outputs**: ADR(s) under `docs/architecture/`; updated system diagram.
55
+
56
+ **Entry / exit / anti-patterns**: P1 fill.
57
+
58
+ ---
59
+
60
+ ## 3. TASKS
61
+
62
+ **Trigger**: plan approved (medium+) OR direct request (simple).
63
+
64
+ **Owner**: orchestrator (Claude) or human.
65
+
66
+ **Inputs**: `.plan.md` (medium+) or request alone (simple).
67
+
68
+ **Outputs**: enumerated task list with: objective, file paths, constraints (`must_do`, `must_not_do`), output paths, stop condition.
69
+
70
+ **Entry / exit / anti-patterns**: P1 fill.
71
+
72
+ ---
73
+
74
+ ## 4. IMPLEMENTATION
75
+
76
+ **Trigger**: tasks ready.
77
+
78
+ **Owner**: builder / helper / designer / mailer / translator / scribe agent (Claude) or human.
79
+
80
+ **Inputs**: task list.
81
+
82
+ **Outputs**: code + e2e test updates per task.
83
+
84
+ **Entry / exit / anti-patterns**: P1 fill (will include "one task per agent", "no general-purpose agent", "model override per R2").
85
+
86
+ ---
87
+
88
+ ## 5. REVIEW
89
+
90
+ **Trigger**: implementation task complete.
91
+
92
+ **Owner**:
93
+ - Stage A: code-reviewer agent (Claude) or human (other tools).
94
+ - Stage B: `/code-review` slash command (Claude + Cursor partial) or human (other tools).
95
+
96
+ **Inputs**: git diff (Stage A) or open PR (Stage B).
97
+
98
+ **Outputs**: reviewer report; either pass-through or block-on-issues.
99
+
100
+ **Entry / exit / anti-patterns**: P1 fill (will include "block on HIGH-confidence ≥75 issues", "specialized reviewer agents per change kind").
101
+
102
+ ---
103
+
104
+ ## 6. SPEC
105
+
106
+ **Trigger**: implementation merged.
107
+
108
+ **Owner**: scribe agent (Claude) or human.
109
+
110
+ **Inputs**: shipped code; existing `docs/specs/<area>.md`.
111
+
112
+ **Outputs**: updated spec reflecting actual shipped behavior.
113
+
114
+ **Entry / exit / anti-patterns**: P1 fill (will include "spec-as-you-go ABSOLUTE", "Stop hook enforcement on Claude", "rule reminder on others").
115
+
116
+ ---
117
+
118
+ ## Phase scaling reminder
119
+
120
+ | Scope | Phases entered | Notes |
121
+ |---|---|---|
122
+ | Trivial | 4, 5, 6 | Skip Plan + Architecture + Tasks. |
123
+ | Simple | 3, 4, 5, 6 | Skip Plan + Architecture. |
124
+ | Medium | 1, 3, 4, 5, 6 | Skip Architecture. |
125
+ | Large | 1, 2, 3, 4, 5, 6 | Full ceremony. |
126
+
127
+ ## Tool-agnostic enforcement reminder
128
+
129
+ Workflow definition is universal. Enforcement degrades:
130
+
131
+ - **Claude Code**: Stop hooks can block phase-skipping at commit time (e.g., no `.plan.md` for medium+ → blocked).
132
+ - **Cursor / Copilot / Gemini / Codex / Windsurf**: rule text reminds. Self-policed.
133
+
134
+ See `docs/COMPATIBILITY-MATRIX.md` for the per-tool enforcement column.
@@ -0,0 +1,56 @@
1
+ # `core/workflow/` — Universal workflow definition
2
+
3
+ The Plan → Architecture → Tasks → Implementation → Review → Spec workflow that every CONDUCTOR project follows, regardless of which AI coding tool drives it.
4
+
5
+ ## The 6 phases
6
+
7
+ ```
8
+ Request
9
+
10
+ 1. PLAN — clarify intent + write .plan.md (medium+ scope only)
11
+
12
+ 2. ARCHITECTURE — system-level shape, ADRs, contracts (large scope only)
13
+
14
+ 3. TASKS — break plan into discrete tasks with file paths + stop conditions
15
+
16
+ 4. IMPLEMENTATION — execute one task at a time, delegated when possible
17
+
18
+ 5. REVIEW — Stage A pre-commit + Stage B pre-merge PR
19
+
20
+ 6. SPEC — update docs/specs/* to reflect what shipped
21
+ ```
22
+
23
+ ## Phase scaling by scope
24
+
25
+ Not every change goes through all 6 phases. Scale the workflow to scope:
26
+
27
+ | Scope | Files | Phases entered | Review checkpoint |
28
+ |---|---|---|---|
29
+ | Trivial | 1 | 4, 5, 6 | None |
30
+ | Simple | 1-2 | 3, 4, 5, 6 | None |
31
+ | Medium | 3-10 | 1, 3, 4, 5, 6 | Plan → Implement → Review |
32
+ | Large | 10+ | 1, 2, 3, 4, 5, 6 | Architecture → Plan → Implement → Review |
33
+
34
+ ## What lives here
35
+
36
+ - `PHASES.md` — detailed entry/exit criteria per phase. (P1: filled with full content derived from the reference adopter's workflow.)
37
+ - (future) `templates/` — phase output templates (`.plan.md` skeleton, ADR skeleton).
38
+
39
+ ## Tool-agnostic enforcement
40
+
41
+ The workflow itself is tool-agnostic. Enforcement varies:
42
+
43
+ - **Claude Code**: Stop hook can verify a `.plan.md` exists for medium+ scope tasks before allowing commits.
44
+ - **Cursor / Copilot / Gemini / Codex / Windsurf**: rule text reminds the user; enforcement is self-policed.
45
+
46
+ Adapter outputs all reference these phase definitions but the *mechanism* of enforcement is per-tool (see `docs/COMPATIBILITY-MATRIX.md`).
47
+
48
+ ## Why 6 phases (not fewer / more)
49
+
50
+ - Fewer than 6 (collapse Tasks into Implementation) loses the explicit "what files, in what order" artifact that prevents scope creep mid-implementation.
51
+ - More than 6 (separate Verification phase, etc.) adds ceremony users will skip.
52
+ - The 6 phases match the natural rhythm of a feature, refactor, or bug fix at solo / small-team scale.
53
+
54
+ ## Status (P0 foundation)
55
+
56
+ `PHASES.md` is a placeholder. P1 fills it with detailed entry/exit criteria, examples, and anti-patterns to avoid per phase.