@rashidee/co2 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +25449 -0
- package/drizzle/0000_remarkable_charles_xavier.sql +210 -0
- package/drizzle/0001_wise_wolf_cub.sql +13 -0
- package/drizzle/0002_secret_spyke.sql +16 -0
- package/drizzle/0003_workspace_config_singleton.sql +16 -0
- package/drizzle/0004_terminal_claim_v120.sql +11 -0
- package/drizzle/0005_brainstorm_v124.sql +10 -0
- package/drizzle/0006_project_v140.sql +6 -0
- package/drizzle/0007_prd_wizard_v124.sql +14 -0
- package/drizzle/0008_workflow_artifact_v126.sql +24 -0
- package/drizzle/0009_project_import_v150.sql +7 -0
- package/drizzle/0010_quality_v151.sql +3 -0
- package/drizzle/meta/0000_snapshot.json +1335 -0
- package/drizzle/meta/0001_snapshot.json +1416 -0
- package/drizzle/meta/0002_snapshot.json +1510 -0
- package/drizzle/meta/_journal.json +83 -0
- package/package.json +41 -0
- package/plugin/.claude-plugin/marketplace.json +36 -0
- package/plugin/.claude-plugin/plugin.json +22 -0
- package/plugin/README.md +625 -0
- package/plugin/SKILLS.md +350 -0
- package/plugin/co2.svg +5 -0
- package/plugin/commands/brainstorm-loop.md +129 -0
- package/plugin/skills/conductor-defect/SKILL.md +898 -0
- package/plugin/skills/conductor-feature-develop/SKILL.md +1383 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-domain-template.md +131 -0
- package/plugin/skills/conductor-feature-develop/references/implementation-master-template.md +89 -0
- package/plugin/skills/conductor-feature-develop/references/playwright-setup.md +224 -0
- package/plugin/skills/conductor-feature-prepare/SKILL.md +604 -0
- package/plugin/skills/depgen-k8s/SKILL.md +468 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-laravel.md +197 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-nodejs.md +163 -0
- package/plugin/skills/depgen-k8s/references/dockerfile-spring-boot.md +174 -0
- package/plugin/skills/depgen-k8s/references/k8s-patterns.md +869 -0
- package/plugin/skills/mockgen-shadcn/SKILL.md +1067 -0
- package/plugin/skills/mockgen-shadcn/references/admin-layout-template.md +1467 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-shadcn/references/mockup-index-template.md +216 -0
- package/plugin/skills/mockgen-tailwind/SKILL.md +904 -0
- package/plugin/skills/mockgen-tailwind/references/admin-layout-template.md +720 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-hub-template.md +498 -0
- package/plugin/skills/mockgen-tailwind/references/mockup-index-template.md +190 -0
- package/plugin/skills/modelgen-nosql/SKILL.md +617 -0
- package/plugin/skills/modelgen-nosql/references/model-extraction-methodology.md +497 -0
- package/plugin/skills/modelgen-nosql/references/nosql-design-guide.md +258 -0
- package/plugin/skills/modelgen-relational/SKILL.md +707 -0
- package/plugin/skills/modelgen-relational/references/model-extraction-methodology.md +499 -0
- package/plugin/skills/specgen-flutter-riverpod/SKILL.md +898 -0
- package/plugin/skills/specgen-flutter-riverpod/references/component-patterns.md +971 -0
- package/plugin/skills/specgen-flutter-riverpod/references/notification-patterns.md +457 -0
- package/plugin/skills/specgen-flutter-riverpod/references/routing-patterns.md +362 -0
- package/plugin/skills/specgen-flutter-riverpod/references/security-patterns.md +709 -0
- package/plugin/skills/specgen-flutter-riverpod/references/spec-template.md +1566 -0
- package/plugin/skills/specgen-flutter-riverpod/references/state-patterns.md +518 -0
- package/plugin/skills/specgen-flutter-riverpod/references/storage-patterns.md +370 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/SKILL.md +984 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/batch-patterns.md +359 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/messaging-patterns.md +468 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/modulith-patterns.md +461 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/reporting-patterns.md +803 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/security-patterns.md +501 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/spec-template.md +1268 -0
- package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/web-patterns.md +301 -0
- package/plugin/skills/specgen-node-cli-web/SKILL.md +561 -0
- package/plugin/skills/specgen-node-cli-web/references/auth-patterns.md +293 -0
- package/plugin/skills/specgen-node-cli-web/references/cli-packaging-patterns.md +250 -0
- package/plugin/skills/specgen-node-cli-web/references/server-patterns.md +247 -0
- package/plugin/skills/specgen-node-cli-web/references/spec-template.md +401 -0
- package/plugin/skills/specgen-node-cli-web/references/testing-patterns.md +174 -0
- package/plugin/skills/specgen-react-mui/SKILL.md +789 -0
- package/plugin/skills/specgen-react-mui/references/component-patterns.md +1077 -0
- package/plugin/skills/specgen-react-mui/references/reporting-patterns.md +1998 -0
- package/plugin/skills/specgen-react-mui/references/routing-patterns.md +461 -0
- package/plugin/skills/specgen-react-mui/references/security-patterns.md +599 -0
- package/plugin/skills/specgen-react-mui/references/spec-template.md +1030 -0
- package/plugin/skills/specgen-react-mui/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-react-tailwind/SKILL.md +859 -0
- package/plugin/skills/specgen-react-tailwind/references/component-patterns.md +1212 -0
- package/plugin/skills/specgen-react-tailwind/references/reporting-patterns.md +1529 -0
- package/plugin/skills/specgen-react-tailwind/references/routing-patterns.md +669 -0
- package/plugin/skills/specgen-react-tailwind/references/security-patterns.md +656 -0
- package/plugin/skills/specgen-react-tailwind/references/spec-template.md +1237 -0
- package/plugin/skills/specgen-react-tailwind/references/state-patterns.md +327 -0
- package/plugin/skills/specgen-sdk-java/SKILL.md +933 -0
- package/plugin/skills/specgen-sdk-java/references/api-extraction-patterns.md +247 -0
- package/plugin/skills/specgen-sdk-java/references/http-client-patterns.md +495 -0
- package/plugin/skills/specgen-sdk-java/references/packaging-patterns.md +366 -0
- package/plugin/skills/specgen-sdk-java/references/spec-template.md +956 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/SKILL.md +1284 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/jasper-patterns.md +1638 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/modulith-patterns.md +354 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/security-patterns.md +551 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/spec-template.md +2502 -0
- package/plugin/skills/specgen-spring-jpa-jtehtmx/references/web-patterns.md +503 -0
- package/plugin/skills/specgen-spring-jpa-restapi/SKILL.md +990 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/batch-patterns.md +1224 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/messaging-patterns.md +512 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/modulith-patterns.md +279 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/reporting-patterns.md +1536 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/restapi-patterns.md +722 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/security-patterns.md +351 -0
- package/plugin/skills/specgen-spring-jpa-restapi/references/spec-template.md +553 -0
- package/plugin/skills/specgen-ts-cli/SKILL.md +861 -0
- package/plugin/skills/specgen-ts-cli/references/async-patterns.md +1101 -0
- package/plugin/skills/specgen-ts-cli/references/command-patterns.md +383 -0
- package/plugin/skills/specgen-ts-cli/references/config-patterns.md +430 -0
- package/plugin/skills/specgen-ts-cli/references/database-patterns.md +750 -0
- package/plugin/skills/specgen-ts-cli/references/packaging-patterns.md +426 -0
- package/plugin/skills/specgen-ts-cli/references/spec-template.md +1391 -0
- package/plugin/skills/specgen-ts-cli/references/testing-patterns.md +909 -0
- package/plugin/skills/testgen-functional/SKILL.md +1381 -0
- package/plugin/skills/tracegen-matrix/SKILL.md +243 -0
- package/plugin/skills/util-preparek8senv/SKILL.md +422 -0
- package/plugin/skills/util-projectinit/SKILL.md +307 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-loop.md +129 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-protocol.md +144 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-setup-guide.md +153 -0
- package/plugin/skills/util-projectinit/reference/brainstorm-template-appdev.md +87 -0
- package/plugin/skills/util-projectinit/reference/co2-context-generation-guide.md +761 -0
- package/plugin/skills/util-projectsync/SKILL.md +501 -0
- package/plugin/skills/util-updprd/SKILL.md +324 -0
- package/plugin/skills/util-usanalyzer/SKILL.md +307 -0
- package/plugin/skills/util-ustagger/SKILL.md +154 -0
- package/static/assets/abnfDiagram-VRR7QNED-DvPuwyCV.js +1 -0
- package/static/assets/arc-DRKw7sjs.js +1 -0
- package/static/assets/architectureDiagram-ZJ3FMSHR-CaNcxUbC.js +36 -0
- package/static/assets/blockDiagram-677ZJIJ3-Demd4AOK.js +132 -0
- package/static/assets/c4Diagram-LMCZKHZV-PVKUfc2x.js +10 -0
- package/static/assets/channel-C2nVbuwv.js +1 -0
- package/static/assets/chunk-2Q5K7J3B-CExf8ww_.js +1 -0
- package/static/assets/chunk-32BRIVSS-CFPaoONF.js +1 -0
- package/static/assets/chunk-5VM5RSS4-DE2esM67.js +15 -0
- package/static/assets/chunk-EX3LRPZG-SON_YdDG.js +231 -0
- package/static/assets/chunk-JWPE2WC7-Qxah8LNr.js +1 -0
- package/static/assets/chunk-MOJQB5TN-BcWGQV3j.js +88 -0
- package/static/assets/chunk-RYQCIY6F-DkDj-OR5.js +1 -0
- package/static/assets/chunk-V7JOEXUC-BlI1Mrah.js +206 -0
- package/static/assets/chunk-VR4S4FIN-Agf__duj.js +1 -0
- package/static/assets/chunk-XXDRQBXY-B5CfAh85.js +1 -0
- package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +1 -0
- package/static/assets/cose-bilkent-JH36ORCC-DO0cQkcy.js +1 -0
- package/static/assets/cynefin-VYW2F7L2-CfOnsnXc.js +178 -0
- package/static/assets/cynefinDiagram-TSTJHNR4-BJ8tULAv.js +62 -0
- package/static/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
- package/static/assets/dagre-VKFMJZFB-DfjwzHqP.js +4 -0
- package/static/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/static/assets/diagram-FQU43EPY-CndSOIIM.js +3 -0
- package/static/assets/diagram-G47NLZAW-Czf5hN0Z.js +24 -0
- package/static/assets/diagram-NH7WQ7WH-COAyojGh.js +24 -0
- package/static/assets/diagram-OA4YK3LP-H8PoiN2m.js +30 -0
- package/static/assets/diagram-WEI45ONY-DzcaVzjp.js +41 -0
- package/static/assets/ebnfDiagram-CCIWWBDH-DPazGYLJ.js +1 -0
- package/static/assets/erDiagram-Q63AITRT-Bo-fubgF.js +85 -0
- package/static/assets/flowDiagram-23GEKE2U-CSvxUDwh.js +156 -0
- package/static/assets/ganttDiagram-NO4QXBWP-DnBveWX6.js +292 -0
- package/static/assets/gitGraphDiagram-IHSO6WYX-B3rVL8c-.js +106 -0
- package/static/assets/graph-C9eacEi8.js +1 -0
- package/static/assets/index-LZSQkLE2.css +41 -0
- package/static/assets/index-y7XDSgMG.js +495 -0
- package/static/assets/infoDiagram-FWYZ7A6U-CvWV9yy2.js +2 -0
- package/static/assets/init-Gi6I4Gst.js +1 -0
- package/static/assets/ishikawaDiagram-FXEZZL3T-DF28a1N6.js +70 -0
- package/static/assets/journeyDiagram-5HDEW3XC-CB6CugYk.js +139 -0
- package/static/assets/kanban-definition-HUTT4EX6-ResSLF6d.js +89 -0
- package/static/assets/katex-C5jXJg4s.js +257 -0
- package/static/assets/layout-DEXfKzaS.js +1 -0
- package/static/assets/linear-CLO--ryk.js +1 -0
- package/static/assets/map-Czzmt4hB.js +1 -0
- package/static/assets/mindmap-definition-LN4V7U3C-BvW3EbxX.js +96 -0
- package/static/assets/ordinal-Cboi1Yqb.js +1 -0
- package/static/assets/pegDiagram-2B236MQR-BHCgqrrM.js +1 -0
- package/static/assets/pieDiagram-ENE6RG2P-DVmCQ5FA.js +39 -0
- package/static/assets/quadrantDiagram-ABIIQ3AL-B3e5KR52.js +7 -0
- package/static/assets/railroadDiagram-RFXS5EU6-Csv5ysLc.js +1 -0
- package/static/assets/requirementDiagram-TGXJPOKE-DOMVzvnB.js +84 -0
- package/static/assets/sankeyDiagram-HTMAVEWB-B1dcTOvy.js +40 -0
- package/static/assets/sequenceDiagram-DBY2YBRQ-BY414yeO.js +162 -0
- package/static/assets/sizeCapture-X5ZJPWSS-CuJfrfBN.js +1 -0
- package/static/assets/stateDiagram-2N3HPSRC-FX4rJkzV.js +1 -0
- package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +1 -0
- package/static/assets/swimlanes-5IMT3BWC-Sfy58mmv.js +2 -0
- package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +8 -0
- package/static/assets/timeline-definition-FHXFAJF6-CmV7by8p.js +120 -0
- package/static/assets/vennDiagram-L72KCM5P-FqIyFZFt.js +34 -0
- package/static/assets/wardleyDiagram-EHGQE667-BZ06O45i.js +78 -0
- package/static/assets/xychartDiagram-FW5EYKEG-BOkffR06.js +7 -0
- package/static/index.html +24 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: util-updprd
|
|
3
|
+
model: claude-opus-4-8
|
|
4
|
+
effort: high
|
|
5
|
+
description: >
|
|
6
|
+
Apply a free-form requirement change to the PRD.md files of a CO2 project. Takes a
|
|
7
|
+
human-written prompt describing NEW requirements or updates to existing ones, analyzes
|
|
8
|
+
the PRD.md of every custom application to determine which applications, modules and
|
|
9
|
+
subsections (User Story, Non Functional Requirement, Constraint, Reference, Test) are
|
|
10
|
+
impacted, and decides for each impacted item whether to ADD, CANCEL or MODIFY it.
|
|
11
|
+
Automatically classifies the change complexity per application as major, minor or patch,
|
|
12
|
+
computes the next semantic version, and writes the new/updated items under a NEW version
|
|
13
|
+
tag layered on top of the existing versions in each PRD.md — never rewriting or deleting
|
|
14
|
+
prior versions. Cancelled items are struck through in place and recorded in the new
|
|
15
|
+
version. New items are tagged with unique IDs (via util-ustagger) and a CHANGELOG.md
|
|
16
|
+
entry is appended per impacted application. Presents an impact plan for human
|
|
17
|
+
confirmation before writing (skippable with `--auto-approve` for orchestrated runs).
|
|
18
|
+
ALWAYS stops after updating the PRDs and hands back for human review — it never chains
|
|
19
|
+
into conductor-feature-prepare / -develop / -defect or any generator skill.
|
|
20
|
+
Trigger on keywords: "update PRD", "update the PRD", "add requirement", "new requirement",
|
|
21
|
+
"change requirement", "update requirements", "add user story", "cancel user story",
|
|
22
|
+
"modify user story", "add NFR", "add constraint", "requirement update", "bump PRD version",
|
|
23
|
+
"new version of requirements", "apply this requirement", "we now need", "the client wants".
|
|
24
|
+
Accepts a free-form change prompt as the main argument, with optional `application:<app>`
|
|
25
|
+
and `module:<module>` scope filters
|
|
26
|
+
(e.g., `/util-updprd "Add SSO login for all users"`,
|
|
27
|
+
`/util-updprd "Corridor codes must be unique" application:hub_middleware`).
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Util Update PRD
|
|
31
|
+
|
|
32
|
+
Take a free-form requirement change written by a human and apply it to the PRD.md files across
|
|
33
|
+
a CO2 project. The skill figures out **what changed**, **which applications/modules are
|
|
34
|
+
impacted**, **whether each change is an add / cancel / modify**, and **how big the change is**
|
|
35
|
+
(major / minor / patch) — then layers the change onto each impacted PRD.md as a **new version
|
|
36
|
+
on top of the existing versions**, leaving all prior versions untouched.
|
|
37
|
+
|
|
38
|
+
This skill is the counterpart to the human-authored PRD: instead of a person hand-editing
|
|
39
|
+
requirements, they describe the change in plain language and this skill applies it consistently
|
|
40
|
+
and traceably across every affected application.
|
|
41
|
+
|
|
42
|
+
## Inputs
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
/util-updprd "<free-form requirement change>" [application:<app>] [module:<module>] [--auto-approve]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
| Argument | Required | Description |
|
|
49
|
+
|----------|----------|-------------|
|
|
50
|
+
| `<prompt>` | Yes | Free-form description of the new requirement(s) or the update(s) to existing ones. May describe multiple discrete changes at once, and may explicitly say something should be removed/cancelled. |
|
|
51
|
+
| `application:<app>` | No | Restrict analysis to a single application. If omitted, **all** custom applications are analyzed and only the impacted ones are changed. |
|
|
52
|
+
| `module:<module>` | No | Hint/restrict the change to a specific module. If omitted, the impacted modules are inferred. |
|
|
53
|
+
| `--auto-approve` | No | Skip the Phase 3 confirmation checkpoint and apply the plan directly. Intended for orchestrated/autonomous runs where interactive confirmation is not possible. Without this flag, the skill presents the plan and waits for the human to confirm before writing. |
|
|
54
|
+
|
|
55
|
+
Example invocations:
|
|
56
|
+
- `/util-updprd "Every user must be able to reset their own password from the login screen"`
|
|
57
|
+
- `/util-updprd "Drop the CSV export from the dashboard — it is being replaced by scheduled email reports" application:hub_middleware`
|
|
58
|
+
- `/util-updprd "Corridor codes must be globally unique and are now case-insensitive" application:hub_middleware module:corridor`
|
|
59
|
+
- `/util-updprd "Add audit logging for all admin actions" --auto-approve`
|
|
60
|
+
|
|
61
|
+
### Application Resolution
|
|
62
|
+
|
|
63
|
+
Same rules as the other CO2 skills:
|
|
64
|
+
1. List root-level application folders (with or without a numeric prefix, e.g. `1_hub_middleware`, `mainapp`).
|
|
65
|
+
2. Strip any leading `<number>_` prefix.
|
|
66
|
+
3. Match the `application:` value case-insensitively (accept `snake_case`, `kebab-case`, title-case).
|
|
67
|
+
4. If `application:` is given but does not match, list available applications and **stop**.
|
|
68
|
+
5. If `application:` is omitted, the candidate set is **every** custom application folder that has a `context/PRD.md`.
|
|
69
|
+
|
|
70
|
+
### Auto-Resolved Paths (per application)
|
|
71
|
+
|
|
72
|
+
| File | Resolved Path |
|
|
73
|
+
|------|---------------|
|
|
74
|
+
| PRD.md | `<app_folder>/context/PRD.md` |
|
|
75
|
+
| CHANGELOG.md | `<app_folder>/CHANGELOG.md` |
|
|
76
|
+
|
|
77
|
+
## Pre-Requisite: CLAUDE.md (already in context)
|
|
78
|
+
|
|
79
|
+
CLAUDE.md is loaded automatically at session start. Use it as the **source of truth for what
|
|
80
|
+
applications and modules exist**. This skill NEVER invents new applications or modules — modules
|
|
81
|
+
are governed by CLAUDE.md and PRD.md is synced from it by `util-projectsync`. If a change
|
|
82
|
+
requires a module or application that does not yet exist (see Boundary Rules), report it as a
|
|
83
|
+
follow-up action instead of creating it here.
|
|
84
|
+
|
|
85
|
+
## How Versions Work in PRD.md (read this before editing)
|
|
86
|
+
|
|
87
|
+
Every subsection in a module carries one or more version tags, each on its own line, with the
|
|
88
|
+
items for that version listed below it. New versions are **appended** below older ones —
|
|
89
|
+
older version blocks are immutable:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
### User Story
|
|
93
|
+
[v1.0.0]
|
|
94
|
+
- [USHM00003] As a user, I want to log in so that I can access my data.
|
|
95
|
+
[v1.1.0]
|
|
96
|
+
- As a user, I want to reset my own password so that I don't need to call support.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The versioning semantics (from the PRD.md `# Context` section) are:
|
|
100
|
+
|
|
101
|
+
| Level | When to use | Version change |
|
|
102
|
+
|-------|-------------|----------------|
|
|
103
|
+
| **major** | A significant change that alters the overall understanding of a module or the system — a new module-scale capability, a fundamental behavior/purpose change, cancelling core user stories, or a Design-System / Architecture-Principle change. | `X+1 . 0 . 0` |
|
|
104
|
+
| **minor** | A change that affects some details but not the overall understanding — adding new user stories / NFRs / constraints / references / tests to existing modules, or extending existing behavior with new fields or rules. | `X . Y+1 . 0` |
|
|
105
|
+
| **patch** | A small change that does not affect understanding — clarifying wording, fixing a typo, tightening a constraint without changing its meaning, or fixing a reference link. | `X . Y . Z+1` |
|
|
106
|
+
|
|
107
|
+
**One new version per application per run.** All impacted subsections across all impacted
|
|
108
|
+
modules of a single application receive the **same** new version tag. The bump level for that
|
|
109
|
+
application is the **highest-severity** change among everything affecting it (one major change
|
|
110
|
+
makes the whole application bump major, even if the other changes are patches).
|
|
111
|
+
|
|
112
|
+
## Workflow
|
|
113
|
+
|
|
114
|
+
### Phase 1 — Understand the Change
|
|
115
|
+
|
|
116
|
+
1. Read the `<prompt>`. Decompose it into a list of **discrete changes**. A single prompt may
|
|
117
|
+
contain several (e.g., "add password reset AND remove CSV export" is two changes).
|
|
118
|
+
2. For each discrete change, determine its **operation** and **artifact type**:
|
|
119
|
+
- **Operation**: `ADD` (a brand-new requirement), `CANCEL` (an existing requirement is no
|
|
120
|
+
longer valid), or `MODIFY` (an existing requirement changes — treated as CANCEL of the old
|
|
121
|
+
wording + ADD of the revised wording so history is preserved).
|
|
122
|
+
- **Artifact type**: which subsection it belongs in — `User Story`, `Non Functional
|
|
123
|
+
Requirement`, `Constraint`, `Reference`, or `Test`. A behavioral feature is usually a User
|
|
124
|
+
Story; a performance/security/availability rule is an NFR; a hard limitation or business
|
|
125
|
+
rule is a Constraint; a pointer to an external doc/message/spec is a Reference; a
|
|
126
|
+
verification instruction is a Test. One discrete change may produce items in more than one
|
|
127
|
+
subsection (e.g., a new feature = a User Story + a Test).
|
|
128
|
+
3. If the prompt is genuinely ambiguous about intent (add vs cancel, or which behavior), note
|
|
129
|
+
the ambiguity — it will be surfaced in the Phase 3 plan for the user to resolve. Do not guess
|
|
130
|
+
silently on high-impact interpretations.
|
|
131
|
+
|
|
132
|
+
### Phase 2 — Impact Analysis
|
|
133
|
+
|
|
134
|
+
For each candidate application (all, or the `application:`-filtered one):
|
|
135
|
+
|
|
136
|
+
1. Read `<app_folder>/context/PRD.md`. Parse module sections (`## <Module>` under
|
|
137
|
+
`# System Module` / `# Business Module`) and, within each, the subsections and their
|
|
138
|
+
existing tagged items.
|
|
139
|
+
2. Read the application's modules from CLAUDE.md (source of truth) to know the full module set.
|
|
140
|
+
3. Map each discrete change to the application's module(s) by matching on:
|
|
141
|
+
- Entities, roles, screens, and domain nouns mentioned in the change vs. those already
|
|
142
|
+
described in each module's user stories / NFRs / constraints.
|
|
143
|
+
- Explicit `module:` hint if provided (restrict to that module but still check cross-module
|
|
144
|
+
references).
|
|
145
|
+
- Cross-application relevance: a change like "all users must use SSO" may impact **several**
|
|
146
|
+
applications — include each one it genuinely affects.
|
|
147
|
+
4. For CANCEL / MODIFY operations, locate the **exact existing item(s)** (by ID and wording) that
|
|
148
|
+
the change supersedes. If no matching item exists, downgrade the operation to `ADD` (you can't
|
|
149
|
+
cancel something that isn't there) and note it.
|
|
150
|
+
5. Produce, per application, the set of `(module, subsection, operation, item text or target ID)`
|
|
151
|
+
entries. An application with zero entries is **not impacted** and will be left untouched.
|
|
152
|
+
|
|
153
|
+
### Phase 3 — Classify Version & Present the Plan
|
|
154
|
+
|
|
155
|
+
For each **impacted** application:
|
|
156
|
+
|
|
157
|
+
1. Discover the current highest version: scan PRD.md for all `[vX.Y.Z]` tags **and**
|
|
158
|
+
CHANGELOG.md `## vX.Y.Z` headings; take the semantic-version maximum. If none exist, treat
|
|
159
|
+
the baseline as `v1.0.0`.
|
|
160
|
+
2. Classify the bump level using the table in "How Versions Work" — pick the highest severity
|
|
161
|
+
across all changes affecting this application.
|
|
162
|
+
3. Compute the new version by applying the bump to the highest version
|
|
163
|
+
(e.g., highest `v1.2.3` + minor → `v1.3.0`; + major → `v2.0.0`; + patch → `v1.2.4`).
|
|
164
|
+
|
|
165
|
+
Then present a consolidated **Impact Analysis & Change Plan** and **wait for confirmation**
|
|
166
|
+
before writing anything (this is a cross-cutting, hard-to-reverse edit):
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
## PRD Update Plan
|
|
170
|
+
|
|
171
|
+
Change prompt: "<the prompt>"
|
|
172
|
+
|
|
173
|
+
### hub_middleware (v1.2.3 → v1.3.0, MINOR)
|
|
174
|
+
| Module | Subsection | Op | Item |
|
|
175
|
+
|----------|-------------|--------|------|
|
|
176
|
+
| User | User Story | ADD | As a user, I want to reset my own password ... |
|
|
177
|
+
| User | Test | ADD | Verify password reset email is delivered ... |
|
|
178
|
+
| Dashboard| User Story | CANCEL | [USHM00021] ... CSV export ... |
|
|
179
|
+
|
|
180
|
+
### hc_adapter (not impacted)
|
|
181
|
+
|
|
182
|
+
### ⚠ Follow-ups
|
|
183
|
+
- Change "add real-time chat module" needs a new module `Chat` that does not exist in CLAUDE.md.
|
|
184
|
+
Add it to CLAUDE.md and run /util-projectsync first, then re-run this skill.
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Confirmation gate:**
|
|
188
|
+
- If `--auto-approve` is **not** set: present the plan and **stop until the human confirms**. Do
|
|
189
|
+
not write any file before confirmation. If the human amends the plan, apply the amended version.
|
|
190
|
+
- If `--auto-approve` **is** set (orchestrated/autonomous run): skip the wait and proceed directly
|
|
191
|
+
to Phase 4, but clearly log every decision and every ambiguity you resolved so the human can
|
|
192
|
+
audit them afterward.
|
|
193
|
+
|
|
194
|
+
### Phase 4 — Apply the Changes
|
|
195
|
+
|
|
196
|
+
For each impacted application, edit `<app_folder>/context/PRD.md`. **Never modify or delete any
|
|
197
|
+
existing version block, tag, or item** — only append and (for cancellations) strike through.
|
|
198
|
+
|
|
199
|
+
**ADD** — for each new item:
|
|
200
|
+
- Locate the target subsection in the target module.
|
|
201
|
+
- If the new version tag `[v{new}]` is not yet present in that subsection, append it on its own
|
|
202
|
+
line **after** the last existing version block of that subsection.
|
|
203
|
+
- Append the new item as a plain, **untagged** top-level bullet under `[v{new}]`:
|
|
204
|
+
`- As a user, I want to reset my own password so that I don't need to call support.`
|
|
205
|
+
(User Stories must follow the Agile "As a … I want … so that …" form. Leave the item untagged —
|
|
206
|
+
Phase 5 assigns the ID.)
|
|
207
|
+
|
|
208
|
+
**CANCEL** — for each cancelled item:
|
|
209
|
+
- Find the existing item under its original version block. Wrap its text (keeping its ID) in
|
|
210
|
+
strikethrough and append a cancellation marker, editing it **in place**:
|
|
211
|
+
`- ~~[USHM00021] As a user, I want to export the dashboard to CSV ...~~ [CANCELLED v1.3.0]`
|
|
212
|
+
- Under the `[v{new}]` block of the same subsection, add a note bullet recording the removal:
|
|
213
|
+
`- [CANCELLED] [USHM00021] — CSV export removed; superseded by scheduled email reports.`
|
|
214
|
+
(This note already contains the ID, so util-ustagger will skip it.)
|
|
215
|
+
|
|
216
|
+
**MODIFY** — treat as CANCEL of the old wording plus ADD of the new wording:
|
|
217
|
+
- Strike through the old item in place with `[SUPERSEDED v{new}]` instead of `[CANCELLED v{new}]`.
|
|
218
|
+
- Add the revised item as a fresh untagged bullet under `[v{new}]` (it gets a new ID in Phase 5).
|
|
219
|
+
- Add a note bullet under `[v{new}]` linking them:
|
|
220
|
+
`- [SUPERSEDED] [USHM00007] → revised below (case-insensitive corridor codes).`
|
|
221
|
+
|
|
222
|
+
Formatting discipline:
|
|
223
|
+
- Preserve all existing content, indentation, blank lines, and separators (`---`) exactly.
|
|
224
|
+
- Only add top-level bullets for new items; use sub-bullets for their supporting detail if needed.
|
|
225
|
+
- Keep the new version tag identical across every subsection you touched in this application.
|
|
226
|
+
|
|
227
|
+
### Phase 5 — Tag New Items
|
|
228
|
+
|
|
229
|
+
After all edits for an application are written, assign IDs to the newly added (still untagged)
|
|
230
|
+
items by invoking the tagging skill with the application and the **new** version:
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
Skill(skill: "util-ustagger", args: "<application> <new-version>")
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
util-ustagger tags every untagged top-level bullet, continues the running numbers per category,
|
|
237
|
+
and skips items that already contain an ID (including the `[CANCELLED]` / `[SUPERSEDED]` notes).
|
|
238
|
+
Run it once per impacted application.
|
|
239
|
+
|
|
240
|
+
### Phase 6 — Record in CHANGELOG.md
|
|
241
|
+
|
|
242
|
+
For each impacted application, append an entry to `<app_folder>/CHANGELOG.md`:
|
|
243
|
+
|
|
244
|
+
1. Read `<app_folder>/CHANGELOG.md`. If it does not exist, create it with:
|
|
245
|
+
```markdown
|
|
246
|
+
# Changelog
|
|
247
|
+
|
|
248
|
+
- This file tracks all skill executions by version for this application.
|
|
249
|
+
- The highest version recorded here is the current application version.
|
|
250
|
+
- Skills MUST NOT execute for a version lower than the highest version in this file.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
```
|
|
254
|
+
2. Search for a `## {new-version}` heading.
|
|
255
|
+
3. If it **exists**, append a new row to its table. If it **does not exist**, insert a new
|
|
256
|
+
section after the `---` below the context header and before any existing `## vX.Y.Z` section
|
|
257
|
+
(newest-first ordering), with a table header and the first row.
|
|
258
|
+
4. Row format:
|
|
259
|
+
`| {YYYY-MM-DD} | {application_name} | util-updprd | {impacted modules or "All"} | {N added, M cancelled, K modified — one-line summary} |`
|
|
260
|
+
5. **Never modify or delete existing rows.** The new version is always higher than the previous
|
|
261
|
+
highest, so it satisfies every downstream skill's version gate.
|
|
262
|
+
|
|
263
|
+
### Phase 7 — Output Summary
|
|
264
|
+
|
|
265
|
+
Print a summary table of everything applied:
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
## PRD Update Summary
|
|
269
|
+
|
|
270
|
+
| Application | Version | Level | Added | Cancelled | Modified | Modules Touched |
|
|
271
|
+
|----------------|----------------|-------|-------|-----------|----------|----------------------|
|
|
272
|
+
| hub_middleware | v1.2.3 → v1.3.0| MINOR | 2 | 1 | 0 | User, Dashboard |
|
|
273
|
+
| hc_adapter | (not impacted) | — | 0 | 0 | 0 | — |
|
|
274
|
+
|
|
275
|
+
### Follow-ups (for the human to run after review — NOT run automatically)
|
|
276
|
+
- <any module/application that must be added to CLAUDE.md + util-projectsync first>
|
|
277
|
+
- Recommended: run /util-usanalyzer <app> to quality-check the updated requirements.
|
|
278
|
+
- When you are satisfied with the updated PRDs, regenerate artifacts with
|
|
279
|
+
/conductor-feature-prepare <app> version:<new-version>, then implement.
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### STOP — Hand Back to the Human
|
|
283
|
+
|
|
284
|
+
This skill's job **ends** once the PRD.md files are updated, new items tagged, and CHANGELOG.md
|
|
285
|
+
appended. **Do NOT continue into any conductor skill** (`conductor-feature-prepare`,
|
|
286
|
+
`conductor-feature-develop`, `conductor-defect`) or any `modelgen-*` / `mockgen-*` / `specgen-*` /
|
|
287
|
+
`testgen-*` skill. Requirement changes must be reviewed by a human before any downstream artifact
|
|
288
|
+
is generated or code is written. This is true **even under `--auto-approve`** — auto-approve only
|
|
289
|
+
skips the *plan* confirmation, it does NOT authorize downstream execution. Print the summary and
|
|
290
|
+
the follow-ups (as manual, human-triggered next steps) and stop.
|
|
291
|
+
|
|
292
|
+
## Boundary Rules (what this skill does NOT do)
|
|
293
|
+
|
|
294
|
+
- **Never create a new module.** Modules come from CLAUDE.md. If a change needs a module that
|
|
295
|
+
doesn't exist, report it as a follow-up (update CLAUDE.md, run `util-projectsync`, then re-run).
|
|
296
|
+
- **Never create a new application.** Out of scope — report it as a follow-up.
|
|
297
|
+
- **Never touch downstream artifacts** (models, mockups, specs, tests under `context/*`). This
|
|
298
|
+
skill only edits PRD.md. Regenerating artifacts for the new version is the job of
|
|
299
|
+
`conductor-feature-prepare` — but that is a **separate, human-triggered** run after review, not
|
|
300
|
+
something this skill invokes.
|
|
301
|
+
- **Never auto-chain into conductor or generator skills.** After updating the PRDs, stop and hand
|
|
302
|
+
back to the human (see "STOP — Hand Back to the Human"). Even in `--auto-approve` mode, the skill
|
|
303
|
+
applies the PRD changes and stops; it never starts development, preparation, or defect skills.
|
|
304
|
+
- **Never rewrite or delete history.** Prior version blocks, tags, and items are immutable;
|
|
305
|
+
cancellations are strikethroughs, not deletions.
|
|
306
|
+
|
|
307
|
+
## Important Rules
|
|
308
|
+
|
|
309
|
+
- **Layer, don't overwrite.** Every change lands under a NEW version tag appended below existing
|
|
310
|
+
versions. Existing `[vX.Y.Z]` tags and their items are never modified (except adding
|
|
311
|
+
strikethrough + a cancellation marker to a cancelled item's line).
|
|
312
|
+
- **One coherent version per application per run**, applied uniformly to every subsection touched.
|
|
313
|
+
- **Bump = highest severity.** If any change to an application is major, the application bumps
|
|
314
|
+
major; otherwise minor if any change is minor; otherwise patch.
|
|
315
|
+
- **Leave IDs to util-ustagger.** Insert new items untagged; never hand-assign ID codes — that
|
|
316
|
+
risks collisions with the running counters ustagger maintains.
|
|
317
|
+
- **Preserve existing tags and formatting exactly**, including `[USHM…]`/`[NFRHM…]` codes and
|
|
318
|
+
version tags.
|
|
319
|
+
- **Only impacted applications are changed.** Applications with no matching modules are reported
|
|
320
|
+
as "not impacted" and left byte-for-byte unchanged.
|
|
321
|
+
- **Surface ambiguity, don't bury it.** When intent is unclear, put it in the plan and (when
|
|
322
|
+
interactive) let the user decide before writing.
|
|
323
|
+
- **CANCEL requires an existing target.** If the item to cancel/modify can't be found, downgrade
|
|
324
|
+
to ADD and note the discrepancy rather than fabricating a strikethrough.
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: util-usanalyzer
|
|
3
|
+
model: claude-sonnet-4-6
|
|
4
|
+
effort: medium
|
|
5
|
+
description: >
|
|
6
|
+
Analyze PRD.md files for quality issues: incomplete sentences, non-existent references,
|
|
7
|
+
cross-module inconsistencies, contradictory requirements, duplicate roles, design system
|
|
8
|
+
validation, architecture principle violations, and process flow coverage gaps. Validates
|
|
9
|
+
bi-directional coverage between User Stories/NFRs and High Level Process Flows — detects
|
|
10
|
+
modules not covered by any process flow and process flow steps not covered by any User
|
|
11
|
+
Story or NFR. Adds inline [TODO] annotations directly into the PRD.md file for each
|
|
12
|
+
issue found.
|
|
13
|
+
Trigger on keywords: "analyze user story", "analyze user stories", "check user story quality",
|
|
14
|
+
"validate user stories", "find user story issues", "audit user stories", "review user stories",
|
|
15
|
+
"check requirements quality", "find inconsistencies", "find contradictions".
|
|
16
|
+
Accepts an application name as input (e.g., `/util-usanalyzer mainapp`,
|
|
17
|
+
`/util-usanalyzer "Main App"`).
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Util US Analyzer
|
|
21
|
+
|
|
22
|
+
Analyze PRD.md files for quality issues and add `[TODO]` annotations for each issue found.
|
|
23
|
+
|
|
24
|
+
## Input Resolution
|
|
25
|
+
|
|
26
|
+
This skill requires one mandatory argument: `<application>`.
|
|
27
|
+
|
|
28
|
+
| Argument | Required | Description |
|
|
29
|
+
|----------|----------|-------------|
|
|
30
|
+
| `<application>` | Yes | Application name — matched against root-level application folders |
|
|
31
|
+
| `<module>` | No | Optional module name to limit analysis to a single module |
|
|
32
|
+
|
|
33
|
+
### Application Folder Resolution
|
|
34
|
+
|
|
35
|
+
1. List root-level application folders that may have a numeric prefix (e.g., `1_hub_middleware`, `2_hc_adapter`) or no prefix (e.g., `mainapp`)
|
|
36
|
+
2. Strip the leading `<number>_` prefix from each folder name if present (e.g., `1_hub_middleware` -> `hub_middleware`)
|
|
37
|
+
3. Match the provided application name **case-insensitively** against the stripped folder names
|
|
38
|
+
4. Accept `snake_case`, `kebab-case`, or title-case input (e.g., `hub_middleware`, `hub-middleware`, `Hub Middleware` all match `1_hub_middleware`)
|
|
39
|
+
5. If no match is found, list all available application names and **stop**
|
|
40
|
+
|
|
41
|
+
### Auto-Resolved Paths
|
|
42
|
+
|
|
43
|
+
| File | Resolved Path |
|
|
44
|
+
|------|---------------|
|
|
45
|
+
| PRD.md | `<app_folder>/context/PRD.md` |
|
|
46
|
+
|
|
47
|
+
Example invocations:
|
|
48
|
+
- `/util-usanalyzer mainapp`
|
|
49
|
+
- `/util-usanalyzer "Main App"`
|
|
50
|
+
- `/util-usanalyzer mainapp module:Home`
|
|
51
|
+
|
|
52
|
+
## Workflow
|
|
53
|
+
|
|
54
|
+
### 1. Read and Parse PRD.md
|
|
55
|
+
|
|
56
|
+
Read the entire PRD.md file and parse its structure:
|
|
57
|
+
- Identify all module sections (delimited by `## <Module Name>` headers under `# System Module` or `# Business Module`)
|
|
58
|
+
- Within each module, identify subsections: `### User Story`, `### Non Functional Requirement`, `### Constraint`, `### Reference`, `### Test`, `### Bug`
|
|
59
|
+
- Record line numbers for every item for precise TODO annotations
|
|
60
|
+
- Parse the following top-level extended sections if they exist:
|
|
61
|
+
- `# Design System` — extract referenced file paths and any inline declarations
|
|
62
|
+
- `# Architecture Principle` — extract all declared architectural patterns and principles
|
|
63
|
+
- `# High Level Process Flow` — extract all process flow entries (inline or external file references). For external references (e.g., `- Flow Name: Refer to [file.md](path/to/file.md) for the high level process flow`):
|
|
64
|
+
- Extract the flow name (text before the colon)
|
|
65
|
+
- Extract the referenced file path from the markdown link
|
|
66
|
+
- Resolve the path relative to PRD.md's location
|
|
67
|
+
- Read the external file and parse its `# Process/System Flow` section (ordered steps) and `# Statuses` section (per-application status tables)
|
|
68
|
+
- If the external file does not exist, flag the reference line as `BAD_REF` and skip further analysis of that flow
|
|
69
|
+
|
|
70
|
+
### 2. Collect All Roles
|
|
71
|
+
|
|
72
|
+
Scan the entire document and collect every role mentioned in user stories (the part after "As a" / "As" and before the comma or "I want"). Build a normalized role registry mapping each unique role to its canonical form and the line numbers where it appears.
|
|
73
|
+
|
|
74
|
+
### 3. Collect All Cross-References
|
|
75
|
+
|
|
76
|
+
Scan the entire document for:
|
|
77
|
+
- References to other modules (e.g., mentions of `Batch Job`, `Audit Trail`, `Headcount`, etc.)
|
|
78
|
+
- References to external documents or sections (e.g., `[PROJECT.md](../PROJECT.md)`)
|
|
79
|
+
- References to pages, sections, or features by name within user stories, NFRs, constraints
|
|
80
|
+
|
|
81
|
+
Build a registry of all outbound references per module.
|
|
82
|
+
|
|
83
|
+
### 4. Run Analysis Checks
|
|
84
|
+
|
|
85
|
+
**Skip empty modules entirely.** If a module has no content in any of its subsections (User Story, Non Functional Requirement, Constraint, Reference are all empty — no bullet items), skip that module completely. Do not flag empty sections or run any checks on empty modules.
|
|
86
|
+
|
|
87
|
+
Execute the following checks in order. For each issue found, record the line number, issue category, and a description.
|
|
88
|
+
|
|
89
|
+
#### 4.1 Incomplete User Stories
|
|
90
|
+
|
|
91
|
+
Check every top-level bullet under `### User Story` sections:
|
|
92
|
+
- Must follow the Agile format: **"As a [role], I want [feature] so that [benefit]"** or **"As [role], I want [feature] so that [benefit]"**
|
|
93
|
+
- Flag items missing "I want" clause
|
|
94
|
+
- Flag items missing "so that" clause (benefit/justification)
|
|
95
|
+
- Flag items that appear to be truncated or end abruptly (e.g., ending with a colon but no sub-bullets, or trailing whitespace with no content)
|
|
96
|
+
**Exception:** User stories that end with a colon (`:`) followed by sub-bullets describing the detail are acceptable — they provide the "what" through their sub-items. Only flag these if the sub-bullets are missing.
|
|
97
|
+
|
|
98
|
+
#### 4.2 Non-Existent References
|
|
99
|
+
|
|
100
|
+
For each reference found in step 3:
|
|
101
|
+
- If it references an external file (e.g., `[PROJECT.md](../PROJECT.md)`), verify the file exists at the resolved path relative to the PRD.md location
|
|
102
|
+
- If it references a module by name (e.g., backtick-quoted `Batch Job`), verify that module exists as a `## <Module>` section in the document
|
|
103
|
+
- If it references a page or feature (e.g., "redirect to the Headcount list page"), verify that the referenced module exists
|
|
104
|
+
|
|
105
|
+
#### 4.3 Cross-Module Inconsistencies
|
|
106
|
+
|
|
107
|
+
For each module, check:
|
|
108
|
+
- If a user story, NFR, or constraint mentions a feature/entity from another module (e.g., "Headcount Fulfillment Status"), verify that feature is actually defined in the referenced module
|
|
109
|
+
- If a user story mentions navigating to another module's page (e.g., "redirect to the Sub Project details page"), verify that view/page is described in the target module's user stories
|
|
110
|
+
- If an NFR or constraint references a concept from another module (e.g., "using `Batch Job`"), verify the referenced module defines that concept
|
|
111
|
+
|
|
112
|
+
#### 4.4 Contradictory Requirements
|
|
113
|
+
|
|
114
|
+
Compare requirements within the same module and across modules:
|
|
115
|
+
- Look for NFRs or constraints that directly contradict each other (e.g., one says "will be automatically deleted" while another says "will not be automatically deleted")
|
|
116
|
+
- Look for user stories that grant permissions contradicted by constraints (e.g., a user story allows editing but a constraint says the data is read-only)
|
|
117
|
+
- Look for status values or enums defined differently in different places (e.g., status list in user story differs from status list in constraint)
|
|
118
|
+
- Look for contradictions between NFR and Constraint sections within the same module (e.g., Sub Project NFR says it has status values but Constraint says it will not have status)
|
|
119
|
+
|
|
120
|
+
#### 4.5 Duplicate Roles
|
|
121
|
+
|
|
122
|
+
Using the role registry from step 2:
|
|
123
|
+
- Identify roles that are semantically similar but named differently (e.g., "Project Manager" vs "PM", "user" vs "User", "staff" vs "Staff")
|
|
124
|
+
- Check the `## Role` module's constraint section for the canonical role list
|
|
125
|
+
- Flag any role used in user stories that doesn't match the canonical list
|
|
126
|
+
- Flag inconsistent capitalization of the same role (e.g., "a user" vs "a User")
|
|
127
|
+
|
|
128
|
+
#### 4.6 Design System Reference Validation
|
|
129
|
+
|
|
130
|
+
If a `# Design System` section exists in PRD.md:
|
|
131
|
+
- Extract the referenced file path (e.g., from `[DESIGN_SYSTEM.md](reference/DESIGN_SYSTEM.md)`)
|
|
132
|
+
- Resolve the path relative to PRD.md's location
|
|
133
|
+
- Verify the referenced file actually exists at the resolved path
|
|
134
|
+
- If the file does not exist, flag as `BAD_REF`
|
|
135
|
+
- If the design system file exists, read it and extract declared UI component patterns, layout conventions, and interaction patterns. Then:
|
|
136
|
+
- Cross-reference User Stories that describe UI behavior (e.g., "view dashboard", "search for", "view details") with the design system's declared patterns
|
|
137
|
+
- If a User Story describes a UI interaction or component that directly contradicts a design system declaration (e.g., user story says "popup modal" but design system prohibits modals in favor of inline expansion), flag as `CONTRADICTION`
|
|
138
|
+
- Only flag clear contradictions — do not flag User Stories that simply omit UI detail, as implementation choices belong in the specification phase
|
|
139
|
+
|
|
140
|
+
#### 4.7 Architecture Principle Consistency
|
|
141
|
+
|
|
142
|
+
If an `# Architecture Principle` section exists in PRD.md:
|
|
143
|
+
- Extract declared architectural patterns (e.g., "stateless", "event-driven", "document based database", "message driven", "monolithic", "container based", "file storage using GridFS")
|
|
144
|
+
- Cross-reference with User Stories, NFRs, and Constraints across all modules:
|
|
145
|
+
- If architecture declares "stateless" but a User Story or NFR implies server-side session storage, flag as `ARCH_VIOLATION`
|
|
146
|
+
- If architecture declares "document based database" but a User Story, NFR or constraint references SQL joins, foreign key enforcement, or relational schema concepts, flag as `ARCH_VIOLATION`
|
|
147
|
+
- If architecture declares "event-driven" inter-module communication but a User Story or NFR describes synchronous direct calls between modules, flag as `ARCH_VIOLATION`
|
|
148
|
+
- If architecture declares "message driven" processing but a User Story, NFR or constraint implies synchronous external API polling for message processing, flag as `ARCH_VIOLATION`
|
|
149
|
+
- If architecture declares a specific file storage mechanism (e.g., "GridFS in MongoDB") but an NFR or constraint describes a different file storage approach (e.g., local filesystem, S3), flag as `ARCH_VIOLATION`
|
|
150
|
+
- If architecture declares "monolithic" design but a User Story or NFR describes deploying separate microservices, flag as `ARCH_VIOLATION`
|
|
151
|
+
- If architecture declares a specific framework/technology (e.g., "Spring Boot", "JTE template engine") but an NFR or constraint references an incompatible technology, flag as `ARCH_VIOLATION`
|
|
152
|
+
- Also check Test sections: if test instructions reference infrastructure or tooling that contradicts architecture principles (e.g., test setup assumes a relational DB when architecture declares document-based), flag as `ARCH_VIOLATION`
|
|
153
|
+
- Only flag clear, unambiguous contradictions — patterns that directly oppose the stated architectural principle
|
|
154
|
+
|
|
155
|
+
#### 4.8 Process Flow Coverage and Consistency
|
|
156
|
+
|
|
157
|
+
If a `# High Level Process Flow` section exists in PRD.md:
|
|
158
|
+
|
|
159
|
+
##### 4.8.1 Parse and Resolve Process Flows
|
|
160
|
+
|
|
161
|
+
- Each process flow entry in the `# High Level Process Flow` section may be:
|
|
162
|
+
- **Inline**: A named subsection (e.g., `## Recruitment Agent Sync`) with ordered steps as bullet items directly in PRD.md
|
|
163
|
+
- **External reference**: A bullet item referencing an external file (e.g., `- Recruitment Agent Sync: Refer to [ra_sync.md](path/ra_sync.md) for the high level process flow`)
|
|
164
|
+
- For external references:
|
|
165
|
+
- Extract the flow name (text before the colon)
|
|
166
|
+
- Extract the referenced file path from the markdown link
|
|
167
|
+
- Resolve the path relative to PRD.md's location
|
|
168
|
+
- Read the external file and parse its `# Process/System Flow` section (ordered numbered steps) and `# Statuses` section (per-application status tables)
|
|
169
|
+
- If the file does not exist, flag as `BAD_REF` and skip further analysis of that flow
|
|
170
|
+
- For each successfully parsed flow, build a flow registry containing:
|
|
171
|
+
- Flow name (e.g., "Recruitment Agent Sync", "Job Demand", "Candidate Registration")
|
|
172
|
+
- All numbered steps with their descriptions
|
|
173
|
+
- Application-relevant steps (steps that mention the current application name — inferred from the root folder name, e.g., "Hub Middleware")
|
|
174
|
+
- Application-specific statuses from the status table (if defined)
|
|
175
|
+
|
|
176
|
+
##### 4.8.2 Flow → Module Coverage (Forward Check)
|
|
177
|
+
|
|
178
|
+
For each process flow that has application-relevant steps:
|
|
179
|
+
- **Module existence**: Match the flow name to a module under `# System Module` or `# Business Module`. If no module with a matching name exists, flag the flow entry line in the `# High Level Process Flow` section as `FLOW_COVERAGE` with description: "Process flow '<flow name>' has steps for this application but no corresponding module exists in PRD"
|
|
180
|
+
- **Step-to-NFR coverage**: For each application-relevant step in the flow, verify the corresponding module has an NFR that describes the behavior:
|
|
181
|
+
- **Message consumption**: If a step describes consuming/listening to messages from a queue, the module must have an NFR describing message queue consumption (e.g., "listen to incoming messages from ... via message queue"). If missing, flag the module's first NFR line as `FLOW_COVERAGE` with description: "Process flow '<flow name>' step <N> describes message consumption but no NFR in module '<module>' covers this behavior"
|
|
182
|
+
- **Message publishing/forwarding**: If a step describes publishing messages to a queue (forwarding to another system), the module must have an NFR describing message publishing. If missing, flag as `FLOW_COVERAGE`
|
|
183
|
+
- **Acknowledgement publishing**: If a step describes publishing acknowledgement messages, the module must have an NFR describing acknowledgement behavior. If missing, flag as `FLOW_COVERAGE`
|
|
184
|
+
- **Data recording**: If a step describes recording/storing messages in the database, the module must have an NFR describing data storage/recording. If missing, flag as `FLOW_COVERAGE`
|
|
185
|
+
- **Error/failure paths**: If the flow describes error or failure paths (e.g., "response with error if validation failed"), the module must have an NFR or constraint handling that error condition. If missing, flag as `FLOW_COVERAGE`
|
|
186
|
+
- **Cross-entity extraction**: If a flow step implies the application extracts or creates entities managed by other modules (e.g., Job Demand processing that extracts Employer and Recruitment Agent data), verify there is an NFR in either the flow's primary module or the target module describing this extraction. If missing, flag as `FLOW_COVERAGE`
|
|
187
|
+
|
|
188
|
+
##### 4.8.3 Module → Flow Coverage (Reverse Check)
|
|
189
|
+
|
|
190
|
+
For each module under `# System Module` or `# Business Module`, scan its NFRs for any of the following message-processing behaviors:
|
|
191
|
+
- Listening to / consuming messages from a message queue
|
|
192
|
+
- Publishing messages to a message queue
|
|
193
|
+
- Publishing acknowledgement messages to a message queue
|
|
194
|
+
- Processing incoming messages from external systems via message queue
|
|
195
|
+
|
|
196
|
+
If any NFR describes such behavior, verify that:
|
|
197
|
+
- There is a corresponding process flow in the `# High Level Process Flow` section whose name matches or covers this module
|
|
198
|
+
- OR the module's message-processing NFR explicitly references another module's process flow (e.g., an NFR says "updated from Job Demand messages" — this is covered by the Job Demand flow)
|
|
199
|
+
|
|
200
|
+
If no process flow covers the module's message-processing behavior (directly or via cross-reference), flag the first message-processing NFR in the module as `FLOW_COVERAGE` with description: "Module '<module name>' has message-processing NFRs (e.g., <NFR_ID>) but is not covered by any High Level Process Flow"
|
|
201
|
+
|
|
202
|
+
**Exceptions — do NOT flag these modules:**
|
|
203
|
+
- Modules whose NFRs only describe internal asynchronous processing (e.g., event listeners triggered within the application, scheduled tasks, internal Spring events) without external message queue interaction
|
|
204
|
+
- Modules whose NFRs explicitly state they receive data as a side effect of another module's message processing (e.g., "Employer information will be extracted from the incoming Job Demand message") — these are indirectly covered by the parent flow
|
|
205
|
+
|
|
206
|
+
##### 4.8.4 User Story ↔ Process Flow Alignment
|
|
207
|
+
|
|
208
|
+
For each module that is covered by a process flow (either directly or indirectly):
|
|
209
|
+
- **Data availability check**: If a User Story describes viewing, searching, or managing data (e.g., "search for Employer"), verify that the data referenced in the User Story is delivered to the application by at least one process flow. If a User Story references an entity or data type that no process flow delivers, flag the User Story as `FLOW_COVERAGE` with description: "User story <US_ID> references '<entity/data>' but no process flow delivers this data to the application"
|
|
210
|
+
- **Contradiction check**: If a User Story implies manual creation or modification of data that a process flow says is only received via message queue (read-only from the application's perspective), and no constraint explicitly permits manual override, flag as `CONTRADICTION`
|
|
211
|
+
- **Completeness check**: If a process flow delivers data to the application (e.g., Candidate Registration messages) but the corresponding module has NO User Stories for viewing or managing that data, flag the module's `### User Story` section as `FLOW_COVERAGE` with description: "Process flow '<flow name>' delivers data to this application but module '<module>' has no User Stories for viewing or managing this data"
|
|
212
|
+
|
|
213
|
+
**Exception**: Modules that are purely system/infrastructure modules (e.g., Authentication, Audit Trail) or modules that only store data as a side effect of another module's processing and have their own explicit User Stories are not required to have a 1:1 User Story for every piece of flow-delivered data.
|
|
214
|
+
|
|
215
|
+
##### 4.8.5 NFR ↔ Process Flow Status Coverage
|
|
216
|
+
|
|
217
|
+
For each process flow that defines application-specific statuses in its status table:
|
|
218
|
+
- Each status should correspond to a behavior described by an NFR in the relevant module
|
|
219
|
+
- If a status is defined in the flow's status table for the application but no NFR in the corresponding module describes the behavior that triggers that status (e.g., status `PROCESSED` implies message processing, status `SC_ACKNOWLEDGED` implies publishing acknowledgement), flag the module's first NFR as `FLOW_COVERAGE` with description: "Process flow '<flow name>' defines status '<STATUS_CODE>' for this application but no NFR in module '<module>' describes the behavior triggering this status"
|
|
220
|
+
- Conversely, if an NFR describes a status-producing behavior (e.g., "publish acknowledgement message") but the process flow's status table does not include a matching status for the application, flag the NFR as `FLOW_COVERAGE` with description: "NFR <NFR_ID> describes behavior that should produce a status but process flow '<flow name>' does not define a corresponding application status"
|
|
221
|
+
|
|
222
|
+
##### 4.8.6 Test Section ↔ Process Flow Alignment
|
|
223
|
+
|
|
224
|
+
For modules covered by a process flow:
|
|
225
|
+
- If the `### Test` section defines test data or test configuration, verify it is consistent with what the process flow describes
|
|
226
|
+
- If test instructions reference message structures, queue names, or external system interactions, they should be consistent with the process flow's description. If a test references a message type or system interaction not present in any process flow, flag as `FLOW_COVERAGE`
|
|
227
|
+
- Do not flag empty Test sections — test completeness is not the concern of this check
|
|
228
|
+
|
|
229
|
+
##### 4.8.7 Reference Section ↔ Process Flow Alignment
|
|
230
|
+
|
|
231
|
+
For modules covered by a process flow:
|
|
232
|
+
- If the `### Reference` section references message structure documents (e.g., `[Job Demand Message](path/to/MESSAGE_JOB_DEMAND.md)`), verify the referenced message type aligns with what the process flow says the application receives
|
|
233
|
+
- If a Reference points to a message structure for a recruitment step that has no process flow defined, flag as `FLOW_COVERAGE` with description: "Reference <REF_ID> points to message structure for '<message type>' but no process flow is defined for this recruitment step"
|
|
234
|
+
|
|
235
|
+
### 5. Insert TODO Annotations
|
|
236
|
+
|
|
237
|
+
For each issue found, insert a `[TODO]` annotation in the PRD.md file:
|
|
238
|
+
|
|
239
|
+
**Placement rules:**
|
|
240
|
+
- Insert the `[TODO]` as a new line **immediately above** (before) the problematic line, at the **same indentation level** as the problematic line
|
|
241
|
+
- If the issue relates to a section-level problem (e.g., empty section, cross-module inconsistency), insert the `[TODO]` as a top-level bullet above the first item after the version tag line
|
|
242
|
+
|
|
243
|
+
**Format:**
|
|
244
|
+
```
|
|
245
|
+
- [TODO] <CATEGORY>: <description> (line <N>)
|
|
246
|
+
- <the problematic line stays unchanged below>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Categories:**
|
|
250
|
+
| Category | Code |
|
|
251
|
+
|----------|------|
|
|
252
|
+
| Incomplete User Story | `INCOMPLETE` |
|
|
253
|
+
| Non-Existent Reference | `BAD_REF` |
|
|
254
|
+
| Cross-Module Inconsistency | `CROSS_MODULE` |
|
|
255
|
+
| Contradictory Requirement | `CONTRADICTION` |
|
|
256
|
+
| Duplicate Role | `DUP_ROLE` |
|
|
257
|
+
| Architecture Violation | `ARCH_VIOLATION` |
|
|
258
|
+
| Process Flow Coverage Gap | `FLOW_COVERAGE` |
|
|
259
|
+
|
|
260
|
+
**Examples:**
|
|
261
|
+
```markdown
|
|
262
|
+
- [TODO] INCOMPLETE: User story is missing content after the colon — no sub-bullets describing what the dashboard shows. Add the dashboard items or remove the trailing colon. (line 25)
|
|
263
|
+
- As Management Team, I want to be able to view the dashboard showing:
|
|
264
|
+
- [TODO] INCOMPLETE: User story is missing "so that [benefit]" clause. Add the business justification. (line 304)
|
|
265
|
+
- [TODO] INCOMPLETE: Possible typo — "be to manage" should likely be "be able to manage". (line 304)
|
|
266
|
+
- As Super Admin, I want to be to manage divisions
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 6. Output Summary
|
|
270
|
+
|
|
271
|
+
After inserting all TODOs, print a summary table:
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
## Analysis Summary for <Application Name>
|
|
275
|
+
|
|
276
|
+
| Category | Count | Modules Affected |
|
|
277
|
+
|-----------------------|-------|-----------------------------------|
|
|
278
|
+
| Incomplete | X | Home, Division, ... |
|
|
279
|
+
| Bad Reference | X | ... |
|
|
280
|
+
| Cross-Module | X | ... |
|
|
281
|
+
| Contradiction | X | ... |
|
|
282
|
+
| Duplicate Role | X | ... |
|
|
283
|
+
| Arch Violation | X | ... |
|
|
284
|
+
| Flow Coverage | X | ... |
|
|
285
|
+
| **Total** | **X** | |
|
|
286
|
+
|
|
287
|
+
### Details by Module
|
|
288
|
+
|
|
289
|
+
#### <Module Name>
|
|
290
|
+
- [INCOMPLETE] line X: <brief description>
|
|
291
|
+
- [BAD_REF] line Y: <brief description>
|
|
292
|
+
...
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Important Rules
|
|
296
|
+
|
|
297
|
+
- **NEVER remove, modify, or delete existing content.** Only add new `[TODO]` annotation lines.
|
|
298
|
+
- **NEVER modify existing tags** (e.g., `[USHM00003]`, `[v1.0.0]`). These are immutable identifiers.
|
|
299
|
+
- Preserve all existing content, formatting, and indentation exactly.
|
|
300
|
+
- Each TODO must reference the specific line number where the issue was found for easy navigation.
|
|
301
|
+
- Be precise and actionable in TODO descriptions — state what the issue is AND what needs to be done to fix it.
|
|
302
|
+
- Do not flag stylistic preferences — only flag genuine quality issues that could lead to implementation ambiguity.
|
|
303
|
+
- If a module filter is provided, only analyze that module but still check cross-module references involving it.
|
|
304
|
+
- Do not insert duplicate TODOs — if the same issue applies to multiple lines, annotate each line individually but do not repeat the same TODO on the same line.
|
|
305
|
+
- Tables, blank lines, version tags (e.g., `[v1.0.0]`), and section headers are never annotated.
|
|
306
|
+
- When checking for contradictions, consider the full context — an NFR in one module may intentionally override a general rule stated elsewhere. Only flag clear, unambiguous contradictions.
|
|
307
|
+
- When checking roles, the canonical role list is defined in the `## Role > ### Constraint` section under the Role module. Roles not in this list should be flagged.
|