fix(harness): align workspace paths and best-practices mount target

- Mount best-practices context at /workspace/best-practices/ (was
  /opt/harness/context/best-practices/) for consistent agent access
- Fix /workspace/working/ → /workspace/project/ in all CLAUDE.md files
  (planning, spec-writing, security-review, code-methodology,
  qwen-code-methodology, test-writing)
- Update best-practices path references in all CLAUDE.md files to
  /workspace/best-practices/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-04-28 13:24:10 +12:00
parent b04f718530
commit c0758cbd71
7 changed files with 26 additions and 26 deletions

View File

@@ -7,4 +7,4 @@ provides: [best-practices]
context_files: context_files:
- source: ./best-practices/ - source: ./best-practices/
target: /opt/harness/context/best-practices/ target: /workspace/best-practices/

View File

@@ -4,21 +4,21 @@
Before starting any task: Before starting any task:
1. Check if `/best-practices/INDEX.md` exists 1. Check if `/workspace/best-practices/INDEX.md` exists
2. If it exists, read it to see available topics 2. If it exists, read it to see available topics
3. Identify relevant topics for the current task: 3. Identify relevant topics for the current task:
- Python task → read `test-driven-development.md`, `spec-driven-development.md` - Python task → read `test-driven-development.md`, `spec-driven-development.md`
- Kubernetes task → read `kubernetes.md` - Kubernetes task → read `kubernetes.md`
- Shell scripts → read `scripting.md` - Shell scripts → read `scripting.md`
4. Read the relevant topic files from `/best-practices/` 4. Read the relevant topic files from `/workspace/best-practices/`
5. Apply those practices to your work 5. Apply those practices to your work
If `/best-practices/` doesn't exist, proceed without — it's not mandatory. If `/workspace/best-practices/` doesn't exist, proceed without — it's not mandatory.
## Spec-Driven Development Workflow ## Spec-Driven Development Workflow
1. **Read the spec** — Read relevant files in `spec/` before writing any code 1. **Read the spec** — Read relevant files in `spec/` before writing any code
2. **Write tests first** — Create test cases from spec requirements before implementing (see `best-practices/test-driven-development.md` and `best-practices/spec-driven-development.md` if available) 2. **Write tests first** — Create test cases from spec requirements before implementing (see `/workspace/best-practices/test-driven-development.md` and `/workspace/best-practices/spec-driven-development.md` if available)
3. **Implement iteratively** — Build implementation to satisfy tests and spec 3. **Implement iteratively** — Build implementation to satisfy tests and spec
4. **Write session log** — Document what was accomplished, decisions made, and gotchas discovered 4. **Write session log** — Document what was accomplished, decisions made, and gotchas discovered

View File

@@ -4,7 +4,7 @@ You are a planning and specification agent. Your job is to produce high-quality
## Best Practices ## Best Practices
Read these before starting any planning task. They are mounted at `/opt/harness/context/best-practices/`: Read these before starting any planning task. They are mounted at `/workspace/best-practices/`:
| File | When to read | | File | When to read |
|---|---| |---|---|
@@ -22,8 +22,8 @@ Read at minimum the four "Always" files. Read others based on the task domain.
## Output Conventions ## Output Conventions
- **If `/workspace/working/` exists** (agent-repo mode): write output files directly into the working directory (e.g., `/workspace/working/spec/auth.md`). Edit existing files in place. Your changes will be auto-committed and pushed by the finalize script. - **If `/workspace/project/` exists** (agent-repo mode): write output files directly into the working directory (e.g., `/workspace/project/spec/auth.md`). Edit existing files in place. Your changes will be auto-committed and pushed by the finalize script.
- **If `/workspace/working/` does not exist**: write output to `/workspace/.agent-output/output.md` - **If `/workspace/project/` does not exist**: write output to `/workspace/.agent-output/output.md`
- Use structured markdown with clear section headings - Use structured markdown with clear section headings
- Number all requirements with a prefix (e.g., `WF-1`, `AU-1`) — each must be independently testable - Number all requirements with a prefix (e.g., `WF-1`, `AU-1`) — each must be independently testable
- Every requirement needs a "Why:" rationale - Every requirement needs a "Why:" rationale
@@ -41,7 +41,7 @@ Read at minimum the four "Always" files. Read others based on the task domain.
## Session Logging ## Session Logging
Write a brief session log to `/workspace/.agent-output/session-log.md` (or `/workspace/working/memory/log/` in agent-repo mode) with: Write a brief session log to `/workspace/.agent-output/session-log.md` (or `/workspace/project/memory/log/` in agent-repo mode) with:
- **Summary**: What was produced - **Summary**: What was produced
- **Key Decisions**: Design choices made and rationale - **Key Decisions**: Design choices made and rationale
- **Open Questions**: Anything that needs human input - **Open Questions**: Anything that needs human input

View File

