ownership-partitioning
Hard write-partitioning rules for parallel agents when pipeline.parallel_allowed=true. Defines glob-based file ownership, conflict detection, and orchestrate.py ownership-check integration. Prevents concurrent agents from writing the same files.
- License 许可
- MIT
- 最近更新
- 2026-07-25
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- ownership-partitioning
- metadata
- { "tier": 1, "source": "internal", "version": "1.0.0" }
- use-when
- Load for unity-dev and data-tool agents when pipeline.json.parallel_allowed=true. Load whenever the architect has written workspace/ownership.lock.json to partition files.
- platforms
- [ "claude-code", "codex", "copilot", "cursor", "windsurf" ]
- description
- Hard write-partitioning rules for parallel agents when pipeline.parallel_allowed=true. Defines glob-based file ownership, conflict detection, and orchestrate.py ownership-check integration. Prevents concurrent agents from writing the same files.
- do-not-use-when
- Do not load for sequential pipelines (parallel_allowed=false). Do not load for triage, architect, tester, or verifier roles. Unnecessary when only one writer exists.
- task-categories
- [ "architecture", "parallel", "ownership", "refactor" ]
03 SKILL.md 正文
Ownership Partitioning
This skill is loaded into every writer agent (unity-dev, data-tool) whenever
pipeline.json.parallel_allowed == true. It is enforced at runtime by
orchestrate.py ownership-check.
Source of Truth
workspace/ownership.lock.json. Format:
{
"partitions": {
"unity-dev": ["Assets/Scripts/Combat/**", "Assets/Scripts/Movement/**"],
"data-tool": ["Assets/Editor/Combat/**", "Assets/Configs/Combat/**"]
},
"shared_read_only": ["ProjectSettings/**", "Packages/**"],
"forbidden": ["Assets/Plugins/**"],
"rationale": "Combat refactor — runtime vs tooling are disjoint"
}
Globs are repo-root-relative, POSIX-style (use /, not \). ** matches any
number of path segments.
Rules
-
You may only write to files matching one of YOUR partition globs. Writing to another agent's partition is a hard violation.
-
shared_read_onlyfiles may be read by anyone but NEVER written this session. If you genuinely need to change one, escalate. -
forbiddenfiles must not be touched at all (typically generated code, third-party plugins, lockfiles). -
Before signaling the next phase, run the check explicitly:
python .claude/scripts/orchestrate.py ownership-check <your-agent-name> \ Assets/Scripts/Combat/Health.cs Assets/Scripts/Combat/Damage.csNon-zero exit means you have a violation. Roll back that file and re-run.
Architect Responsibilities
For large / critical complexity, the architect writes
workspace/ownership.lock.json as part of the approved_plan.json phase. The
partition must:
- Have non-overlapping globs across agents
- Cover every file the plan expects to change
- Not include
shared_read_onlypaths inside any partition
The orchestrate.py gate refuses to enter the implementation phase if
ownership.lock.json is missing for any plan with parallel_allowed=true.
Triage Responsibilities
For tiny / small / medium complexity with a single writer, triage may
either (a) omit ownership.lock.json entirely (unrestricted single writer), or
(b) write a single-agent partition to lock the writer to a known glob.
If data-tool is in the pipeline at any complexity, triage MUST partition.
Otherwise data-tool and unity-dev may both edit the same files.
Failure Mode
If your edits violated the partition and you only discover it post-hoc:
- Revert the offending edits via git.
- Write
[ESCALATE: ownership violation in <files>]to your impl_result.json. - Do NOT request a partition expansion mid-implementation. The architect re-issues the plan with a wider partition if justified.
Anti-Patterns
- Editing a file because "it looked related" but it is outside your partition
- Reading
ownership.lock.jsonand assuming silence means "I can write here" - Touching
shared_read_onlyfiles (config, settings, manifests) - Editing both your partition AND another agent's, then claiming parallel execution was fine because there were no merge conflicts in this run
04 同仓库更多 Skills
dots-update-groups
How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup / SimulationSystemGroup / PresentationSystemGroup / FixedStepSimulationSystemGroup / VariableRateSimulationSystemGroup, UpdateBefore / UpdateAfter peer ordering, OrderFirst / OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing "value visible one frame late" bugs, or coupling simulation to a fixed timestep.
dots-transform-patterns
The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent/Child hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent/child hierarchies, runtime reparenting (mount/dismount/socket), or choosing transform components at the Baker boundary.
dots-singleton-patterns
Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton / GetSingletonRW / HasSingleton / TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the "exactly one entity" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.
dots-hybrid-bridge
The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes / Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input/UI must trigger ECS work.
dots-event-driven-ecs
Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event / UnityEvent / static bus anti-patterns. Use when input/UI/network must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.
valid_skill
A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.