Skip to content

Commit 9f3107a

Browse files
authored
Separation of opt-in question for extensions (Progressive Disclosure) (#111)
* Separation of opt-in question for extensions * Removed duplication with line 40
1 parent 3dfdb80 commit 9f3107a

File tree

5 files changed

+40
-28
lines changed

5 files changed

+40
-28
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ AI-DLC supports an extension system that lets you layer additional rules on top
500500

501501
Extensions are grouped by category (e.g., `security/`, `scalability/`, `accessibility/`). Each category can contain its own rules and any number of subcategories you define.
502502

503-
Each extension should include an **Applicability Question** — a structured multiple-choice question that AI-DLC automatically presents during the Requirements Analysis phase. This lets the user decide whether to enable or skip that extension for the current project. For example, the built-in security extension includes:
503+
Each extension should include an **Opt-In Prompt** — a structured multiple-choice question that AI-DLC automatically presents during the Requirements Analysis phase. This lets the user decide whether to enable or skip that extension for the current project. For example, the built-in security extension includes:
504504

505505
```markdown
506506
## Question: Security Extensions
@@ -513,11 +513,11 @@ X) Other (please describe)
513513
[Answer]:
514514
```
515515

516-
When you create your own extensions, include a similar applicability question so users can opt in or out per project.
516+
When you create your own extensions, include a similar opt-in prompt so users can opt in or out per project.
517517

518518
Here's the general flow once an extension is enabled:
519519

520-
1. During the Inception phase, AI-DLC presents the extension's applicability question.
520+
1. During the Inception phase, AI-DLC presents the extension's opt-in prompt.
521521
2. If enabled, the extension's rules are loaded as mandatory, blocking constraints that apply across all AI-DLC phases.
522522
3. At each stage, the model verifies compliance with all loaded extension rules before allowing the stage to proceed.
523523

aidlc-rules/aws-aidlc-rule-details/extensions/security/baseline/security-baseline.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@ Verification items in this document are plain bullet points describing complianc
2222

2323
---
2424

25-
## Applicability Question
26-
27-
The following question is automatically included in the Requirements Analysis clarifying questions when this extension is loaded:
28-
29-
```markdown
30-
## Question: Security Extensions
31-
Should security extension rules be enforced for this project?
32-
33-
A) Yes — enforce all SECURITY rules as blocking constraints (recommended for production-grade applications)
34-
B) No — skip all SECURITY rules (suitable for PoCs, prototypes, and experimental projects)
35-
X) Other (please describe after [Answer]: tag below)
36-
37-
[Answer]:
38-
```
39-
40-
---
41-
4225
## Rule SECURITY-01: Encryption at Rest and in Transit
4326

4427
**Rule**: Every data persistence store (databases, object storage, file systems, caches, or any equivalent) MUST have:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security Baseline — Opt-In
2+
3+
**Extension**: Security Baseline
4+
5+
## Opt-In Prompt
6+
7+
The following question is automatically included in the Requirements Analysis clarifying questions when this extension is loaded:
8+
9+
```markdown
10+
## Question: Security Extensions
11+
Should security extension rules be enforced for this project?
12+
13+
A) Yes — enforce all SECURITY rules as blocking constraints (recommended for production-grade applications)
14+
B) No — skip all SECURITY rules (suitable for PoCs, prototypes, and experimental projects)
15+
X) Other (please describe after [Answer]: tag below)
16+
17+
[Answer]:
18+
```

aidlc-rules/aws-aidlc-rule-details/inception/requirements-analysis.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ Analyze whatever the user has provided:
9090

9191
**When in doubt, ask questions** - incomplete requirements lead to poor implementations.
9292

93-
### Step 5.1: Extension Applicability Questions
93+
### Step 5.1: Extension Opt-In Prompts
9494

95-
**MANDATORY**: Scan all loaded extension files for an `## Applicability Question` section. For each extension that declares one, include that question in the clarifying questions file created in Step 6. After receiving answers, record each extension's enablement status in `aidlc-docs/aidlc-state.md` under `## Extension Configuration`:
95+
**MANDATORY**: Scan all loaded `*.opt-in.md` files (loaded at workflow start from `extensions/` subdirectories) for an `## Opt-In Prompt` section. For each extension that declares one, include that question in the clarifying questions file created in Step 6.
96+
97+
After receiving answers:
98+
1. Record each extension's enablement status in `aidlc-docs/aidlc-state.md` under `## Extension Configuration`:
9699

97100
```markdown
98101
## Extension Configuration
@@ -101,6 +104,8 @@ Analyze whatever the user has provided:
101104
| [Extension Name] | [Yes/No] | Requirements Analysis |
102105
```
103106

107+
2. **Deferred Rule Loading**: For each extension the user opted IN, load the full rules file now. The rules file is derived by naming convention: strip `.opt-in.md` from the opt-in filename and append `.md` (e.g., `security-baseline.opt-in.md``security-baseline.md`). For extensions the user opted OUT, do NOT load the full rules file.
108+
104109
### Step 6: Generate Clarifying Questions (PROACTIVE APPROACH)
105110
- **ALWAYS** create `aidlc-docs/inception/requirements/requirement-verification-questions.md` unless requirements are exceptionally clear and complete
106111
- Ask questions about ANY missing, unclear, or ambiguous areas

aidlc-rules/aws-aidlc-rules/core-workflow.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,28 @@ All subsequent rule detail file references (e.g., `common/process-overview.md`,
2525
- Load `common/question-format-guide.md` for question formatting rules
2626
- Reference these throughout the workflow execution
2727

28-
## MANDATORY: Extensions Loading
29-
**CRITICAL**: At workflow start, scan the `extensions/` directory recursively for all `.md` files. These are extension rule files that apply as cross-cutting constraints across the entire workflow.
28+
## MANDATORY: Extensions Loading (Context-Optimized)
29+
**CRITICAL**: At workflow start, scan the `extensions/` directory recursively but load ONLY lightweight opt-in files — NOT full rule files. Full rule files are loaded on-demand after the user opts in.
3030

3131
**Loading process**:
3232
1. List all subdirectories under `extensions/` (e.g., `extensions/security/`, `extensions/compliance/`)
33-
2. Load every `.md` file found within those subdirectories
34-
3. Each extension file defines its own verification criteria and enforcement rules as cross-cutting constraints
33+
2. In each subdirectory, load ONLY `*.opt-in.md` files — these contain the extension's opt-in prompt. The corresponding rules file is derived by convention: strip the `.opt-in.md` suffix and append `.md` (e.g., `security-baseline.opt-in.md``security-baseline.md`)
34+
3. Do NOT load full rule files (e.g., `security-baseline.md`) at this stage
3535

36-
**Enforcement**:
36+
**Deferred Rule Loading**:
37+
- During Requirements Analysis, opt-in prompts from the loaded `*.opt-in.md` files are presented to the user
38+
- When the user opts IN for an extension, load the corresponding rules file (derived by naming convention) at that point
39+
- When the user opts OUT, the full rules file is never loaded — saving context
40+
- Extensions without a matching `*.opt-in.md` file are always enforced — load their rule files immediately at workflow start
41+
42+
**Enforcement** (applies only to loaded/enabled extensions):
3743
- Extension rules are hard constraints, not optional guidance
3844
- At each stage, the model intelligently evaluates which extension rules are applicable based on the stage's purpose, the artifacts being produced, and the context of the work — enforce only those rules that are relevant
3945
- Rules that are not applicable to the current stage should be marked as N/A in the compliance summary (this is not a blocking finding)
4046
- Non-compliance with any applicable enabled extension rule is a **blocking finding** — do NOT present stage completion until resolved
4147
- When presenting stage completion, include a summary of extension rule compliance (compliant/non-compliant/N/A per rule, with brief rationale for N/A determinations)
4248

43-
**Conditional Enforcement**: Extensions may be conditionally enabled/disabled. See `inception/requirements-analysis.md` for the collection mechanism. Before enforcing any extension at ANY stage, check its `Enabled` status in `aidlc-docs/aidlc-state.md` under `## Extension Configuration`. Skip disabled extensions and log the skip in audit.md. Default to enforced if no configuration exists. Extensions without an `## Applicability Question` are always enforced.
49+
**Conditional Enforcement**: Extensions may be conditionally enabled/disabled. See `inception/requirements-analysis.md` for the opt-in mechanism. Before enforcing any extension at ANY stage, check its `Enabled` status in `aidlc-docs/aidlc-state.md` under `## Extension Configuration`. Skip disabled extensions and log the skip in audit.md. Default to enforced if no configuration exists.
4450

4551
## MANDATORY: Content Validation
4652
**CRITICAL**: Before creating ANY file, you MUST validate content according to `common/content-validation.md` rules:

0 commit comments

Comments
 (0)