agentleFS
LieubkLieubk/automotive-safety-security-assurance-kit/.claude/skills/sw-architecture/SKILL.md

sw-architecture

Skill4 starsChanged 15 days agoMITView on GitHub

Design the software architecture from approved software requirements (Automotive SPICE SWE.2): components, interfaces, dynamic and resource views, design decisions, and the allocation of every requirement. Use when an architecture is to be created, extended or reworked, or when the trace check reports requirements without allocation (COV-07), components without requirements (COV-08) or missing architecture views (COV-25).

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every requirement is allocated.

    line 14
  2. Very specific:

    Run python tools/traceability.py status and python tools/traceability.py check --all (every command takes --project <dir> when the project …

    line 33
  3. Very specific:

    Run python tools/traceability.py matrix.

    line 52
  4. Distinctive:

    Read the requirements in scope by ID.

    line 58
  5. Very specific:

    Read references/architecture-guidance.md first.

    line 69
  6. Very specific:

    Check both directions with python tools/traceability.py show <ID>: Responsibility covers every requirement of the element, and every …

    line 127
  7. Very specific:

    Before changing an approved architecture item, say that its approval becomes stale and run python tools/traceability.py impact <ID> to show …

    line 157
  8. Very specific:

    Do not set status to anything but draft (open for a query), or obsolete for an element the user withdraws, and do not write a review record.

    line 190
  9. Very specific:

    Do not edit requirements, imported items (a problem with one is a query) or project.yaml, and do not design units.

    line 192
  10. Distinctive:

    Do not decide between alternatives, lower an ASIL or state a measured value.

    line 194

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Software architectural design (SWE.2)

Toolkit root: ${CLAUDE_PLUGIN_ROOT} - where this shows a placeholder instead of a folder, it is the repository you are in. The tools/, schema/, aspice/, iso-26262/, iso-sae-21434/, examples/ and .claude/docs/ named here and in the references lie in the toolkit root; run its tools from the project folder as python "<toolkit root>/tools/<script>.py".

Turns approved software requirements into an architecture expressed as items: components in a hierarchy, interfaces precise enough to implement and integrate against, views of structure, behaviour, execution and resources, and decisions with their alternatives. Every requirement is allocated. All items are written in state draft, ready for /review.

Base practiceWhat this skill doesEvidence it leaves
SWE.2.BP1 Develop software architectural designdecomposes the software into components over as many levels as needed, each with its reasonsoftware-component items with part_of, kind, layer, origin; an architecture-view of kind structure
SWE.2.BP2 Allocate software requirementsassigns every requirement to the element responsible and checks the result in both directionsfulfils links on the software-component and software-interface items
SWE.2.BP3 Define interfaces of software elementsdefines each interface with structured data elements or operations, provider, users and error behavioursoftware-interface items; realizes links to system-interface items
SWE.2.BP4 Describe dynamic behaviordescribes modes, start-up, shut-down, error handling, timing chains, tasks and interruptsDynamic behavior sections; views of kind state-machine, sequence, execution-model
SWE.2.BP5 Define resource consumption objectivessets budgets per component and totals for the ECU that add upresource_budget; a view of kind resource-summary
SWE.2.BP6 Evaluate alternative software architecturesfixes criteria first and assesses alternatives against them; the user decidesdesign-decision items with concerns links
SWE.2.BP7 Establish bidirectional traceabilitysets fulfils, realizes, shows, concerns and part_of linkslinks; matrix output
SWE.2.BP8 Ensure consistencyself-checks against the checklist; the evidence itself comes from /reviewproposed findings; review record written by /review
SWE.2.BP9 Communicate agreed software architectural designnot done here: /baseline records the baseline and who was informed-

Before you start

  1. No project.yaml: stop. "This project has no scope yet. Run /aspice-start first."
  2. SWE.2 not in scope.processes: stop. "SWE.2 is out of scope for this project. An architecture delivered from outside is registered with /import-inputs."
  3. Run python tools/traceability.py status and python tools/traceability.py check --all (every command takes --project <dir> when the project is not the current directory).
  4. The inputs are software-requirement items, approved or imported with an input acceptance review. If there are none, stop and name /sw-requirements or /import-inputs.
  5. A requirement in draft or in-review, or with a COV-19 finding, is not settled. Name each one and ask: wait, or design against it at risk. Elements that fulfil it stay in draft until it is approved: the check reports UPSTREAM, and the review refuses to approve an item above one that is not approved.
  6. SUSPECT on an existing element means that a requirement it fulfils changed after its review: read the new version first. An open QUERY on an input means a question to its source is unanswered: read the query before designing on that input.

Steps

1. Decide what to cover

  • With arguments: the named requirements, component or feature. Without: every COV-07 (requirement not allocated), COV-08 (component without a requirement) and COV-25 (required view kind missing) finding, plus existing draft architecture items.
  • Run python tools/traceability.py matrix; its fulfils, part_of, realizes and shows tables show what exists. For the IDs of one type run python tools/traceability.py list --type software-component. Ask the user whether the list is the right scope.

2. Find what shapes the architecture

  • Read the requirements in scope by ID. List those that constrain structure, interfaces, timing, resources, safety or reuse, and add the project goals the user names.
  • Propose evaluation criteria from this list and ask the user to rank them before any structure is drawn. Every design-decision uses them (step 8).
  • A question the user cannot answer is not design input. About an imported item, or about a supplied or reused component (to its supplier), it becomes a query item (python tools/record.py next-id query; folder records/queries; to, asked_at, a Question section, about linking the item). About a requirement the project wrote, it goes back to /sw-requirements.

3. Decompose

  • Read references/architecture-guidance.md first. Propose the components, each with the reason it is an element of its own. part_of gives the hierarchy; a composition has parts and no behaviour of its own. Units belong to /sw-detailed-design.
  • Per component set kind, layer, origin and execution_context; write Purpose (why it exists) and Responsibility (what it does, and what it does not do).
  • Supplied, reused and basic software are component items too, with supplier (source, version, form of delivery, ASIL developed to) and a Purpose saying why they are present. They take part in interfaces, execution model and budgets like the rest.

4. AUTOSAR Classic

  • kind and layer follow the layered architecture; the mapping is in the guidance.
  • Where a component description file exists, set model to its path and read ports, port interfaces and runnables from it. Never retype them into the component item or invent a name: the model stays the source, and what it lacks is a change to the model.
  • A model without items yet: python tools/arxml.py import <file> --dry-run, then, with the user's yes, without --dry-run. It writes drafts with kind, providers, users, data elements, operations and part_of; purpose, responsibility, layer, origin, ASIL and allocation stay to be written here.
  • Model and items both exist: python tools/arxml.py compare <file> lists the components, interfaces, providers, users, data elements and operations that differ. Quote it; a difference is resolved in the model or in the item, as the user decides.

5. Define the interfaces

  • One software-interface per exchange between components, with one provided_by and all used_by. kind decides whether elements or operations are filled; references/interface-template.md lists what a complete definition holds.
  • Description: what a user may rely on, what each side does in an error case, constraints on use. Set realizes where the interface carries the software side of a system-interface, and compare ranges and timing with that item.

6. Describe the dynamic behaviour

  • A component's own modes, activation and state after initialisation go into its Dynamic behavior section; behaviour across components goes into views.
  • Cover the operating modes of the ECU, start-up, shut-down, error handling and every chain with a timing requirement: a view for each, or the reason why none is needed. references/view-templates.md says what each view kind must show. Every view links with shows to every item that appears in it.

7. Execution model and resource budgets

  • One view of kind execution-model: a tasks row per task and interrupt, every entry function of every component in exactly one row, in calling order. Description gives priorities, preemption, protection of shared data and the resulting processor load.
  • Give every component a resource_budget, or not_relevant with the reason, and say where each number comes from. Ask the user for capacities and the reserve to keep.
  • One view of kind resource-summary with a resource-totals row per resource. No tool adds the numbers: show the user the sums before writing - parts to composition, entries to task budget, tasks to processor load, objective against capacity less reserve.

8. Alternatives

  • For each choice that shapes the structure (the decomposition or the adoption of a given one, task model, make or reuse, partitioning) draft a design-decision: context, the criteria of step 2, at least two real alternatives, each assessed against each one.
  • Present the assessment and ask the user to decide. Decision and Consequences record what the user decided; an undecided draft is listed as open in the hand-over.

9. Allocate

  • Per requirement choose the responsible component, or for kind: interface the interface, and record it as fulfils on that element. Requirements are not edited.
  • Check both directions with python tools/traceability.py show <ID>: Responsibility covers every requirement of the element, and every element has a requirement or a recorded reason (COV-08).
  • A need that only the design creates goes to /sw-requirements as a requirement with origin: internal; it is not written here.

10. ASIL and partitioning

  • An element carries the highest ASIL of the requirements allocated to it, a composition the highest of its parts, an interface at least that of its most critical use.
  • COV-23 reports an element below an allocated requirement: raise it or re-allocate. A lower ASIL is a decomposition and needs a design-decision that concerns every item whose ASIL is lowered, approved through /review. Never lower one on your own.
  • Where elements of different ASIL coexist, draft a decision on how the lower ones are kept from disturbing the higher ones (memory, timing, exchanged data).

11. Self-check

Apply .claude/docs/checklists/software-architecture.md to the drafts. check --all says what a draft still needs for review, but not what depends on kind or origin nor what approval needs: walk the "Needed" column of the templates for those. Show the findings as proposals; correct what the user accepts.

Writing

  • Show a table of the drafts (ID, type, title, kind, ASIL, links) and the allocation, and ask: "May I write these N items to spec/software/architecture/, spec/views/ and spec/decisions/?" Queries go to records/queries/.
  • IDs: python tools/record.py next-id software-component, likewise for the other types; then count upwards. Status draft. File layout: component-template.md, interface-template.md, view-templates.md and decision-template.md in references/.
  • The allocation is written as links.fulfils on the element; no requirement is edited.
  • Before changing an approved architecture item, say that its approval becomes stale and run python tools/traceability.py impact <ID> to show what depends on it. Change the status line to draft first, then the content; what depends on it stays as it is and is reported as UPSTREAM and, once the item is approved again, as SUSPECT.
  • An element the user withdraws becomes obsolete with superseded_by, after every link to it has moved: LINK and COV-24 report links to an obsolete item.
  • Inside a baseline, changing or withdrawing an item needs an approved change request first (/change-request).

Checks before you finish

Run python tools/traceability.py check --all and python tools/traceability.py matrix.

  • FORMAT, SCHEMA and LINK findings on items written in this session: fix them.
  • COV-07, COV-08, COV-23 and COV-24 for the scope of this session should be gone. If one remains, report it with the reason. Quote the fulfils tables.
  • Expected, and to be said: COV-25 until /review has approved the views; COV-23 until a decomposition decision is approved; COV-09 and COV-21 until the detailed design exists.

Hand-over

Report, in this order:

  1. The base practice table with what was done in this session and what is open.
  2. The budget sums against capacity and reserve; what is NOT ASSESSED and why.
  3. Decisions the user has not taken; the queries written, by ID; needs and questions handed to /sw-requirements.
  4. The remaining findings of the check that concern these items.
  5. Next: /review, top down: requirements before the elements that fulfil them, shown items before or together with their views. Then /baseline, then /sw-detailed-design.

Do not

  • Do not set status to anything but draft (open for a query), or obsolete for an element the user withdraws, and do not write a review record.
  • Do not edit requirements, imported items (a problem with one is a query) or project.yaml, and do not design units.
  • Do not decide between alternatives, lower an ASIL or state a measured value.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.