一键导入
role-identity
Assemble a canonical role identity (P3 adapter per ADR-017 §2.1 Layer 3) for a dispatch — resolve a role name against the canonical roster (Directive
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Assemble a canonical role identity (P3 adapter per ADR-017 §2.1 Layer 3) for a dispatch — resolve a role name against the canonical roster (Directive
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | role-identity |
| description | Assemble a canonical role identity (P3 adapter per ADR-017 §2.1 Layer 3) for a dispatch — resolve a role name against the canonical roster (Directive |
Invoke tools/assemble-role.sh to obtain a canonical RoleIdentity for a named role — typically inside a dispatch-construction flow (e.g., authoring a dispatch contract) or for inspection of a role's canonical roster/tier classification.
Per ADR-017 §2.1 Layer 3 + plan §Phase 3 Task 3.4: assemble-role.sh is the P3 adapter bash primitive thin-wrapping python3 -m role_schema.cli assemble-role. The CLI subcommand resolves --role <name> against the canonical roster constants at tools/role_schema/ports/role_identity.py:39-62.
--role <name>; resolves against the canonical roster (Directive #10 + working-vocabulary + tier-overlay-only).RoleIdentity via the _assemble_role_identity helper (sets name, canonical_in, tier; iron_law / halt_criteria / sign_off_shape / dispatch_packet_template / traits default to empty per Task 3.4 DO Q3 disposition — per-role base file authoring is a follow-up scope per options.md §9.5).--include-traits, populates the traits[] field with all 11 on-disk standing-binding trait names sorted alphabetically (universal-traits read per options.md §9.5; identity-independent per Phase 2 Task 2.3).{
"assembled": true,
"role": "<role-name>",
"identity": {
"name": "<role-name>",
"canonical_in": "directive_10",
"tier": "T2",
"iron_law": [],
"halt_criteria": [],
"sign_off_shape": {},
"dispatch_packet_template": {},
"traits": [],
"collision_resolution": null
}
}
Field semantics (mirrors tools/role_schema/ports/role_identity.py:83-117):
assembled: boolean — true if the role is in the canonical roster; false otherwise (halts).role: echo of the input --role <name> for traceability.identity.canonical_in: T2 roster membership discriminator — "directive_10" (7 Appendix B §1.3 canonical roles), "working_vocabulary" (4 Annotation 1 + R-Q1a working-vocab roles), "extension" (HC#3a extension-hook roles), or null (tier-overlay-only roles; DO at T0).identity.tier: governance tier per Appendix B §1.1 — "T0" / "T1" / "T2".identity.iron_law / halt_criteria / sign_off_shape / dispatch_packet_template: empty by default; per-role base file authoring at tools/role_schema/roles/<name>.py is deferred to a follow-up task per options.md §9.5 design intent (Task 3.4 DO Q3 disposition).identity.traits: empty by default; populated with all 11 on-disk standing-binding trait names sorted when --include-traits is set (universal-traits read per options.md §9.5; identity-independent per Phase 2 Task 2.3).identity.collision_resolution: per-port collision-winner map for trait composition (null if no collisions expected).Per role_identity.py:39-62 + Task 3.4 DO Stage 1 Q1 disposition (plan L574 "2 tier-overlay roles" pre-finalization text reconciled to 1 per design comment at role_identity.py:57-59 — Orchestrator is in directive_10 only, not separately in tier_overlay_only):
tools/assemble-role.sh--role <name> (required; canonical role name from the 12 enumerated above)--include-traits (optional; populates traits[] with all 11 on-disk standing-binding trait names sorted)--json (machine-readable output; default behavior)--pretty (pretty-printed JSON via indent=2)-h / --help (usage){
"assembled": false,
"role": "<role-name>",
"violations": [
{
"halt_class": "halt-role-not-canonical",
"severity": "block",
"detail": "role '<role-name>' is not in any canonical roster (directive_10 + working_vocabulary + tier_overlay_only); 12 canonical role names available"
}
]
}
# Canonical Consigliere identity (T2, directive_10)
tools/assemble-role.sh --role Consigliere --pretty
# Architect identity with full trait set (11 universal traits)
tools/assemble-role.sh --role Architect --include-traits --pretty
# DO identity (T0, tier-overlay-only; canonical_in is null)
tools/assemble-role.sh --role DO --pretty
# Unknown role → halt-role-not-canonical (exit 1)
tools/assemble-role.sh --role NonexistentRole
halt-role-not-canonical (block): --role <name> is not in any canonical roster (directive_10 + working_vocabulary + tier_overlay_only); 12 canonical role names are available.Per-role base file authoring (per options.md §9.5 design intent; Task 3.4 DO Q3 disposition deferred):
The current _assemble_role_identity helper (cli.py:353-380) emits a MINIMAL RoleIdentity with empty iron_law / halt_criteria / sign_off_shape / dispatch_packet_template fields. options.md §9.5 L1003-1029 designs per-role base files at tools/role_schema/roles/<name>.py (e.g., roles/architect.py exporting ARCHITECT = RoleIdentity(name="Architect", iron_law=[...], halt_criteria=[...], ...)). These files were never authored in Phases 1-2; a follow-up task (filing as bd issue at Task 3.4 closure per DO Q3 disposition) will:
_assemble_role_identity to compose the role base with the registry rather than emit empty fieldsPer-dispatch trait narrowing (per options.md §9.5 L982): traits attach at role-injection per dispatch declaration; the --include-traits flag implements the universal-traits read (all 11 attach by default) — per-dispatch narrowing happens at dispatch-validate time via the contract's explicit traits: field. A --contract <path> flag on assemble-role (returning only contract-declared traits) is a future refinement.
tools/assemble-role.sh explicitly enumerated alongside the 4 other bash primitives).role: field).tools/role_schema/ports/role_identity.py (P3 port: RoleIdentity + IronLawClause + roster constants).tools/role_schema/traits/ (11 standing-binding trait modules; each exposes TRAIT: Trait constant).tools/role_schema/cli.py:assemble_role (Python implementation; this skill's underlying mechanism; sixth cli.py subcommand surface — completes plan §Task 1.8's enumerated 3 deferred subcommands).tools/dispatch-validate.sh (sibling primitive — pre-launch validation; uses the same _assemble_role_identity helper for tier-identification at validation time).Close a bd issue with structured rationale, evidence-path verification, worktree-owner lifecycle enforcement, and post-close verification. Idempotent.
Assemble a bdClosureAttestation JSON object (bd-close evidence shape — issueId/head/timestamp/evidenceBundle/evidencePaths/rationaleHash). This is DISTINCT from the canonical ADR-016 §6 closureAttestation (post-sign-off-correction) shape; see amnesia-pdqi.
Resolve P1 references per-class (Cerberus-aggregate; no halt-on-first) — invoke tools/validate-refs.sh to validate file_path / commit_sha / bd_id / adr_anchor / memory_binding citations against their named targets via the 5 per-class adapters at tools/role_schema/adapters/refs/. Returns full inventory of {resolved, violations, warnings}; exit 1 on any block-severity (STALE/NOT_FOUND/AMBIGUOUS for non-warn classes), exit 0 on all RESOLVED OR only warn-severity (bd_id STALE; memory ACTIVE_PENDING_CODIFICATION) per ADR-017 §2.4 + AC
Manage halt-condition state across a dispatch lifecycle (ARMED → CHECKED → FIRED → ATTESTED) per ADR-017 §2.4 — arm halts pre-flight via tools/halt-arm.sh (Task 3.2), query/fire mid-dispatch via tools/halt-check.sh (Task 3.3 TBD).
Validate a dispatch contract YAML against ADR-017 §2.2 canonical packet shape + P4 structural + P3 role-canonical + P1 reference resolution; emit conformance diagnostic for pre-launch gating.
Copy artifacts from a worktree to a main-tree archive directory with per-file sha256 verification.