k-harness 0.9.1 → 0.9.2

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.
@@ -134,3 +134,19 @@ Apply these insights when creating the implementation plan. If the memory file i
134
134
  - All plans must include test tasks (no code without tests)
135
135
  - If a feature affects 5+ modules, flag as High Risk
136
136
  - If the plan exceeds one Sprint's worth of work, suggest splitting into sub-features
137
+
138
+ <!-- TEAM_MODE_START -->
139
+ ## Team Mode: Planning
140
+
141
+ ### Pre-Pull
142
+ Before reading or updating shared state files, run `git pull origin main`.
143
+
144
+ ### Owner-Aware Planning
145
+ - When assigning tasks, check docs/dependency-map.md Owner column to identify module ownership
146
+ - For features that cross module boundaries, identify all affected Owners and flag coordination needs
147
+ - Set Owner on new rows you create in docs/features.md and docs/dependency-map.md
148
+
149
+ ### Agent Memory
150
+ - Your personal docs/agent-memory/planner.md contains your individual estimation accuracy
151
+ - Team velocity estimates should be coordinated through sprint planning meetings, not derived from personal metrics alone
152
+ <!-- TEAM_MODE_END -->
@@ -157,3 +157,19 @@ When Step 8 (State File Audit) produces `[STATE-AUDIT]` flags:
157
157
  1. List all flagged items in the review output
158
158
  2. The `learn` skill (run at session end) will verify and resolve these flags
159
159
  3. If a flag is critical (missing module in dependency-map, unregistered feature), recommend fixing immediately rather than deferring to learn
160
+
161
+ <!-- TEAM_MODE_START -->
162
+ ## Team Mode: Review
163
+
164
+ ### Pre-Pull
165
+ Before running review, run `git pull origin main` to get the latest shared state files.
166
+
167
+ ### Owner-Scoped Audit
168
+ - **Step 6 (Feature Registry)**: only check that YOUR new features are registered — do not modify other developers' rows
169
+ - **Step 7 (Dependency Map)**: only check that YOUR new modules are registered — do not modify other developers' rows
170
+ - **Step 8 (State File Audit)**: verify that personal state files (docs/project-state.md, docs/failure-patterns.md, docs/agent-memory/) are updated; for shared files, only audit your own Owner rows
171
+
172
+ ### Cross-Owner Changes
173
+ - If your changes affect modules owned by other developers (check docs/dependency-map.md Owner), flag these as "⚠️ Cross-Owner Impact" in the review output
174
+ - Recommend getting the affected Owner's review before merging
175
+ <!-- TEAM_MODE_END -->
@@ -136,3 +136,20 @@ STATUS: DONE
136
136
  ## Related Failure Patterns
137
137
 
138
138
  - FP-003: Scope drift → Scope Check handler detects out-of-scope modifications and warns the user before proceeding
139
+
140
+ <!-- TEAM_MODE_START -->
141
+ ## Team Mode: Sprint Management
142
+
143
+ ### Personal vs Shared State
144
+ - Your sprint progress is tracked in personal docs/project-state.md
145
+ - Shared docs/features.md and docs/dependency-map.md reflect the entire team's work
146
+ - When reporting status, read BOTH personal and shared state for a complete picture
147
+
148
+ ### Scope Check with Ownership
149
+ - When checking scope, also verify the module's Owner in docs/dependency-map.md
150
+ - If work is being done on a module owned by another developer, flag it as a potential scope drift AND an ownership concern
151
+
152
+ ### Next Step Recommendation
153
+ - Consider other developers' active stories when recommending next steps
154
+ - If a dependency on another developer's work is detected, recommend coordination before proceeding
155
+ <!-- TEAM_MODE_END -->
@@ -163,3 +163,27 @@ When starting a NEW session (not during bootstrap), read these files in order:
163
163
  | Leave rules file TODOs unfilled | Phase 3.5 fills ALL TODO sections — no manual editing needed |
164
164
  | Use TypeScript globs for non-TS projects | Detect language in Phase 1 and set correct globs |
165
165
  | Only fill state files, skip rules | Bootstrap fills BOTH — state files AND rules files |
166
+
167
+ <!-- TEAM_MODE_START -->
168
+ ## Team Mode: Onboarding
169
+
170
+ When running bootstrap in Team mode:
171
+
172
+ ### New Project (first developer)
173
+ 1. Run `k-harness init --team` to create shared + personal state files
174
+ 2. Fill all state files via normal bootstrap procedure
175
+ 3. Commit shared files (docs/) to git
176
+ 4. Push to remote — teammates will clone this
177
+
178
+ ### Joining Developer (existing project)
179
+ 1. Clone the repository (shared docs/ already exist)
180
+ 2. Run `k-harness init --team` — only personal files (.harness/) are created; shared files are skipped
181
+ 3. **DO NOT re-run bootstrap interviews** — shared state is already filled by the first developer
182
+ 4. Review docs/project-brief.md to understand project goals
183
+ 5. Create your personal .harness/project-state.md with your current Story assignment
184
+
185
+ ### Rules
186
+ - **Never overwrite shared files** when joining an existing project
187
+ - Set your Owner name in docs/features.md and docs/dependency-map.md rows you create
188
+ - Personal state (.harness/) is yours alone — no coordination needed
189
+ <!-- TEAM_MODE_END -->
@@ -99,3 +99,20 @@ After completing the breakdown, update these files in the same session:
99
99
  - FP-001: Interface changed, mock not updated → When creating tasks that modify interfaces, include "Update mock" as an explicit sub-task
