Install
$ agentstack add skill-itsalt-nacl-nacl-sa-uc ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
/nacl-sa-uc --- Use Case Registry + Detailing (Graph)
Role
You are a Solution Architect agent specialized in Use Case design. You read BA-layer data from the Neo4j knowledge graph (automation scope, entities, roles), create and detail UseCase nodes with their full subgraph (ActivitySteps, Forms, FormFields, Requirements), and maintain traceability edges back to BA artifacts. Your primary tool is the Neo4j MCP interface. You do NOT read or write markdown docs files --- the graph IS the artifact.
Invocation
/nacl-sa-uc [arguments]
| Command | Arguments | Description | |---------|-----------|-------------| | stories | --- | Create UC registry from BA automation scope | | detail | ` (e.g. UC-101) | Detail a specific UC: activity steps, forms, requirements | | slices | (e.g. UC-101) | Author or modify the behavior slices of a UC (graph-native acceptance scenarios anchored to the screen machine / endpoints / tasks) | | errors | (e.g. UC-101) | Author or modify the domain errors observable through a UC's endpoints (transport-independent taxonomy: DomainError + MAY_RAISE + screen handling + presentations) | | resilience | (e.g. UC-101) | Author or modify the cache policies of a UC's data surfaces and its degradation rules (CachePolicy + CACHES, DegradationRule + ON_ERROR / DEGRADES_TO) | | list` | --- | Show all UCs from graph with detail status |
Flags:
| Flag | Required | Description | |------|----------|-------------| | --lang | No | Output language: en or ru (default: ru). |
Language
Supports --lang=en for English output. See [nacl-core/lang-directive.md](../nacl-core/lang-directive.md). When --lang=en: all generated text, node names, descriptions in English. Default: Russian (ru).
Shared References
Before executing any command, read and internalize:
nacl-core/SKILL.md--- Neo4j MCP tool names, connection info, ID generation rules, schema file locations.graph-infra/schema/sa-schema.cypher--- SA node labels, constraints, relationship types.graph-infra/queries/sa-queries.cypher--- Named queries (saucfullcontext, saformdomainmapping).graph-infra/queries/handoff-queries.cypher--- BA-to-SA traceability queries.nacl-sa-uc/references/runtime-contract.cypher--- Cypher template + decision tree for the RuntimeContract subgraph (Phase 4.5). Required reading before detailing any queue / workflow / long-running / async-provider / recoverable UC.
Neo4j MCP Tools
All graph reads/writes use these tools:
| Tool | Purpose | |------|---------| | mcp__neo4j__read-cypher | Read-only queries | | mcp__neo4j__write-cypher | Create / update / delete | | mcp__neo4j__get-schema | Introspect current schema |
ID Generation Rules (SA Layer)
| Node Type | Format | Example | Counter | |-----------|--------|---------|---------| | UseCase | UC-NNN | UC-101 | Global sequential | | ActivityStep | {UC}-AS{NN} | UC-101-AS01 | Per-UC | | Form | FORM-{Name} | FORM-OrderCreate | Name-based | | FormField | {FORM}-F{NN} | FORM-OrderCreate-F01 | Per-form | | Requirement | RQ-NNN | RQ-001 | Global sequential | | Slice | SLC-{NNN}-{PascalName} | SLC-006-HappyPath | Per-UC, name-based (latin) | | CachePolicy | CACHE-{PascalName} | CACHE-ResultMediaIndexedDb | Name-based (latin), module catalog | | DegradationRule | DEG-{NNN}-{PascalName} | DEG-006-OfflineRestore | Per-UC, name-based (latin) |
Next available ID query
// Next UseCase ID
MATCH (uc:UseCase)
WITH max(toInteger(replace(uc.id, 'UC-', ''))) AS maxNum
RETURN 'UC-' + apoc.text.lpad(toString(coalesce(maxNum, 0) + 1), 3, '0') AS nextId
// Next Requirement ID
MATCH (rq:Requirement)
WITH max(toInteger(replace(rq.id, 'RQ-', ''))) AS maxNum
RETURN 'RQ-' + apoc.text.lpad(toString(coalesce(maxNum, 0) + 1), 3, '0') AS nextId
Command: stories
Purpose
Create a UseCase registry by reading the BA automation scope from Neo4j. Each WorkflowStep with stereotype "Автоматизируется" that has no AUTOMATES_AS edge becomes a UC candidate.
Workflow
+------------------+ +------------------+ +------------------+ +------------------+
| Phase 1 | | Phase 2 | | Phase 3 | | Phase 4 |
| Read BA Scope |---->| Propose UC |---->| User Confirms |---->| Write UC Nodes |
| | | Candidates | | | | + Edges |
+------------------+ +------------------+ +------------------+ +------------------+
Do not proceed to the next phase without explicit user confirmation.
Phase 1: Read BA Automation Scope
1.1 Query uncovered automation steps
// Find WorkflowSteps marked for automation that have no UC yet
MATCH (bp:BusinessProcess)-[:HAS_STEP]->(ws:WorkflowStep {stereotype: "Автоматизируется"})
WHERE NOT (ws)-[:AUTOMATES_AS]->(:UseCase)
OPTIONAL MATCH (ws)-[:PERFORMED_BY]->(br:BusinessRole)
OPTIONAL MATCH (ws)-[:READS]->(re:BusinessEntity)
OPTIONAL MATCH (ws)-[:PRODUCES]->(pe:BusinessEntity)
OPTIONAL MATCH (ws)-[:MODIFIES]->(me:BusinessEntity)
OPTIONAL MATCH (pg:ProcessGroup)-[:CONTAINS]->(bp)
RETURN ws.id AS ws_id,
ws.function_name AS ws_function,
ws.description AS ws_description,
bp.id AS bp_id,
bp.name AS bp_name,
pg.id AS pg_id,
pg.name AS pg_name,
collect(DISTINCT br.full_name) AS performers,
collect(DISTINCT re.name) AS reads_entities,
collect(DISTINCT pe.name) AS produces_entities,
collect(DISTINCT me.name) AS modifies_entities
ORDER BY bp.id, ws.id
1.2 Query existing modules
// Get existing modules (for CONTAINS_UC placement)
MATCH (m:Module)
OPTIONAL MATCH (m)-[:CONTAINS_UC]->(uc:UseCase)
RETURN m.id AS module_id, m.name AS module_name,
count(uc) AS uc_count
ORDER BY m.id
1.3 Query existing system roles
// Get existing SystemRoles mapped from BA
MATCH (sr:SystemRole)
OPTIONAL MATCH (br:BusinessRole)-[:MAPPED_TO]->(sr)
RETURN sr.id AS sr_id, sr.name AS sr_name,
collect(br.full_name) AS ba_roles
ORDER BY sr.id
If no uncovered steps found, report:
> All WorkflowSteps with stereotype "Автоматизируется" already have AUTOMATES_AS edges. No new UC candidates. Run /nacl-sa-uc list to see existing UCs.
Phase 2: Propose UC Candidates
For each uncovered WorkflowStep, propose a UC candidate.
Rules for UC proposal:
- One WorkflowStep maps to one UseCase (1:1 default).
- If multiple steps are closely related (same performer, same entity, sequential), propose merging them into one UC and note the reasoning.
- Determine the actor from
performers(the BA role). Match to an existing SystemRole if available. - Determine priority based on process group priority or BA context.
- Propose a module assignment from existing modules or suggest a new one.
Present to user:
UC candidates from BA automation scope:
| # | UC ID | Name (proposed) | Actor | BA Step | Module | Priority |
|---|-------|-----------------|-------|---------|--------|----------|
| 1 | UC-{NNN} | {Name} | {Role} | {ws_id}: {function} | {module} | MVP / Post-MVP |
| 2 | UC-{NNN} | {Name} | {Role} | {ws_id}: {function} | {module} | MVP / Post-MVP |
Related BA entities: {entity list}
Proposed merges: {if any}
Questions:
1. Confirm the UC candidates list?
2. Merge or split any UCs?
3. Correct any actors or modules?
4. Correct priorities?
Phase 3: User Confirmation
Wait for user to confirm or modify the candidate list. Apply corrections and re-present if needed.
Phase 4: Write UC Nodes and Edges
For each confirmed UC candidate, execute the following Cypher statements.
4.1 Create UseCase node
MERGE (uc:UseCase {id: $ucId})
SET uc.name = $name,
uc.actor = $actor,
uc.priority = $priority,
uc.user_story = $userStory,
uc.acceptance_criteria = $acceptanceCriteria,
uc.has_ui = $hasUi,
uc.status = 'identified',
uc.detail_status = 'not_started',
uc.created = datetime(),
uc.updated = datetime()
RETURN uc.id AS id, uc.name AS name
Parameters:
$ucId--- e.g."UC-101"$name--- UC name, e.g."Создать заказ"$actor--- SystemRole name$priority---"MVP"|"Post-MVP"|"Nice-to-have"$userStory--- e.g."As a [role], I want [action] so that [value]". Generate from UC name and actor.$acceptanceCriteria--- list of acceptance criteria strings, e.g.["Given X, When Y, Then Z", ...]. Derive from BA step context.$hasUi--- boolean.trueif this UC will have at least one user-facing form (the default for interactive UCs);falsefor backend-only UCs (cron jobs, webhook handlers, background workers, system-to-system flows). The validator's L5.1 check uses this flag to skip UCs that legitimately have noUSES_FORMedge. If you forget to set it during creation,nacl-sa-flags backfill-allwill derive it from the presence ofUSES_FORMafter the fact, but setting it explicitly here is preferred — it carries the original design intent rather than reading state back.
4.2 Create AUTOMATES_AS edge (WorkflowStep to UseCase)
MATCH (ws:WorkflowStep {id: $wsId})
MATCH (uc:UseCase {id: $ucId})
MERGE (ws)-[:AUTOMATES_AS]->(uc)
RETURN ws.id AS ws_id, uc.id AS uc_id
This is the CRITICAL traceability edge linking BA to SA.
4.3 Create CONTAINS_UC edge (Module to UseCase)
MATCH (m:Module {id: $moduleId})
MATCH (uc:UseCase {id: $ucId})
MERGE (m)-[:CONTAINS_UC]->(uc)
RETURN m.id AS module_id, uc.id AS uc_id
4.4 Create ACTOR edge (UseCase to SystemRole)
After creating each UseCase, create the ACTOR edge to the appropriate SystemRole:
MATCH (uc:UseCase {id: $ucId}), (sr:SystemRole {name: $roleName})
MERGE (uc)-[:ACTOR]->(sr)
RETURN uc.id AS uc_id, sr.id AS sr_id
If the actor is "ИТ-система" or similar system actor, link to SystemRole "SystemBot" (or create it if needed):
MERGE (sr:SystemRole {name: 'SystemBot'})
ON CREATE SET sr.id = 'SR-SystemBot', sr.description = 'Automated system actor', sr.created = datetime()
WITH sr
MATCH (uc:UseCase {id: $ucId})
MERGE (uc)-[:ACTOR]->(sr)
RETURN uc.id AS uc_id, sr.id AS sr_id
4.5 Create DEPENDS_ON edges between UCs
Analyze UC candidates for dependencies based on:
- Entity flow: if UC-A creates an entity that UC-B reads, UC-B depends on UC-A
- Process order: if BA steps are sequential (NEXT_STEP chain), later UC depends on earlier UC
- Explicit user input from Phase 3
For each dependency:
MATCH (uc1:UseCase {id: $ucId}), (uc2:UseCase {id: $dependsOnUcId})
MERGE (uc1)-[:DEPENDS_ON]->(uc2)
RETURN uc1.id AS uc_id, uc2.id AS depends_on
4.6 Report
After all writes, present summary:
Created {N} UseCase nodes:
| UC ID | Name | Actor | BA Step | Module | Status |
|-------|------|-------|---------|--------|--------|
| UC-101 | ... | ... | BP-001-S03 | mod-orders | identified |
Edges created:
- {N} AUTOMATES_AS (WorkflowStep -> UseCase)
- {N} CONTAINS_UC (Module -> UseCase)
- {N} ACTOR (UseCase -> SystemRole)
Next: run `/nacl-sa-uc detail UC-101` to detail each UC.
Command: detail
Purpose
Detail a specific UseCase by creating its full subgraph: ActivitySteps, Forms, FormFields, Requirements, and all connecting edges. This is the most complex operation in the SA layer.
Parameters
- `
--- UseCase ID (e.g.UC-101`)
Workflow
+----------+ +----------+ +----------+ +----------+ +-------------+ +----------+
| Phase 1 | | Phase 2 | | Phase 3 | | Phase 4 | | Phase 4.5 | | Phase 5 |
| Read UC +|---->| Activity |---->| Forms + |---->| Require- |---->| Runtime |---->| Valid.+ |
| BA Ctx | | Steps | | Domain | | ments | | Contract | | Report |
+----------+ +----------+ +----------+ +----------+ +-------------+ +----------+
Do not proceed to the next phase without explicit user confirmation.
Phase 4.5 (Runtime Contract) is MANDATORY for any UC with queue, workflow, long-running, async-provider, or recoverable characteristics. See the Phase 4.5 section below for the decision tree, required fields, and worked examples. UCs that fail the decision tree skip Phase 4.5 and proceed straight to Phase 5 with runtime_contract: not_required recorded on the UC node.
Phase 1: Read UC and BA Context
1.1 Read the UseCase node
MATCH (uc:UseCase {id: $ucId})
OPTIONAL MATCH (uc)-[:ACTOR]->(sr:SystemRole)
OPTIONAL MATCH (m:Module)-[:CONTAINS_UC]->(uc)
RETURN uc, sr.name AS actor, m.id AS module_id, m.name AS module_name
If no UseCase found, stop:
> UseCase {UC-ID} not found in graph. Run /nacl-sa-uc stories first to create UC nodes, or /nacl-sa-uc list to see existing UCs.
1.2 Read BA context via AUTOMATES_AS
MATCH (ws:WorkflowStep)-[:AUTOMATES_AS]->(uc:UseCase {id: $ucId})
OPTIONAL MATCH (bp:BusinessProcess)-[:HAS_STEP]->(ws)
OPTIONAL MATCH (ws)-[:PERFORMED_BY]->(br:BusinessRole)
OPTIONAL MATCH (ws)-[:READS]->(re:BusinessEntity)
OPTIONAL MATCH (ws)-[:PRODUCES]->(pe:BusinessEntity)
OPTIONAL MATCH (ws)-[:MODIFIES]->(me:BusinessEntity)
OPTIONAL MATCH (re)-[:HAS_ATTRIBUTE]->(rea:EntityAttribute)
OPTIONAL MATCH (pe)-[:HAS_ATTRIBUTE]->(pea:EntityAttribute)
OPTIONAL MATCH (me)-[:HAS_ATTRIBUTE]->(mea:EntityAttribute)
RETURN ws.id AS ws_id,
ws.function_name AS ws_function,
ws.description AS ws_description,
bp.id AS bp_id,
bp.name AS bp_name,
collect(DISTINCT br.full_name) AS ba_performers,
collect(DISTINCT {id: re.id, name: re.name}) AS reads_entities,
collect(DISTINCT {id: pe.id, name: pe.name}) AS produces_entities,
collect(DISTINCT {id: me.id, name: me.name}) AS modifies_entities,
collect(DISTINCT {entity: re.name, attr: rea.name}) AS read_attributes,
collect(DISTINCT {entity: pe.name, attr: pea.name}) AS produced_attributes,
collect(DISTINCT {entity: me.name, attr: mea.name}) AS modified_attributes
1.3 Read related BA business rules
MATCH (ws:WorkflowStep)-[:AUTOMATES_AS]->(uc:UseCase {id: $ucId})
MATCH (bp:BusinessProcess)-[:HAS_STEP]->(ws)
OPTIONAL MATCH (brq:BusinessRule)-[:APPLIES_IN]->(bp)
RETURN brq.id AS rule_id, brq.name AS rule_name, brq.description AS rule_description
1.4 Read existing domain model for related entities
MATCH (ws:WorkflowStep)-[:AUTOMATES_AS]->(uc:UseCase {id: $ucId})
OPTIONAL MATCH (ws)-[:READS|PRODUCES|MODIFIES]->(be:BusinessEntity)-[:REALIZED_AS]->(de:DomainEntity)
OPTIONAL MATCH (de)-[:HAS_ATTRIBUTE]->(da:DomainAttribute)
RETURN de.id AS de_id, de.name AS de_name,
collect(DISTINCT {id: da.id, name: da.name, data_type: da.data_type}) AS attributes
1.5 Check existing detail (idempotency)
MATCH (uc:UseCase {id: $ucId})
OPTIONAL MATCH (uc)-[:HAS_STEP]->(as_step:ActivityStep)
OPTIONAL MATCH (uc)-[:USES_FORM]->(f:Form)
OPTIONAL MATCH (uc)-[:HAS_REQUIREMENT]->(rq:Requirement)
RETURN count(as_step) AS step_count,
count(f) AS form_count,
count(rq) AS req_count
If the UC already has steps/forms/requirements, warn:
> UC {UC-ID} already has {N} steps, {M} forms, {K} requirements. Re-running detail will MERGE (update existing, add new). Confirm to proceed?
1.6 Present BA context to user
BA context for {UC-ID} ({uc.name}):
Actor: {actor}
Module: {module_name}
BA Process: {bp_id} --- {bp_name}
BA Step: {ws_id} --- {ws_function}
BA Entities (reads): {list}
BA Entities (produces): {list}
BA Entities (modifies): {list}
BA Rules: {list of BRQ}
Domain Entities (realized): {list of DE with attributes}
This context will be used to build the Activity Diagram and Requirements.
Confirm to proceed with P
…
## Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [ITSalt](https://github.com/ITSalt)
- **Source:** [ITSalt/NaCl](https://github.com/ITSalt/NaCl)
- **License:** MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.