@@ -41,13 +41,13 @@ If a directory or file does not exist where you expect it: do not debug the envi
## Best practices ## Best practices
This container has cross-project best practices mounted at `/opt/harness/context/best-practices/`. **For any non-trivial Python task, read the relevant topic file before writing code.** This container has cross-project best practices mounted at `/workspace/best-practices/`. **For any non-trivial Python task, read the relevant topic file before writing code.**
- `/opt/harness/context/best-practices/python-patterns.md` — Pydantic v2 validators, `threading.Lock` vs `RLock`, `extra='ignore'` silent drops, subprocess mocking, `model_validator`, packaging - `/workspace/best-practices/python-patterns.md` — Pydantic v2 validators, `threading.Lock` vs `RLock`, `extra='ignore'` silent drops, subprocess mocking, `model_validator`, packaging
- `/opt/harness/context/best-practices/test-driven-development.md` — for tasks that involve writing tests - `/workspace/best-practices/test-driven-development.md` — for tasks that involve writing tests
- `/opt/harness/context/best-practices/spec-driven-development.md` — when a `spec/` file is referenced - `/workspace/best-practices/spec-driven-development.md` — when a `spec/` file is referenced
- `/opt/harness/context/best-practices/security-architecture.md` — for anything touching auth, credentials, or external boundaries - `/workspace/best-practices/security-architecture.md` — for anything touching auth, credentials, or external boundaries
- `/opt/harness/context/best-practices/BESTPRACTICES.md` — index of all topics - `/workspace/best-practices/BESTPRACTICES.md` — index of all topics
## Python conventions (this codebase) ## Python conventions (this codebase)

View File

@@ -4,7 +4,7 @@ You are a security review agent. Your job is to audit code, specs, and infrastru
## Required Reading ## Required Reading
Before starting any review, read these from `/opt/harness/context/best-practices/`: Before starting any review, read these from `/workspace/best-practices/`:
| File | Priority | | File | Priority |
|---|---| |---|---|
@@ -49,7 +49,7 @@ Write your review to the working directory as `security-review.md` with:
## Session Logging ## Session Logging
Write a brief session log to `/workspace/.agent-output/session-log.md` (or `/workspace/working/memory/log/` in agent-repo mode) with: Write a brief session log to `/workspace/.agent-output/session-log.md` (or `/workspace/project/memory/log/` in agent-repo mode) with:
- **Summary**: What was reviewed, finding count by severity - **Summary**: What was reviewed, finding count by severity
- **Key Findings**: Top 3 most important findings - **Key Findings**: Top 3 most important findings
- **Open Questions**: Areas that need human judgment - **Open Questions**: Areas that need human judgment

View File

@@ -4,7 +4,7 @@ You are a specification writing agent. Your job is to produce detailed, testable
## Required Reading ## Required Reading
Before starting any spec, read these from `/opt/harness/context/best-practices/`: Before starting any spec, read these from `/workspace/best-practices/`:
| File | Priority | | File | Priority |
|---|---| |---|---|
@@ -43,10 +43,10 @@ Every spec must follow this structure:
## Output Conventions ## Output Conventions
- **If `/workspace/working/` exists** (agent-repo mode): write spec files to `/workspace/working/spec/<name>.md`. Edit existing specs in place. - **If `/workspace/project/` exists** (agent-repo mode): write spec files to `/workspace/project/spec/<name>.md`. Edit existing specs in place.
- **If `/workspace/working/` does not exist**: write to `/workspace/.agent-output/output.md` - **If `/workspace/project/` does not exist**: write to `/workspace/.agent-output/output.md`
- **NEVER write to `/workspace/spec/`** — that path is outside the git working tree and the file will not be committed. - **NEVER write to `/workspace/spec/`** — that path is outside the git working tree and the file will not be committed.
- **NEVER write to `/workspace/.agent-output/` when `/workspace/working/` exists** — that directory is gitignored. - **NEVER write to `/workspace/.agent-output/` when `/workspace/project/` exists** — that directory is gitignored.
- Use the project's existing requirement prefix convention if one exists - Use the project's existing requirement prefix convention if one exists
- Cross-reference other specs by filename when declaring dependencies - Cross-reference other specs by filename when declaring dependencies
@@ -54,9 +54,9 @@ Every spec must follow this structure:
Before writing your session log and exiting, run these checks: Before writing your session log and exiting, run these checks:
1. `ls /workspace/working/spec/<your-spec-file>.md` — confirm the file exists at the correct path 1. `ls /workspace/project/spec/<your-spec-file>.md` — confirm the file exists at the correct path
2. `cd /workspace/working && git status` — confirm the file appears as untracked or modified (not ignored) 2. `cd /workspace/project && git status` — confirm the file appears as untracked or modified (not ignored)
3. If the file does NOT appear in `git status`, you wrote it to the wrong path — move it to `/workspace/working/spec/` before exiting 3. If the file does NOT appear in `git status`, you wrote it to the wrong path — move it to `/workspace/project/spec/` before exiting
## What NOT to Do ## What NOT to Do
@@ -67,7 +67,7 @@ Before writing your session log and exiting, run these checks:
## Session Logging ## Session Logging
Write a brief session log to `/workspace/working/memory/log/<date>.<time>.md` (agent-repo mode) or `/workspace/.agent-output/session-log.md` (fallback) with: Write a brief session log to `/workspace/project/memory/log/<date>.<time>.md` (agent-repo mode) or `/workspace/.agent-output/session-log.md` (fallback) with:
- **Summary**: What specs were written/updated, requirement count - **Summary**: What specs were written/updated, requirement count
- **Key Decisions**: Design choices and rationale - **Key Decisions**: Design choices and rationale
- **Open Questions**: Anything that needs human input - **Open Questions**: Anything that needs human input

View File

@@ -4,7 +4,7 @@ You are a test writing agent. Your job is to write comprehensive tests from spec
## Required Reading ## Required Reading
Before starting any test work, read these from `/opt/harness/context/best-practices/`: Before starting any test work, read these from `/workspace/best-practices/`:
| File | Priority | | File | Priority |
|---|---| |---|---|