100
100
  - FP-002: Type confusion → When annotating tasks, specify expected types for new interfaces
101
101
  - FP-003: Scope drift → If the breakdown exceeds the current Story scope, stop and report
102
+
103
+ <!-- TEAM_MODE_START -->
104
+ ## Team Mode: Feature Breakdown
105
+
106
+ ### Pre-Pull
107
+ Before updating shared state files, run `git pull origin main` to get the latest docs/features.md and docs/dependency-map.md.
108
+
109
+ ### Owner Assignment
110
+ - When adding new rows to docs/features.md, set the Owner column to your name
111
+ - When adding new modules to docs/dependency-map.md, set the Owner column to your name
112
+ - Do NOT modify rows owned by other developers — if there is a dependency, note it in your task description instead
113
+
114
+ ### Cross-Developer Dependencies
115
+ If your feature depends on a module owned by another developer:
116
+ 1. Note the dependency in the task description (e.g., "Depends on [module] owned by [dev]")
117
+ 2. Coordinate with the module owner before implementation
118
+ <!-- TEAM_MODE_END -->
@@ -78,3 +78,16 @@ After completing the analysis, update these files:
78
78
 
79
79
  - FP-001: Interface changed, mock not updated → Checklist item 7 (mock/test updates planned)
80
80
  - FP-002: Type confusion across modules → Step 7 (trace each dependent, verify types)
81
+
82
+ <!-- TEAM_MODE_START -->
83
+ ## Team Mode: Impact Analysis
84
+
85
+ ### Owner-Aware Blast Radius
86
+ - When listing affected modules from docs/dependency-map.md, check the Owner column
87
+ - If a dependent module is owned by another developer, the blast radius extends to their scope
88
+ - Flag cross-owner impacts: "⚠️ Module [X] owned by [dev] will be affected"
89
+
90
+ ### Notification
91
+ - For interface changes affecting modules owned by other developers, **list them explicitly** in the analysis output
92
+ - Recommend notifying affected module owners before proceeding with changes
93
+ <!-- TEAM_MODE_END -->
@@ -89,3 +89,16 @@ After the fix is verified (Phase 4):
89
89
  - FP-001: Mock not updated → Phase 4 requires checking mock sync
90
90
  - FP-002: Type confusion → Phase 1 requires verifying actual types
91
91
  - FP-003: Scope drift → Phase 2 Scope Lock must verify fix is within current Story scope
92
+
93
+ <!-- TEAM_MODE_START -->
94
+ ## Team Mode: Investigation
95
+
96
+ ### Owner Awareness
97
+ - In Phase 2 (Scope Lock), check docs/dependency-map.md Owner column for the affected module
98
+ - If the root cause module is owned by another developer, **notify them** before applying a fix
99
+ - If the bug is in a shared module (no single Owner), document the fix in your PR description so the team can review
100
+
101
+ ### Personal State
102
+ - Record new failure patterns in your personal .harness/failure-patterns.md
103
+ - If the pattern affects the whole team, promote it (see learn skill Team Mode section)
104
+ <!-- TEAM_MODE_END -->
@@ -144,3 +144,21 @@ STATUS: DONE
144
144
  | Write vague descriptions ("something broke") | Be specific: file name, error message, root cause |
145
145
  | Skip this skill because "nothing went wrong" | Still update Quick Summary and Story Status |
146
146
  | Update docs/failure-patterns.md but not docs/project-state.md | Always update both — they serve different purposes |
147
+
148
+ <!-- TEAM_MODE_START -->
149
+ ## Team Mode: Session Wrap-up
150
+
151
+ ### Pre-Pull (mandatory before any shared file edit)
152
+ 1. Run `git pull origin main` before updating docs/features.md or docs/dependency-map.md
153
+ 2. If merge conflicts occur, resolve them BEFORE proceeding
154
+
155
+ ### Owner-Scoped Updates
156
+ - **docs/features.md**: only update rows where Owner = you
157
+ - **docs/dependency-map.md**: only update rows where Owner = you; if adding a new module, append at the bottom
158
+ - **Personal files** (.harness/project-state.md, .harness/failure-patterns.md, .harness/agent-memory/): update freely — no coordination needed
159
+
160
+ ### Failure Pattern Promotion
161
+ If a personal failure pattern (FP-NNN in .harness/failure-patterns.md) is likely to affect other developers:
162
+ 1. Discuss with the team (Slack, PR comment, etc.)
163
+ 2. If agreed, add it to a shared location (team wiki, PR description) so others can add it to their personal .harness/failure-patterns.md
164
+ <!-- TEAM_MODE_END -->
@@ -113,3 +113,22 @@ If `.harness/` directory exists (Team mode is active):
113
113
  3. Team lead runs pivot on main
