@v11g/agents-rock 1.0.2 → 1.0.4
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/README.md +4 -2
- package/package.json +1 -1
- package/plugins/business-analyst/.claude-plugin/plugin.json +9 -0
- package/plugins/business-analyst/skills/business-analyst/README.md +23 -0
- package/plugins/business-analyst/skills/business-analyst/SKILL.md +73 -0
- package/plugins/business-analyst/skills/business-analyst/references/ai-extension.md +37 -0
- package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +53 -0
- package/plugins/business-analyst/skills/business-analyst/references/interview.md +89 -0
- package/plugins/business-analyst/skills/business-analyst/references/review.md +25 -0
- package/plugins/business-analyst/skills/business-analyst/references/writing.md +102 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +166 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/schema.mjs +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +188 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/e2e.test.mjs +17 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-fail.json +205 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.json +59 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.md +63 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/python-parity.test.mjs +50 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/schema.test.mjs +41 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +20 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.py +288 -0
- package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +4 -2
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/chrome.mjs +4 -1
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/viewer-template.test.mjs +3 -2
- package/plugins/solution-architect/skills/estimate/SKILL.md +13 -5
- package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +917 -0
- package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +430 -13
- package/plugins/solution-architect/skills/estimate/references/agentic-estimation.md +148 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +10 -0
- package/plugins/solution-architect/skills/estimate/references/interview.md +20 -1
- package/plugins/solution-architect/skills/estimate/references/task-shapes.md +173 -0
- package/plugins/solution-architect/skills/estimate/references/writing.md +31 -0
- package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +5 -1
- package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +65 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/baselines.mjs +107 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +16 -7
- package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +14 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/measurements.mjs +59 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +28 -5
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +53 -22
- package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +52 -7
- package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -3
- package/plugins/solution-architect/skills/estimate/scripts/test/baselines.test.mjs +120 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +69 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +28 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md +55 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md +54 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +45 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/measurements.jsonl +20 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/measurements.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +25 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +48 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +59 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +37 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +168 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/zip.mjs +41 -0
- package/plugins/solution-architect/skills/new-lead/SKILL.md +15 -10
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/detail.html +25 -50
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/index.html +20 -40
- package/plugins/solution-architect/skills/new-lead/scripts/lib/map-nodes.mjs +12 -4
- package/plugins/solution-architect/skills/new-lead/scripts/serve.mjs +8 -3
- package/plugins/solution-architect/skills/new-lead/scripts/test/map.test.mjs +4 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/serve.test.mjs +25 -21
package/README.md
CHANGED
|
@@ -81,7 +81,8 @@ rather than a hang.
|
|
|
81
81
|
|
|
82
82
|
| Plugin | Description | Version |
|
|
83
83
|
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
84
|
-
| `
|
|
84
|
+
| `business-analyst` | Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture. | 0.2.0 |
|
|
85
|
+
| `solution-architect` | Solution-architecture toolkit: interview-driven architecture documentation with interactive diagrams and provenance-tagged facts, AI-aware project estimation, and client-ready proposals. | 1.1.1 |
|
|
85
86
|
| `lmk` | Terminal-native visual explainer: explains the current topic with cheap diagrams (flowcharts, sequences, timelines, tables) rendered directly in the terminal via a bundled Mermaid renderer. | 0.1.0 |
|
|
86
87
|
|
|
87
88
|
## Skills
|
|
@@ -93,11 +94,12 @@ for automatically by the agent when the task fits.
|
|
|
93
94
|
|
|
94
95
|
**User-invoked**
|
|
95
96
|
|
|
96
|
-
- **[new-lead](./plugins/solution-architect/skills/new-lead/SKILL.md)** (`solution-architect`) — Orchestrator: sets up a lead workspace and launches analyze-requirements → estimate → proposal in order, stopping between each, plus a leads dashboard.
|
|
97
|
+
- **[new-lead](./plugins/solution-architect/skills/new-lead/SKILL.md)** (`solution-architect`) — Orchestrator: sets up a lead workspace and launches business-analyst (when installed) → analyze-requirements → estimate → proposal in order, stopping between each, plus a leads dashboard.
|
|
97
98
|
- **[lmk](./plugins/lmk/skills/lmk/SKILL.md)** (`lmk`) — `/lmk` explains the current topic visually in the terminal; bare `/lmk` recaps the last substantial thing. Also auto-triggers on keywords like "explain this", "show me", or "I'm lost".
|
|
98
99
|
|
|
99
100
|
**Model-invoked**
|
|
100
101
|
|
|
102
|
+
- **[business-analyst](./plugins/business-analyst/skills/business-analyst/SKILL.md)** (`business-analyst`) — Interview-driven requirements discovery: turns raw client input (emails, notes, transcripts) into a validated requirements package (requirements.md + requirements.json) with labeled facts, open questions, and a readiness gate; triggers on asks to analyze client requirements, run discovery, or clarify a vague request. `new-lead` offers it as optional step 0 when installed.
|
|
101
103
|
- **[analyze-requirements](./plugins/solution-architect/skills/analyze-requirements/SKILL.md)** (`solution-architect`) — Interview-driven architecture documentation with interactive diagrams and provenance-tagged facts; triggers on asks for architecture docs, C4 diagrams, ADRs, or a threat model.
|
|
102
104
|
- **[estimate](./plugins/solution-architect/skills/estimate/SKILL.md)** (`solution-architect`) — Interview-driven, AI-aware project estimation with an interactive what-if page; triggers on asks for an estimate, quote, timeline, or "how long would this take".
|
|
103
105
|
- **[proposal](./plugins/solution-architect/skills/proposal/SKILL.md)** (`solution-architect`) — Pre-sales client proposal rendered as a print-ready page; triggers on asks for a proposal, client pitch, or "something I can send the client".
|
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "business-analyst",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Business-analysis toolkit: interview-driven requirements discovery that turns raw client input into a validated, traceable requirements package ready for solution architecture.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Truong Vu",
|
|
7
|
+
"email": "vukhanhtruong@gmail.com"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# business-analyst
|
|
2
|
+
|
|
3
|
+
Requirements discovery for pre-sales leads. Feed it raw client input —
|
|
4
|
+
emails, meeting notes, transcripts, briefs — and it interviews you to fill
|
|
5
|
+
the gaps, then writes a validated requirements package:
|
|
6
|
+
|
|
7
|
+
- `requirements.md` — discovery brief, process analysis, requirements,
|
|
8
|
+
acceptance scenarios, readiness report (five parts, one file)
|
|
9
|
+
- `requirements.json` — machine-readable handoff with stable IDs
|
|
10
|
+
|
|
11
|
+
Designed to run before the solution-architect plugin's chain
|
|
12
|
+
(`analyze-requirements` → `estimate` → `proposal`); its `new-lead`
|
|
13
|
+
orchestrator offers this skill as step 0 when installed. Also works
|
|
14
|
+
standalone: `/business-analyst` in any project directory.
|
|
15
|
+
|
|
16
|
+
The package is gated by `scripts/validate.mjs`: schema, ID traceability,
|
|
17
|
+
label discipline, an ambiguity lint on requirement text, readiness math,
|
|
18
|
+
and md↔json consistency.
|
|
19
|
+
|
|
20
|
+
Requires Node ≥ 20 or Python ≥ 3.10 (`scripts/validate.py` is a
|
|
21
|
+
parity-tested port of the validator, so the skill also runs on claude.ai —
|
|
22
|
+
zip this folder and upload it under Settings → Features). No dependencies
|
|
23
|
+
either way.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: business-analyst
|
|
3
|
+
description: Interview-driven requirements discovery — turn raw client input (emails, notes, transcripts, briefs) into a validated, traceable requirements package before solution architecture. Use when the user asks to analyze client requirements, run discovery on a lead, clarify a vague request, build a BA requirements package, or prepare requirements for architecture and estimation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# business-analyst
|
|
7
|
+
|
|
8
|
+
Turn incomplete client input into two artifacts in the lead directory:
|
|
9
|
+
`requirements.md` (five parts, human-readable) and `requirements.json`
|
|
10
|
+
(machine handoff for analyze-requirements, estimate, and proposal).
|
|
11
|
+
|
|
12
|
+
## Hard rules
|
|
13
|
+
|
|
14
|
+
1. Never invent requirements — every material fact carries a label
|
|
15
|
+
(`confirmed` | `assumed` | `recommended`) and a source. A
|
|
16
|
+
recommendation never renders as a confirmed requirement.
|
|
17
|
+
2. Problem before solution — no technology recommendations, no
|
|
18
|
+
architecture. This skill stops at WHAT; HOW belongs to
|
|
19
|
+
analyze-requirements and later skills.
|
|
20
|
+
3. Unknowns render as open questions, never silently filled. Distinguish
|
|
21
|
+
unknown (client doesn't know) from undecided (client must choose).
|
|
22
|
+
4. Never block on unanswered questions — write the package with an honest
|
|
23
|
+
status and readiness; a re-run refines it, never restarts the interview.
|
|
24
|
+
5. Every requirement carries a stable ID and traceability links;
|
|
25
|
+
`node scripts/validate.mjs` must exit 0 before the package is final.
|
|
26
|
+
6. The human reviews requirements.md before status may become
|
|
27
|
+
`READY_FOR_ARCHITECTURE`.
|
|
28
|
+
|
|
29
|
+
## Flow
|
|
30
|
+
|
|
31
|
+
1. **Detect evidence**: input documents? an existing `requirements.json`
|
|
32
|
+
(re-run — see Re-run)? greenfield or existing system? State findings;
|
|
33
|
+
the user can override.
|
|
34
|
+
2. **Depth**: ask QUICK / STANDARD / DEEP first
|
|
35
|
+
(`references/interview.md` §6).
|
|
36
|
+
3. **Extract**: pull every known goal, actor, process, rule, constraint,
|
|
37
|
+
integration, and assumption from ALL inputs before asking anything.
|
|
38
|
+
4. **Gap analysis**: extracted knowledge vs the nine layers
|
|
39
|
+
(`references/interview.md` §4) → prioritized P1/P2/P3 gap list.
|
|
40
|
+
5. **Select frameworks**: from `references/frameworks.md` — justify each
|
|
41
|
+
pick in one line; never apply all.
|
|
42
|
+
6. **Interview**: per `references/interview.md` — grouped, adaptive,
|
|
43
|
+
contradiction-challenging, example-hungry. Solution involves AI or
|
|
44
|
+
agents → also work through `references/ai-extension.md`.
|
|
45
|
+
7. **Write**: requirements.md + requirements.json per
|
|
46
|
+
`references/writing.md`.
|
|
47
|
+
8. **Validate**: `node scripts/validate.mjs --json <dir>/requirements.json
|
|
48
|
+
--md <dir>/requirements.md` — fix findings, re-run until clean. No Node
|
|
49
|
+
in the environment (e.g. the claude.ai sandbox) → run
|
|
50
|
+
`python3 scripts/validate.py` with the same flags; identical checks.
|
|
51
|
+
9. **Fresh-eyes review**: dispatch a subagent per `references/review.md`;
|
|
52
|
+
apply findings, re-validate; one cycle max.
|
|
53
|
+
10. **Human review**: show Part 5 (readiness report); the human confirms
|
|
54
|
+
the status. Only they can promote it to `READY_FOR_ARCHITECTURE`.
|
|
55
|
+
|
|
56
|
+
## Re-run
|
|
57
|
+
|
|
58
|
+
`requirements.json` already exists → diff the new answers and material into
|
|
59
|
+
the registers (answer open questions, confirm assumptions, add findings),
|
|
60
|
+
keep every existing ID stable, recompute readiness, and advance the status.
|
|
61
|
+
Never restart the interview; ask only what is still open.
|
|
62
|
+
|
|
63
|
+
## Handoff
|
|
64
|
+
|
|
65
|
+
Downstream skills treat `requirements.json` as detected evidence — never a
|
|
66
|
+
prerequisite. FR/BR/ASM/Q ids are stable so architecture decisions and
|
|
67
|
+
estimates can cite them.
|
|
68
|
+
|
|
69
|
+
## Dependency
|
|
70
|
+
|
|
71
|
+
Node ≥ 20, or Python ≥ 3.10 where Node is unavailable (`scripts/validate.py`
|
|
72
|
+
is a parity-tested port of `scripts/validate.mjs`). Scripts are
|
|
73
|
+
dependency-free either way.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# AI-specific investigation
|
|
2
|
+
|
|
3
|
+
Trigger: the solution involves AI, an agent, an LLM, a chatbot, ML
|
|
4
|
+
classification, or "automation with judgment". When triggered, work
|
|
5
|
+
through all six areas below and fill the json `ai` object (otherwise it
|
|
6
|
+
stays `null`).
|
|
7
|
+
|
|
8
|
+
## Areas
|
|
9
|
+
|
|
10
|
+
1. **Agent responsibility** — which decisions or actions does the AI
|
|
11
|
+
perform, exactly?
|
|
12
|
+
2. **Decision boundary** — for each responsibility: does the AI
|
|
13
|
+
*recommend*, *decide*, or *execute*? Push for one verb per action.
|
|
14
|
+
3. **Human-in-the-loop** — which actions require review, approval, or
|
|
15
|
+
escalation, and by whom (an ACT- id)?
|
|
16
|
+
4. **Tool access** — which systems may the agent read? Which may it write
|
|
17
|
+
or act on? Map each to an INT- entry.
|
|
18
|
+
5. **Failure handling** — expected behavior when confidence is low, input
|
|
19
|
+
is incomplete, a tool fails, results conflict, or policy blocks action.
|
|
20
|
+
6. **Evaluation requirements** — representative test cases, expected and
|
|
21
|
+
unacceptable behavior, quality metric, threshold. Ask for real sample
|
|
22
|
+
data ("can you provide 20 contracts with known-good answers?").
|
|
23
|
+
|
|
24
|
+
## json shape
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
"ai": {
|
|
28
|
+
"decisionBoundary": [{ "action": "flag risky clauses", "authority": "recommend" }],
|
|
29
|
+
"hitl": [{ "action": "contract approval", "gate": "lawyer review", "actor": "ACT-003" }],
|
|
30
|
+
"toolAccess": [{ "integration": "INT-002", "access": "read" }],
|
|
31
|
+
"failureHandling": [{ "condition": "low confidence", "behavior": "escalate to lawyer queue" }],
|
|
32
|
+
"evalRequirements": [{ "capability": "risky-clause detection", "dataset": "200 representative contracts", "metric": "recall on critical risks", "threshold": ">= 0.95" }]
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Guardrails ("the agent cannot approve contracts") are business rules —
|
|
37
|
+
file them as BR- entries and reference them from the affected FR.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Framework selection
|
|
2
|
+
|
|
3
|
+
Pick by symptom, never apply all. Justify each pick to the user in one
|
|
4
|
+
line. Two frameworks per engagement is typical; four is the ceiling.
|
|
5
|
+
|
|
6
|
+
| Symptom in the input | Framework |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| Request names a solution, problem unclear ("we need a chatbot") | 5 Whys |
|
|
9
|
+
| Manual workflow described; stated process may differ from reality | Contextual inquiry |
|
|
10
|
+
| Multiple actors, approvals, handoffs | Process mapping |
|
|
11
|
+
| Feature list with no link to outcomes | Impact mapping |
|
|
12
|
+
| Complex or ambiguous business rules, edge cases matter | Example mapping |
|
|
13
|
+
| Product scope / MVP boundary undefined | Story mapping |
|
|
14
|
+
| Behavior must be precise, rule-heavy | Specification by example |
|
|
15
|
+
| Requirements mature enough to test | Given / When / Then |
|
|
16
|
+
|
|
17
|
+
## 5 Whys
|
|
18
|
+
Ask "why" down from the stated solution until a business problem appears
|
|
19
|
+
(usually 3–5 levels). Produces: root problem, motivation, outcome.
|
|
20
|
+
Example: "We need a chatbot" → why → "support tickets take 2 days" → why →
|
|
21
|
+
"tier-1 answers are manual" → root problem: repetitive tier-1 load.
|
|
22
|
+
|
|
23
|
+
## Contextual inquiry
|
|
24
|
+
Ask the client to walk through a recent real case, step by step, naming
|
|
25
|
+
systems and people. Produces: the actual process, workarounds, hidden
|
|
26
|
+
steps, pain points. Trigger phrase: "Walk me through the last time…"
|
|
27
|
+
|
|
28
|
+
## Process mapping
|
|
29
|
+
Draw the as-is flow (actors, decisions, handoffs) as a mermaid flowchart;
|
|
30
|
+
confirm; then draw to-be. Produces: WF- entries, decision points,
|
|
31
|
+
exceptions.
|
|
32
|
+
|
|
33
|
+
## Impact mapping
|
|
34
|
+
WHY (business goal) → WHO (actors) → HOW (behavior change) → WHAT
|
|
35
|
+
(capability). A feature that maps to no WHY becomes an open question, not
|
|
36
|
+
a requirement.
|
|
37
|
+
|
|
38
|
+
## Example mapping
|
|
39
|
+
Per story: rules (blue), examples per rule (green), questions (red).
|
|
40
|
+
Every complex BR- gets at least one example inside and one outside the
|
|
41
|
+
boundary — these become SC- entries.
|
|
42
|
+
|
|
43
|
+
## Story mapping
|
|
44
|
+
Activities across the top, tasks below, slice releases horizontally.
|
|
45
|
+
Produces: capabilities, journey order, MVP line → scope in/future.
|
|
46
|
+
|
|
47
|
+
## Specification by example
|
|
48
|
+
Turn each agreed rule into concrete input → expected-output rows
|
|
49
|
+
(the Part 4 tables). Disagreement over a row = an undiscovered rule.
|
|
50
|
+
|
|
51
|
+
## Given / When / Then
|
|
52
|
+
Final form for acceptance: `Given <state> When <event> Then <outcome>`.
|
|
53
|
+
Use once requirements are stable; earlier it hardens guesses.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Clarification interview
|
|
2
|
+
|
|
3
|
+
Behave like an experienced BA interviewer: extract everything from the
|
|
4
|
+
inputs first, then ask only about holes, highest impact first.
|
|
5
|
+
|
|
6
|
+
## §1 Question priority
|
|
7
|
+
|
|
8
|
+
- **P1 — blocking**: scope or architecture cannot reasonably proceed
|
|
9
|
+
without the answer. Mark `architectureBlocker: true` when the answer
|
|
10
|
+
changes system boundaries, integrations, decision authority, or data
|
|
11
|
+
ownership.
|
|
12
|
+
- **P2 — high impact**: could materially change scope, complexity, or cost.
|
|
13
|
+
- **P3 — detail**: safely deferred; record in the register, don't ask now.
|
|
14
|
+
|
|
15
|
+
Triage rule: ask P1s first, in groups of at most 4 related questions per
|
|
16
|
+
message. Never move to P2 while an easy-to-answer P1 is open.
|
|
17
|
+
|
|
18
|
+
## §2 Question rules
|
|
19
|
+
|
|
20
|
+
1. Never ask what the inputs already answer.
|
|
21
|
+
2. Ground every question in what the client said: "You mentioned approved
|
|
22
|
+
contracts are stored in SharePoint. Does the new system need to A. read
|
|
23
|
+
from it, B. write back, C. both, D. neither?" — offer concrete options
|
|
24
|
+
where possible.
|
|
25
|
+
3. Explain why a question matters when the answer is expensive to get.
|
|
26
|
+
4. Adapt: each round of answers reprioritizes the remaining gaps.
|
|
27
|
+
5. Prefer a real example over an abstract description: "walk me through
|
|
28
|
+
the last time this happened" beats "how does this normally work".
|
|
29
|
+
6. Challenge vague words (see the banned list in writing.md): "how fast is
|
|
30
|
+
fast — what is acceptable in seconds?"
|
|
31
|
+
7. Distinguish **unknown** (client doesn't know yet — record the question)
|
|
32
|
+
from **undecided** (client must choose — present the options and the
|
|
33
|
+
consequence of each).
|
|
34
|
+
8. Contradictions are surfaced, never resolved silently (§5).
|
|
35
|
+
|
|
36
|
+
## §3 Sequencing shapes
|
|
37
|
+
|
|
38
|
+
- **Funnel** (broad → narrow): default for vague inputs ("we need a
|
|
39
|
+
chatbot"). Start at business problem, narrow to workflows, rules, edge
|
|
40
|
+
cases.
|
|
41
|
+
- **Pyramid** (narrow → broad): for detailed-but-suspect inputs (a feature
|
|
42
|
+
list with no why). Start from a concrete feature, climb to the goal it
|
|
43
|
+
serves — features that climb to no goal become open questions.
|
|
44
|
+
- **Diamond** (narrow → broad → narrow): for existing-system work. Start
|
|
45
|
+
from the pain point, widen to the surrounding process, narrow back to
|
|
46
|
+
the change.
|
|
47
|
+
|
|
48
|
+
## §4 The nine layers
|
|
49
|
+
|
|
50
|
+
Work through these progressively; the depth mode decides how far.
|
|
51
|
+
|
|
52
|
+
1. **Business context** — why now, cost of doing nothing, desired outcome,
|
|
53
|
+
success metric. Ask: "What business result should improve, and how will
|
|
54
|
+
you measure it?"
|
|
55
|
+
2. **Stakeholders and actors** — users, deciders, approvers, external and
|
|
56
|
+
system actors. Per actor: goal, decisions, information needed, pain.
|
|
57
|
+
3. **Current state (as-is)** — trigger, steps, decisions, handoffs,
|
|
58
|
+
systems, manual work, exceptions, workarounds. Always request a recent
|
|
59
|
+
real example.
|
|
60
|
+
4. **Business rules** — explicit and implied. Per rule: statement, source,
|
|
61
|
+
two concrete examples (one inside, one outside the boundary).
|
|
62
|
+
5. **Scenarios** — happy path, alternatives, edge cases, errors, missing
|
|
63
|
+
information, cancellation, human intervention.
|
|
64
|
+
6. **Future state** — pain point → desired change → required capability.
|
|
65
|
+
Capabilities, not implementations.
|
|
66
|
+
7. **Functional requirements** — convert validated capabilities into FRs
|
|
67
|
+
with traces (goal, workflow, rules) and acceptance scenarios.
|
|
68
|
+
8. **NFRs** — investigate only relevant areas (security, privacy,
|
|
69
|
+
performance, availability, auditability, compliance, retention,
|
|
70
|
+
localization, device support). Never run the full list mechanically.
|
|
71
|
+
9. **Integrations and data** — systems, direction (read/write/both),
|
|
72
|
+
identity, then per entity: source of truth, ownership, volume,
|
|
73
|
+
sensitivity, retention, synchronization.
|
|
74
|
+
|
|
75
|
+
## §5 Contradiction protocol
|
|
76
|
+
|
|
77
|
+
When two statements conflict: record a `CONFLICT-` entry quoting both
|
|
78
|
+
statements with their sources, present it to the user verbatim, and ask
|
|
79
|
+
which holds (or whether both do under different conditions). Never pick an
|
|
80
|
+
interpretation yourself. A conflict stays open until the client resolves
|
|
81
|
+
it; open conflicts block READY_FOR_ARCHITECTURE.
|
|
82
|
+
|
|
83
|
+
## §6 Depth modes
|
|
84
|
+
|
|
85
|
+
- **QUICK**: layers 1, 2, 6, 7 only; P1 questions only; one interview round.
|
|
86
|
+
- **STANDARD**: all layers; P1 + P2; iterate until P1s are answered or
|
|
87
|
+
explicitly parked.
|
|
88
|
+
- **DEEP**: all layers; P1–P3; example mapping on every complex rule;
|
|
89
|
+
scenario tables for every critical FR.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Fresh-eyes review
|
|
2
|
+
|
|
3
|
+
After validate.mjs passes, dispatch ONE subagent with fresh eyes over both
|
|
4
|
+
artifacts. Give it the two file paths and this checklist verbatim. Apply
|
|
5
|
+
its findings, re-run validate.mjs, and stop after one cycle — do not loop.
|
|
6
|
+
|
|
7
|
+
## Checklist
|
|
8
|
+
|
|
9
|
+
1. **Invented requirements**: is any `confirmed` item unsupported by a
|
|
10
|
+
quoted source? Downgrade to `assumed` or `recommended`.
|
|
11
|
+
2. **Hidden solutioning**: does any FR prescribe a technology or
|
|
12
|
+
architecture ("use SharePoint webhooks")? Rewrite as a capability.
|
|
13
|
+
3. **Vague requirements**: any FR that two reasonable readers would
|
|
14
|
+
implement differently? Flag with the two readings.
|
|
15
|
+
4. **Missed contradictions**: do any two statements (rules, scopes,
|
|
16
|
+
answers) conflict without a CONFLICT- entry?
|
|
17
|
+
5. **Unlabeled scope**: any capability discussed in Parts 1–2 that appears
|
|
18
|
+
in no FR and no scope list (out / future / unconfirmed)?
|
|
19
|
+
6. **Readiness honesty**: do the area scores overstate what Parts 1–4
|
|
20
|
+
actually contain? Name the section that contradicts the score.
|
|
21
|
+
7. **Traceability spot-check**: pick 3 FRs; do their traces point at
|
|
22
|
+
goals/workflows/rules that genuinely motivate them?
|
|
23
|
+
|
|
24
|
+
Report findings as a list: `<artifact>:<id or section> — <problem> — <fix>`.
|
|
25
|
+
No praise, no rewrites beyond the flagged items.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Writing the requirements package
|
|
2
|
+
|
|
3
|
+
Two artifacts, always together, in the lead directory:
|
|
4
|
+
|
|
5
|
+
- `requirements.md` — the human document. Five parts (below).
|
|
6
|
+
- `requirements.json` — the machine handoff downstream skills read.
|
|
7
|
+
|
|
8
|
+
The canonical json shape is `scripts/test/fixtures/requirements-pass.json` —
|
|
9
|
+
copy its structure exactly; the validator enforces it. `schemaVersion` is
|
|
10
|
+
`"1.0"`; bump only on a breaking shape change.
|
|
11
|
+
|
|
12
|
+
## ID conventions
|
|
13
|
+
|
|
14
|
+
| Prefix | Register | Prefix | Register |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| G- | goals (context.goals) | NFR- | non-functional requirements |
|
|
17
|
+
| ACT- | actors | INT- | integrations |
|
|
18
|
+
| WF- | workflows | DAT- | data entities |
|
|
19
|
+
| FR- | functional requirements | CON- | constraints (hard limits) |
|
|
20
|
+
| BR- | business rules | ASM- | assumptions (unverified beliefs) |
|
|
21
|
+
| SC- | scenarios | Q- | open questions |
|
|
22
|
+
| | | CONFLICT- | contradictions |
|
|
23
|
+
|
|
24
|
+
Three digits, zero-padded (`FR-001`). IDs are stable: never renumber on
|
|
25
|
+
re-run; retired items keep their id with a note rather than vanishing.
|
|
26
|
+
|
|
27
|
+
Constraint vs assumption: a constraint is a confirmed boundary ("must run in
|
|
28
|
+
the client's M365 tenant"); an assumption is an unverified belief ("managers
|
|
29
|
+
authenticate through Entra"). Never file one as the other.
|
|
30
|
+
|
|
31
|
+
## Label discipline
|
|
32
|
+
|
|
33
|
+
Every requirement, NFR, integration and data row carries
|
|
34
|
+
`label: confirmed | assumed | recommended` and (where the schema asks) a
|
|
35
|
+
`source`. Recommendations never render as confirmed requirements; a
|
|
36
|
+
`recommended` item in scope `in` must have an open question referencing it
|
|
37
|
+
(the validator enforces this).
|
|
38
|
+
|
|
39
|
+
## Ambiguous terms — banned in requirement text
|
|
40
|
+
|
|
41
|
+
fast, quick, easy, simple, user-friendly, intuitive, flexible, robust,
|
|
42
|
+
seamless, efficient, optimal, appropriate, various, etc, some, many,
|
|
43
|
+
several, as needed.
|
|
44
|
+
|
|
45
|
+
Replace with a measurable statement: not "the search must be fast" but
|
|
46
|
+
"search results return within 2 seconds for 10,000 records". This list is
|
|
47
|
+
mirrored in `scripts/lib/checks.mjs` (`AMBIGUOUS`) — change both together.
|
|
48
|
+
|
|
49
|
+
## requirements.md structure
|
|
50
|
+
|
|
51
|
+
Frontmatter (must match the json — the validator checks status and readiness):
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
---
|
|
55
|
+
lead: <lead-id>
|
|
56
|
+
status: <status enum>
|
|
57
|
+
depth: QUICK | STANDARD | DEEP
|
|
58
|
+
updated: YYYY-MM-DD
|
|
59
|
+
readiness: <overall number>
|
|
60
|
+
---
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- **Part 1 — Discovery Brief**: problem, goals table (id, goal, metric),
|
|
64
|
+
one benefit hypothesis per goal ("we believe *capability* will result in
|
|
65
|
+
*outcome*, measured by *metric*"), stakeholders (add a power-interest
|
|
66
|
+
table when more than 3 stakeholder groups), pain points, constraints.
|
|
67
|
+
- **Part 2 — Process & Domain**: as-is workflows (mermaid flowchart when a
|
|
68
|
+
workflow has more than one actor), decision points, business-rules table
|
|
69
|
+
with concrete examples, exceptions, to-be capabilities, glossary of
|
|
70
|
+
domain terms.
|
|
71
|
+
- **Part 3 — Requirements**: scope (out / future / unconfirmed — in-scope
|
|
72
|
+
is the FR table itself), actors and permissions, FR table (id, text,
|
|
73
|
+
label, scope), NFRs, data, integrations, dependencies.
|
|
74
|
+
- **Part 4 — Acceptance Scenarios**: per critical FR a given/when/then
|
|
75
|
+
table; input → expected tables for rule-heavy requirements.
|
|
76
|
+
- **Part 5 — Readiness Report**: readiness per area and overall, open
|
|
77
|
+
questions register, assumptions register, conflicts register,
|
|
78
|
+
architecture blockers. Registers live HERE only — other parts reference
|
|
79
|
+
ids (one home per fact).
|
|
80
|
+
|
|
81
|
+
Section headings must be exactly `## Part N — <title>` — the validator
|
|
82
|
+
matches on `## Part N`.
|
|
83
|
+
|
|
84
|
+
Depth scaling: QUICK writes Parts 1, 3 (slim) and 5 only; STANDARD all
|
|
85
|
+
five; DEEP all five plus example-mapping tables and full scenario coverage.
|
|
86
|
+
|
|
87
|
+
## Honest absences
|
|
88
|
+
|
|
89
|
+
An unknown renders as an honest absence — "Not provided — asked, awaiting
|
|
90
|
+
client", "Not applicable — <reason>" — never `[TODO]`, `TBD`, `XXX`, never
|
|
91
|
+
an invented value. The validator refuses placeholders.
|
|
92
|
+
|
|
93
|
+
## Readiness scoring
|
|
94
|
+
|
|
95
|
+
You judge each area score (0–100) and justify it in Part 5 prose. The
|
|
96
|
+
script recomputes `overall` as the rounded mean and refuses a mismatch.
|
|
97
|
+
Status rules the validator enforces:
|
|
98
|
+
|
|
99
|
+
- open question with `architectureBlocker: true` → status at most `ANALYZED`;
|
|
100
|
+
- `READY_FOR_ARCHITECTURE` requires no unconfirmed high-impact assumptions
|
|
101
|
+
and no open conflicts;
|
|
102
|
+
- every open architecture blocker appears in `readiness.blockers`.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { REGISTERS, STATUSES, AREAS, checkSchema } from './schema.mjs';
|
|
2
|
+
|
|
3
|
+
const LABELED = ['requirements', 'nfrs', 'integrations', 'data'];
|
|
4
|
+
const SOURCED = ['requirements', 'businessRules', 'constraints'];
|
|
5
|
+
|
|
6
|
+
export function collectIds(pkg) {
|
|
7
|
+
const ids = new Set((pkg.context?.goals ?? []).map((g) => g.id));
|
|
8
|
+
for (const [name] of REGISTERS) for (const row of pkg[name] ?? []) ids.add(row.id);
|
|
9
|
+
return ids;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function checkDuplicates(pkg) {
|
|
13
|
+
const findings = [];
|
|
14
|
+
const seen = new Set();
|
|
15
|
+
const rows = [...(pkg.context?.goals ?? []), ...REGISTERS.flatMap(([name]) => pkg[name] ?? [])];
|
|
16
|
+
for (const row of rows) {
|
|
17
|
+
if (seen.has(row.id)) findings.push(`duplicate id: ${row.id}`);
|
|
18
|
+
seen.add(row.id);
|
|
19
|
+
}
|
|
20
|
+
return findings;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function checkRefs(pkg, ids) {
|
|
24
|
+
const findings = [];
|
|
25
|
+
const miss = (owner, ref) => findings.push(`${owner}: dangling reference ${ref}`);
|
|
26
|
+
for (const fr of pkg.requirements ?? []) {
|
|
27
|
+
const t = fr.traces ?? {};
|
|
28
|
+
const refs = [t.goal, t.workflow, ...(t.rules ?? []), ...(fr.acceptance ?? [])];
|
|
29
|
+
for (const ref of refs) if (ref && !ids.has(ref)) miss(fr.id, ref);
|
|
30
|
+
}
|
|
31
|
+
for (const br of pkg.businessRules ?? []) {
|
|
32
|
+
if (br.openQuestion && !ids.has(br.openQuestion)) miss(br.id, br.openQuestion);
|
|
33
|
+
}
|
|
34
|
+
for (const sc of pkg.scenarios ?? []) if (!ids.has(sc.requirement)) miss(sc.id, sc.requirement);
|
|
35
|
+
for (const q of pkg.openQuestions ?? []) {
|
|
36
|
+
for (const ref of q.affects ?? []) if (!ids.has(ref)) miss(q.id, ref);
|
|
37
|
+
}
|
|
38
|
+
for (const ref of pkg.readiness?.blockers ?? []) if (!ids.has(ref)) miss('readiness.blockers', ref);
|
|
39
|
+
return findings;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function hasOpenQuestionFor(pkg, id) {
|
|
43
|
+
return (pkg.openQuestions ?? []).some((q) => (q.affects ?? []).includes(id));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function checkLabels(pkg) {
|
|
47
|
+
const findings = [];
|
|
48
|
+
for (const name of LABELED) {
|
|
49
|
+
for (const row of pkg[name] ?? []) if (!row.label) findings.push(`${row.id}: missing label`);
|
|
50
|
+
}
|
|
51
|
+
for (const name of SOURCED) {
|
|
52
|
+
for (const row of pkg[name] ?? []) if (!row.source) findings.push(`${row.id}: missing source`);
|
|
53
|
+
}
|
|
54
|
+
for (const fr of pkg.requirements ?? []) {
|
|
55
|
+
if (fr.label === 'recommended' && fr.scope === 'in' && !hasOpenQuestionFor(pkg, fr.id)) {
|
|
56
|
+
findings.push(`${fr.id}: recommended requirement in scope "in" without a paired open question`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return findings;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const AMBIGUOUS = [
|
|
63
|
+
'fast', 'quick', 'easy', 'simple', 'user-friendly', 'intuitive', 'flexible',
|
|
64
|
+
'robust', 'seamless', 'efficient', 'optimal', 'appropriate', 'various',
|
|
65
|
+
'etc', 'some', 'many', 'several', 'as needed',
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
export function checkAmbiguity(pkg) {
|
|
69
|
+
const findings = [];
|
|
70
|
+
for (const row of [...(pkg.requirements ?? []), ...(pkg.nfrs ?? [])]) {
|
|
71
|
+
for (const word of AMBIGUOUS) {
|
|
72
|
+
const re = new RegExp(`\\b${word.replace(/[-\s]/g, '[-\\s]')}\\b`, 'i');
|
|
73
|
+
if (re.test(row.text ?? '')) {
|
|
74
|
+
findings.push(`${row.id}: ambiguous term "${word}" — replace with a measurable statement`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return findings;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function checkReadiness(pkg) {
|
|
82
|
+
const findings = [];
|
|
83
|
+
const r = pkg.readiness ?? {};
|
|
84
|
+
const values = AREAS.map((a) => r.areas?.[a]).filter((v) => typeof v === 'number');
|
|
85
|
+
if (values.length !== AREAS.length) findings.push('readiness.areas: missing area score');
|
|
86
|
+
const mean = Math.round(values.reduce((s, v) => s + v, 0) / (values.length || 1));
|
|
87
|
+
if (r.overall !== mean) findings.push(`readiness.overall ${r.overall} != recomputed mean ${mean}`);
|
|
88
|
+
const openBlockers = (pkg.openQuestions ?? []).filter((q) => q.status === 'open' && q.architectureBlocker);
|
|
89
|
+
if (openBlockers.length && STATUSES.indexOf(pkg.status) > STATUSES.indexOf('ANALYZED')) {
|
|
90
|
+
findings.push(`status ${pkg.status} with open architecture blockers: ${openBlockers.map((q) => q.id).join(', ')}`);
|
|
91
|
+
}
|
|
92
|
+
for (const q of openBlockers) {
|
|
93
|
+
if (!(r.blockers ?? []).includes(q.id)) findings.push(`readiness.blockers missing ${q.id}`);
|
|
94
|
+
}
|
|
95
|
+
const risky = (pkg.assumptions ?? []).filter((a) => a.impact === 'high' && a.status === 'unconfirmed');
|
|
96
|
+
if (pkg.status === 'READY_FOR_ARCHITECTURE' && risky.length) {
|
|
97
|
+
findings.push(`READY_FOR_ARCHITECTURE with unconfirmed high-impact assumptions: ${risky.map((a) => a.id).join(', ')}`);
|
|
98
|
+
}
|
|
99
|
+
if (pkg.status === 'READY_FOR_ARCHITECTURE' && (pkg.conflicts ?? []).some((c) => c.status === 'open')) {
|
|
100
|
+
findings.push('READY_FOR_ARCHITECTURE with open conflicts');
|
|
101
|
+
}
|
|
102
|
+
return findings;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const PARTS = ['Part 1', 'Part 2', 'Part 3', 'Part 4', 'Part 5'];
|
|
106
|
+
const QUICK_PARTS = ['Part 1', 'Part 3', 'Part 5'];
|
|
107
|
+
const ID_TOKEN = /\b(?:G|ACT|WF|FR|BR|SC|NFR|INT|DAT|CON|ASM|Q|CONFLICT)-\d{3}\b/g;
|
|
108
|
+
|
|
109
|
+
function sectionBodies(md) {
|
|
110
|
+
const bodies = {};
|
|
111
|
+
for (const chunk of md.split(/^## /m).slice(1)) {
|
|
112
|
+
const nl = chunk.indexOf('\n');
|
|
113
|
+
const title = nl === -1 ? chunk.trim() : chunk.slice(0, nl).trim();
|
|
114
|
+
const body = nl === -1 ? '' : chunk.slice(nl + 1);
|
|
115
|
+
bodies[title] = body;
|
|
116
|
+
}
|
|
117
|
+
return bodies;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function checkMd(pkg, md) {
|
|
121
|
+
const findings = [];
|
|
122
|
+
if (/\[TODO\]|\bTBD\b|\bXXX\b/.test(md)) findings.push('md: placeholder found ([TODO]/TBD/XXX)');
|
|
123
|
+
const bodies = sectionBodies(md);
|
|
124
|
+
const required = pkg.depth === 'QUICK' ? QUICK_PARTS : PARTS;
|
|
125
|
+
for (const part of required) {
|
|
126
|
+
const key = Object.keys(bodies).find((h) => h.startsWith(part));
|
|
127
|
+
if (!key) findings.push(`md: missing section "## ${part}"`);
|
|
128
|
+
else if (!bodies[key].trim()) findings.push(`md: empty section "## ${part}"`);
|
|
129
|
+
}
|
|
130
|
+
const mdIds = new Set([...md.matchAll(ID_TOKEN)].map((m) => m[0]));
|
|
131
|
+
for (const id of collectIds(pkg)) {
|
|
132
|
+
if (!mdIds.has(id)) findings.push(`md: id ${id} absent from requirements.md`);
|
|
133
|
+
}
|
|
134
|
+
const fmStatus = md.match(/^status:\s*(\S+)/m)?.[1];
|
|
135
|
+
if (fmStatus !== pkg.status) findings.push(`md frontmatter status ${fmStatus} != json status ${pkg.status}`);
|
|
136
|
+
const fmDepth = md.match(/^depth:\s*(\S+)/m)?.[1];
|
|
137
|
+
if (fmDepth !== pkg.depth) findings.push(`md frontmatter depth ${fmDepth} != json depth ${pkg.depth}`);
|
|
138
|
+
const fmReadiness = Number(md.match(/^readiness:\s*(\d+)/m)?.[1]);
|
|
139
|
+
if (fmReadiness !== pkg.readiness?.overall) {
|
|
140
|
+
findings.push(`md frontmatter readiness ${fmReadiness} != json readiness.overall ${pkg.readiness?.overall}`);
|
|
141
|
+
}
|
|
142
|
+
return findings;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function checkMdOrphanIds(pkg, md, ids) {
|
|
146
|
+
const findings = [];
|
|
147
|
+
for (const m of md.matchAll(ID_TOKEN)) {
|
|
148
|
+
if (!ids.has(m[0])) findings.push(`md: unknown id ${m[0]}`);
|
|
149
|
+
}
|
|
150
|
+
return findings;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function checkPackage({ pkg, md }) {
|
|
154
|
+
const schemaFindings = checkSchema(pkg);
|
|
155
|
+
if (schemaFindings.length) return schemaFindings;
|
|
156
|
+
const ids = collectIds(pkg);
|
|
157
|
+
return [
|
|
158
|
+
...checkDuplicates(pkg),
|
|
159
|
+
...checkRefs(pkg, ids),
|
|
160
|
+
...checkLabels(pkg),
|
|
161
|
+
...checkAmbiguity(pkg),
|
|
162
|
+
...checkReadiness(pkg),
|
|
163
|
+
...checkMd(pkg, md),
|
|
164
|
+
...checkMdOrphanIds(pkg, md, ids),
|
|
165
|
+
];
|
|
166
|
+
}
|