初始化 Makelore 项目协作文档

需求:为客户端修复任务建立独立 worktree 所有权与项目记忆门禁。

实现:引入标准 .project-docs 模板,不修改现有客户端业务代码。
This commit is contained in:
2026-08-06 12:44:55 +08:00
parent 15b17775cb
commit 929b124852
34 changed files with 627 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Concurrent Task Gate
Complete this gate before the Planning Gate.
## Invariants
- One active task owns one worktree.
- Concurrent tasks use different branches and worktrees.
- Never stash, reset, move, delete, or adopt unknown work automatically.
- Feature tasks write only their own task record and uniquely named supporting records.
## Required Output
- Task ID:
- Mode: Feature | Integration
- Branch:
- Worktree:
- Base commit:
- Ownership result: Claimed | Resumed | Isolated | Blocked
- Other active local tasks:
## Block Conditions
- The worktree belongs to another active task and isolation did not succeed.
- An unowned worktree contains staged, unstaged, or untracked changes.
- No reliable committed base was selected for a new worktree.
- The runtime cannot keep later Git and file operations rooted in the isolated worktree.

View File

@@ -0,0 +1,15 @@
# Context Checklist
Before planning, confirm:
- I know the task ID, mode, branch, worktree, base commit, and ownership result.
- I read the active task record and know its scope.
- I know what this project is and what it is not.
- I treat current-state as the last integrated snapshot rather than live concurrent state.
- I checked active decisions and the architecture overview.
- I identified task-specific docs that need deeper reading.
- I inspected other local task records through `task_context.py status --json`.
- I assessed code overlap separately from semantic or decision conflict.
- I reported missing peer records as unknown coordination state.
- I can name unknown, stale, or conflicting information.
- I know which updates remain task-scoped and which require Integration Gate.

View File

@@ -0,0 +1,14 @@
# Integration Gate
Use this gate to promote completed task facts into canonical project memory.
## Requirements
- Run in an exclusively owned integration worktree.
- Hold the repository integration lock.
- Verify the task commits being integrated are present.
- Review task promotion candidates and semantic conflicts.
- Ask before changing architecture direction, product behavior, or accepted decisions.
- Record source task or merge commits under `Integrated Through` in `current-state.md`.
Do not resolve meaningful document conflicts with `ours`, `theirs`, or union merge rules.

View File

@@ -0,0 +1,23 @@
# Memory Index
Use this as the high-density entry point after the Concurrent Task Gate establishes task identity and worktree ownership.
## Startup Set
- Active task: `.project-docs/30-worklog/tasks/{task_id}.md`
- Project identity: `.project-docs/00-brief/project-positioning.md`
- Integrated state: `.project-docs/30-worklog/current-state.md`
- Decision list: `.project-docs/10-decisions/decision-index.md`
- System shape: `.project-docs/20-architecture/system-overview.md`
## Recall Pointers
- Evidence-heavy bugs, experiments, investigations: `.project-docs/50-evidence/evidence-index.md`
- Workflow lessons and repeated agent mistakes: `.project-docs/60-reflection/reflection-index.md`
- Pending promises, loops, timed follow-ups: `.project-docs/80-commitments/commitments.md`
- Integrated stale items: `.project-docs/90-maintenance/stale-items.md`
- Task-scoped conflicts: `.project-docs/90-maintenance/conflicts/{task_id}-<slug>.md`
## Loading Rule
Keep this file short. Add shared pointers only during Integration Gate. Feature tasks keep their working context and promotion candidates in their own task record.

View File

@@ -0,0 +1,66 @@
# Planning Gate
A coding agent must complete this gate after the Concurrent Task Gate and before writing an implementation plan.
## Peer Scope Check
Run `task_context.py status --json`. For each other owner, read only the peer task record at `Path(owner.worktree) / owner.task_record`. Use its `Scope`, `Intent And Constraints`, and `Promotion Candidates` sections to assess overlap.
Do not inspect or modify arbitrary uncommitted files in another task's worktree. Report a missing or unreadable peer record as unknown coordination state; do not silently treat it as no overlap. Code-path overlap alone is a warning. Block when semantic decisions conflict or unresolved overlap could change the plan.
## Required Output
```md
## Project Context Loaded
Task context:
- Task ID:
- Mode:
- Branch:
- Worktree:
- Base commit:
- Other active local tasks:
- Overlap or semantic-conflict assessment:
Read:
- {file path}
Relevant understanding:
- Project goal:
- Current integrated focus:
- Active task scope:
- Active constraints:
- Decisions affecting this task:
- Evidence, reflections, or commitments affecting this task:
- Files or modules likely involved:
- Unknowns, stale docs, or conflicts:
Gate result:
- Passed or Blocked
```
## Pass Criteria
The gate passes only when:
- task identity and worktree ownership are resolved
- the active task record exists and matches the owner task ID
- required documents were read
- task-relevant decisions were checked
- relevant evidence, reflection, and commitment indexes were checked when applicable
- other active local task scopes were assessed
- stale, unknown, or conflicting context was called out
- the plan respects project positioning and constraints
## Block Criteria
Block planning when:
- worktree ownership is unresolved
- an unowned worktree is dirty and has not been explicitly adopted by a human
- required worktree isolation failed or later operations cannot remain rooted there
- required documents are missing or a concurrency upgrade is incomplete
- current integrated state conflicts with the user request
- an existing decision appears to be violated
- semantic decisions conflict across active tasks
- the task changes project positioning or architecture without human confirmation

View File

@@ -0,0 +1,7 @@
# Read Before Coding
Before editing code, verify that the implementation plan passed both the Concurrent Task Gate and Planning Gate. Confirm the task ID, branch, worktree, owner, and active task record still match.
If the plan is stale, ownership changed, or new peer scope affects the plan, return to `read-before-planning.md`. Keep every later file and Git operation rooted in the owned worktree.
Read the source files directly related to the target modules. Record feature progress, discovered constraints, verification, and promotion candidates in `.project-docs/30-worklog/tasks/{task_id}.md`; leave canonical project memory to Integration Gate.

View File

@@ -0,0 +1,24 @@
# Read Before Planning
Before writing any coding plan, follow this order:
1. Run the Concurrent Task Gate.
2. Read memory-index.md.
3. Read the active task record at `.project-docs/30-worklog/tasks/{task_id}.md`.
4. Read project-positioning.md.
5. Read current-state.md as the integrated snapshot.
6. Read decision-index.md and system-overview.md.
7. Inspect other locally active task scopes.
Then read additional files when relevant:
- Architecture or refactor task: `.project-docs/20-architecture/module-map.md` and `.project-docs/20-architecture/data-flow.md`
- Product or behavior task: `.project-docs/40-domain/business-rules.md` and `.project-docs/00-brief/success-criteria.md`
- Ambiguous terms: `.project-docs/40-domain/glossary.md`
- Decision-sensitive task: referenced accepted ADRs in `.project-docs/10-decisions/`
- Evidence-heavy bug, investigation, or experiment: `.project-docs/50-evidence/evidence-index.md`
- Repeated workflow issue, skipped gate, or skill/script candidate: `.project-docs/60-reflection/reflection-index.md`
- Follow-up, loop, timed check, or restart-point task: `.project-docs/80-commitments/commitments.md`
- Suspicious integrated context: `.project-docs/90-maintenance/stale-items.md`
Treat shared files as the last integrated snapshot, not as live state from concurrent feature tasks. Do not write a plan until both the Concurrent Task Gate and Planning Gate pass.