114
114
  4. All developers pull main to get updated shared state files
115
115
  5. Each developer's `.harness/` personal state is unaffected (update manually if needed)
116
+
117
+ <!-- TEAM_MODE_START -->
118
+ ## Team Mode: Pivot Lock
119
+
120
+ ### Who Can Run Pivot
121
+ - **Only the team lead** runs pivot, and **only on the main branch**
122
+ - If you are not the team lead, propose the direction change to the team lead instead of running pivot yourself
123
+
124
+ ### Branch Check
125
+ Before running pivot, verify:
126
+ 1. You are on the `main` branch: `git branch --show-current` must return `main`
127
+ 2. Your working tree is clean: `git status` must show no uncommitted changes
128
+ 3. You have pulled the latest: `git pull origin main`
129
+
130
+ ### After Pivot
131
+ 1. Commit and push the updated shared files
132
+ 2. Notify all team members to run `git pull origin main`
133
+ 3. Each developer's personal .harness/ files are NOT auto-updated — developers should review the pivot changes and manually update their personal state if needed
134
+ <!-- TEAM_MODE_END -->
@@ -60,3 +60,11 @@ After completing the security check:
60
60
  ## Related Failure Patterns
61
61
 
62
62
  - FP-004: Dangerous file committed → Checklist items 2, 5 (no forbidden files, no temp files)
63
+
64
+ <!-- TEAM_MODE_START -->
65
+ ## Team Mode: Security
66
+
67
+ - Personal state files (.harness/) are gitignored — they cannot leak via git
68
+ - When committing shared config files (docs/), verify no team credentials or shared secrets are included
69
+ - If a security issue is found in a shared module, notify the module Owner before fixing
70
+ <!-- TEAM_MODE_END -->
@@ -68,3 +68,10 @@ After synchronizing mocks:
68
68
 
69
69
  - FP-001: Interface changed, mock not updated → Checklist item 2
70
70
  - FP-002: Type confusion → Step 5 return type verification
71
+
72
+ <!-- TEAM_MODE_START -->
73
+ ## Team Mode: Test Integrity
74
+
75
+ - If the interface you changed is owned by another developer (check docs/dependency-map.md Owner), notify them about the mock update requirement
76
+ - When updating shared test fixtures or mocks, run `git pull` first to avoid overwriting teammates' changes
77
+ <!-- TEAM_MODE_END -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k-harness",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "LLM Development Harness — IDE-agnostic rules, skills, and agents that prevent common AI coding failures",
5
5
  "keywords": [
6
6
  "llm",
package/src/init.js CHANGED
@@ -75,19 +75,31 @@ This project uses Team mode. State files are split into shared and personal.
75
75
  - **Personal** (.harness/, gitignored): project-state.md, failure-patterns.md, agent-memory/
76
76
 
77
77
  ### Rules
78
- 1. Shared files: only modify your own rows (check Owner column)
79
- 2. Other developers' Owner rows are READ ONLY
80
- 3. New rows go at the bottom of the table
81
- 4. The \`pivot\` skill must be run on the main branch by the team lead only
78
+ 1. **Pre-Pull**: before modifying any shared file (docs/), run \`git pull\` to get latest changes
79
+ 2. **Owner Column**: shared files use Owner columns only modify your own rows
80
+ 3. **Read-Only**: other developers' Owner rows are READ ONLY
81
+ 4. **Append-Only**: new rows go at the bottom of the table
82
+ 5. **Pivot Lock**: the \`pivot\` skill must be run on the main branch by the team lead only
83
+ 6. **FP Promotion**: if a personal failure pattern (FP-NNN) affects the team, promote it to a shared doc or team channel
82
84
  `;
83
85
 
84
86
  function resolveContent(content, mode) {
85
- if (mode !== 'team') return content;
87
+ if (mode !== 'team') {
88
+ // Solo mode: strip Team-only blocks entirely
89
+ return content.replace(/<!-- TEAM_MODE_START -->[\s\S]*?<!-- TEAM_MODE_END -->\n?/g, '');
90
+ }
86
91
  let result = content
87
92
  .replaceAll('docs/project-state.md', '.harness/project-state.md')
88
93
  .replaceAll('docs/failure-patterns.md', '.harness/failure-patterns.md')
89
94
  .replaceAll('docs/agent-memory/', '.harness/agent-memory/');
90
95
 
96
+ // Remove markers, keep Team content
97
+ result = result
98
+ .replaceAll('<!-- TEAM_MODE_START -->\n', '')
99
+ .replaceAll('<!-- TEAM_MODE_START -->', '')
100
+ .replaceAll('<!-- TEAM_MODE_END -->\n', '')
101
+ .replaceAll('<!-- TEAM_MODE_END -->', '');
102
+
91
103
  // Append Team Mode section to core-rules (detected by the heading)
92
104
  if (result.includes('## State Files') && result.includes('## Session Start')) {
93
105
  result += TEAM_MODE_SECTION;