AGENT SKILL

author-decision-mapping

v4 sub-skill #3. Adds the `decisions:` block to the brief and emits one Cypher precedent-query file per HITL phase under `api/server/services/precedent_queries/<workflow_type>_<phase>.cypher`.

License 许可
MIT
最近更新
2026-09-28
Stars
★ 1
Forks
2

01 前言 Front Matter

name
author-decision-mapping
inputs
[ { "brief.phases (kind": "hitl entries)" }, "brief.entities (so decided_on_entities can resolve)" ]
outputs
[ "brief.decisions", "<sandbox>/api/server/services/precedent_queries/<wt>_<phase>.cypher" ]
audience
design-time-only
description
v4 sub-skill #3. Adds the `decisions:` block to the brief and emits one Cypher precedent-query file per HITL phase under `api/server/services/precedent_queries/<workflow_type>_<phase>.cypher`.
hands_off_to
author-function-membership
forbidden-runtime
true

02 资源文件 3

03 SKILL.md 正文

author-decision-mapping

This sub-skill encodes the persona-precedent contract: every HITL phase that wants to surface "what did this persona decide last time on a similar entity?" gets a Cypher template that the Phase 3 persona reasoning loop will run with bind params $entity_id and $limit.

Procedure

  1. Read the v1 brief (now carrying entities).

  2. Propose decisions:. One entry per HITL phase that should record a precedent. Schema:

    decisions:
      - phase: <hitl-phase-name>             # must exist in phases & be kind: hitl
        persona: <role>                      # must exist in api/server/personae/
        source_event: <FleetEvent type>      # default: workflow.hitl.requested
        decided_on_entities: [payload.X.id]  # optional refs from entities[]
        attributes_from_context:             # optional context map for Decision.attributes
          <key>: payload.<path>
    
  3. Validate. Run validator.py:validate(brief, ...). STOP on SchemaError.

  4. Render. For each decision, call codegen.render_cypher(brief, decision). Write each to <sandbox>/api/server/services/precedent_queries/<workflow_type>_<phase>.cypher.

  5. Hand off to author-function-membership.

Cypher template (replicated from blueprint §10 decision #4)

// Auto-generated by compose-domain v4 author-decision-mapping codegen.
MATCH (d:Decision)-[:DECIDED_ON]->(e {id: $entity_id})
WHERE d.persona_role = '<persona>'
  AND d.workflow_type = '<workflow_type>'
RETURN d
ORDER BY d.decided_at DESC
LIMIT $limit

The persona reasoning loop binds $entity_id from the current workflow's entity ref and $limit from the per-call cap.

Constraints

  • Exactly one decision per HITL phase (the dedupe triple (workflow_id, phase, persona_role) is enforced by Phase 1's reflector).
  • Persona names must reference an existing folder under api/server/personae/.
  • source_event defaults to workflow.hitl.requested when omitted.

04 同仓库更多 Skills